forked from ARMmbed/mbed-os
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ARMmbed#20 from ARMmbed/iriark01-patch-2
Suggested new format for these files
- Loading branch information
Showing
1 changed file
with
26 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,33 @@ | ||
This example creates and updates a standard Battery Level service containing a single | ||
GATT characteristic. | ||
|
||
Checking for Success | ||
==================== | ||
The [battery service transmits](https://developer.bluetooth.org/gatt/services/Pages/ServiceViewer.aspx?u=org.bluetooth.service.battery_service.xml) a device's battery level in percentage, with 100% being a fully charged battery and 0% being a fully drained battery. | ||
|
||
Your BatteryLevel peripheral should be detectable by BLE scanners (e.g. a | ||
smartphone). To use your phone as a BLE scanner simply install one of the | ||
following apps: | ||
Although the sample application runs on a BLE device, it doesn't show the device's real battery level (because that changes very slowly and will make for a dull example). Instead, it transmits a fake battery level that starts at 50% (half charged). Every half second, it increments the battery level, going in single increments until reaching 100% (as if the battery is charging). It then drops down to 20% to start incrementing again. | ||
|
||
- For Android, you can get [nRF Master Control Panel](https://play.google.com/store/apps/details?id=no.nordicsemi.android.mcp). | ||
# Running the application | ||
|
||
- For iPhone, you can get [LightBlue](https://itunes.apple.com/gb/app/lightblue-bluetooth-low-energy/id557428110?mt=8). | ||
## Requirements | ||
|
||
The sample application can be seen on any BLE scanner on a smartphone. If you don't have a scanner on your phone, please install : | ||
|
||
- [nRF Master Control Panel](https://play.google.com/store/apps/details?id=no.nordicsemi.android.mcp) for Android. | ||
|
||
- [LightBlue](https://itunes.apple.com/gb/app/lightblue-bluetooth-low-energy/id557428110?mt=8) for iPhone. | ||
|
||
Hardware requirements are in the [main readme](https://github.com/ARMmbed/ble-examples/blob/master/README.md). | ||
|
||
## Building instructions | ||
|
||
Building instructions for all samples are in the [main readme](https://github.com/ARMmbed/ble-examples/blob/master/README.md). | ||
|
||
## Checking for success | ||
|
||
1. Build the application and install it on your board as explained in the building instructions. | ||
1. Open the BLE scanner on your phone. | ||
1. Find your device. | ||
1. View the device's characteristics; the exact steps depend on which scanner you're using. | ||
1. The value of the battery level characteristic should be incrementing as explained above. | ||
|
||
If you can see the characteristic, and if its value incrementing correctly, the application worked properly. | ||
|
||
Using the phone app you can connect to the peripheral and observe how the | ||
battery level characteristic changes. |