Bluetooth LE - Programmatically determine if a peripheral has lost its side of the bond keys

EricP-8687 60 Reputation points
2024-03-06T21:13:47.2233333+00:00

A common scenario in Bluetooth LE is for one side of a bonded pair of devices to lose their side of previously exchanged bond keys. The Bluetooth LE spec states that the peripheral shall send a LL_REJECT_EXT_IND with error code 6, "PIN or Key Missing", when the central attempts to start encryption but the peripheral no longer has an LTK associated with the central.

Most BLE programming libraries or stacks have a mechanism to convey to an application that this specific error happened. Some use a specific exception type in managed languages or C++, like a SmpProtocolException with the error code included as a field of the exception.

Some use a return code when the library is implemented in C, or include the information in a callback.

The Windows Bluetooth LE API doesn't appear to provide this capability. The device is just reported as "unreachable", but still paired.

Am I missing a mechanism to have this specific error reported to an application so the application can call Unpair()? If not, can one be added please? Thanks.

Trace

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,619 questions
Universal Windows Platform (UWP)
Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,422 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
8,167 questions
{count} votes

Accepted answer
  1. Roy Li - MSFT 31,826 Reputation points Microsoft Vendor
    2024-03-11T01:31:39.9233333+00:00

    Hello,

    Welcome to Microsoft Q&A!

    Am I missing a mechanism to have this specific error reported to an application so the application can call Unpair()? If not, can one be added please?

    I have confirmed with the Bluetooth team about this. Based on the response I got, there is no such mechanism that can propagate this error in the API. And currently, there is no documented plan to add such feature in Bluetooth APIs.

    Please submit a feature request in the Feedback Hub about this feature. You could find the Feedback Hub in the Start Menu. Open the Feedback Hub app, select Developer Platform->API Feedback as the category when you submit your request. Please share the link with us so the team could monitor how many users need it. You could find the Feedback Hub in the Start Menu.

    Thank you.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful