mirror of
https://github.com/meshtastic/firmware.git
synced 2025-10-28 23:34:03 +00:00
PhoneAPI: onConfigStart and onConfigComplete callbacks for subclasses
This commit is contained in:
parent
492e2ae5e5
commit
a4785eed80
@ -57,6 +57,9 @@ void PhoneAPI::handleStartConfig()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Allow subclasses to prepare for high-throughput config traffic
|
||||||
|
onConfigStart();
|
||||||
|
|
||||||
// even if we were already connected - restart our state machine
|
// even if we were already connected - restart our state machine
|
||||||
if (config_nonce == SPECIAL_NONCE_ONLY_NODES) {
|
if (config_nonce == SPECIAL_NONCE_ONLY_NODES) {
|
||||||
// If client only wants node info, jump directly to sending 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;
|
fromRadioScratch.config_complete_id = config_nonce;
|
||||||
config_nonce = 0;
|
config_nonce = 0;
|
||||||
state = STATE_SEND_PACKETS;
|
state = STATE_SEND_PACKETS;
|
||||||
|
|
||||||
|
// Allow subclasses to know we've entered steady-state so they can lower power consumption
|
||||||
|
onConfigComplete();
|
||||||
|
|
||||||
pauseBluetoothLogging = false;
|
pauseBluetoothLogging = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -159,6 +159,11 @@ class PhoneAPI
|
|||||||
*/
|
*/
|
||||||
virtual void onNowHasData(uint32_t fromRadioNum) {}
|
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
|
/// begin a new connection
|
||||||
void handleStartConfig();
|
void handleStartConfig();
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user