2025-01-10 07:41 AM
Hi!
I am using a STM32WB55 on a custom platform.
I added "just work" encryption that will force a pairing with my device when I am using a protected characteristic thanks to ATTR_PERMISSION_ENCRY_READ/WRITE.
My enc_key_size is 10, my CFG_IO_CAPABILITY is CFG_IO_CAPABILITY_NO_INPUT_NO_OUTPUT, my CFG_MITM_PROTECTION is CFG_MITM_PROTECTION_NOT_REQUIRED,
Everything behaves normally but when I read a characteristic and the pop-up to pair my device appears. At this moment, if I close the application connected to my device (nrf connect in my case) without responding anything to the pairing it disconnects to the device but the application does not seem to see the flag HCI_DISCONNECTION_COMPLETE_EVT_CODE and thus does not restart the advertising. In this situation, my device is so no more visible on BLE through its advertising data.
Do you have a clue about the origin of the problem and how I could solve it?
Do not hesitate if you need any additional information.
Thank you in advance
Tom
2025-01-10 07:56 AM
However, it seems I receive the message SMP timeout from ACI_GAP_PAIRING_COMPLETE_EVENT
I should be able to use this event to verify if I still am connected
2025-01-10 10:04 AM
Hello @TVandenbussche
Make sure that your application is correctly handling the HCI_DISCONNECTION_COMPLETE_EVT_CODE event. This event should trigger the restart of advertising. Verify that the event handler for this code is implemented and functioning as expected. For example, on the line 591 of the app_ble.c file of the P2P_Server app. The restart of Advertising after disconnection is done throw the command: "Adv_Request(APP_BLE_FAST_ADV);" (you can see the same behavior if you comment it).
Best Regards.
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-01-13 12:52 AM
Hi!
Thank you for your response.
We are indeed handling correctly HCI_DISCONNECTION_COMPLETE_EVT_CODE.
However, during a pairing request or at the end of a pairing request when the timeout is reached, it seems that HCI_DISCONNECTION_COMPLETE_EVT_CODE is never received as it was disactivated during this time.
Is there any reason we do not receive this event during a pairing request?
Best regards
2025-01-19 11:33 PM
Hi,
Do you know any reason why HCI_DISCONNECTION_COMPLETE_EVT_CODE is never received although it is indeed disconnected?
Otherwise do you know any way to identify if my device is connected or not to another?
Due to the fact that HCI_DISCONNECTION_COMPLETE_EVT_CODE is never received, BleApplicationContext.Device_Connection_Status is never changed and thus I can not use this to identify the connection status of my device
Thank you in advance
Best regards