mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
disconnect existing wifi client when new connection established
This commit is contained in:
parent
4d6e33b365
commit
796b4c705c
1 changed files with 12 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue