diff --git a/src/helpers/nrf52/SerialBLEInterface.cpp b/src/helpers/nrf52/SerialBLEInterface.cpp index 5a3017af..c7c211a3 100644 --- a/src/helpers/nrf52/SerialBLEInterface.cpp +++ b/src/helpers/nrf52/SerialBLEInterface.cpp @@ -177,6 +177,11 @@ void SerialBLEInterface::begin(const char* prefix, char* name, uint32_t pin_code Bluefruit.setEventCallback(onBLEEvent); + // Register DFU on the main BLE stack so paired clients can discover it + // without switching the device into a separate OTA-only BLE mode first. + bledfu.setPermission(SECMODE_ENC_WITH_MITM, SECMODE_ENC_WITH_MITM); + bledfu.begin(); + bleuart.setPermission(SECMODE_ENC_WITH_MITM, SECMODE_ENC_WITH_MITM); bleuart.begin(); bleuart.setRxCallback(onBleUartRX); diff --git a/src/helpers/nrf52/SerialBLEInterface.h b/src/helpers/nrf52/SerialBLEInterface.h index e2fc6cb9..de103054 100644 --- a/src/helpers/nrf52/SerialBLEInterface.h +++ b/src/helpers/nrf52/SerialBLEInterface.h @@ -8,6 +8,7 @@ #endif class SerialBLEInterface : public BaseSerialInterface { + BLEDfu bledfu; BLEUart bleuart; bool _isEnabled; bool _isDeviceConnected;