27
27
*
28
28
* The battery service exposes the charge level of the battery of the device.
29
29
* This information is exposed as a percentage from 0% to 100%; a value of 0%
30
- * represents a fully discharged battery while a value of 100% represents a
30
+ * represents a fully discharged battery, and a value of 100% represents a
31
31
* fully charged battery.
32
32
*
33
- * Clients can read the current charge level and subscribe for server initiated
34
- * updates of the charge level. The server delivers these updates to subscribed
33
+ * Clients can read the current charge level and subscribe to server initiated
34
+ * updates of the charge level. The server delivers these updates to the subscribed
35
35
* client in a notification packet.
36
36
*
37
- * The subscription mechanism is usefull to save power; it avoids unecessary data
38
- * traffic between the client and the server which may be induced by polling the
37
+ * The subscription mechanism is useful to save power; it avoids unecessary data
38
+ * traffic between the client and the server, which may be induced by polling the
39
39
* battery level characteristic value.
40
40
*
41
41
* @par usage
42
42
*
43
- * When this class is instantiated it adds a Battery service in the GattServer.
43
+ * When this class is instantiated, it adds a battery service in the GattServer.
44
44
*
45
45
* The application code can use the function updateBatteryLevel() to update the
46
- * charge level exposed by the service and notify subscribed client that the
46
+ * charge level that the service exposes and to notify the subscribed client that the
47
47
* value changed.
48
48
*
49
- * @note Specification of the Battery service can be found here:
49
+ * @note You can find specification of the battery service here:
50
50
* https://www.bluetooth.com/specifications/gatt
51
51
*
52
- * @important Multiple instances of this Battery service are not supported.
52
+ * @important Multiple instances of this battery service are not supported.
53
53
*/
54
54
class BatteryService {
55
55
public:
@@ -86,11 +86,11 @@ class BatteryService {
86
86
}
87
87
88
88
/* *
89
- * Update the battery charge level exposed by the service.
89
+ * Update the battery charge level that the service exposes .
90
90
*
91
- * The server will send a notification of the new value to clients that have
92
- * subscribed to the battery level characteristic updates and clients
93
- * reading the charge level after the update will obtain the updated value.
91
+ * The server sends a notification of the new value to clients that have
92
+ * subscribed to the battery level characteristic updates, and clients
93
+ * reading the charge level after the update obtain the updated value.
94
94
*
95
95
* @param newLevel Charge level of the battery. It is a percentage of the
96
96
* remaining charge between 0% and 100%.
@@ -113,7 +113,7 @@ class BatteryService {
113
113
/* *
114
114
* Reference to the underlying BLE instance that this object is attached to.
115
115
*
116
- * The services and characteristics will be registered in the GattServer of
116
+ * The services and characteristics are registered in the GattServer of
117
117
* this BLE instance.
118
118
*/
119
119
BLE &ble;
@@ -124,7 +124,7 @@ class BatteryService {
124
124
uint8_t batteryLevel;
125
125
126
126
/* *
127
- * The GATT characteristic which expose the charge level.
127
+ * The GATT characteristic, which exposes the charge level.
128
128
*/
129
129
ReadOnlyGattCharacteristic<uint8_t > batteryLevelCharacteristic;
130
130
};
0 commit comments