T5 附属固件注册时返回-4(不支持)问题
Posted: 2025年 Oct 19日 17:11
各位大佬好,
我的SDK版本为: T5_TuyaOS-3.12.16
从example中拷贝修改的代码:
Code: Select all
OPERATE_RET rt = OPRT_OK;
char ver_buf[10] = {0};
// Initialize TuyaOS product information
TY_IOT_CBS_S iot_cbs = {0};
iot_cbs.gw_status_cb = __dev_status_changed_cb;
iot_cbs.gw_reset_cb = __dev_reset_inform_cb;
iot_cbs.dev_obj_dp_cb = __dev_obj_dp_cmd_cb;
iot_cbs.dev_raw_dp_cb = __dev_raw_dp_cmd_cb;
iot_cbs.dev_dp_query_cb = __dev_dp_query_cb;
//attach module upgrade
iot_cbs.gw_ug_cb = __dev_rev_attatch_upgrade_info_cb;
TAL_PR_DEBUG("ci1302_attach_ota in");
while (!ci1302_read_version(ver_buf)) {
tal_system_sleep(50);
TAL_PR_NOTICE("version read erro recheck!");
}
GW_ATTACH_ATTR_T attach_arr[] = {
{
.tp = DEV_NM_NOT_ATH_SNGL,
},
};
strcpy(attach_arr[0].ver, ver_buf);
#ifdef ENABLE_WIFI_SERVICE
TUYA_CALL_ERR_LOG(tuya_iot_wf_dev_init(GWCM_OLD, WF_START_SMART_AP_CONCURRENT, &iot_cbs,\
FIRMWARE_KEY, DEVICE_PID, USER_SW_VER, DEV_NM_ATH_SNGL,\
attach_arr, CNTSOF(attach_arr)));
#else
iot_cbs.active_shorturl = __qrcode_active_shourturl_cb;
TUYA_CALL_ERR_LOG(tuya_iot_dev_init(&iot_cbs, FIRMWARE_KEY, DEVICE_PID, USER_SW_VER, DEV_NM_ATH_SNGL,\
attach_arr, CNTSOF(attach_arr)));
#endif
运行后报错LOG如下:
Code: Select all
[01-01 08:00:02 ty N][7010][ci1302_ota.c:187] Firmeware version: V1.0.0
[01-01 08:00:02 ty N][7010][tuya_iot_wifi_api.c:209] sw ver: 1.0.0
[01-01 08:00:02 ty D][7010][tuya_wifi_link.c:905] tuya wifi link init mthd:0,wifi start mode:4, enable_station_ap:0
[01-01 08:00:02 ty D][7010][simple_flash_protected.c:343] protected read [gw_wsm]
[01-01 08:00:02 ty D][7010][simple_flash_protected.c:387] protected read ret:0 length:169
[01-01 08:00:02 ty D][7010][ws_db_gw.c:257] gw_wsm read ret:0
[01-01 08:00:02 ty N][7010][tuya_wifi_link.c:86] start wifi link params validate, nc_tp:10 md:0
[01-01 08:00:02 ty N][7010][tuya_wifi_link.c:108] gw_wsm.nc_tp:10
[01-01 08:00:02 ty N][7010][tuya_wifi_link.c:109] gw_wsm.md:0
[01-01 08:00:02 ty D][7010][tuya_bt_link.c:287] bt init...
[01-01 08:00:02 ty D][7010][tuya_ble_svc.c:2414] get_wifi_list eanbled
[01-01 08:00:02 ty D][7010][tuya_ble_svc.c:2420] get_netcfg_stat eanbled
[01-01 08:00:02 ty D][7010][tuya_ble_svc.c:2424] get_dev_log eanbled
[01-01 08:00:02 ty D][7010][tuya_ble_svc.c:2430] get_ap_name eanbled
[01-01 08:00:02 ty E][7010][tuya_bt_link.c:304] ret:-4
[01-01 08:00:02 ty E][7010][tuya_iot_wifi_api.c:241] ret:-4
[01-01 08:00:02 ty E][7010][ci1302_ota.c:756] ret:-4
也就是tuya_iot_wf_dev_init在注册时返回了-4错误码对应的宏定义为:
#define OPRT_NOT_SUPPORTED (-0x0004) //-4, 不支持
为什么会出现这样的情况?我是不是应该增加什么宏定义还是说我目前的SDK版本并不支持?