PhoneAPI: onConfigStart and onConfigComplete callbacks for subclasses

This commit is contained in:
Mike Robbins 2025-10-17 22:14:49 -04:00
parent 492e2ae5e5
commit a4785eed80
2 changed files with 12 additions and 0 deletions

View File

@ -57,6 +57,9 @@ void PhoneAPI::handleStartConfig()
#endif
}
// Allow subclasses to prepare for high-throughput config traffic
onConfigStart();
// even if we were already connected - restart our state machine
if (config_nonce == SPECIAL_NONCE_ONLY_NODES) {
// If client only wants node info, jump directly to sending nodes
@ -575,6 +578,10 @@ void PhoneAPI::sendConfigComplete()
fromRadioScratch.config_complete_id = config_nonce;
config_nonce = 0;
state = STATE_SEND_PACKETS;
// Allow subclasses to know we've entered steady-state so they can lower power consumption
onConfigComplete();
pauseBluetoothLogging = false;
}

View File

@ -159,6 +159,11 @@ class PhoneAPI
*/
virtual void onNowHasData(uint32_t fromRadioNum) {}
/// Subclasses can use these lifecycle hooks for transport-specific behavior around config/steady-state
/// (i.e. BLE connection params)
virtual void onConfigStart() {}
virtual void onConfigComplete() {}
/// begin a new connection
void handleStartConfig();