【已同步】BK7231N 2.3.3_277 查询模块授权成功接口

Wi-Fi 设备、Wi-Fi 低功耗设备、Wi-Fi BLE 双模设备、Ethernet设备、Ethernet+Wi-Fi设备等
Post Reply
13548849851
Posts: 15

在3.3.4SDK上面找到这个 get_gw_auth_status

请问2.3.3_277 这个版本查询模块是否授权成功用哪个接口

yingtao_33
Posts: 209

Re: 【求助】BK7231N 2.3.3_277 查询模块授权成功接口

2.3.3 不支持该接口

可以用以下方式实现

Code: Select all

BOOL_T __is_dev_authorized(VOID_T)
{
    OPERATE_RET  ret = OPRT_OK;
    GW_BASE_IF_S *p_gw_base = NULL;
    BOOL_T is_authorized = TRUE;

p_gw_base = (GW_BASE_IF_S *)tal_malloc(SIZEOF(GW_BASE_IF_S));
if(NULL == p_gw_base) {
    TAL_PR_ERR("malloc failed");
    return FALSE;
}
memset((UCHAR_T *)p_gw_base, 0x00,  SIZEOF(GW_BASE_IF_S));

ret = wd_gw_base_if_read(p_gw_base);
if (OPRT_OK != ret) {
    TAL_PR_ERR("read flash err");
    tal_free(p_gw_base), p_gw_base = NULL;
    return FALSE;
}

// gateway base info verify
if (0 ==  p_gw_base->auth_key[0] || 0 == p_gw_base->uuid[0]) {
    TAL_PR_NOTICE("please write uuid and auth_key first");
    is_authorized = FALSE;
}else {
    is_authorized = TRUE;
}

tal_free(p_gw_base), p_gw_base = NULL;

return is_authorized;
}
Post Reply