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

BLE connection through MAC Address Issue.

Hey, what i'm trying to do is the following:

- Advertise The unique MAC-Addresse

- Scan and connect to a Peripheral Node with a specific MAC-Address

But it isn't working

My configuration is as following:

advertisement setup:

scan setup:

BLE nRF Connect advertiement :

i also wonder why the 0 is attached.

  • In the scan setup, try changing the following line:

    to the following:

    Swap m_mac_filter with mac_addr

    Best regards,

    Simon

  • The change unfortunately did not fix the issue.

    A thing i have noticed is that a 0 is attached in the avertissement header and that the address is mirrored, why is this? 

  • I was able to achieve this in the following manner:

    • I modified the examples examples\ble_peripheral\ble_app_blinky and examples\ble_central\ble_app_blinky_c
    • In examples\ble_peripheral\ble_app_blinky I did the following:
      • Built and flashed the example without modifying it
        • If I understand you right, you want to connect to the device based on the unique MAC address. By default, this address will be included in the advertising packet (no need to add it through sd_ble_gap_addr_set()).
      • The blinky peripheral device is now advertising, and I used the nRF Connect app on my phone to check what the device/mac address was:

    • In the examples\ble_central\ble_app_blinky_c I did the following:
      • Added address filtering based on the findings above:

    A thing i have noticed is that a 0 is attached in the avertissement header and that the address is mirrored, why is this? 

    I think this is related to the specific address type. Since you set it to BLE_GAP_ADDR_TYPE_PUBLIC in the peripheral example, the MSBits was set to '0'. Read more about this in these links:

    Best regards,

    Simon

  • what solved the issue was for some reason removing the sd_ble_gap_addr_set()