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
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!
no valid text here