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 Reply Children
No Data
Related