【已解决】【中控】【TuyaOS SDK】怎么获取网关下的设备名字等信息以及app场景名称
1) 开发包全称:tuyaos-gw-integrated_5.0.4_rk3308_wifi-cc-tpp01z_0.1.11
2) 问题现象:获取设备名字以及场景名称失败
接口调用如下所示:
STATIC VOID_T __test_time_handler(TIMER_ID timer_id, VOID_T *arg)
{
TUYA_DEV_BRIEF_INFO_S *list;
UINT_T cnt;
OPERATE_RET op_ret;
TUYA_SCENE_INFO_S *scnee_list;
Code: Select all
op_ret = tuya_scene_info_list_get(&scnee_list, &cnt);
if (op_ret != OPRT_OK) {
PR_DEBUG("tuya_scene_info_list_get error!");
return;
} else {
PR_DEBUG("tuya_scene_info_list_get cnt:%d!",cnt);
for (UINT_T i = 0; i < cnt; cnt++) {
PR_DEBUG("scnee_list[%d].id:%s!", i, scnee_list[i].id);
PR_DEBUG("scnee_list[%d].name:%s!", i, scnee_list[i].name);
}
tuya_scene_info_list_free(scnee_list, cnt);
}
op_ret = tuya_get_dev_brief_info_list(&list, &cnt);
if (op_ret != OPRT_OK) {
PR_DEBUG("tuya_get_dev_brief_info_list error!");
return;
}
PR_DEBUG("tuya_get_dev_brief_info_list cnt:%d!",cnt);
for (UINT_T i = 0; i < cnt; cnt++) {
PR_DEBUG("list[%d]:%s!", i, list[i]);
}
tuya_dev_brief_info_list_free(list, cnt);
}
详细日志如附件所示