mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
Add DFU to BLE Stack
This commit is contained in:
parent
9f680d1744
commit
b898e7a04e
2 changed files with 6 additions and 0 deletions
|
|
@ -177,6 +177,11 @@ void SerialBLEInterface::begin(const char* prefix, char* name, uint32_t pin_code
|
||||||
|
|
||||||
Bluefruit.setEventCallback(onBLEEvent);
|
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.setPermission(SECMODE_ENC_WITH_MITM, SECMODE_ENC_WITH_MITM);
|
||||||
bleuart.begin();
|
bleuart.begin();
|
||||||
bleuart.setRxCallback(onBleUartRX);
|
bleuart.setRxCallback(onBleUartRX);
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class SerialBLEInterface : public BaseSerialInterface {
|
class SerialBLEInterface : public BaseSerialInterface {
|
||||||
|
BLEDfu bledfu;
|
||||||
BLEUart bleuart;
|
BLEUart bleuart;
|
||||||
bool _isEnabled;
|
bool _isEnabled;
|
||||||
bool _isDeviceConnected;
|
bool _isDeviceConnected;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue