From 381ee6b97c9922b8193e14f076657addf6189a1f Mon Sep 17 00:00:00 2001 From: "kibak.yoon" Date: Mon, 16 Sep 2013 18:26:41 +0900 Subject: delete warning log and revise always_on option bug Change-Id: I886dd287050eb0f4fe73c17dc26c62eb0cbc5e5c Signed-off-by: kibak.yoon --- src/client.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/client.cpp') 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); -- cgit v1.2.3