Skip to content

Commit b898e7a

Browse files
committed
Add DFU to BLE Stack
1 parent 9f680d1 commit b898e7a

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/helpers/nrf52/SerialBLEInterface.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ void SerialBLEInterface::begin(const char* prefix, char* name, uint32_t pin_code
177177

178178
Bluefruit.setEventCallback(onBLEEvent);
179179

180+
// Register DFU on the main BLE stack so paired clients can discover it
181+
// without switching the device into a separate OTA-only BLE mode first.
182+
bledfu.setPermission(SECMODE_ENC_WITH_MITM, SECMODE_ENC_WITH_MITM);
183+
bledfu.begin();
184+
180185
bleuart.setPermission(SECMODE_ENC_WITH_MITM, SECMODE_ENC_WITH_MITM);
181186
bleuart.begin();
182187
bleuart.setRxCallback(onBleUartRX);

src/helpers/nrf52/SerialBLEInterface.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#endif
99

1010
class SerialBLEInterface : public BaseSerialInterface {
11+
BLEDfu bledfu;
1112
BLEUart bleuart;
1213
bool _isEnabled;
1314
bool _isDeviceConnected;

0 commit comments

Comments
 (0)