tuya_ipc_start_sdk(mode, NULL) != OPRT_OK是传入的mode值为PARING_MODE_WIFI_AP,运行tuyaos后 tuya_ipc_status_changed_cb回调的状态是status chaged: group[1] status[5],按道理是回调的group值应该是2但实际tuyaos回调出来的是TUYA_IPC_STATUS_GROUP_DEVICE而不是TUYA_IPC_STATUS_GROUP_WIFI
VOID tuya_ipc_status_changed_cb(IN TUYA_IPC_STATUS_GROUP_E changed_group, IN CONST TUYA_IPC_STATUS_E status[TUYA_IPC_STATUS_GROUP_MAX])
{
TUYA_IPC_STATUS_E cur_status = status[changed_group];
INT_T i;
LOG_W("status chaged: group[%d] status[%d]", changed_group, cur_status);
Code: Select all
for(i = 0; i < SIZEOF(status_change_cb_map)/SIZEOF(IPC_STATUS_CHANGE_CB_MAP_T); i++) {
LOG_W("2023---12-23--1--\n.");
if(status_change_cb_map[i].stat == cur_status) {
LOG_W("2023---12-23--2--\n.");
if(status_change_cb_map[i].cb) {
LOG_W("2023---12-29--3--\n.");
status_change_cb_map[i].cb(NULL);
LOG_W("2023---12-29--4--\n.");
} else {
LOG_W("status ignore. cb is null.");
}
}
}
}
static IPC_STATUS_CHANGE_CB_MAP_T status_change_cb_map[] = {
{TUYA_IPC_STATUS_REGISTER, NULL},
{TUYA_IPC_STATUS_REGISTER_FAILED, __on_register_fail},
{TUYA_IPC_STATUS_ACTIVED, NULL},
{TUYA_IPC_STATUS_RESET, NULL},
{TUYA_IPC_STATUS_NETCFG_START, __on_netcfg_start},
{TUYA_IPC_STATUS_NETCFG_STOP, __on_netcfg_stop},
{TUYA_IPC_STATUS_WIFI_STA_UNCONN, NULL},
{TUYA_IPC_STATUS_WIFI_STA_CONN, NULL},
{TUYA_IPC_STATUS_WIRE_UNCONN, NULL},
{TUYA_IPC_STATUS_WIRE_CONN, NULL},
{TUYA_IPC_STATUS_ONLINE, __on_status_online},
{TUYA_IPC_STATUS_OFFLINE, __on_status_offline},
};
程序运行到 status_change_cb_map.cb(NULL);就会导致程序崩溃的