Debug-Output on client-Connect
This commit is contained in:
parent
697afa3abc
commit
42851b848b
23
src/main.cpp
23
src/main.cpp
@ -43,6 +43,9 @@ TM1637Display disp_FAC_1(CLK, DIO_FAC_1_7SEG);
|
||||
TM1637Display disp_FAC_2(CLK, DIO_FAC_2_7SEG);
|
||||
TM1637Display disp_FAC_3(CLK, DIO_FAC_3_7SEG);
|
||||
|
||||
WiFiEventHandler stationConnectedHandler;
|
||||
WiFiEventHandler stationDisconnectedHandler;
|
||||
|
||||
#ifdef CAPTIVE
|
||||
DNSServer dnsServer;
|
||||
#endif
|
||||
@ -98,6 +101,26 @@ String processor(const String &var)
|
||||
return String(buffer);
|
||||
}
|
||||
|
||||
String macToString(const unsigned char *mac)
|
||||
{
|
||||
char buf[20];
|
||||
snprintf(buf, sizeof(buf), "%02x:%02x:%02x:%02x:%02x:%02x",
|
||||
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
|
||||
return String(buf);
|
||||
}
|
||||
|
||||
void onStationConnected(const WiFiEventSoftAPModeStationConnected &evt)
|
||||
{
|
||||
Serial.print("Station connected: ");
|
||||
Serial.println(macToString(evt.mac));
|
||||
}
|
||||
|
||||
void onStationDisconnected(const WiFiEventSoftAPModeStationDisconnected &evt)
|
||||
{
|
||||
Serial.print("Station disconnected: ");
|
||||
Serial.println(macToString(evt.mac));
|
||||
}
|
||||
|
||||
String getValue(String data, char separator, int index)
|
||||
{
|
||||
int found = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user