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

DFU Service in scan response advertising data

Hi,

I am designing a BLE Device based on nRF51822, which broadcast three services : one home made service, the Battery Service, and the DFU service for the OTA update.

When the device is advertising, it is supposed to broacast the UUID of all the services in the scan response data. It works perfectly when the DFU service is not included, but when it is, the uuid_list_sized_encode() functions returns NRF_ERROR_DATA_SIZE (0x0C) and none of the services are broadcasted.

The m_adv_uuids[] which contains the UUIDs of the service to be advertised is the following : m_adv_uuids[] = {{BLE_UUID_HOME_MADE_SERVICE, BLE_UUID_TYPE_VENDOR_BEGIN}, {BLE_UUID_BATTERY_SERVICE, BLE_UUID_TYPE_BLE}, {BLE_DFU_SERVICE_UUID, BLE_UUID_TYPE_VENDOR_BEGIN}};

My target is an nRF51822 QFACA1, I am using SDK v11.0.0 and Softdevice S130 v2.0.0

Could you please help me to solve this problem ?

Best regards,

Guillaume

Parents
  • Hi Guillaume,

    Both ADV_DATA and SCAN_RSP data are limited to 31B by BT SIG specification (not counting latest BT 5.0 extension). That includes GAP AD element's overhead (TAG and LENGTH bytes) so you are not able to put more than one 16-byte (128-bit) UUID string into either of these data fields. If you have some other AD objects there (which you typically have - e.g. mandatory AD Flags etc.) then your capacity goes even lower. Can you check what exact string are you trying to put into ADV. and SCAN RSP. data?

    Cheers Jan

  • Hi Jan, Thank you for you anwer. Indeed 2 times 16 bytes is bigger than 31 bytes so I guess than even if the service UUID was the only thing I send through advertising, it would not work, thanks for this point that I forgot. At this moment I am sending the following informations through advertising : adv_data : advdata.name_type = BLE_ADVDATA_FULL_NAME; advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;

    sr_data : srdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]); srdata.uuids_complete.p_uuids = m_adv_uuids; srdata.p_tx_power_level = &tx_power;

    Is there a more effective way to split it ? I don't think that I can split the array that contains the UUIDs for advertising, is it possible ?

    Best regards,

    Guillaume

Reply
  • Hi Jan, Thank you for you anwer. Indeed 2 times 16 bytes is bigger than 31 bytes so I guess than even if the service UUID was the only thing I send through advertising, it would not work, thanks for this point that I forgot. At this moment I am sending the following informations through advertising : adv_data : advdata.name_type = BLE_ADVDATA_FULL_NAME; advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;

    sr_data : srdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]); srdata.uuids_complete.p_uuids = m_adv_uuids; srdata.p_tx_power_level = &tx_power;

    Is there a more effective way to split it ? I don't think that I can split the array that contains the UUIDs for advertising, is it possible ?

    Best regards,

    Guillaume

Children
No Data
Related