I need to connect to other units according to their MAC address. I'm assuming that this:
Where this:
I need to connect to other units according to their MAC address. I'm assuming that this:
Hi
Try something like this (assuming there are no conflicting filters already set in your project:
err_code = nrf_ble_scan_copy_addr_to_sd_gap_addr(&m_mac_filter, target_mac_addr); err_code = nrf_ble_scan_filter_set(&m_scan, SCAN_ADDR_FILTER, &m_mac_filter); m_mac_filter.addr_type = BLE_GAP_ADDR_TYPE_RANDOM_STATIC;
err_code = nrf_ble_scan_filters_enable(&m_scan, NRF_BLE_SCAN_ADDR_FILTER, false); APP_ERROR_CHECK(err_code);
Setting up and enabling a filter should be done before you start scanning.
Best regards,
Simon
Hi,
Thanks for that, but it's not answering my question in terms of the syntax for the mac address. I guess this:
target_mac_addr
is where the mac address itself is stored, but what type of variable is this?
So , for example is it a string of hie kind of format:
45:67:A5:76:AA:FF
Or just a hex number such as
4567A576AAFF
Or...?
Thanks!
Hi,
Thanks for that, but it's not answering my question in terms of the syntax for the mac address. I guess this:
target_mac_addr
is where the mac address itself is stored, but what type of variable is this?
So , for example is it a string of hie kind of format:
45:67:A5:76:AA:FF
Or just a hex number such as
4567A576AAFF
Or...?
Thanks!
BTW, what is this random bt all about?
I get this:
Identity: D9:AD:8D:A9:1A:A2 (random)
When I connect with the two dev kits, but also in your snipped you have this:
BLE_GAP_ADDR_TYPE_RANDOM_STATIC
Surely a mac address is a mac address on fixed, not random? Does each unit not have a uniqu MAC address?