src_legacy/2017/pixelgateway.cpp
// connect to a client if available
connect to a client if available
connect to a client if available
void client_connect(){
  if (WiFi.status() != WL_CONNECTED) {
    printf("***CONNECTION LOST\n");
    nextPoiState = POI_NETWORK_SEARCH;
    return;
  }
  server.begin(); 
  client = server.available();
  if (client.connected()){
    if (logLevel != MUTE) printf("Client connected.\n" );
    resetTimeout();
    nextPoiState = POI_RECEIVING_DATA;
  }
  else if (!runner.isProgramActive()) {
    delay(100);
  }
}
void client_connect ( ) { if ( WiFi . status ( ) != WL_CONNECTED ) { printf ( " \n " ) ; nextPoiState = POI_NETWORK_SEARCH ; return ; } server . begin ( ) ; client = server . available ( ) ; if ( client . connected ( ) ) { if ( logLevel != MUTE ) printf ( " \n " ) ; resetTimeout ( ) ; nextPoiState = POI_RECEIVING_DATA ; } else if ( ! runner . isProgramActive ( ) ) { delay ( 100 ) ; } }
connect to a client if available
connect to a client if available
//printf("****client_connect status: %d", WiFi.status()); // if server has been started it simply returns // slow down a bit