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

Can a BLE device natively receive a phone's battery level?

I have a BLE application in mind in which it would be useful for the BLE server to obtain the battery level of the BLE client (in this case, a phone, laptop, or tablet). I know that the Battery Service exists and is used as a way for the server to inform the client of its remaining battery level, but are there any BLE native mechanisms in place to have the client inform the server of its remaining battery level? Or will I just need to make a custom service and have something running in the background of the client to periodically update the characteristics of that service?

If it's applicable, my initial target is an android phone and tablet as the client, but I would love to have something generic enough to be able to port to iOS without requiring extra development.

Parents
  • Hi, by default the Android's GATT server has only Generic Access and Generic Attribute services, so what you can get is only the device name (which may be changed by the user in Settings). To obtain the Battery level you would have to create an app where you open the GATT Server and create a Battery Service. You have to implement the behaviour yourself, so read battery level of the phone and send it on read request / send notification when % has changed. You may also use nRF Master Control Panel, configure the GATT Server, connect to your device and set/send values manually.

    On iOS it's a bit easier, as iOS supports Battery Service, Current Time Service etc so you just can start using natively supported services (pairing required I think).

    BR, Aleksander

Reply
  • Hi, by default the Android's GATT server has only Generic Access and Generic Attribute services, so what you can get is only the device name (which may be changed by the user in Settings). To obtain the Battery level you would have to create an app where you open the GATT Server and create a Battery Service. You have to implement the behaviour yourself, so read battery level of the phone and send it on read request / send notification when % has changed. You may also use nRF Master Control Panel, configure the GATT Server, connect to your device and set/send values manually.

    On iOS it's a bit easier, as iOS supports Battery Service, Current Time Service etc so you just can start using natively supported services (pairing required I think).

    BR, Aleksander

Children
No Data
Related