Skip to content

Instantly share code, notes, and snippets.

@amcjen
Created May 21, 2014 15:51
Show Gist options
  • Save amcjen/ffdf9cbf68daad7bac97 to your computer and use it in GitHub Desktop.
Save amcjen/ffdf9cbf68daad7bac97 to your computer and use it in GitHub Desktop.
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