max22- / ESP32-BLE-MIDI

An Arduino library to use Midi over BLE (Bluetooth Low Energy), on ESP32 boards
MIT License
228 stars 27 forks source link

Wish to subscribe to "subscription" events. #25

Open kepello opened 1 year ago

kepello commented 1 year ago

I am using MIDIServer to allow my Mac laptop, my iPad or iPhone to connect to my ESP32 device. Your library is WONDERFUL for this, by the way,..

In all cases I can see an unsubscribe event happen (I enabled debugging inside the Nimble library) when I disconnect from within the computer/mobile app.

But I don't receive a disconnect event unless I actually turn off bluetooth on the device.

Because of this, I think that I need to have the ability to be notified of the "subscribe" events inside Nimble so that I can close the bluetooth connection from the ESP device side when the client unsubscribes. Unless I am mistaken, you are not passing those up thru your library so that I can subscribe to them.

Any assistance or advice would be appreciated. I want the ESP32 device to recognize when it is no longer being used so that it can again advertise to receive new connections.

thank you! Carl Lance