Improve support for Heltec Wireless Bridge (#6647)

* Use BLE_LED where present for CONNECTED/DISCONNECTED

* Use WIFI_LED where present for WiFi started/stopped (as AP) or connected/disconnected (as Station)

* improve support for Heltec Wireless Bridge

* satisfy 'trunk fmt'
This commit is contained in:
Andreas 'count' Kotes
2025-06-10 05:54:07 +02:00
committed by GitHub
parent 79b8e7b1cf
commit c6c2a4d4dd
7 changed files with 88 additions and 26 deletions

View File

@@ -327,9 +327,15 @@ static void WiFiEvent(WiFiEvent_t event)
break;
case ARDUINO_EVENT_WIFI_STA_CONNECTED:
LOG_INFO("Connected to access point");
#ifdef WIFI_LED
digitalWrite(WIFI_LED, HIGH);
#endif
break;
case ARDUINO_EVENT_WIFI_STA_DISCONNECTED:
LOG_INFO("Disconnected from WiFi access point");
#ifdef WIFI_LED
digitalWrite(WIFI_LED, LOW);
#endif
if (!isReconnecting) {
WiFi.disconnect(false, true);
syslog.disable();
@@ -378,9 +384,15 @@ static void WiFiEvent(WiFiEvent_t event)
break;
case ARDUINO_EVENT_WIFI_AP_START:
LOG_INFO("WiFi access point started");
#ifdef WIFI_LED
digitalWrite(WIFI_LED, HIGH);
#endif
break;
case ARDUINO_EVENT_WIFI_AP_STOP:
LOG_INFO("WiFi access point stopped");
#ifdef WIFI_LED
digitalWrite(WIFI_LED, LOW);
#endif
break;
case ARDUINO_EVENT_WIFI_AP_STACONNECTED:
LOG_INFO("Client connected");
@@ -474,4 +486,4 @@ uint8_t getWifiDisconnectReason()
{
return wifiDisconnectReason;
}
#endif
#endif