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

Adding Battery percentage and Temperature in Scan response packet in a ble_app_beaocn

Hi,

I'm trying to add the device information such as Battery percentage , temperature in the scan response packet to the ble_app_beacon example. I could add the data and adversities the data in the scan response, but the issue is the battery level or the temperature are being updated on device reset. Is there a way to fix the issue?

I'm using nRF5_SDK_15.2.0_9412b96 and nRF52840-DK

Right now i am trying to read the battery and temp value and added to scan response data

I have few questions:

1. Do we need to add it as a services like Battery service and temperature service

Thanks

Parents
  • Hi

    the battery level or the temperature are being updated on device reset.

     What do you mean by this? It should be possible to add these values in the scan response data, but I don't know how well it would work in practice, as most mobile devices won't show the scan response if you don't have a specific app for that purpose. I assume you are adding this data in the .scan_rsp_data function?

    I think it would be easier, if it's possible in your use case, to add the battery level and temperature data in the advertisement packet itself if it doesn't take too much space.

    To add the battery and temperature services the device has to connect to a central, which the beacon doesn't do.

    Best regards,

    Simon

Reply
  • Hi

    the battery level or the temperature are being updated on device reset.

     What do you mean by this? It should be possible to add these values in the scan response data, but I don't know how well it would work in practice, as most mobile devices won't show the scan response if you don't have a specific app for that purpose. I assume you are adding this data in the .scan_rsp_data function?

    I think it would be easier, if it's possible in your use case, to add the battery level and temperature data in the advertisement packet itself if it doesn't take too much space.

    To add the battery and temperature services the device has to connect to a central, which the beacon doesn't do.

    Best regards,

    Simon

Children
No Data
Related