Hi,
im running my DK as a central of a BLE connection and i'd like to read the device_name of the peripheral board that im communication with. how do i do this? i cannot find a fieldname in the ble structures that stores it.
thank you :)
Hi,
im running my DK as a central of a BLE connection and i'd like to read the device_name of the peripheral board that im communication with. how do i do this? i cannot find a fieldname in the ble structures that stores it.
thank you :)
Hi,
There is no separate field in the struct for the name. The name can be put in the advertising data (data
field), but it is not required.
Check out the BLE multilink central example and the function adv_report_parse()
for details on how tha name can be extracted from the advertising data.
Best regards,
Jørgen
First, the central is always the one initiating a connection. The peripheral only advertise its precence and the central is the one to decide if it wants to connect, and initiate the connection. What you are describing is exactly what happens in the examle I linked above:
BLE_GAP_EVT_ADV_REPORT
event in the on_ble_evt()
handler, and the function on_adv_report()
is called.on_adv_report()
checks if the name given in m_target_periph_name
is found in the advertising data.First, the central is always the one initiating a connection. The peripheral only advertise its precence and the central is the one to decide if it wants to connect, and initiate the connection. What you are describing is exactly what happens in the examle I linked above:
BLE_GAP_EVT_ADV_REPORT
event in the on_ble_evt()
handler, and the function on_adv_report()
is called.on_adv_report()
checks if the name given in m_target_periph_name
is found in the advertising data.