void service_app_terminate(void *data)
{
+ FWR_ENTER
// Todo: add your code here.
if (unset_state_changed_cb() != 0) {
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;
}
}
-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");
+ }
+
}
int unset_state_changed_cb()
{
- fmwup_unset_resource_changed_cb();
+ fmwup_unset_state_changed_cb();
return 0;
}
#endif
// _lock_and_wait();
-
fmwup_check_firmware_upgraded();
return 0;