SWRU455M February 2017 – October 2020 CC3120 , CC3120MOD , CC3130 , CC3135 , CC3135MOD , CC3220MOD , CC3220MODA , CC3220R , CC3220S , CC3220SF , CC3230S , CC3230SF , CC3235MODAS , CC3235MODASF , CC3235MODS , CC3235MODSF , CC3235S , CC3235SF
The SimpleLink device allows the following IPv4 acquisition methods:
Example:
_i16 Status;
_u32 LLATimeout = 60; // default is 25 seconds
Status = sl_NetCfgSet(SL_NETCFG_IPV4_STA_ADDR_MODE, SL_NETCFG_ADDR_DHCP_LLA, sizeof(_u32), &LLATimeout);
if( Status )
{
// error
}
Example:
_i16 Status;
Status = sl_NetCfgSet(SL_NETCFG_IPV4_STA_ADDR_MODE,SL_NETCFG_ADDR_DHCP,0,0);
if( Status )
{
// error
}
Example:
_i16 Status;
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 STA/P2P
ipV4.IpGateway = (_u32)SL_IPV4_VAL(10,1,1,1); // _u32 Default gateway address
ipV4.IpDnsServer = (_u32)SL_IPV4_VAL(8,8,8,8); // _u32 DNS server address
Status = sl_NetCfgSet(SL_NETCFG_IPV4_STA_ADDR_MODE,SL_NETCFG_ADDR_STATIC,sizeof(ipV4),(_u8*)&ipV4);
if( Status )
{
// error
}