Browse Source

Merge pull request #685 from liamcottle/fix/wifi-companion-clients

WiFi Companion: always accept new connections
pull/693/head
ripplebiz 9 months ago
committed by GitHub
parent
commit
bc8c95fcb3
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 13
      src/helpers/esp32/SerialWifiInterface.cpp

13
src/helpers/esp32/SerialWifiInterface.cpp

@ -44,7 +44,18 @@ bool SerialWifiInterface::isWriteBusy() const {
}
size_t SerialWifiInterface::checkRecvFrame(uint8_t dest[]) {
if (!client) client = server.available();
// check if new client connected
auto newClient = server.available();
if (newClient) {
// disconnect existing client
deviceConnected = false;
client.stop();
// switch active connection to new client
client = newClient;
}
if (client.connected()) {
if (!deviceConnected) {

Loading…
Cancel
Save