bleuart service stay registered first to prevent gatt cache issues on android when already paired
This commit is contained in:
@@ -177,15 +177,17 @@ void SerialBLEInterface::begin(const char* prefix, char* name, uint32_t pin_code
|
|||||||
|
|
||||||
Bluefruit.setEventCallback(onBLEEvent);
|
Bluefruit.setEventCallback(onBLEEvent);
|
||||||
|
|
||||||
|
bleuart.setPermission(SECMODE_ENC_WITH_MITM, SECMODE_ENC_WITH_MITM);
|
||||||
|
bleuart.begin();
|
||||||
|
bleuart.setRxCallback(onBleUartRX);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Register DFU on the main BLE stack so paired clients can discover it
|
// 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.
|
// without switching the device into a separate OTA-only BLE mode first.
|
||||||
bledfu.setPermission(SECMODE_ENC_WITH_MITM, SECMODE_ENC_WITH_MITM);
|
bledfu.setPermission(SECMODE_ENC_WITH_MITM, SECMODE_ENC_WITH_MITM);
|
||||||
bledfu.begin();
|
bledfu.begin();
|
||||||
|
|
||||||
bleuart.setPermission(SECMODE_ENC_WITH_MITM, SECMODE_ENC_WITH_MITM);
|
|
||||||
bleuart.begin();
|
|
||||||
bleuart.setRxCallback(onBleUartRX);
|
|
||||||
|
|
||||||
Bluefruit.Advertising.addFlags(BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE);
|
Bluefruit.Advertising.addFlags(BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE);
|
||||||
Bluefruit.Advertising.addTxPower();
|
Bluefruit.Advertising.addTxPower();
|
||||||
Bluefruit.Advertising.addService(bleuart);
|
Bluefruit.Advertising.addService(bleuart);
|
||||||
|
|||||||
Reference in New Issue
Block a user