Test fmwup_set_firmware_resource_value API 96/151496/2
authorhhk86.heo <hhk86.heo@samsung.com>
Thu, 21 Sep 2017 05:38:30 +0000 (14:38 +0900)
committerSang-Hun Chung <sanghun.chung@samsung.com>
Thu, 21 Sep 2017 05:45:42 +0000 (05:45 +0000)
Change namaing (fmwup_unset_resource_changed_cb-> fmwup_unset_state_changed_cb)

Change-Id: I461a6d31c0937bcc67ed361afa4774027a55cfa6

src/fmw_update_service.c
src/fmw_update_service_internal.c

index e3dcd2431b89470acd1374ec2cfeb071ab1e9ff1..74f4874dcf36586e24190764a9c466e5861f767a 100644 (file)
@@ -47,6 +47,7 @@ bool service_app_create(void *data)
 
 void service_app_terminate(void *data)
 {
+       FWR_ENTER
     // Todo: add your code here.
 
        if (unset_state_changed_cb() != 0) {
@@ -64,13 +65,15 @@ void service_app_terminate(void *data)
        if (deinit_oc_stack() != 0) {
                FWR_LOGE("Failed deinit_oc_stack");
        }
+       FWR_EXIT
     return;
 }
 
 void service_app_control(app_control_h app_control, void *data)
 {
+       FWR_ENTER
     // Todo: add your code here.
-
+       FWR_EXIT
     return;
 }
 
index 274ce43cb7b134e17f6bd3722563f9c4a4b804ec..a1a7db8861b02d866c3521076f6f62e27de741a2 100644 (file)
@@ -572,9 +572,21 @@ int destory_default_res()
 }
 
 
-static void _state_changed_cb(fmwup_state_e value)
+static void _state_changed_cb(fmwup_state_e value, bool is_new_firmware)
 {
-       FWR_LOGD("state_changed_cb [%d]\n", value);
+       FWR_LOGD("state_changed_cb state[%d], is_new_firmware[%d]\n", value, is_new_firmware);
+
+       if (is_new_firmware) {
+               //0 – Initial value
+               //1 – download image
+               //2 – update using current downloaded image
+               //3 – download and upgrade image  // 주로 force update 용도
+               //4 – update (scheduled) // “updatetime” property 참조
+
+//             if (fmwup_set_firmware_resource_value(FMWUP_RES_UPDATE, "3") != 0)
+//                     FWR_LOGE("Failed fmwup_set_firmware_resource_value");
+       }
+
 }
 
 
@@ -590,7 +602,7 @@ int set_state_changed_cb()
 
 int unset_state_changed_cb()
 {
-       fmwup_unset_resource_changed_cb();
+       fmwup_unset_state_changed_cb();
        return 0;
 }
 
@@ -675,7 +687,6 @@ int _publish_fw_res_to_rd()
 #endif
 
 //     _lock_and_wait();
-
        fmwup_check_firmware_upgraded();
 
        return 0;