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

Modifying BLE_APP_UART central example (pair certain address/device name)

Hi, I'm using the nRF52 SDK 15.3.0's BLE_APP_UART central/peripheral examples with my PCA10040 boards.

Can I ask about the central example, please?

0. Currently, I think the central example pairs with the nearby peripheral if it was scanned.

What is the condition to get paired?  The peripheral advertising the NUS(Nordic UART Service) in the ADV packet? Or the device name?

1. I can get the Bluetooth address (MAC address) of my PCA10040 peripheral, right? Which SoftDevice 132 function can give me the address?

If I know the address, can I set my central to pair with that address, only?

How can I change this?

2. Also, can I change the central example to pair with the device name that has "MY_UART", or something else?
I wish to know how to implement this, please.

-Thanks

Parents
  • What is the condition to get paired?  The peripheral advertising the NUS(Nordic UART Service) in the ADV packet? Or the device name?

     The ble_app_uart_central example doesn't support pairing by default.

     

    I can get the Bluetooth address (MAC address) of my PCA10040 peripheral, right? Which SoftDevice 132 function can give me the address?

     sd_ble_gap_addr_get()

     

    If I know the address, can I set my central to pair with that address, only?

     Yes, you can use nrf_ble_scan_filters_enable() and set the filter with nrf_ble_scan_filter_set() with SCAN_ADDR_FILTER as type and the appropriate address as p_data.

     

    Also, can I change the central example to pair with the device name that has "MY_UART", or something else?

     Yes, I believe you need to use SCAN_NAME_FILTER  then, otherwise same as above.

Reply
  • What is the condition to get paired?  The peripheral advertising the NUS(Nordic UART Service) in the ADV packet? Or the device name?

     The ble_app_uart_central example doesn't support pairing by default.

     

    I can get the Bluetooth address (MAC address) of my PCA10040 peripheral, right? Which SoftDevice 132 function can give me the address?

     sd_ble_gap_addr_get()

     

    If I know the address, can I set my central to pair with that address, only?

     Yes, you can use nrf_ble_scan_filters_enable() and set the filter with nrf_ble_scan_filter_set() with SCAN_ADDR_FILTER as type and the appropriate address as p_data.

     

    Also, can I change the central example to pair with the device name that has "MY_UART", or something else?

     Yes, I believe you need to use SCAN_NAME_FILTER  then, otherwise same as above.

Children
Related