BEFORE MOD RESULTS:
Initialization takes me about 2.6 seconds
Connecting to AP takes me about 13.4 seconds
Waiting for DHCP to resolve takes 10.2 seconds
IP Config displayed in 100ms
DNS lookup completes in 300 - 500ms
AFTER MOD RESULTS:
Initialization takes me about 2.6 seconds
Connecting to AP takes me about 8.2 seconds
Waiting for DHCP to resolve takes 10.2 seconds
IP Config displayed in 100ms
DNS lookup completes in 300 - 500ms
BEFORE MOD CODE (Adafruit_CC3000.ccp):
Code: Select all
// Connect with timeout
void Adafruit_CC3000::connectToAP(char *ssid, char *key, uint8_t secmode) {
int16_t timer = WLAN_CONNECT_TIMEOUT;
do {
/* MEME: not sure why this is absolutely required but the cc3k freaks
if you dont. maybe bootup delay? */
// Setup a 4 second SSID scan
scanSSIDs(4000);
// Wait for results
delay(4500);
scanSSIDs(0);
Code: Select all
// Connect with timeout
void Adafruit_CC3000::connectToAP(char *ssid, char *key, uint8_t secmode) {
do {
int16_t timer = WLAN_CONNECT_TIMEOUT; // inside the do-while() to reset timer
// Setup a 10 minute SSID scan, don't wait for results... stop it right away.
scanSSIDs(1); // 1 = 10 mins, 2-1000 = 1000, above that equals that time in ms
scanSSIDs(0); // stop the SSID scan
http://software-dl.ti.com/ecs/simplelin ... 557c18ed0e
One extra improvement here is moving the 'timer' initialization into the do-while() loop. This is necessary if you don't connect the first time, to reset the timer... or it will be zero the next time through.