Tool/software: Code Composer Studio
I am adding IPv6 support to a battery-powered WiFi device that wakes up from hibernation mode, sends a UDP packet, and returns to hibernation mode.
This functionality is working wonderfully for IPv4 configurations; waking up and sending a UDP packet is taking less than 500ms.
For IPv6 configurations, this functionality is taking longer than I expect - more than 3 to 3.5 seconds - which is hurting the expected battery life.
Is there anything that can be done to validate the IPv6 address more quickly on via SL_IS_IPV6_ADDR_VALID?
For this application, it would be acceptable to disable DAD. Is there a way to disable DAD via the SDK or otherwise? (However, the router appears to be responding quickly to the solicitation - see the Wireshark capture.)
Could the CC3220 be put into a low power mode while the address is validating?
Proposed IPv6:
/* IPV6 */
SlNetCfgIpV6Args_t newIPv6;
int32_t theSLStatus;
uint32_t ifBitmap;
uint16_t configOpt = 0;
uint16_t configLen = (Settings.IP_Mode == IP_MODE_IPV4) ?
sizeof(SlNetCfgIpV4Args_t) : sizeof(SlNetCfgIpV6Args_t);
ifBitmap = SL_NETCFG_IF_IPV6_STA_LOCAL | SL_NETCFG_IF_IPV6_STA_GLOBAL;
theSLStatus = sl_NetCfgSet(SL_NETCFG_IF,SL_NETCFG_IF_STATE,sizeof(ifBitmap),(uint8_t *)&ifBitmap);
newIPv6.Ip[0] = Settings.Static_IPV6_Addr[0];
newIPv6.Ip[1] = Settings.Static_IPV6_Addr[1];
newIPv6.Ip[2] = Settings.Static_IPV6_Addr[2];
newIPv6.Ip[3] = Settings.Static_IPV6_Addr[3];
theSLStatus = sl_NetCfgSet(SL_NETCFG_IPV6_ADDR_LOCAL,SL_NETCFG_ADDR_STATIC,sizeof(SlNetCfgIpV6Args_t),(uint8_t *)&newIPv6);
// hibernate
// ...
// wake from hibernation
for (uint8_t i = 0; i < 20; i++)
{
sl_NetCfgGet(SL_NETCFG_IPV6_ADDR_LOCAL,&configOpt,&configLen,(_u8 *)&newIPv6);
// This condition appears to take several seconds to validate
if (SL_IS_IPV6_ADDR_VALID(newIPv6.IpV6Flags))
break;
usleep(300 * 1000L);
}
// send packet
Working IPv4:
/* IPV4 */ SlNetCfgIpV4Args_t newIPv4; int32_t theSLStatus; uint32_t ifBitmap; uint16_t configOpt = 0; uint16_t configLen = (Settings.IP_Mode == IP_MODE_IPV4) ? sizeof(SlNetCfgIpV4Args_t) : sizeof(SlNetCfgIpV6Args_t); newIPv4.Ip = Static_IPV4_Addr; newIPv4.IpMask = Static_IPV4_Mask; newIPv4.IpGateway = Static_IPV4_GW; theSLStatus = sl_NetCfgSet(SL_NETCFG_IPV4_STA_ADDR_MODE, SL_NETCFG_ADDR_STATIC, sizeof(SlNetCfgIpV4Args_t), (uint8_t *) &newIPv4); // hibernate // ... // wake from hibernation sl_NetCfgGet(SL_NETCFG_IPV4_STA_ADDR_MODE, &configOpt, &configLen, (uint8_t *) &newIPv4); // send packet