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

which program to choose to advertise data over BLE ?

Hello Everyone,

I have done I2C communication with Grid Eye sensor (AMG 8832) using twi_master_with_twis_slave (nRF5_SDK_12.3.0_d7731ad) example program. Now i want to transmit the Temperature data over BLE . I am not sure which ble_peripheral example to use to transmit the data ?

Thanks in advance.

Parents
  • You can change the advertising data, but you will have to stop advertising using sd_ble_gap_adv_stop(). This will always return NRF_SUCCESS, unless it isn't advertising, in which case you can ignore the return value from this call.

    Then run ble_advertising_init() again with the updated advertising data. You can e.g. set up a timer and read thermometer data, and update the advertising data if the temperature has changed significantly from the current "advertising value".

    Remember to stop the advertising before you run ble_advertising_init() and ble_advertising_start() again.

     

    Best regards,

    Edvin

  • no you don't need to stop advertising to change the adversing data. You can just call sd_ble_adv_data_set() and put the new adv data / scan data into the packet. 

Reply Children
Related