diff options
author | Kim Kibum <kb0929.kim@samsung.com> | 2012-04-29 17:00:26 +0900 |
---|---|---|
committer | Kim Kibum <kb0929.kim@samsung.com> | 2012-04-29 17:00:26 +0900 |
commit | 1feaa62b195159acf4f3137ce3c376fc62ae5f9c (patch) | |
tree | 24af3b7cfaee5f78bf197d177c8831b180a1787d | |
parent | 6a4504d2928ee9f7127a84a2f91e615f5035a861 (diff) | |
download | emulator-plugin-gyro-pkgs-1feaa62b195159acf4f3137ce3c376fc62ae5f9c.tar.gz emulator-plugin-gyro-pkgs-1feaa62b195159acf4f3137ce3c376fc62ae5f9c.tar.bz2 emulator-plugin-gyro-pkgs-1feaa62b195159acf4f3137ce3c376fc62ae5f9c.zip |
upload tizen1.0 source
-rw-r--r-- | debian/changelog | 6 | ||||
-rw-r--r-- | debian/control | 2 | ||||
-rw-r--r-- | packaging/sf-plugin-gyro-emul-pkgs.spec | 57 | ||||
-rw-r--r-- | sensor/include/l3g4200d.h | 8 | ||||
-rw-r--r-- | sensor/src/cgyro_sim.cpp | 39 |
5 files changed, 88 insertions, 24 deletions
diff --git a/debian/changelog b/debian/changelog index 34dbce9..8ba2142 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +sf-plugin-gyro-emul-pkgs (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-gyro-emul-pkgs (0.2.2) unstable; urgency=low * modified for build only i386 diff --git a/debian/control b/debian/control index 143ff75..d6a8462 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, libslp-setting-dev -Standards-Version: 0.2.1 +Standards-Version: 0.2.3 Package: sf-plugin-gyro-emul-pkgs Architecture: i386 diff --git a/packaging/sf-plugin-gyro-emul-pkgs.spec b/packaging/sf-plugin-gyro-emul-pkgs.spec new file mode 100644 index 0000000..3afc8a5 --- /dev/null +++ b/packaging/sf-plugin-gyro-emul-pkgs.spec @@ -0,0 +1,57 @@ +#git:/slp/pkgs/e/emulator-plugin-gyro-pkgs +Name: sf-plugin-gyro-emul-pkgs +Version: 0.2.1 +Release: 1 +Summary: gyro-sim plugins for sensor framework (using setting) +Group: System Environment/Libraries +License: GNUv2 +Source0: %{name}-%{version}.tar.gz +BuildArch: i386 +ExclusiveArch: %{ix86} +BuildRequires: cmake +BuildRequires: pkgconfig(sf_common) +BuildRequires: pkgconfig(vconf) + +%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 +rm -rf sensor/CMakeFiles +rm -rf sensor/cmake_install.cmake +rm -rf sensor/Makefile +rm -rf sensor/*.so + +rm -rf processor/CMakeFiles +rm -rf processor/cmake_install.cmake +rm -rf processor/Makefile +rm -rf processor/*.so + +%post + +%postun + +%files +%defattr(-,root,root,-) +%{_prefix}/lib/sensor_framework/*.so* + +%changelog diff --git a/sensor/include/l3g4200d.h b/sensor/include/l3g4200d.h index e7435c1..0b70ab4 100644 --- a/sensor/include/l3g4200d.h +++ b/sensor/include/l3g4200d.h @@ -74,12 +74,12 @@ #define L3G4200D_GET_RANGE _IOW(L3G4200D_IOCTL_BASE, 5, int) #define L3G4200D_SELF_TEST_MODE _IOW(L3G4200D_IOCTL_BASE, 6, int) -#define L3G4200D_FS_250DPS 0x00 -#define L3G4200D_FS_500DPS 0x10 +//#define L3G4200D_FS_250DPS 0x00 +//#define L3G4200D_FS_500DPS 0x10 #define L3G4200D_FS_2000DPS 0x30 -#define L3G4200D_FS_250DPS_SENSITIVITY (8.75) // mdps/digit -#define L3G4200D_FS_500DPS_SENSITIVITY (17.50) // mdps/digit +//#define L3G4200D_FS_250DPS_SENSITIVITY (8.75) // mdps/digit +//#define L3G4200D_FS_500DPS_SENSITIVITY (17.50) // mdps/digit #define L3G4200D_FS_2000DPS_SENSITIVITY (70) // mdps/digit #define PM_OFF 0x00 diff --git a/sensor/src/cgyro_sim.cpp b/sensor/src/cgyro_sim.cpp index 5bb9145..84937af 100644 --- a/sensor/src/cgyro_sim.cpp +++ b/sensor/src/cgyro_sim.cpp @@ -65,6 +65,8 @@ #define LOG_TAG "gyro_sim_SENSOR" #endif +#define SENSOR_NAME "Emul_ModelId_Gyro" +#define SENSOR_VENDOR "Emul_Vendor" const char *cgyro_sim::m_port[] = {"x", "y", "z"}; @@ -440,24 +442,21 @@ long cgyro_sim::set_cmd(int type , int property , long input_value) int cgyro_sim::get_property(unsigned int property_level , void *property_data) { DBG("gyro_sim_sensor called get_property , with property_level : 0x%x", property_level); -#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_DEGREE_PER_SECOND; - return_property->sensor_min_range = -(m_sensitivity*32768/1000); - return_property->sensor_max_range = (m_sensitivity*32767/1000); - return_property->sensor_resolution = (m_sensitivity/1000); - return 0; - - } else { - ERR("Doesnot support property_level : %d\n",property_level); - return -1; - } - -#else - return -1; -#endif + base_property_struct *return_property; + return_property = (base_property_struct *)property_data; + return_property->sensor_unit_idx = IDX_UNIT_DEGREE_PER_SECOND; + return_property->sensor_min_range = -(m_sensitivity*32768/1000); + return_property->sensor_max_range = (m_sensitivity*32767/1000); + return_property->sensor_resolution = (m_sensitivity/1000); + 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 { + ERR("Doesnot support property_level : %d\n",property_level); + return -1; + } } int cgyro_sim::get_struct_value(unsigned int struct_type , void *struct_values) @@ -551,7 +550,7 @@ int cgyro_sim::check_sensitivity(int update) { int fd; int state; - unsigned char fs_range = 0; + unsigned char fs_range = 0x30; // L3G4200D_FS_2000DPS fd = open(m_resource , O_RDWR); if ( fd < 0 ) @@ -559,7 +558,8 @@ int cgyro_sim::check_sensitivity(int update) if (update) { - switch (fs_range ) { + m_sensitivity = L3G4200D_FS_2000DPS_SENSITIVITY; + /* switch (fs_range ) { case L3G4200D_FS_250DPS: m_sensitivity = L3G4200D_FS_250DPS_SENSITIVITY; break; @@ -576,6 +576,7 @@ int cgyro_sim::check_sensitivity(int update) close(fd); return -1; } + */ } DBG("Check sensitivity : 0x%x\n",fs_range); |