请问CC3200 作为station连接AP时可以不由AP动态分配,指定固定IP吗?有代码参考吗,因为要作为服务器,希望IP和端口固定
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
请问CC3200 作为station连接AP时可以不由AP动态分配,指定固定IP吗?有代码参考吗,因为要作为服务器,希望IP和端口固定
把DHCP关闭掉,打开静态IP,代码如下
//Enable Static IP Client
SlNetCfgIpV4Args_t ipV4;
ipV4.ipV4 = (_u32)SL_IPV4_VAL(192,168,1,8); // _u32 IP address
ipV4.ipV4Mask = (_u32)SL_IPV4_VAL(255,255,255,0); // _u32 Subnet mask for this STA/P2P
ipV4.ipV4Gateway = (_u32)SL_IPV4_VAL(192,168,1,1); // _u32 Default gateway address
ipV4.ipV4DnsServer = (_u32)SL_IPV4_VAL(192,168,1,1); // _u32 DNS server address