#include <Arduino.h>
#include "abc800_wifi.h"
#include "abc800_func.h"
#include "WiFi.h"
#include "abc800_config.h"
#include "abc800_callback.h"
#include "abc800_web.h"
#include "abc800_hidboot.h"
#include <esp_wifi.h>
#include <DNSServer.h>
#include <ESPAsyncWiFiManager.h> 
static const char TAG[] = __FILE__;
extern WiFiClass WiFi;
extern key800config abc800_configuration;
extern TaskHandle_t WiFi_Task;
extern abc800::std_abc800 abc800_std;
extern abc800::web abc800_web;
extern abc800::callback abc800_callback;
extern AsyncWebServer server;
extern DNSServer dns;
extern AsyncWiFiManager wifiManager;
namespace abc800 {
	void wificonnect(){
		ESP_LOGI(TAG,"WiFi Connected start web");
		if (!abc800_web.connected){
			abc800_web.init();
			abc800_web.connected=true;
		}
	}
	void wifi::setup(){
		
		wifiManager.setConnectCallback(wificonnect);
		wifiManager.autoConnect(ABC800_KEY_WIFI_SSID, ABC800_KEY_WIFI_PSK);
	}	
	
	

}

