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

  • Hello Edvin,

    Thanks for replying it was very helpful.As mentioned in the above we send more the 31 bytes of data by adding the scan response function .By adding this we can send 62 bytes of data(Each 31 bytes for advertisement and scan response).But i am only able send 24 bytes each ,when i try to more than that i am getting error "NRF_ERROR_INVALID_DATA"  .what might be the issue?

    waiting for your reply.

    Thanks you.

Reply
  • Hello Edvin,

    Thanks for replying it was very helpful.As mentioned in the above we send more the 31 bytes of data by adding the scan response function .By adding this we can send 62 bytes of data(Each 31 bytes for advertisement and scan response).But i am only able send 24 bytes each ,when i try to more than that i am getting error "NRF_ERROR_INVALID_DATA"  .what might be the issue?

    waiting for your reply.

    Thanks you.

Children
No Data
Related