mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-22 13:08:06 +00:00
fix wifi/bt connection status
This commit is contained in:
parent
008b3c494d
commit
179027ed80
@ -750,7 +750,7 @@ void AdminModule::handleGetDeviceConnectionStatus(const meshtastic_MeshPacket &r
|
|||||||
#ifdef ARCH_PORTDUINO
|
#ifdef ARCH_PORTDUINO
|
||||||
conn.wifi.status.is_connected = true;
|
conn.wifi.status.is_connected = true;
|
||||||
#else
|
#else
|
||||||
conn.wifi.status.is_connected = WiFi.status() != WL_CONNECTED;
|
conn.wifi.status.is_connected = WiFi.status() == WL_CONNECTED;
|
||||||
#endif
|
#endif
|
||||||
strncpy(conn.wifi.ssid, config.network.wifi_ssid, 33);
|
strncpy(conn.wifi.ssid, config.network.wifi_ssid, 33);
|
||||||
if (conn.wifi.status.is_connected) {
|
if (conn.wifi.status.is_connected) {
|
||||||
@ -782,10 +782,14 @@ void AdminModule::handleGetDeviceConnectionStatus(const meshtastic_MeshPacket &r
|
|||||||
conn.has_bluetooth = true;
|
conn.has_bluetooth = true;
|
||||||
conn.bluetooth.pin = config.bluetooth.fixed_pin;
|
conn.bluetooth.pin = config.bluetooth.fixed_pin;
|
||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
|
if (config.bluetooth.enabled && nimbleBluetooth) {
|
||||||
conn.bluetooth.is_connected = nimbleBluetooth->isConnected();
|
conn.bluetooth.is_connected = nimbleBluetooth->isConnected();
|
||||||
conn.bluetooth.rssi = nimbleBluetooth->getRssi();
|
conn.bluetooth.rssi = nimbleBluetooth->getRssi();
|
||||||
|
}
|
||||||
#elif defined(ARCH_NRF52)
|
#elif defined(ARCH_NRF52)
|
||||||
|
if (config.bluetooth.enabled && nrf52Bluetooth) {
|
||||||
conn.bluetooth.is_connected = nrf52Bluetooth->isConnected();
|
conn.bluetooth.is_connected = nrf52Bluetooth->isConnected();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
conn.has_serial = true; // No serial-less devices
|
conn.has_serial = true; // No serial-less devices
|
||||||
|
Loading…
Reference in New Issue
Block a user