Address of device before resolution in BLE_EVT_GAP_CONNECTED event

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
9 posts / 0 new
Last post
apoudret
Offline
Last seen:1 year 5 months ago
加入:2017-09-22 08:33
Address of device before resolution in BLE_EVT_GAP_CONNECTED event

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:
PM_Dialog
Offline
Last seen:5 days 15 hours ago
Staff
加入:2018-02-08 11:03
Hi apoudret,

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

apoudret
Offline
Last seen:1 year 5 months ago
加入:2017-09-22 08:33
Thank you for your answer.

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

PM_Dialog
Offline
Last seen:5 days 15 hours ago
Staff
加入:2018-02-08 11:03
Hi apoudret,

Hi apoudret,

谢谢你的信息。我们正在on your issue an we will get back to you as soon as possible.

Thanks, PM_Dialog

PM_Dialog
Offline
Last seen:5 days 15 hours ago
Staff
加入:2018-02-08 11:03
Hi apoudret,

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

apoudret
Offline
Last seen:1 year 5 months ago
加入:2017-09-22 08:33
Hello 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

PM_Dialog
Offline
Last seen:5 days 15 hours ago
Staff
加入:2018-02-08 11:03
Hi apoudret,

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

apoudret
Offline
Last seen:1 year 5 months ago
加入:2017-09-22 08:33
Hello 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

PM_Dialog
Offline
Last seen:5 days 15 hours ago
Staff
加入:2018-02-08 11:03
Hi apoudret,

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