Created
May 21, 2014 15:51
-
-
Save amcjen/ffdf9cbf68daad7bac97 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void WiFiBackpack::onAssociate(void *data) { | |
WiFiBackpack& wifi = *(WiFiBackpack*)data; | |
#ifdef USE_TLS | |
// Do a timesync | |
IPAddress ip = wifi.gs.dnsLookup(NTP_SERVER); | |
if (ip == INADDR_NONE || | |
!wifi.gs.timeSync(ip, NTP_INTERVAL)) { | |
Serial.println("Time sync failed, reassociating to retry"); | |
wifi.autoConnectHq(); | |
} | |
#endif | |
wifi.apConnCount++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment