summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEunyoung Lee <ey928.lee@samsung.com>2019-04-26 15:40:46 +0900
committer박정훈/Tizen Platform Lab(SR)/Staff Engineer/삼성전자 <jh1979.park@samsung.com>2019-04-26 16:28:17 +0900
commite74cfe5b42ecfb2c04e727602291bde580fe3e2b (patch)
tree7a8159cf1c9ceb0b34b6cb48cde9f4df753d352e
parentb4cefd66446366a1fd9c9e481fe5ab896f5d0a9a (diff)
downloadiot-device-manager-e74cfe5b42ecfb2c04e727602291bde580fe3e2b.tar.gz
iot-device-manager-e74cfe5b42ecfb2c04e727602291bde580fe3e2b.tar.bz2
iot-device-manager-e74cfe5b42ecfb2c04e727602291bde580fe3e2b.zip
[sample] fix details
-rw-r--r--inc/devicemanagerservice.h12
-rwxr-xr-xinc/log.h4
-rw-r--r--src/devicemanagerservice.c14
3 files changed, 11 insertions, 19 deletions
diff --git a/inc/devicemanagerservice.h b/inc/devicemanagerservice.h
deleted file mode 100644
index d38e682..0000000
--- a/inc/devicemanagerservice.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef __devicemanagerservice_H__
-#define __devicemanagerservice_H__
-
-#include <dlog.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-#define LOG_TAG "devicemanagerservice"
-
-
-#endif /* __devicemanagerservice_H__ */
diff --git a/inc/log.h b/inc/log.h
index 066d2e6..9a9ce12 100755
--- a/inc/log.h
+++ b/inc/log.h
@@ -29,14 +29,14 @@ extern "C" {
#define retv_if(expr, val) do { \
if (expr) { \
- dlog_print(DLOG_INFO, "(%s) -> %s() return", #expr, __FUNCTION__); \
+ dlog_print(DLOG_INFO, "%s : %s(%d) > (%s) -> %s() return", rindex(__FILE__, '/') + 1, __func__, __LINE__, #expr, __FUNCTION__); \
return (val); \
} \
} while (0)
#define ret_if(expr) do { \
if (expr) { \
- dlog_print(DLOG_INFO, "(%s) -> %s() return", #expr, __FUNCTION__); \
+ dlog_print(DLOG_INFO, "%s : %s(%d) > (%s) -> %s() return", rindex(__FILE__, '/') + 1, __func__, __LINE__, #expr, __FUNCTION__); \
return; \
} \
} while (0)
diff --git a/src/devicemanagerservice.c b/src/devicemanagerservice.c
index 28ff368..63835d2 100644
--- a/src/devicemanagerservice.c
+++ b/src/devicemanagerservice.c
@@ -3,7 +3,6 @@
#include <Ecore.h>
#include <glib.h>
-#include "devicemanagerservice.h"
#include "iot-device-manage.h"
#include "iot-device-manage-type.h"
#include "log.h"
@@ -19,7 +18,7 @@ static char *__make_request(int duration, int period)
{
char *request_json = NULL;
- request_json = g_strdup_printf("{ \"type\" : \"%d,\" \"duration\" : \"%d,\" \"period\" : \"%d\" }", 1, duration, period);
+ request_json = g_strdup_printf("{ \"type\" : %d, \"duration\" : %d, \"period\" : %d }", 1, duration, period);
return request_json;
}
@@ -85,15 +84,16 @@ static Eina_Bool __command_stop(void *data)
static void __get_tinfo_result_cb(idm_command_h command, idm_result_e result, idm_reason_e reason, const char *detail, void *data)
{
- _D("result : %d, reason : %d, detail : %s", result, reason, detail ? detail : "None");
+ unsigned long id;
+ idm_command_get_id(command, &id);
+
+ _D("[%d] result : %d, reason : %d, detail : %s", id, result, reason, detail ? detail : "None");
if (result != IDM_RESULT_RUNNING) {
app_data *ad = data;
idm_command_free(command);
ad->command = NULL;
- unsigned long id;
- idm_command_get_id(command, &id);
if (id == 1) {
// 2. 2초 간격으로 1분간 task info 받도록 cmd 실행하고, 30초 뒤에 cmd stop 호출
__get_taskinfo(60, 2, 2, __get_tinfo_result_cb, ad);
@@ -151,11 +151,13 @@ static void __get_taskinfo(int duration, int period, unsigned long id, idm_resul
static bool service_app_create(void *data)
{
+ _D("app create");
return true;
}
static void service_app_terminate(void *data)
{
+ _D("app terminate");
app_data *ad = data;
if (ad->command) {
@@ -174,6 +176,7 @@ static void service_app_terminate(void *data)
static void service_app_control(app_control_h app_control, void *data)
{
+ _D("app control");
app_data *ad = data;
if (ad->command) {
@@ -197,6 +200,7 @@ int main(int argc, char* argv[])
{
app_data ad;
ad.timer = NULL;
+ ad.command = NULL;
service_app_lifecycle_callback_s event_callback;
event_callback.create = service_app_create;