diff options
author | Kim Kibum <kb0929.kim@samsung.com> | 2012-04-29 17:00:29 +0900 |
---|---|---|
committer | Kim Kibum <kb0929.kim@samsung.com> | 2012-04-29 17:00:29 +0900 |
commit | c9d5d3b126ae2532b44867d828c47cafb5108a1b (patch) | |
tree | cc5d3cd6ff2e620563bab77504594d39ca5731ea | |
parent | 2e861ca7beccdb167e366eadf77d2c0f11f627f2 (diff) | |
download | emulator-plugin-proxi-c9d5d3b126ae2532b44867d828c47cafb5108a1b.tar.gz emulator-plugin-proxi-c9d5d3b126ae2532b44867d828c47cafb5108a1b.tar.bz2 emulator-plugin-proxi-c9d5d3b126ae2532b44867d828c47cafb5108a1b.zip |
upload tizen1.0 source
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | debian/changelog | 18 | ||||
-rw-r--r-- | debian/control | 2 | ||||
-rw-r--r-- | debian/sf-plugin-gp2ap002proxi-dbg/usr/lib/debug/usr/lib/sensor_framework/libproxi_sim.so | bin | 20484 -> 0 bytes | |||
-rw-r--r-- | include/cproxi_sim.h | 5 | ||||
-rw-r--r-- | packaging/sf-plugin-proxi-emul.spec | 47 | ||||
-rw-r--r-- | src/cproxi_sim.cpp | 48 |
7 files changed, 102 insertions, 20 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c9696bb..1e0578a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ MESSAGE("add -DTARGET") #add_definitions(-D_ESTIMATE_PERFORMANCE) #add_definitions(-D_DEFAULT_FONT_NAME="Vera") add_definitions(-Wall -O3 -omit-frame-pointer) -add_definitions(-Wall -g -D_DEBUG) +#add_definitions(-Wall -g -D_DEBUG) add_definitions(-Iinclude) add_library(${PROJECT_NAME} SHARED diff --git a/debian/changelog b/debian/changelog index f84a8a6..84f3baa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,21 @@ +sf-plugin-proxi-emul (0.2.5) unstable; urgency=low + + * modified enum name for sync with proxi-proc + + -- Sungmin Ha <sungmin82.ha@samsung.com> Thu, 19 Apr 2012 17:35:52 +0900 + +sf-plugin-proxi-emul (0.2.4) unstable; urgency=low + + * modified for get_struct_value bug fix + + -- Sungmin Ha <sungmin82.ha@samsung.com> Thu, 19 Apr 2012 16:35:52 +0900 + +sf-plugin-proxi-emul (0.2.3) unstable; urgency=low + + * modified for support updated libslp-sensor + + -- Sungmin Ha <sungmin82.ha@samsung.com> Thu, 5 Apr 2012 15:06:52 +0900 + sf-plugin-proxi-emul (0.2.2) unstable; urgency=low * modified for build only i386 diff --git a/debian/control b/debian/control index b98e3b1..41384a2 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: misc Priority: extra Maintainer: Sungmin ha <sungmin82.ha@samsung.com> Build-Depends: libsf-common-dev -Standards-Version: 0.2.1 +Standards-Version: 0.2.5 Package: sf-plugin-proxi-emul Section: misc diff --git a/debian/sf-plugin-gp2ap002proxi-dbg/usr/lib/debug/usr/lib/sensor_framework/libproxi_sim.so b/debian/sf-plugin-gp2ap002proxi-dbg/usr/lib/debug/usr/lib/sensor_framework/libproxi_sim.so Binary files differdeleted file mode 100644 index 9c44c9d..0000000 --- a/debian/sf-plugin-gp2ap002proxi-dbg/usr/lib/debug/usr/lib/sensor_framework/libproxi_sim.so +++ /dev/null diff --git a/include/cproxi_sim.h b/include/cproxi_sim.h index f51592a..dd9d4ed 100644 --- a/include/cproxi_sim.h +++ b/include/cproxi_sim.h @@ -30,6 +30,11 @@ public: PROXIMITY_DISTANCE_DATA_SET = (0x0008 << 16) | 0x0002 }; + enum proxi_sim_state_event_t { + PROXIMITY_STATE_FAR = 0, + PROXIMITY_STATE_NEAR = 1, + }; + enum cproxi_sim_cmd_property_t { PROPERTY_CMD_START = 0, PROPERTY_CMD_1, diff --git a/packaging/sf-plugin-proxi-emul.spec b/packaging/sf-plugin-proxi-emul.spec new file mode 100644 index 0000000..e08b616 --- /dev/null +++ b/packaging/sf-plugin-proxi-emul.spec @@ -0,0 +1,47 @@ +#git:/slp/pkgs/e/emulator-plugin-proxi +Name: sf-plugin-proxi-emul +Version: 0.2.5 +Release: 1 +Summary: GP2AP002 proximity Plugin for sensor framework +Group: System Environment/Libraries +License: GNUv2 +Source0: %{name}-%{version}.tar.gz +BuildArch: i386 +ExclusiveArch: %{ix86} +BuildRequires: cmake +BuildRequires: pkgconfig(sf_common) + +%description + +%prep +%setup -q + +%build +export LDFLAGS+="-Wl,--rpath=%{_prefix}/lib -Wl,--as-needed" + +LDFLAGS="$LDFLAGS" cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} + +make + +%install +rm -rf %{buildroot} +%make_install + +%clean +make clean +rm -rf CMakeCache.txt +rm -rf CMakeFiles +rm -rf cmake_install.cmake +rm -rf Makefile +rm -rf install_manifes.txt +rm -rf *.so + +%post + +%postun + +%files +%defattr(-,root,root,-) +%{_prefix}/lib/sensor_framework/*.so* + +%changelog diff --git a/src/cproxi_sim.cpp b/src/cproxi_sim.cpp index 61124e5..fa7ebbc 100644 --- a/src/cproxi_sim.cpp +++ b/src/cproxi_sim.cpp @@ -54,6 +54,9 @@ #define DISTANCE_LIMIT 8 +#define SENSOR_NAME "Emul_ModelId_Proximity" +#define SENSOR_VENDOR "Emul_Vendor" + const char *cproxi_sim::m_port[] = {"vo","enable"}; cproxi_sim::cproxi_sim() @@ -466,23 +469,29 @@ long cproxi_sim::set_cmd(int type , int property , long input_value) int cproxi_sim::get_property(unsigned int property_level , void *property_data) { -#ifdef TARGET - if ( (property_level & 0xFFFF) == 1 ) { - base_property_struct *return_property; - return_property = (base_property_struct *)property_data; - return_property->sensor_unit_idx = IDX_UNIT_STATE_ON_OFF; - return_property->sensor_min_range = 0.; - return_property->sensor_max_range = 1.; - return_property->sensor_resolution = 1.; - return 0; - - } else { - ERR("Doesnot support property_level : %d\n",property_level); - return -1; - } -#endif - - return -1; + base_property_struct *return_property; + return_property = (base_property_struct *)property_data; + + if ( (property_level & 0xFFFF) == 1 ) { + base_property_struct *return_property; + return_property = (base_property_struct *)property_data; + return_property->sensor_unit_idx = IDX_UNIT_STATE_ON_OFF; + return_property->sensor_min_range = 0.; + return_property->sensor_max_range = 1.; + return_property->sensor_resolution = 1.; + snprintf(return_property->sensor_name, sizeof(return_property->sensor_name), SENSOR_NAME ); + snprintf(return_property->sensor_vendor, sizeof(return_property->sensor_vendor), SENSOR_VENDOR); + return 0; + } else if ( (property_level & 0xFFFF) == 2 ) { + return_property->sensor_unit_idx = IDX_UNIT_CENTIMETER; + return_property->sensor_min_range = 0; + return_property->sensor_max_range = 8; + return_property->sensor_resolution = 1; + return 0; + } else { + ERR("Doesnot support property_level : %d\n",property_level); + return -1; + } } int cproxi_sim::get_struct_value(unsigned int struct_type , void *struct_values) @@ -497,7 +506,10 @@ int cproxi_sim::get_struct_value(unsigned int struct_type , void *struct_values) return_struct_value->data_unit_idx = IDX_UNIT_STATE_ON_OFF; return_struct_value->time_stamp = m_fired_time ; return_struct_value->values_num = 1; - return_struct_value->values[0] = m_vo; + if(m_vo > 3) + return_struct_value->values[0] = PROXIMITY_STATE_FAR; + else + return_struct_value->values[0] = PROXIMITY_STATE_NEAR; return 0; } else { |