fix:demos/ota: fix the api changes
@@ -113,14 +113,13 @@ static ota_storage_t s_ota_storage_device =
}
};
-static void *s_lwm2m_context = NULL; ///< this is used when we want to send some message to the platform
static queue_t *s_queue_msgrcv = NULL; ///< this is used to cached the message
static int ota_msg_send(void *msg,int len)
{
int ret;
- ret = oc_lwm2m_report(s_lwm2m_context,(char *)msg,len,1000);
+ ret = oc_lwm2m_report((char *)msg,len,1000);
return ret;
}
@@ -210,9 +209,7 @@ static int app_report_task_entry()
return ret;
}
- if(NULL != context) //success ,so we could receive and send
- {
- s_lwm2m_context = context;
+
while(1) //--TODO ,you could add your own code here
{
if(s_report_switch)
@@ -222,12 +219,11 @@ static int app_report_task_entry()
light.msgid = cn_app_light;
light.intensity = htons(lux);
- oc_lwm2m_report(s_lwm2m_context,(char *)&light,sizeof(light),1000); ///< report the light message
+ oc_lwm2m_report((char *)&light,sizeof(light),1000); ///< report the light message
}
osal_task_sleep(10*1000);
}
- }
return ret;
}
