请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号: CC3235SF
您好、
我将使用 SDKv7.10 中的开箱即用示例程序。 我将域名设置为 www.cvd2500.net 和 cvd2500.net、但在互联网浏览器中无法识别。 我在 ConfigureSimpleLinkToDefaultState () 中更改域名。
static int32_t ConfigureSimpleLinkToDefaultState(void)
{
SlWlanRxFilterOperationCommandBuff_t RxFilterIdMask;
uint8_t ucConfigOpt = 0;
uint16_t ifBitmap = 0;
uint8_t ucPower = 0;
int32_t ret = -1;
int32_t mode = -1;
memset(&RxFilterIdMask,0,sizeof(SlWlanRxFilterOperationCommandBuff_t));
/* Start Simplelink - Blocking mode */
mode = sl_Start(0, 0, 0);
if(SL_RET_CODE_DEV_ALREADY_STARTED != mode)
{
ASSERT_ON_ERROR(mode);
}
/* If the device is not in AP mode, try configuring it in AP mode
in case device is already started
(got SL_RET_CODE_DEV_ALREADY_STARTED error code), then mode would remain
-1 and in this case we do not know the role. Move to AP role anyway */
if(ROLE_AP != mode)
{
/* Switch to AP role and restart */
ret = sl_WlanSetMode(ROLE_AP);
ASSERT_ON_ERROR(ret);
ret = sl_Stop(SL_STOP_TIMEOUT);
ASSERT_ON_ERROR(ret);
ret = sl_Start(0, 0, 0);
ASSERT_ON_ERROR(ret);
/* Check if the device is in AP again */
if(ROLE_AP != ret)
{
return(ret);
}
}
/* Set connection policy to Auto (no AutoProvisioning) */
ret = sl_WlanPolicySet(SL_WLAN_POLICY_CONNECTION,
SL_WLAN_CONNECTION_POLICY(1, 0, 0, 0), NULL, 0);
ASSERT_ON_ERROR(ret);
/* Remove all profiles */
ret = sl_WlanProfileDel(0xFF);
ASSERT_ON_ERROR(ret);
// Added by Markel
unsigned char domainstr[32] = "www.cvd2500.net";
//unsigned char domainstr[32] = "cvd2500.net";
/* Set domain name */
sl_NetAppSet(SL_NETAPP_DEVICE_ID, SL_NETAPP_DEVICE_DOMAIN, strlen((char*)domainstr), domainstr);
ASSERT_ON_ERROR(ret);
/* Enable DHCP client */
ret = sl_NetCfgSet(SL_NETCFG_IPV4_STA_ADDR_MODE,SL_NETCFG_ADDR_DHCP,0,0);
ASSERT_ON_ERROR(ret);
/* Disable IPV6 */
ifBitmap = 0;
ret = sl_NetCfgSet(SL_NETCFG_IF, SL_NETCFG_IF_STATE, sizeof(ifBitmap),
(uint8_t *)&ifBitmap);
ASSERT_ON_ERROR(ret);
/* Disable scan */
ucConfigOpt = SL_WLAN_SCAN_POLICY(0, 0);
ret = sl_WlanPolicySet(SL_WLAN_POLICY_SCAN, ucConfigOpt, NULL, 0);
ASSERT_ON_ERROR(ret);
/* Set Tx power level for station mode
Number between 0-15, as dB offset from max power - 0 will
set max power */
ucPower = 0;
ret = sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID,
SL_WLAN_GENERAL_PARAM_OPT_STA_TX_POWER, 1,
(uint8_t *)&ucPower);
ASSERT_ON_ERROR(ret);
/* Set PM policy to normal */
ret = sl_WlanPolicySet(SL_WLAN_POLICY_PM, SL_WLAN_NORMAL_POLICY, NULL, 0);
ASSERT_ON_ERROR(ret);
/* Unregister mDNS services */
ret = sl_NetAppMDNSUnRegisterService(0, 0, 0);
ASSERT_ON_ERROR(ret);
/* Remove all 64 filters (8*8) */
memset(RxFilterIdMask.FilterBitmap, 0xFF, 8);
ret = sl_WlanSet(SL_WLAN_RX_FILTERS_ID,
SL_WLAN_RX_FILTER_REMOVE,
sizeof(SlWlanRxFilterOperationCommandBuff_t),
(uint8_t *)&RxFilterIdMask);
ASSERT_ON_ERROR(ret);
ret = sl_Stop(SL_STOP_TIMEOUT);
ASSERT_ON_ERROR(ret);
return(ret);
}
我可以在 settings.html 上看到设置了域。 为什么新的域名在谷歌铬互联网浏览器中被识别?

-kel