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

ble_app_proximity sample advertising data not exceeding limit?

static void advertising_init(uint8_t adv_flags) { uint32_t err_code; ble_advdata_t advdata; int8_t tx_power_level = TX_POWER_LEVEL;

ble_uuid_t adv_uuids[] = 
{
    {BLE_UUID_TX_POWER_SERVICE,        BLE_UUID_TYPE_BLE}, 
    {BLE_UUID_IMMEDIATE_ALERT_SERVICE, BLE_UUID_TYPE_BLE}, 
    {BLE_UUID_LINK_LOSS_SERVICE,       BLE_UUID_TYPE_BLE}
};

m_advertising_mode = BLE_NO_ADV;

// 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(adv_flags);
advdata.flags.p_data            = &adv_flags;
advdata.p_tx_power_level        = &tx_power_level;
advdata.uuids_complete.uuid_cnt = sizeof(adv_uuids) / sizeof(adv_uuids[0]);
advdata.uuids_complete.p_uuids  = adv_uuids;

err_code = ble_advdata_set(&advdata, NULL);
APP_ERROR_CHECK(err_code);

} the above code is from ble_app_proximity sample, according to Creating Bluetooth low energy applications using nRF51822 v1.0 Page 26 to 27 ble_advdata_set sets advdata and response data, if so, why ble_app_proximity combine it together? I try ble_app_proximity advertising_init in my own project, I get error NRF_ERROR_DATA_SIZE, any reason ble_app_proximity is ok to call ble_advdata_set without NRF_ERROR_DATA_SIZE? some previous setting?

and in ble_app_proximity code, it adds tx_power_level, does that mean by this way, it announce power_level in the advertising stage, then we don't need battery service?

Parents
  • Hi Hung,

     I read from one of your reply on an other thread about adv data.  The limit of 31 bytes seems to be a bug in the s110.  In the Bluetooth specs, the device name alone can be up to 128 bytes.  In s110 we can't have a device name more than 10 bytes.  The full UUID takes up 16 bytes.  We can't even have one defined.  Can you validate on this ?  I am not an expert on Bluetooth.
    
  • @Hoang: The maximum advertising data payload and scan response payload are 31 bytes and is limited by BLE v4.0 spec (chapter 11 Part C Vol 3) Device name characteristic, by spec, can be upto 248 bytes, however it's limited on current our S110 to 31 bytes (please refer to the S110 release note). If you want to advertise your device name but don't have enough space in the advertising packet, you can use the scan response packet.

Reply
  • @Hoang: The maximum advertising data payload and scan response payload are 31 bytes and is limited by BLE v4.0 spec (chapter 11 Part C Vol 3) Device name characteristic, by spec, can be upto 248 bytes, however it's limited on current our S110 to 31 bytes (please refer to the S110 release note). If you want to advertise your device name but don't have enough space in the advertising packet, you can use the scan response packet.

Children
No Data
Related