I programmed my thingy91 with lte_ble_gateway example, however I want to be able to connect to devices with specific addresses. Can anyone point me in the right direction?
I programmed my thingy91 with lte_ble_gateway example, however I want to be able to connect to devices with specific addresses. Can anyone point me in the right direction?
Use the function bt_scan_filter_add(..) and provide the scan filter type BT_SCAN_FILTER_TYPE_ADDR along with the address. Take a look at the nrf_desktop application for guidance on how to implement this. If you're wondering where in the lte_ble_gateway sample to add this, you could simply replace it with (or add it after) this function.
Best regards,
Simon
Hi Simon,
I think I have a problem with actually naming the address, does this command works if for example i have a device with address D4:EE:58:A2:2E:D8
bt_scan_filter_add(BT_SCAN_FILTER_TYPE_ADDR, "D4:EE:58:A2:2E:D8");
If you're using BT_SCAN_FILTER_TYPE_ADDR with bt_scan_filter_add, the second argument should be a pointer to a struct of type bt_addr_le_t. If you study the definition of the function bt_scan_filter_add(..), you can see why.
You should define a struct of type bt_addr_le_t first and set the fields type and a. The type field should get set equal to one of these and the a field is of type bt_addr_t which has a field val (an array of u8_t). The val array stores your address.
Remember that bt_scan_filter_add() accepts a pointer, so you should provide a pointer to the struct.
Hope this helps.
Best regards,
Simon