TI中文支持网
TI专业的中文技术问题搜集分享网站

CC3220SF AP修改IP,非默认IP就不能连接

使用CC3220SF作为AP模式,设置非默认IP地址

IP 10.123.45.1, Subnet mask: 255.255.255.0
Default gateway: 10.123.45.1, DNS: 10.123.45.1

设置为历程中的

SlNetCfgIpV4Args_t ipV4;
ipV4.Ip = (_u32)SL_IPV4_VAL(10,1,1,201); // _u32 IP address
ipV4.IpMask = (_u32)SL_IPV4_VAL(255,255,255,0); // _u32 Subnet mask for this AP/P2P
ipV4.IpGateway = (_u32)SL_IPV4_VAL(10,1,1,1); // _u32 Default gateway address
ipV4.IpDnsServer = (_u32)SL_IPV4_VAL(8,16,32,64); // _u32 DNS server address
sl_NetCfgSet(SL_NETCFG_IPV4_AP_ADDR_MODE,SL_NETCFG_ADDR_STATIC,sizeof(SlNetCfgIpV4Args_t),(_u8 *)&ipV4);
sl_Stop(0);
sl_Start(NULL,NULL,NULL);
使用sl_NetCfgGet查询设置成功
_u16 len = sizeof(SlNetCfgIpV4Args_t);
_u16 ConfigOpt = 0; //return value could be one of the following: SL_NETCFG_ADDR_DHCP / SL_NETCFG_ADDR_DHCP_LLA / SL_NETCFG_ADDR_STATIC
SlNetCfgIpV4Args_t ipV4 = {0};
sl_NetCfgGet(SL_NETCFG_IPV4_AP_ADDR_MODE,&ConfigOpt,&len,(_u8 *)&ipV4);
printf("DHCP is %s IP %d.%d.%d.%d MASK %d.%d.%d.%d GW %d.%d.%d.%d DNS %d.%d.%d.%d\n",
(ConfigOpt == SL_NETCFG_ADDR_DHCP) ? "ON" : "OFF",
SL_IPV4_BYTE(ipV4.Ip,3),SL_IPV4_BYTE(ipV4.Ip,2),SL_IPV4_BYTE(ipV4.Ip,1),SL_IPV4_BYTE(ipV4.Ip,0),
SL_IPV4_BYTE(ipV4.IpMask,3),SL_IPV4_BYTE(ipV4.IpMask,2),SL_IPV4_BYTE(ipV4.IpMask,1),SL_IPV4_BYTE(ipV4.IpMask,0),
SL_IPV4_BYTE(ipV4.IpGateway,3),SL_IPV4_BYTE(ipV4.IpGateway,2),SL_IPV4_BYTE(ipV4.IpGateway,1),SL_IPV4_BYTE(ipV4.IpGateway,0),
SL_IPV4_BYTE(ipV4.IpDnsServer,3),SL_IPV4_BYTE(ipV4.IpDnsServer,2),SL_IPV4_BYTE(ipV4.IpDnsServer,1),SL_IPV4_BYTE(ipV4.IpDnsServer,0));
但是电脑连接后,使用TCP 助手 不能连接成功,
如果使用默认IP地址就可以,请问IP地址更改非默认后,还需要进行哪些操作,才能正常运行
Viki Shi:

论坛有类似问题,请看这边解答:e2e.ti.com/…/818926

赞(0)
未经允许不得转载:TI中文支持网 » CC3220SF AP修改IP,非默认IP就不能连接
分享到: 更多 (0)