summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkibak.yoon <kibak.yoon@samsung.com>2013-09-16 09:26:41 (GMT)
committerJacek Bukarewicz <j.bukarewicz@samsung.com>2013-10-28 14:47:24 (GMT)
commit381ee6b97c9922b8193e14f076657addf6189a1f (patch)
treea04e63836eef50b01fcf8147968606434b071212
parent0b466302afcb0ce0e23f0d8f1e1e9820e42326dc (diff)
downloadlibslp-sensor-381ee6b97c9922b8193e14f076657addf6189a1f.zip
libslp-sensor-381ee6b97c9922b8193e14f076657addf6189a1f.tar.gz
libslp-sensor-381ee6b97c9922b8193e14f076657addf6189a1f.tar.bz2
delete warning log and revise always_on option bugrefs/changes/80/11480/1
Change-Id: I886dd287050eb0f4fe73c17dc26c62eb0cbc5e5c Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
-rwxr-xr-xsrc/client.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 381c5c0..952a919 100755
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -1315,7 +1315,12 @@ EXTAPI int sf_start(int handle , int option)
retvm_if( handle > MAX_BIND_SLOT - 1, -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);
- retvm_if( g_bind_table[handle].sensor_state == SENSOR_STATE_STARTED , 0 , "sensor already started");
+
+ if (option == SENSOR_OPTION_ALWAYS_ON)
+ g_bind_table[handle].sensor_option = option;
+
+ retv_if( g_bind_table[handle].sensor_state == SENSOR_STATE_STARTED , 0);
+
try {
packet = new cpacket(sizeof(cmd_start_t)+4);
@@ -1405,7 +1410,6 @@ EXTAPI int sf_start(int handle , int option)
}
g_bind_table[handle].sensor_state = SENSOR_STATE_STARTED;
- g_bind_table[handle].sensor_option = option;
delete packet;
return 0;
@@ -1419,7 +1423,7 @@ EXTAPI int sf_stop(int handle)
retvm_if( handle > MAX_BIND_SLOT - 1, -1 , "Incorrect handle");
retvm_if( (g_bind_table[handle].ipc == NULL) ||(handle < 0) , -1 , "sensor_stop fail , invalid handle value : %d",handle);
- retvm_if( (g_bind_table[handle].sensor_state == SENSOR_STATE_STOPPED) || (g_bind_table[handle].sensor_state == SENSOR_STATE_PAUSED) , 0 , "sensor already stopped");
+ retv_if( (g_bind_table[handle].sensor_state == SENSOR_STATE_STOPPED) || (g_bind_table[handle].sensor_state == SENSOR_STATE_PAUSED) , 0);
try {
packet = new cpacket(sizeof(cmd_stop_t)+4);