upload tizen1.0 source
authorKim Kibum <kb0929.kim@samsung.com>
Sun, 29 Apr 2012 08:00:26 +0000 (17:00 +0900)
committerKim Kibum <kb0929.kim@samsung.com>
Sun, 29 Apr 2012 08:00:26 +0000 (17:00 +0900)
CMakeLists.txt
debian/changelog
debian/control
include/cgeo_sim.h
packaging/sf-plugin-geo-emul.spec [new file with mode: 0644]
src/cgeo_sim.cpp

index 56a273d..612e46a 100644 (file)
@@ -22,7 +22,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
index a78ac19..b2e15b2 100644 (file)
@@ -1,3 +1,9 @@
+sf-plugin-geo-emul (0.2.4) 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-geo-emul (0.2.3) unstable; urgency=low
 
     * add description in control file for server import
index b88a897..17eea80 100644 (file)
@@ -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.4
 
 Package: sf-plugin-geo-emul
 Section: misc
index 7ee3247..b3cb8cf 100644 (file)
@@ -26,7 +26,9 @@ class cgeo_sim : public csensor_module
 public:
 
        enum geo_sim_data_id {
-               GEO_BASE_DATA_SET = (0x0004<<16) | 0x0001,
+               GEOMAGNETIC_BASE_DATA_SET = (0x0004<<16) | 0x0001,
+               GEOMAGNETIC_RAW_DATA_SET = (0x0004<<16) | 0x0001,
+               GEOMAGNETIC_ATITUDE_DATA_SET = (0x0004<<16) | 0x0002,
        };
 
 
diff --git a/packaging/sf-plugin-geo-emul.spec b/packaging/sf-plugin-geo-emul.spec
new file mode 100644 (file)
index 0000000..3bf4e7e
--- /dev/null
@@ -0,0 +1,47 @@
+#git:/slp/pkgs/e/emulator-plugin-geo
+Name: sf-plugin-geo-emul
+Version: 0.2.1
+Release: 1
+Summary: ambient 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
index fef04b4..5e09885 100644 (file)
@@ -52,7 +52,8 @@
 
 #include <cgeo_sim.h>
 
-
+#define SENSOR_NAME    "Emul_ModelId_Magnetic"
+#define SENSOR_VENDOR  "Emul_Vendor"
 
 const char *cgeo_sim::m_port[] = {"raw","tesla"};
 
@@ -466,7 +467,27 @@ long cgeo_sim::set_cmd(int type , int property , long input_value)
 
 int cgeo_sim::get_property(unsigned int property_level , void *property_data)
 {
-       return -1;
+       base_property_struct *return_property;
+       return_property = (base_property_struct *)property_data;
+       
+       if ( (property_level & 0xFFFF) == 1 ) {
+               return_property->sensor_unit_idx = IDX_UNIT_MICRO_TESLA;
+                       return_property->sensor_min_range = -1200;
+               return_property->sensor_max_range = 1200;
+               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);
+       } else if ( (property_level & 0xFFFF) == 2 ) {
+               return_property->sensor_unit_idx = IDX_UNIT_DEGREE;
+               return_property->sensor_min_range = 0;
+               return_property->sensor_max_range = 359;
+               return_property->sensor_resolution = 1;
+       } else {
+               ERR("Doesnot support property_level : %d\n",property_level);
+               return -1;
+       }
+
+       return 0;
 }
 
 int cgeo_sim::get_struct_value(unsigned int struct_type , void *struct_values)