
回复
添加资源
添加资源将有机会获得更多曝光,你也可以直接关联已上传资源
去关联
华为loT平台地址:
https://www.huaweicloud.com/product/iothub.html
static int task_main_entry(void)
{
app_msg_t *app_msg;
uint32_t ret = WifiConnect("Hold", "0987654321");
device_info_init(CLIENT_ID, USERNAME, PASSWORD);
oc_mqtt_init();
oc_set_cmd_rsp_cb(oc_cmd_rsp_cb);
while (1)
{
app_msg = NULL;
(void)osMessageQueueGet(mid_MsgQueue, (void **)&app_msg, NULL, 0U);
if (NULL != app_msg)
{
switch (app_msg->msg_type)
{
case en_msg_cmd:
deal_cmd_msg(&app_msg->msg.cmd);
break;
case en_msg_report:
deal_report_msg(&app_msg->msg.report);
break;
default:
break;
}
free(app_msg);
}
}
return 0;
}
案例展示详细操作:
https://www.bilibili.com/video/BV1tv411b7SA?p=30&share_source=copy_web&vd_source=8f1cf1d7278a65d1271a6ccbd8891dc6 P30