他的回复:
static void deal_report_msg(report_t *report) { oc_mqtt_profile_service_t service; oc_mqtt_profile_kv_t Longitude_value; oc_mqtt_profile_kv_t Latitude_value; oc_mqtt_profile_kv_t beep; if(g_app_cb.connected != 1){ return; } service.event_time = NULL; service.service_id = "Track"; service.service_property = &Longitude_value; service.nxt = NULL; Longitude_value.key = "Longitude"; Longitude_value.value = &report->Longitude; Longitude_value.type = EN_OC_MQTT_PROFILE_VALUE_STRING; Longitude_value.nxt = &Latitude_value; Latitude_value.key = "Latitude"; Latitude_value.value = &report->Latitude; Latitude_value.type = EN_OC_MQTT_PROFILE_VALUE_STRING; Latitude_value.nxt = &beep; beep.key = "BeepStatus"; beep.value = g_app_cb.beep ? "ON" : "OFF"; beep.type = EN_OC_MQTT_PROFILE_VALUE_STRING; beep.nxt = NULL; oc_mqtt_profile_propertyreport(NULL,&service); return; }