mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-18 16:52:27 +00:00
partial fix for #608 - when a new TCP API connection arrives, close old one completely
This commit is contained in:
@@ -21,11 +21,17 @@ void PhoneAPI::init()
|
||||
observe(&service.fromNumChanged);
|
||||
}
|
||||
|
||||
PhoneAPI::~PhoneAPI() {
|
||||
close();
|
||||
}
|
||||
|
||||
void PhoneAPI::close() {
|
||||
unobserve();
|
||||
state = STATE_SEND_NOTHING;
|
||||
bool oldConnected = isConnected;
|
||||
isConnected = false;
|
||||
onConnectionChanged(isConnected);
|
||||
if(oldConnected != isConnected)
|
||||
onConnectionChanged(isConnected);
|
||||
}
|
||||
|
||||
void PhoneAPI::checkConnectionTimeout()
|
||||
|
||||
Reference in New Issue
Block a user