You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In NimBLEServer.cpp: Currently Numeric Comparison and Passkey Entry (BLE_SM_IOACT_NUMCMP and BLE_SM_IOACT_INPUT respectively) perform blocking calls to callbacks in order to determine the input for ble_sm_inject_io. However, this prevents the SMP Timeout (Vol. 3 Part H Section 3.4 of the Bluetooth 4.2 spec) from properly triggering, as those functions may pend too long waiting for user input.
Furthermore, even if the callbacks do properly timeout themselves, there is no way for them to properly align with the spec, which states that in the event of a timeout "No further SMP commands shall be sent over the L2CAP Security Manager Channel." This is because when the callbacks return, ble_sm_inject_io is always called, which results in a "Pairing Failed" command being sent over the SMP channel.
Instead of relying on blocking function calls, these two scenarios should initiate the callbacks only as a means of displaying a prompt to the user, and relying on an asynchronous event for the call to ble_sm_inject_io. This allows the timeout event to properly occur.
The text was updated successfully, but these errors were encountered:
Hello, yes you are absolutely correct, this has been on my radar to address for quite some time. I will look into fixing this when I get some free time.
In
NimBLEServer.cpp
: Currently Numeric Comparison and Passkey Entry (BLE_SM_IOACT_NUMCMP
andBLE_SM_IOACT_INPUT
respectively) perform blocking calls to callbacks in order to determine the input forble_sm_inject_io
. However, this prevents the SMP Timeout (Vol. 3 Part H Section 3.4 of the Bluetooth 4.2 spec) from properly triggering, as those functions may pend too long waiting for user input.Furthermore, even if the callbacks do properly timeout themselves, there is no way for them to properly align with the spec, which states that in the event of a timeout "No further SMP commands shall be sent over the L2CAP Security Manager Channel." This is because when the callbacks return,
ble_sm_inject_io
is always called, which results in a "Pairing Failed" command being sent over the SMP channel.Instead of relying on blocking function calls, these two scenarios should initiate the callbacks only as a means of displaying a prompt to the user, and relying on an asynchronous event for the call to
ble_sm_inject_io
. This allows the timeout event to properly occur.The text was updated successfully, but these errors were encountered: