I am currently developing a BLE central device to find devices based on their name to extract data from their advertising packet without connecting. I was able to do this using the UUID, but since all of these devices will be transmitting the same UUID, I need to do it based on name. I was able to find the top device in my picture using ble_advdata_name_find, but I am unable to find the device below. I am setting the device name as such for now static char const target_device_name[] = "92094"; I have attached my ble event handler as well where this data processing is done. Any help is appreciated why one device is found but the other is not!
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/**@brief Function for handling BLE events.
*
* @param[in] p_ble_evt Bluetooth stack event.
* @param[in] p_context Unused.
*/
static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context)
{
ret_code_t err_code;
// For readability.
ble_gap_evt_t const * p_gap_evt = &p_ble_evt->evt.gap_evt;
switch (p_ble_evt->header.evt_id)
{
// Upon connection, check which peripheral is connected, initiate DB
// discovery, update LEDs status, and resume scanning, if necessary.
case BLE_GAP_EVT_CONNECTED:
{
NRF_LOG_INFO("Connection 0x%x established, starting DB discovery.",
p_gap_evt->conn_handle);