Remove explicit functions for start/stop gathering and include codes in service_app_c... 03/208803/1 smart-things
authorBoyeon <boyeon.son@samsung.com>
Fri, 28 Jun 2019 11:36:43 +0000 (20:36 +0900)
committerBoyeon <boyeon.son@samsung.com>
Fri, 28 Jun 2019 11:36:43 +0000 (20:36 +0900)
Change-Id: I6827be32a46b7eb5b8cb4995f1e3da3ca793fa20

src/controller.c [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index ecca89f..b8d8985
@@ -574,30 +574,6 @@ int _fini_master(app_data *ad)
 }
 #endif /* USE_ST_SDK */
 
-static void _stop_gathering(void *data)
-{
-       app_data *ad = data;
-       ret_if(!ad);
-
-       if (ad->getter_timer) {
-               ecore_timer_del(ad->getter_timer);
-               ad->getter_timer = NULL;
-       }
-}
-
-static void _start_gathering(void *data)
-{
-       app_data *ad = data;
-       ret_if(!ad);
-
-       if (ad->getter_timer)
-               ecore_timer_del(ad->getter_timer);
-
-       ad->getter_timer = ecore_timer_add(TIMER_GATHER_INTERVAL, _get_motion_sensor_data, ad);
-       if (!ad->getter_timer)
-               _E("Failed to add a timer");
-}
-
 static bool service_app_create(void *user_data)
 {
 #ifdef USE_ST_SDK
@@ -617,8 +593,16 @@ static bool service_app_create(void *user_data)
 
 static void service_app_control(app_control_h app_control, void *user_data)
 {
-       _stop_gathering(user_data);
-       _start_gathering(user_data);
+       app_data *ad = user_data;
+
+       if (ad->getter_timer)
+               ecore_timer_del(ad->getter_timer);
+
+       ad->getter_timer = ecore_timer_add(TIMER_GATHER_INTERVAL, _get_motion_sensor_data, ad);
+       if (!ad->getter_timer) {
+               _E("Failed to add getter timer");
+               return;
+       }
 }
 
 static void service_app_terminate(void *user_data)