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

UART Service Pairing

Hi there,

I'm planning and hoping to use the nRF52840 (in module form) for an upcoming medical device design.

This will need to interface to a PC/Mac/Linux to send specific medical data, as well as generic settings/battery percentage/other stuff, so to enable easy cross-platform development, I'm planning to design a USB dongle as well and rely on Nordic UART Service.

I have bought two PCA10056 kits, which are the Evaluation Boards for the nRF52840. In the final product, one would be the medical device, and the other the USB dongle.

I have loaded on the Nordic UART Service Central on one, and Peripheral on the other. Out of the box, they both work PERFECTLY. So amazing and impressive 

However, I had some questions:

  1. How do these two devices know to pair/find each other? From what I can tell, the Central device is scanning all BLE peripherals in its surrounding, and as soon as it finds one with the NUS UUID for its service, it attempts to connect. Is this true, or am I misinterpreting this?
  2. If this is true, is there any way to make this more secure? For example, having two devices paired by giving the peripheral a static MAC Address (or something like that), and making the Central device search for a static MAC Address? I am just worried about the deployment in the field, whereby this causes issues if there is another NUS device in the vicinity - or if there were two full products (two devices, two dongles) in the same room.

Thanks for your time. This forum is amazing and I was here years ago, and am still so amazed at the responses and how every single thread receives the needed help. Nordic rules! 

  • Hi!

    Sorry about the delay here. And thank you for the kind words!

    1.

    Yes, you are correct. The ble_app_uart_c example scans for all nearby devices that are advertising, but will only connect to those with the NUS UUID.

    From the ble_app_uart_c example:
    Main.c - line:191

        err_code = nrf_ble_scan_filter_set(&m_scan, SCAN_UUID_FILTER, &m_nus_uuid);
        APP_ERROR_CHECK(err_code);

        err_code = nrf_ble_scan_filters_enable(&m_scan, NRF_BLE_SCAN_UUID_FILTER, false);
        APP_ERROR_CHECK(err_code);

    You can see that the app will set and enable the UUID filter.

    2.

    Yes, you can also connect using the address as a scan filter.
    You can change this by using the SCAN_ADDR_FILTER to filter for addresses instead.
    Note that you can also change the UUID to avoid the problem you describe, but make sure the UUID match in both the peripheral and the central.

    If you have any further questions, let me know!
    Best regards,
    Joakim Jakobsen

Related