[BLE] Fix crash if BLE stack is not initialized when setting advertising. (#2212)

This commit is contained in:
Ryan Powell authored and GitHub committed 2025-08-05 07:08:03 -05:00
1 parent 4166d2ab68
commit a0d5b7d181
1 file changed
+4
+4
View File
@@ -202,6 +202,10 @@ void stop_connection_timer() {}
# endif
void set_blufi_mfg_data () {
if (!NimBLEDevice::isInitialized() || !NimBLEDevice::getAdvertising()->isAdvertising()) {
Log.notice(F("Unable to set advertising data" CR));
return;
}
ble_hs_adv_fields fields;
ble_uuid16_t blufi_uuid = BLE_UUID16_INIT(BLUFI_APP_UUID);
memset(&fields, 0, sizeof(fields));