summaryrefslogtreecommitdiff
path: root/src/controller.c
diff options
context:
space:
mode:
authorBoyeon <boyeon.son@samsung.com>2019-06-28 20:36:43 +0900
committerBoyeon <boyeon.son@samsung.com>2019-06-28 20:36:43 +0900
commit9571c753b3c1f227a2d7a8ee0a77196c55732c23 (patch)
treed7f1b4c6c7039f7e0c12bd73de5c0ad5f11b5d68 /src/controller.c
parent1eb948c259df6ce7bf2e5c60a1ef86867731c8b6 (diff)
downloadst-things-light-9571c753b3c1f227a2d7a8ee0a77196c55732c23.tar.gz
st-things-light-9571c753b3c1f227a2d7a8ee0a77196c55732c23.tar.bz2
st-things-light-9571c753b3c1f227a2d7a8ee0a77196c55732c23.zip
Remove explicit functions for start/stop gathering and include codes in service_app_controlsmart-things
Change-Id: I6827be32a46b7eb5b8cb4995f1e3da3ca793fa20
Diffstat (limited to 'src/controller.c')
-rwxr-xr-x[-rw-r--r--]src/controller.c36
1 files changed, 10 insertions, 26 deletions
diff --git a/src/controller.c b/src/controller.c
index ecca89f..b8d8985 100644..100755
--- a/src/controller.c
+++ b/src/controller.c
@@ -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)