mirror of
https://github.com/markqvist/RNode_Firmware.git
synced 2025-07-21 22:18:41 -04:00
BLE improvements
This commit is contained in:
parent
9d2da569c9
commit
16dedc72c2
3 changed files with 11 additions and 0 deletions
|
@ -110,7 +110,10 @@ void BLESerial::begin(const char *name) {
|
|||
BLEDevice::setSecurityCallbacks(this);
|
||||
|
||||
SetupSerialService();
|
||||
this->startAdvertising();
|
||||
}
|
||||
|
||||
void BLESerial::startAdvertising() {
|
||||
ble_adv = BLEDevice::getAdvertising();
|
||||
ble_adv->addServiceUUID(BLE_SERIAL_SERVICE_UUID);
|
||||
ble_adv->setMinPreferred(0x20);
|
||||
|
@ -119,6 +122,11 @@ void BLESerial::begin(const char *name) {
|
|||
ble_adv->start();
|
||||
}
|
||||
|
||||
void BLESerial::stopAdvertising() {
|
||||
ble_adv = BLEDevice::getAdvertising();
|
||||
ble_adv->stop();
|
||||
}
|
||||
|
||||
void BLESerial::end() { BLEDevice::deinit(); }
|
||||
|
||||
void BLESerial::onWrite(BLECharacteristic *characteristic) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue