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

Is it possible to send some user data during advertising mode ?? if so how ?

hi, i need to send some temperature value during advertising mode along with the ble name and address .is it possible ? if so how !

Parents
  • Yes you can call:

    /**@brief Stop advertising (GAP Discoverable, Connectable modes, Broadcast Procedure).
    
    • @return @ref NRF_SUCCESS The BLE stack has stopped advertising.
    • @return @ref NRF_ERROR_INVALID_STATE Invalid state to perform operation (most probably not in advertising state). */ SVCALL(SD_BLE_GAP_ADV_STOP, uint32_t, sd_ble_gap_adv_stop(void));

    However, I don't believe you have to stop and restart advertising to update data in the advertising packet. You just need to call ble_advdata_set any time you want to update your advertising data.

Reply
  • Yes you can call:

    /**@brief Stop advertising (GAP Discoverable, Connectable modes, Broadcast Procedure).
    
    • @return @ref NRF_SUCCESS The BLE stack has stopped advertising.
    • @return @ref NRF_ERROR_INVALID_STATE Invalid state to perform operation (most probably not in advertising state). */ SVCALL(SD_BLE_GAP_ADV_STOP, uint32_t, sd_ble_gap_adv_stop(void));

    However, I don't believe you have to stop and restart advertising to update data in the advertising packet. You just need to call ble_advdata_set any time you want to update your advertising data.

Children
Related