SWRA659A March 2020 – June 2020 CC3100 , CC3100MOD , CC3200 , CC3200MOD
This profile is for devices that need to operate between long time intervals. In this mode, the device is in Hibernate state between working cycles, the lowest power consumption possible state. Almost all the device's components are shut-down, hence when waking up a new connection needs to be established. Optimizations were integrated in order to reduce the power consumption cost of this periodic reconnection, these are:
A good representation of a code for such case is:
//Configurations Done once – every exit from hib
sl_start(0,0,0);
sl_NetCfgSet(…) ; // set static IP address to the device
sl_WlanPolicySet(...); // disable scan
sl_WlanPolicySet(…); // set fast connect
sl_NetAppStop(..); // disable mDNS
//Sending/Receiving Data - Done when packet need to be sent or receive
while (1) {
sl_stop(10); // to enter hibernate mode
Delay(); // Long hibernate Time period
sl_Start(); // device wake up and connect to network with previous setting
sl_socket(); // usually UDP
sl_SetSocketOpt(); // configure UDP/TCP Secured or not
sl_bind();
sl_RecvFrom();
sl_SendTo();
sl_Close();
}