From 8f56c26f3446afc486359c252f5e75314b434579 Mon Sep 17 00:00:00 2001 From: Kim Kibum Date: Sun, 29 Apr 2012 16:58:33 +0900 Subject: [PATCH] upload tizen1.0 source --- CMakeLists.txt | 7 ++++--- capi-system-info.pc.in | 2 +- debian/changelog | 17 +++++++++++++++++ debian/control | 6 +++--- include/system_info.h | 3 ++- include/system_info_private.h | 1 + packaging/capi-system-info.spec | 16 +++++++++------- src/system_info.c | 7 +++++++ src/system_info_network.c | 28 +++++++++++++++++++++++++++- src/system_info_platform.c | 2 +- 10 files changed, 72 insertions(+), 17 deletions(-) mode change 100644 => 100755 capi-system-info.pc.in mode change 100644 => 100755 packaging/capi-system-info.spec diff --git a/CMakeLists.txt b/CMakeLists.txt index ea19261..007e9b8 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,10 +10,11 @@ SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(INC_DIR include) INCLUDE_DIRECTORIES(${INC_DIR}) -SET(dependents "dlog capi-base-common vconf iniparser x11") +SET(requires "dlog capi-base-common vconf iniparser x11 tapi") +SET(pc_requires "capi-base-common") INCLUDE(FindPkgConfig) -pkg_check_modules(${fw_name} REQUIRED ${dependents}) +pkg_check_modules(${fw_name} REQUIRED ${requires}) FOREACH(flag ${${fw_name}_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) @@ -51,7 +52,7 @@ INSTALL( ) SET(PC_NAME ${fw_name}) -SET(PC_REQUIRED ${dependents}) +SET(PC_REQUIRED ${pc_requires}) SET(PC_LDFLAGS -l${fw_name}) SET(PC_CFLAGS -I\${includedir}/system) diff --git a/capi-system-info.pc.in b/capi-system-info.pc.in old mode 100644 new mode 100755 index f758dbd..d0610b9 --- a/capi-system-info.pc.in +++ b/capi-system-info.pc.in @@ -11,5 +11,5 @@ Description: @PACKAGE_DESCRIPTION@ Version: @VERSION@ Requires: @PC_REQUIRED@ Libs: -L${libdir} @PC_LDFLAGS@ -Cflags: -I${includedir} @PC_CFLAGS@ +Cflags: -I${includedir} diff --git a/debian/changelog b/debian/changelog index f4089f6..289593f 100755 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,20 @@ +capi-system-info (0.1.0-12) unstable; urgency=low + + * Updated Tizen version + * Git: api/system-info + * Tag: capi-system-info_0.1.0-12 + + -- Junghyuk Park Mon, 19 Mar 2012 19:25:53 +0900 + +capi-system-info (0.1.0-11) unstable; urgency=low + + * Updated build configuration + * Added SYSTEM_INFO_KEY_MOBILE_DEVICE_ID + * Git: api/system-info + * Tag: capi-system-info_0.1.0-11 + + -- Junghyuk Park Thu, 15 Mar 2012 11:41:29 +0900 + capi-system-info (0.1.0-9) unstable; urgency=low * Updated tizen version diff --git a/debian/control b/debian/control index 061960c..ee18cd0 100755 --- a/debian/control +++ b/debian/control @@ -3,16 +3,16 @@ Source: capi-system-info Section: libs Priority: extra Maintainer: Woongsuk Cho , Kyuhun Jung -Build-Depends: debhelper (>= 5), dlog-dev, capi-base-common-dev, libvconf-dev, iniparser-dev, libx11-dev +Build-Depends: debhelper (>= 5), dlog-dev, capi-base-common-dev, libvconf-dev, iniparser-dev, libx11-dev, libslp-tapi-dev Package: capi-system-info Architecture: any -Depends: ${shilbs:Depends}, ${misc:Depends} +Depends: ${shlibs:Depends}, ${misc:Depends} Description: A System Information library in Tizen Native API Package: capi-system-info-dev Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, capi-system-info (= ${Source-Version}), dlog-dev, capi-base-common-dev, libvconf-dev, iniparser-dev, libx11-dev +Depends: ${shlibs:Depends}, ${misc:Depends}, capi-system-info (= ${Source-Version}), capi-base-common-dev Description: A System Information library in Tizen Native API (DEV) Package: capi-system-info-dbg diff --git a/include/system_info.h b/include/system_info.h index 7a3b2bf..ebf584b 100755 --- a/include/system_info.h +++ b/include/system_info.h @@ -60,7 +60,8 @@ typedef enum { SYSTEM_INFO_KEY_SCREEN_HEIGHT, /**< The height of the screen in pixels */ SYSTEM_INFO_KEY_SCREEN_WIDTH, /**< The width of the screen in pixels */ SYSTEM_INFO_KEY_TVOUT_SUPPORTED, /**< Indicates whether the device supports TV-out */ - SYSTEM_INFO_KEY_WIFI_SUPPORTED /**< Indicates whether the device supports Wi-Fi */ + SYSTEM_INFO_KEY_WIFI_SUPPORTED, /**< Indicates whether the device supports Wi-Fi */ + SYSTEM_INFO_KEY_MOBILE_DEVICE_ID, /**< The unique ID to identify GSM, UMTS and CDMA mobile devices */ } system_info_key_e; /** diff --git a/include/system_info_private.h b/include/system_info_private.h index a9ce27a..f2ae1a3 100755 --- a/include/system_info_private.h +++ b/include/system_info_private.h @@ -48,6 +48,7 @@ int system_info_get_screen_height(system_info_key_e key, system_info_data_type_e int system_info_get_screen_width(system_info_key_e key, system_info_data_type_e data_type, void **value); int system_info_get_tvout_supported(system_info_key_e key, system_info_data_type_e data_type, void **value); int system_info_get_wifi_supported(system_info_key_e key, system_info_data_type_e data_type, void **value); +int system_info_get_mobile_device_id(system_info_key_e key, system_info_data_type_e data_type, void **value); #ifdef __cplusplus } diff --git a/packaging/capi-system-info.spec b/packaging/capi-system-info.spec old mode 100644 new mode 100755 index 4223b23..e7717ed --- a/packaging/capi-system-info.spec +++ b/packaging/capi-system-info.spec @@ -1,16 +1,18 @@ Name: capi-system-info Summary: A System Information library in Tizen Native API Version: 0.1.0 -Release: 1 +Release: 12 Group: TO_BE/FILLED_IN License: Apache-2.0 Source0: %{name}-%{version}.tar.gz BuildRequires: cmake BuildRequires: pkgconfig(dlog) -BuildRequires: pkgconfig(iniparser) -BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(vconf) BuildRequires: pkgconfig(capi-base-common) +BuildRequires: pkgconfig(iniparser) +BuildRequires: pkgconfig(x11) +BuildRequires: pkgconfig(tapi) + Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig @@ -31,9 +33,8 @@ Requires: %{name} = %{version}-%{release} %build -FULLVER=%{version} -MAJORVER=`echo ${FULLVER} | cut -d '.' -f 1` -cmake . -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=${FULLVER} -DMAJORVER=${MAJORVER} +MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` +cmake . -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=%{version} -DMAJORVER=${MAJORVER} make %{?jobs:-j%jobs} @@ -48,10 +49,11 @@ rm -rf %{buildroot} %files -%{_libdir}/libcapi-system-info.so* +%{_libdir}/libcapi-system-info.so.* %files devel %{_includedir}/system/system_info.h %{_libdir}/pkgconfig/*.pc +%{_libdir}/libcapi-system-info.so diff --git a/src/system_info.c b/src/system_info.c index d7fab7f..1ce72fb 100755 --- a/src/system_info.c +++ b/src/system_info.c @@ -156,6 +156,13 @@ system_info_s system_info_table[] = { }, { + /**< The unique ID to identify GSM, and UMTS mobile devices */ + SYSTEM_INFO_KEY_MOBILE_DEVICE_ID, + SYSTEM_INFO_DATA_TYPE_STRING, + system_info_get_mobile_device_id +}, + +{ SYSTEM_INFO_MAX, -1, NULL } diff --git a/src/system_info_network.c b/src/system_info_network.c index 0c9b461..7a563f5 100755 --- a/src/system_info_network.c +++ b/src/system_info_network.c @@ -14,7 +14,6 @@ * limitations under the License. */ - #include #include #include @@ -22,6 +21,9 @@ #include #include +#include +#include + #include #include @@ -48,3 +50,27 @@ int system_info_get_network_type(system_info_key_e key, system_info_data_type_e return SYSTEM_INFO_ERROR_NONE; } +int system_info_get_mobile_device_id(system_info_key_e key, system_info_data_type_e data_type, void **value) +{ + TelMiscSNInformation imei = {0,}; + + if (tel_init() != TAPI_API_SUCCESS) + { + LOGE("[%s] IO_ERROR(0x%08x)", __FUNCTION__, SYSTEM_INFO_ERROR_IO_ERROR); + return SYSTEM_INFO_ERROR_IO_ERROR; + } + + if (tel_get_misc_me_sn(TAPI_MISC_ME_IMEI, &imei) != TAPI_API_SUCCESS) + { + tel_deinit(); + LOGE("[%s] IO_ERROR(0x%08x)", __FUNCTION__, SYSTEM_INFO_ERROR_IO_ERROR); + return SYSTEM_INFO_ERROR_IO_ERROR; + } + + *value = strdup((char*)imei.szNumber); + + tel_deinit(); + + return SYSTEM_INFO_ERROR_NONE; +} + diff --git a/src/system_info_platform.c b/src/system_info_platform.c index 9cabd70..7862d32 100755 --- a/src/system_info_platform.c +++ b/src/system_info_platform.c @@ -36,7 +36,7 @@ #define LOG_TAG "TIZEN_N_SYSTEM_INFO" -#define TIZEN_VERSION "Beta" +#define TIZEN_VERSION "1.0" #define DEVICE_MODEL "SDK" #define LIB_GLES_V1 "/usr/lib/libGLESv1_CM.so" #define LIB_GLES_V2 "/usr/lib/libGLESv2.so" -- 2.7.4