enforce pin being used for ble pairing on nrf52
This commit is contained in:
@@ -10,6 +10,7 @@ void SerialBLEInterface::begin(const char* device_name, uint32_t pin_code) {
|
|||||||
Bluefruit.setTxPower(4); // Check bluefruit.h for supported values
|
Bluefruit.setTxPower(4); // Check bluefruit.h for supported values
|
||||||
Bluefruit.setName(device_name);
|
Bluefruit.setName(device_name);
|
||||||
|
|
||||||
|
Bluefruit.Security.setMITM(true);
|
||||||
Bluefruit.Security.setPIN(charpin);
|
Bluefruit.Security.setPIN(charpin);
|
||||||
|
|
||||||
// To be consistent OTA DFU should be added first if it exists
|
// To be consistent OTA DFU should be added first if it exists
|
||||||
@@ -52,6 +53,7 @@ void SerialBLEInterface::enable() {
|
|||||||
clearBuffers();
|
clearBuffers();
|
||||||
|
|
||||||
// Configure and start the BLE Uart service
|
// Configure and start the BLE Uart service
|
||||||
|
bleuart.setPermission(SECMODE_ENC_WITH_MITM, SECMODE_ENC_WITH_MITM);
|
||||||
bleuart.begin();
|
bleuart.begin();
|
||||||
|
|
||||||
// Start advertising
|
// Start advertising
|
||||||
|
|||||||
Reference in New Issue
Block a user