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

BLE Battery Service - Opinion

I need to provide a battery level in the application I'm working on. This application's services will all be custom - I'm not using predefined BLE services.

Our device will run a rechargeable battery, and we are offer an optional solar charging panel. I will likely add a custom "Power Service" to monitor the panels, and charging circuit, and am considering adding a battery level characteristic in my Power Service.

If I use the BLE Battery service, it would be the only BLE pre-defined service I use. I was wondering if there were any advantages to using the BLE battery service vs.just adding the battery level to my custom services. I'm still new to BLE and would like to know what most people do, in situations like this.

Thanks, Clint

  • A Standard Service is used to provide "arm's length" interoperability, i.e. You do not need to know the details of an implementation but you can interact with and get the data that you want by implementing a standard Service. There are tests (available through the PTS) so that you can verify your standard implementation, and the likelihood of interoperating is quite good.

    It is still possible to achieve the same interoperability with a custom service, but you will need to do quite a bit of work to ensure that the Service is documented and understandable and the tests are available to verify that things work as expected. You would do this if you wanted to have a developer program as part of your product to enhance its appeal or extend its functionality. An example would be the Apple Notification Center Service.

    For example: A lot of BTLE heart rate belt today implement a standard BTLE Heart Rate Service, this allows a multitude of apps to work with them.

    If you want only your app to work with your device, then a custom Service may be the way to go. In your case, you have a hybrid possibility i.e. custom Services and a standard battery.

    The standard battery Service implementation can be useful as it leaves open the possibility to manage a user's multitude of battery operated devices from different screens and apps and even open the possibility to work with a battery charger that can query different devices and alert the user about the need to recharge them.

    I would encourage you to see if you can use the standard battery Service so that it leaves open the possibility of extending and adding value.

  • Hi Sir: I also face same situation. Is there a example about "hybrid" service? For example, can i add ble_bas.c to ble_nus project? Thanks a lot

Related