Merge pull request #22 from wakwak-koba/ESP32_NimBLE

Fixed not being able to pair with Windows when using NimBLE, thank you @wakwak-koba !
This commit is contained in:
lathoub 2020-10-25 19:13:08 +01:00 committed by GitHub
commit cc1d4ef1e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -128,17 +128,17 @@ bool BLEMIDI_ESP32_NimBLE::begin(const char* deviceName, BLEMIDI_Transport<class
);
_characteristic->setCallbacks(new MyCharacteristicCallbacks(this));
auto _security = new NimBLESecurity();
_security->setAuthenticationMode(ESP_LE_AUTH_BOND);
// Start the service
service->start();
auto advertisementData = BLEAdvertisementData();
advertisementData.setFlags(0x04);
advertisementData.setCompleteServices(BLEUUID(SERVICE_UUID));
advertisementData.setName(deviceName);
// Start advertising
_advertising = _server->getAdvertising();
_advertising->setAdvertisementData(advertisementData);
_advertising->addServiceUUID(service->getUUID());
_advertising->setAppearance(0x00);
_advertising->start();
return true;