BLEDevice::setSecurityCallbacks(this);
SetupSerialService();
+ this->startAdvertising();
+}
+void BLESerial::startAdvertising() {
ble_adv = BLEDevice::getAdvertising();
ble_adv->addServiceUUID(BLE_SERIAL_SERVICE_UUID);
ble_adv->setMinPreferred(0x20);
ble_adv->start();
}
+void BLESerial::stopAdvertising() {
+ ble_adv = BLEDevice::getAdvertising();
+ ble_adv->stop();
+}
+
void BLESerial::end() { BLEDevice::deinit(); }
void BLESerial::onWrite(BLECharacteristic *characteristic) {
void begin(const char *name);
void end();
+ void startAdvertising();
+ void stopAdvertising();
void onWrite(BLECharacteristic *characteristic);
int available();
int peek();
// Serial.println("Authentication fail");
ble_authenticated = false;
bt_state = BT_STATE_ON;
+ bt_update_passkey();
bt_security_setup();
}
bt_allow_pairing = false;