Hi!
I want to connect a nrf51 dk with a beacon and I'm using the UUID to make the connection. In the beacon code I define the UUID in this way:
ble_uuid_t adv_uuids[] = {{BCS_UUID_SERVICE, m_bcs.uuid_type}};
ble_uuid_t m_adv_uuids[]= {BLE_UUID_OUR_SERVICE_UUID,BLE_UUID_TYPE_VENDOR_BEGIN}; //aggiunta da noi
// Build and set advertising data
memset(&advdata, 0, sizeof(advdata));
advdata.name_type = BLE_ADVDATA_FULL_NAME;
advdata.include_appearance = true;
advdata.flags.size = sizeof(flags);
advdata.flags.p_data = &flags;
memset(&scanrsp, 0, sizeof(scanrsp));
scanrsp.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
scanrsp.uuids_complete.p_uuids = m_adv_uuids;
err_code = ble_advdata_set(&advdata, &scanrsp);
APP_ERROR_CHECK(err_code);
In the nrf51 I use the function is_UUID_present
and I get the error NRF_ERROR_NOT_FOUND
(for a 128bit UUID no match in the populated table of UUIDs ) and the code that I use is
else if ( (field_type == BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_MORE_AVAILABLE)
|| (field_type == BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_COMPLETE)
)
{
err_code = sd_ble_uuid_decode(UUID128_SIZE,
&p_data[index + 2],
&extracted_uuid);
if (err_code == NRF_SUCCESS)
{
if ((extracted_uuid.uuid == p_target_uuid->uuid)
&& (extracted_uuid.type == p_target_uuid->type))
{
return true;
}
}
}
Can someone explain me why this happens? Thank you so much! projects.rar