[sample] fix details
authorEunyoung Lee <ey928.lee@samsung.com>
Fri, 26 Apr 2019 06:40:46 +0000 (15:40 +0900)
committer박정훈/Tizen Platform Lab(SR)/Staff Engineer/삼성전자 <jh1979.park@samsung.com>
Fri, 26 Apr 2019 07:28:17 +0000 (16:28 +0900)
inc/devicemanagerservice.h [deleted file]
inc/log.h
src/devicemanagerservice.c

diff --git a/inc/devicemanagerservice.h b/inc/devicemanagerservice.h
deleted file mode 100644 (file)
index d38e682..0000000
+++ /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__ */
index 066d2e6..9a9ce12 100755 (executable)
--- 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)
index 28ff368..63835d2 100644 (file)
@@ -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;