Implement a means of asynchronous pin injections for Numeric Comparison and PassKey Input
Fixes #114
Summary of changes:
- Split
onPassKeyRequestinto two separate functions:onPassKeyDisplaywhich requests the pin (similar to old functionality)onPassKeyEntrywhich notifies the application to prompt the user for a pin number. No return value
- Changed
onConfirmPINto lack return value, instead just notifies the app to display the pin number - Added two functions to the NimBLEServer class:
injectPassKeyandinjectConfirmPIN, which should be called when the user enters the PIN or presses confirm/cancel respectively.
Thanks for this, I will test it shortly 😄
@csmith-morningstar Sorry for taking so long with this. I have thought about it and there are a few things I would like to change.
- The callback signature I believe would be beneficial to have a
NimBLEConnInfoinstance rather than just the address. - An overload of the
InjectXXX()functions using a connection handle input would be nice to have. - The functions could also be moved to
NimBLEDevicescope so that they could be used by the client code as well and convienience wrappers added toNimBLEClientandNimBLEServer.
Thanks again for submitting this, it's been a long time coming to fix it 😄
I believe this is required to properly implement Google Fast Pair Service - as I've noted in my component example here. The way I've implemented it with bluedroid is to not respond there, simply store the key, and then respond in the side channel as I've noted here.
Closing this as #165 has been merged. Thank you @csmith-morningstar