Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a means of asynchronous pin injections for Numeric Comparison and PassKey Input #117

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

csmith-morningstar
Copy link
Contributor

@csmith-morningstar csmith-morningstar commented May 8, 2023

Fixes #114

Summary of changes:

  • Split onPassKeyRequest into two separate functions:
    • onPassKeyDisplay which requests the pin (similar to old functionality)
    • onPassKeyEntry which notifies the application to prompt the user for a pin number. No return value
  • Changed onConfirmPIN to lack return value, instead just notifies the app to display the pin number
  • Added two functions to the NimBLEServer class: injectPassKey and injectConfirmPIN, which should be called when the user enters the PIN or presses confirm/cancel respectively.

@h2zero
Copy link
Owner

h2zero commented May 14, 2023

Thanks for this, I will test it shortly 😄

@h2zero
Copy link
Owner

h2zero commented Nov 26, 2023

@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 NimBLEConnInfo instance 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 NimBLEDevice scope so that they could be used by the client code as well and convienience wrappers added to NimBLEClient and NimBLEServer.

Thanks again for submitting this, it's been a long time coming to fix it 😄

@finger563
Copy link

finger563 commented Mar 8, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Numeric Comparison and Passkey Entry are not properly handled
3 participants