他的回复:
评论 墨丶文字™:static int app_report_task_entry() { int ret = -1; oc_config_param_t oc_param; tag_app_Track Track; memset(&oc_param,0,sizeof(oc_param)); oc_param.app_server.address = cn_app_server; oc_param.app_server.port = cn_app_port; oc_param.app_server.ep_id = cn_endpoint_id; oc_param.boot_mode = en_oc_boot_strap_mode_factory; oc_param.rcv_func = app_msg_deal; // context = oc_lwm2m_config(&oc_param); ret = oc_lwm2m_config( &oc_param); if (0 != ret) { return ret; } while(1) //--TODO ,you could add your own code here { if(E53_ST1_Data.Latitude!=0&&E53_ST1_Data.Longitude!=0) { Track.messageId = cn_app_Track; sprintf(Track.Longitude , "%.5f", E53_ST1_Data.Longitude); sprintf(Track.Latitude , "%.5f", E53_ST1_Data.Latitude); oc_lwm2m_report( (char *)&Track, sizeof(Track), 1000); } osal_task_sleep(2*1000); } return ret; } 有的呀