diff options
author | Jeonghoon Park <jh1979.park@samsung.com> | 2017-11-08 14:32:12 +0900 |
---|---|---|
committer | Jeonghoon Park <jh1979.park@samsung.com> | 2017-11-08 14:32:12 +0900 |
commit | 58287a48b6896d70d31f3372047254edd6dd3834 (patch) | |
tree | ee5d6d6335d4e1a7120c8715bf5218f1b6258205 | |
parent | e3153559ddf99814f699b065d7bddbe10a69c7fd (diff) | |
download | rcc-58287a48b6896d70d31f3372047254edd6dd3834.tar.gz rcc-58287a48b6896d70d31f3372047254edd6dd3834.tar.bz2 rcc-58287a48b6896d70d31f3372047254edd6dd3834.zip |
apply connectivity functions changes
Change-Id: I658880aec364de35677e8f4f95b0b8aa023a0e18
-rw-r--r-- | src/controller.c | 17 | ||||
-rw-r--r-- | src/controller_internal.c | 5 |
2 files changed, 17 insertions, 5 deletions
diff --git a/src/controller.c b/src/controller.c index c80090e..a442f82 100644 --- a/src/controller.c +++ b/src/controller.c @@ -33,7 +33,7 @@ #include "webutil.h" #define CONNECTIVITY_KEY "opened" -#define SENSORING_TIME_INTERVAL 1.0f +#define SENSORING_TIME_INTERVAL 5.0f typedef struct app_data_s { Ecore_Timer *getter_timer; @@ -43,8 +43,10 @@ typedef struct app_data_s { static Eina_Bool control_sensors_cb(void *data) { app_data *ad = data; + int value = 1; - if (connectivity_notify_bool(ad->resource_info, CONNECTIVITY_KEY, true) == -1) + /* This is example, get value from sensors first */ + if (connectivity_notify_int(ad->resource_info, "Motion", value) == -1) _E("Cannot notify message"); return ECORE_CALLBACK_RENEW; @@ -54,6 +56,7 @@ static bool service_app_create(void *data) { app_data *ad = data; int ret = -1; + const char *path = NULL; /** * No modification required!!! @@ -64,7 +67,15 @@ static bool service_app_create(void *data) /** * Create a connectivity resource and registers the resource in server. */ - ret = connectivity_set_resource(NULL, "org.tizen.door", &ad->resource_info); + connectivity_set_protocol(CONNECTIVITY_PROTOCOL_HTTP); + + controller_util_get_path(&path); + if (path == NULL) { + _E("Failed to get path"); + return false; + } + + ret = connectivity_set_resource(path, "org.tizen.door", &ad->resource_info); if (ret == -1) _E("Cannot broadcast resource"); /** diff --git a/src/controller_internal.c b/src/controller_internal.c index 28002f7..97e8499 100644 --- a/src/controller_internal.c +++ b/src/controller_internal.c @@ -28,13 +28,14 @@ void controller_init_internal_functions(void) { - connectivity_init(); + return; } void controller_fini_internal_functions(void) { _I("Terminating..."); resource_close_all(); - connectivity_fini(); controller_util_free(); + + return; } |