enum geomag_data_id {
GEOMAGNETIC_BASE_DATA_SET = (GEOMAGNETIC_SENSOR<<16) | 0x0001,
- GEOMAGNETIC_RAW_DATA_SET = (GEOMAGNETIC_SENSOR<<16) | 0x0002,
+ GEOMAGNETIC_RAW_DATA_SET = (GEOMAGNETIC_SENSOR<<16) | 0x0001,
+ GEOMAGNETIC_ATITUDE_DATA_SET = (GEOMAGNETIC_SENSOR<<16) | 0x0002,
};
enum geomag_evet_type {
GEOMAGNETIC_EVENT_CALIBRATION_NEEDED = (GEOMAGNETIC_SENSOR<<16) |0x0001,
- GEOMAGNETIC_EVENT_ATTITUDE_DATA_REPORT_ON_TIME = (GEOMAGNETIC_SENSOR<<16) |0x0002,
- GEOMAGNETIC_EVENT_RAW_DATA_REPORT_ON_TIME = (GEOMAGNETIC_SENSOR<<16) |0x0004,
+ GEOMAGNETIC_EVENT_RAW_DATA_REPORT_ON_TIME = (GEOMAGNETIC_SENSOR<<16) |0x0002,
+ GEOMAGNETIC_EVENT_ATTITUDE_DATA_REPORT_ON_TIME = (GEOMAGNETIC_SENSOR<<16) |0x0004,
};
enum geomag_property_id {
-Name: libslp-sensor
+Name: sensor
Summary: Sensor framework client library
Version: 0.5.6
Release: 1
-Group: System/Libraries
-License: Apache-2.0
-Source0: libslp-sensor-%{version}.tar.gz
+Group: TO_BE/FILLED_IN
+License: TO BE FILLED IN
+Source0: sensor-%{version}.tar.gz
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
BuildRequires: cmake
-BuildRequires: vconf-keys-devel
+BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(sf_common)
BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(glib-2.0)
make %{?jobs:-j%jobs}
%install
+rm -rf %{buildroot}
%make_install
-
-
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
-
-
-
%files
+%defattr(-,root,root,-)
+#%doc COPYING
%{_libdir}/libsensor.so.*
%files devel
+%defattr(-,root,root,-)
%{_includedir}/sensor/*.h
%{_libdir}/libsensor.so
%{_libdir}/pkgconfig/sensor.pc
{
cpacket packet(sizeof(cmd_byebye_t)+4);
cmd_byebye_t *payload;
-
+
+ retvm_if( handle > MAX_BIND_SLOT , -1 , "Incorrect handle");
retvm_if( (g_bind_table[handle].ipc == NULL) ||(handle < 0) , -1 , "sensor_detach_channel fail , invalid handle value : %d",handle);
INFO("Detach, so remove %d from the table\n", handle);
cpacket packet(sizeof(cmd_start_t)+4);
cmd_start_t *payload;
+ retvm_if( handle > MAX_BIND_SLOT , -1 , "Incorrect handle");
retvm_if( (g_bind_table[handle].ipc == NULL) ||(handle < 0) , -1 , "sensor_start fail , invalid handle value : %d",handle);
retvm_if( option != 0 , -1 , "sensor_start fail , invalid option value : %d",option);
cpacket packet(sizeof(cmd_stop_t)+4);
cmd_stop_t *payload;
+ retvm_if( handle > MAX_BIND_SLOT , -1 , "Incorrect handle");
retvm_if( (g_bind_table[handle].ipc == NULL) ||(handle < 0) , -1 , "sensor_stop fail , invalid handle value : %d",handle);
int collect_data_flag = 0;
+ retvm_if( handle > MAX_BIND_SLOT , -1 , "Incorrect handle");
retvm_if( (g_bind_table[handle].ipc == NULL) ||(handle < 0) , -1 , "sensor_register_cb fail , invalid handle value : %d",handle);
payload = (cmd_reg_t*)packet.data();
switch (event_type ) {
case ACCELEROMETER_EVENT_RAW_DATA_REPORT_ON_TIME:
/* fall through */
- case GEOMAGNETIC_EVENT_ATTITUDE_DATA_REPORT_ON_TIME:
+ case GEOMAGNETIC_EVENT_RAW_DATA_REPORT_ON_TIME:
/* fall through */
case PROXIMITY_EVENT_STATE_REPORT_ON_TIME:
/* fall through */
break;
case LIGHT_EVENT_LUX_DATA_REPORT_ON_TIME:
/* fall through */
- case GEOMAGNETIC_EVENT_RAW_DATA_REPORT_ON_TIME:
+ case GEOMAGNETIC_EVENT_ATTITUDE_DATA_REPORT_ON_TIME:
/* fall through */
case ACCELEROMETER_EVENT_ORIENTATION_DATA_REPORT_ON_TIME:
/* fall through */
int collect_data_flag = 0;
+ retvm_if( handle > MAX_BIND_SLOT , -1 , "Incorrect handle");
retvm_if( (g_bind_table[handle].ipc == NULL) ||(handle < 0) , -1 , "sensor_unregister_cb fail , invalid handle value : %d",handle);
payload = (cmd_reg_t*)packet.data();
retvm_if( (!values) , -1 , "sf_get_data fail , invalid get_values pointer %p", values);
retvm_if( ( (data_id & 0xFFFF) < 1) || ( (data_id & 0xFFFF) > 0xFFF), -1 , "sf_get_data fail , invalid data_id %d", data_id);
+ retvm_if( handle > MAX_BIND_SLOT , -1 , "Incorrect handle");
retvm_if( (g_bind_table[handle].ipc == NULL) ||(handle < 0) , -1 , "sf_get_data fail , invalid handle value : %d",handle);
if(g_bind_table[handle].sensor_state != SENSOR_STATE_STARTED)