This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Error in "is_UUID_present"

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

Parents
  • The only thing I can think of is that your BLE_UUID_OUR_SERVICE_UUID is not the BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_MORE_AVAILABLE or BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_COMPLETE type. Can you sniff your advertisement packets to see if it is transmitting as 128BIT UUID AD_Type?

Reply
  • The only thing I can think of is that your BLE_UUID_OUR_SERVICE_UUID is not the BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_MORE_AVAILABLE or BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_COMPLETE type. Can you sniff your advertisement packets to see if it is transmitting as 128BIT UUID AD_Type?

Children
No Data
Related