mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-22 10:42:49 +00:00
Guarding PhoneAPI node-info staging with mutex to prevent BLE future foot-gun (#8354)
* Eliminating foot-gun and placing Phone NodeInfo into a mutex * Swapping over to concurrency::Lock from mutex
This commit is contained in:
@@ -139,7 +139,7 @@ class NimbleBluetoothFromRadioCallback : public NimBLECharacteristicCallbacks
|
||||
{
|
||||
bluetoothPhoneAPI->phoneWants = true;
|
||||
bluetoothPhoneAPI->setIntervalFromNow(0);
|
||||
std::lock_guard<std::mutex> guard(bluetoothPhoneAPI->nimble_mutex);
|
||||
std::lock_guard<std::mutex> guard(bluetoothPhoneAPI->nimble_mutex); // BLE callbacks run in NimBLE task
|
||||
|
||||
if (!bluetoothPhoneAPI->hasChecked) {
|
||||
// Fetch payload on demand; prefetch keeps this fast for the first read.
|
||||
|
||||
Reference in New Issue
Block a user