From 4aee6708ca0b49dfe22319da4066ddec5a57ca80 Mon Sep 17 00:00:00 2001 From: lathoub <4082369+lathoub@users.noreply.github.com> Date: Sun, 25 Oct 2020 22:52:27 +0100 Subject: [PATCH] Windows connection to ESP32 Windows connection to ESP32, based on suggestion from @wakwak-koba (I get notes in the MIDIBerry input monitor using ESP32, but not using NimBLE ?? (MidiBle example) --- src/hardware/BLEMIDI_ESP32.h | 14 +++++++------- src/hardware/BLEMIDI_ESP32_NimBLE.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/hardware/BLEMIDI_ESP32.h b/src/hardware/BLEMIDI_ESP32.h index d09b57b..c9868dc 100644 --- a/src/hardware/BLEMIDI_ESP32.h +++ b/src/hardware/BLEMIDI_ESP32.h @@ -132,17 +132,17 @@ bool BLEMIDI_ESP32::begin(const char* deviceName, BLEMIDI_TransportaddDescriptor(new BLE2902()); _characteristic->setCallbacks(new MyCharacteristicCallbacks(this)); + + auto _security = new BLESecurity(); + _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; @@ -157,6 +157,6 @@ MIDI_NAMESPACE::MidiInterface