mirror of
https://github.com/liberatedsystems/RNode_Firmware_CE.git
synced 2025-07-01 01:37:19 -04:00
Improved ESP32 BLE pairing. Added unpair command.
This commit is contained in:
parent
e1a2cc02bb
commit
9ef504392b
6 changed files with 116 additions and 86 deletions
|
@ -96,6 +96,17 @@ void BLESerial::flush() {
|
|||
}
|
||||
}
|
||||
|
||||
void BLESerial::disconnect() {
|
||||
if (ble_server->getConnectedCount() > 0) {
|
||||
uint16_t conn_id = ble_server->getConnId();
|
||||
Serial.printf("Have connected: %d\n", conn_id);
|
||||
ble_server->disconnect(conn_id);
|
||||
Serial.println("Disconnected");
|
||||
} else {
|
||||
Serial.println("No connected");
|
||||
}
|
||||
}
|
||||
|
||||
void BLESerial::begin(const char *name) {
|
||||
ConnectedDeviceCount = 0;
|
||||
BLEDevice::init(name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue