Hello,
When connecting to a device to which we are bonded, the actual address of the device is resolved automatically (using the LTK).
Currently, when I connect to a device with a specific address (the address before resolution), I get a connected event which holds an other address (the address after resolution).
This means that I can not compare the address of the event with the address I tried to connect to.
Would it be possible for the connected event to hold both the resolved address and the address before resolution? So that we can identify the device using the connected event, and still know what is the actual resolved address of the device.
Best regards,
Andy
Device:

Hi apoudret,
Let me check if it is possible for the connected event to hold both the resolved address and the address before resolution and I will let you know as soon as possible. Just for a clarification, the DA14680 acts as a peripheral or as a central device?
Thanks, PM_Dialog
Thank you for your answer.
In my case the DA14681 acts as a central device:
1) I scan nearby devices
2) I connect to a specific device (which I am already bonded with)
3) I get the connected event
Best regards,
Andy
Hi apoudret,
Thanks for the information. We are working on your issue an we will get back to you as soon as possible.
Thanks, PM_Dialog
Hi apoudret,
When a random address is resolved, you will get a BLE_EVT_GAP_ADDRESS_RESOLVED and alla tha available information about the BD address before and after the resolution is hold on the ble_evt_gap_address_resolved_t. Please have a look into the ble_gap.h header file. So, that you have to do is to handle the BLE_EVT_GAP_ADDRESS_RESOLVED in the application level. For example, in the pxp_reporter example of the sdk, I would suggest to check the pxp_reporter_task() function and how the application will attempt to handle each event using the BLE service framework. So, in you case you should add the follow code snippet:
case BLE_EVT_GAP_ADDRESS_RESOLVED :
handle_evt_gap_address_resolution( (ble_evt_gap_address_resolved_t *) hdr);
break;
So, with this way you will have you own function which will be called wheb you get a BLE_EVT_GAP_ADDRESS_RESOLVED event. Every time that the handle_evt_gap_address_resolution() will be triggered, you should read the resolved_adress and address items of the ble_evt_gap_address_resolved_t structure.
Thanks, PM_Dialog
Hello PM_Dialog,
Thanks for you answer.
I have used your example, however in my experience, calling ble_gap_connect() does not generate a BLE_EVT_GAP_ADDRESS_RESOLVED event.
I get the BLE_EVT_GAP_CONNECTED event but not the BLE_EVT_GAP_ADDRESS_RESOLVED one.
It seems to me that this event is only be generated after calling ble_gap_address_resolve().
Am I mistaken?
Andy
Hi apoudret,
You are correct. When the ble_gap_connect() is triggered you get a BLE_EVT_GAP_CONNECTED and when the ble_gap_address_resolve() is called you get BLE_EVT_GAP_ADDRESS_RESOLVED.
Thanks, PM_Dialog
Hello PM_Dialog,
What I would like is to get both the resolved address and the address before resolution when I connect to a device.
Since I am connecting to the device, I do not get a BLE_EVT_GAP_ADDRESS_RESOLVED event, even though the address is automatically resolved when connecting.
Andy
Hi apoudret,
Apologies for the delay. Do you mean that you are not able to get the BLE_EVT_GAP_ADDRESS_RESOLVED when the BD address gets resolved? Could you please make sure that the handle_evt_gap_address_resolution is triggered before the connection?
Thanks, PM_Dialog