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

ble_advertising_advdata_update error

oid ble_service_update_advertising_data() {
   ret_code_t ret_code;
    ble_gap_adv_data_t new_data;

    memcpy(&new_data,&(m_advertising.adv_data), sizeof(new_data));

    uint8_t data[29] = "";
    format_advertising_data(data);

    new_data.adv_data.p_data = data;
    new_data.adv_data.len = strlen(data);

    ret_code = ble_advertising_advdata_update(&m_advertising, &new_data, true);
    APP_ERROR_CHECK(ret_code);

}

<error> app: ERROR 8 [NRF_ERROR_INVALID_STATE] at the same line as

    ret_code = ble_advertising_advdata_update(&m_advertising, &new_data, true);
    APP_ERROR_CHECK(ret_code);

My code is based on

https://devzone.nordicsemi.com/tutorials/b/bluetooth-low-energy/posts/ble-advertising-a-beginners-tutorial

I am trying to add sensor data into the advertising field packet

Related