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

How to get Central name and unique UUID?

Hi all,

I use nRF52832 with the UART peripheral example.

I need to get the name and unique UUID of the Central I'm connecting to (after connection).

The Central can either be Android, iOS or nRF52832 with the Central code of the UART example.

I use SDK V15.0.0 and Softdevice V 6.0.0

How do I go about doing that?

I'm am new to BLE and my knowledge is limited, specific detailed answers will be greatly appreciated.

Thank you

Parents
  • Hi,

    The device name of the central is contained in the device name characteristic, if it has a name. It can then be extracted through the GATT layer by discovering the service. After you have done a service discovery, you will be able to get the device name and UUID.

    Also, if you are using the UART central example, you would need to add a service with a name characteristic.

  • I understand I need to use:

    sd_ble_gattc_char_value_by_uuid_read

    So I did:

                 ble_uuid_t p_uuid = {.uuid = BLE_UUID_GAP_CHARACTERISTIC_DEVICE_NAME,.type = BLE_UUID_TYPE_BLE};
    
                 sd_ble_gattc_char_value_by_uuid_read(m_conn_handle, &p_uuid,
                ble_gattc_handle_range_t const *  p_handle_range
                )

    As you can see, I have no idea what to put in p_handle_range.

    Also, where do I see the response?

Reply
  • I understand I need to use:

    sd_ble_gattc_char_value_by_uuid_read

    So I did:

                 ble_uuid_t p_uuid = {.uuid = BLE_UUID_GAP_CHARACTERISTIC_DEVICE_NAME,.type = BLE_UUID_TYPE_BLE};
    
                 sd_ble_gattc_char_value_by_uuid_read(m_conn_handle, &p_uuid,
                ble_gattc_handle_range_t const *  p_handle_range
                )

    As you can see, I have no idea what to put in p_handle_range.

    Also, where do I see the response?

Children
Related