IoT物联网-更新设备状态:示例

时间:2025-01-26 10:35:34

示例

123
HW_CHAR *pcDeviceId = stDevice.pcDeviceId; IOTA_DeviceStatusUpdate(0, pcDeviceId, ONLINE , NONE);

然后等待命令执行结果

123456789
// 开发者注册该函数进行状态更新后的处理 HW_iNT Device_StatusUpdateHandler(HW_UiNT uiCookie, HW_MSG pstMsg) {    HW_cHAR pcCmdContentl;    pcCmdContent = HW_MsgGetStr(pstMsg, EN_IOTA_DEVUPDATE_IE_RESULT);    pcCmdContent = HW_MsgGetStr(pstMsg, EN_IOTA_DEVUPDATE_IE_DEVICEID);    return 0;}//绑定广播接收处理函数 HW_BroadCastReg(“IOTA_TOPIC_DEVUPDATE_RSP”, Device_StatusUpdateHandler);
support.huaweicloud.com/sdkreference-iot/iot_06_1117.html