This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Get peer address that has connected within BLE_GAP_EVT_CONNECTED event

Hi. I am trying to get the peer address from of the peripheral my central has connected to within the BLE_GAP_EVT_CONNECTED event.

The following returns the address, however the first byte is missing?

NRF_LOG_HEXDUMP_INFO(&p_gap_evt->params.adv_report.peer_addr, 6);

For example, a peer address device 29-20-C7-0F-B1-CA is logged as;

20 C7 0F B1 CA 02.

Seems to be shifted 1 byte for some reason.

Thanks

 

Parents Reply
  • Hi Simon.

    That results in the first two bytes missing so I get;

    C7 0F B1 CA 02 08  (i nstead of 29-20-C7-0F-B1-CA)

     

    Strange since if I do this;

    NRF_LOG_HEXDUMP_INFO(&p_gap_evt->params.adv_report, 7);

    I get;

    02 29 20 C7 0F B1 CA

    So I can use that and strip the first byte off. Seems that the p_gap_evt array is messed up / shifted for some reason in the multilink example.

    Best Regards

    Phil

Children
No Data
Related