36
36
/* *
37
37
* Representation of a characteristic discovered.
38
38
*
39
- * Instances of this class are generated by the GattClient discovery procedure
40
- * initiated with GattClient::launchServiceDiscovery().
39
+ * The GattClient discovery procedure initiated with
40
+ * GattClient::launchServiceDiscovery() generates instances of this class .
41
41
*
42
42
* It exposes the main attributes of the discovered characteristic:
43
43
* - The UUID of the characteristic, it can be retrieved by a call to the
51
51
* It important to note that the value of the characteristic - if it is
52
52
* accessible - is not fetched at discovery time.
53
53
*
54
- * The main operations offered by the class are reading, writing and discovering
54
+ * The main operations the class offers are reading, writing and discovering
55
55
* the descriptors of the characteristic discovered.
56
56
*
57
57
* Reading a discovered characteristic can be accomplished in two different
58
- * fashion :
58
+ * fashions :
59
59
*
60
60
* If the user has a callback registered for the data read operation in the
61
- * GattClient then a call to the read(uint16_t) function will initiate a read of
61
+ * GattClient, then a call to the read(uint16_t) function will initiate a read of
62
62
* the characteristic. Results of the operation will be pass on the callback
63
- * registered by GattClient::onDataRead() which process all the responses to
63
+ * registered by GattClient::onDataRead(), which processes all the responses to
64
64
* read requests. The read request for a given characteristic can be identified
65
- * by the connection handle and the attribute handle which are present in
65
+ * by the connection handle and the attribute handle, which are present in
66
66
* GattReadCallbackParams.
67
67
*
68
68
* Another overload (read(uint16_t, const GattClient::ReadCallback_t&)) of the
69
- * read function accept a completion callback as a last parameter. That
69
+ * read function accepts a completion callback as a last parameter. That
70
70
* completion callback will be invoked automatically once the response to the
71
- * read request for that given characteristic has been received. However
71
+ * read request for that given characteristic has been received. However,
72
72
* convenience came at the expense of dynamic memory usage for the time of the
73
73
* transaction.
74
74
*
75
75
* Similarly, two versions of the write() API are exposed. One where the user
76
- * has to register a callback handling write response via the function
77
- * GattClient::onDataWritten() and another one which accept a completion
76
+ * has to register a callback handling write response through the function
77
+ * GattClient::onDataWritten() and another one that accepts a completion
78
78
* callback in input.
79
79
*
80
- * It is also possible to send a write command which is not acknowledged by the
80
+ * It is also possible to send a write command, which is not acknowledged by the
81
81
* peer server by using the function writeWoResponse().
82
82
*
83
- * Finally descriptors of the characteristic can be discovered by invoking the
84
- * function discoverDescriptors which is a shorthand for calling
83
+ * Finally, descriptors of the characteristic can be discovered by invoking the
84
+ * function discoverDescriptors, which is shorthand for calling
85
85
* GattClient::discoverCharacteristicDescriptors. That discovery is necessary to
86
- * enable or disable characteristic notification or indication which is achieved
86
+ * enable or disable characteristic notification or indication that is achieved
87
87
* by writing on the Client Characteristic Configuration Descriptor (CCCD).
88
88
*/
89
89
class DiscoveredCharacteristic {
@@ -96,47 +96,47 @@ class DiscoveredCharacteristic {
96
96
* Permits broadcasts of the characteristic value using the character
97
97
* the Server Characteristic Configuration Descriptor.
98
98
*
99
- * @note If set descriptors of the characteristic shall contain a Server
99
+ * @note If set, descriptors of the characteristic contain a Server
100
100
* Characteristic Configuration Descriptor.
101
101
*/
102
102
uint8_t _broadcast :1 ;
103
103
104
104
/* *
105
- * If set the value of the characteristic can be read.
105
+ * If set, the value of the characteristic can be read.
106
106
*/
107
107
uint8_t _read :1 ;
108
108
109
109
/* *
110
- * If set the characteristic value can be written by a write command
110
+ * If set, a write command can write the characteristic value
111
111
* (write without response).
112
112
*/
113
113
uint8_t _writeWoResp :1 ;
114
114
115
115
/* *
116
- * If set clients can issue requests to write the characteristic.
116
+ * If set, clients can issue requests to write the characteristic.
117
117
*/
118
118
uint8_t _write :1 ;
119
119
120
120
/* *
121
- * If set the server can emit notifications of the Characteristic Value
122
- * (without client acknowledgement ).
121
+ * If set, the server can emit notifications of the Characteristic Value
122
+ * (without client acknowledgment ).
123
123
*
124
- * @note If set descriptors of the characteristic shall contain a Client
124
+ * @note If set, descriptors of the characteristic contain a Client
125
125
* Characteristic Configuration Descriptor.
126
126
*/
127
127
uint8_t _notify :1 ;
128
128
129
129
/* *
130
- * If set the server can emit indication of the Characteristic Value
130
+ * If set, the server can emit indication of the Characteristic Value
131
131
* (with client acknowledgement).
132
132
*
133
- * @note If set descriptors of the characteristic shall contain a Client
133
+ * @note If set, descriptors of the characteristic contain a Client
134
134
* Characteristic Configuration Descriptor.
135
135
*/
136
136
uint8_t _indicate :1 ;
137
137
138
138
/* *
139
- * If set signed write of the Characteristic Value are supported.
139
+ * If set, signed write of the Characteristic Value is supported.
140
140
*/
141
141
uint8_t _authSignedWrite :1 ;
142
142
@@ -171,7 +171,7 @@ class DiscoveredCharacteristic {
171
171
/* *
172
172
* Return the value of the write without response property.
173
173
*
174
- * @return true if the characteristic accept write without response
174
+ * @return true if the characteristic accepts write without response
175
175
* commands and false otherwise.
176
176
*
177
177
* @see _writeWoResp
@@ -184,7 +184,7 @@ class DiscoveredCharacteristic {
184
184
/* *
185
185
* Return the value of the write property.
186
186
*
187
- * @return true if writing the characteristic accept write requests and
187
+ * @return true if writing the characteristic accepts write requests and
188
188
* false otherwise.
189
189
*
190
190
* @see _write
@@ -201,7 +201,7 @@ class DiscoveredCharacteristic {
201
201
* can be configured to notify the characteristic value to a given
202
202
* client and false otherwise.
203
203
*
204
- * @note unlike indication the notification procedure does not require
204
+ * @note unlike indication, the notification procedure does not require
205
205
* acknowledgement from the client.
206
206
*
207
207
* @see _notify
@@ -219,7 +219,7 @@ class DiscoveredCharacteristic {
219
219
* client and false otherwise.
220
220
*
221
221
* @note unlike notification the indication procedure does require
222
- * acknowledgement from the client.
222
+ * acknowledgment from the client.
223
223
*
224
224
* @see _indicate
225
225
*/
@@ -231,7 +231,7 @@ class DiscoveredCharacteristic {
231
231
/* *
232
232
* Return the value of the authenticated signed writes property.
233
233
*
234
- * @return true if the characteristic accept authenticated signed write
234
+ * @return true if the characteristic accepts authenticated signed write
235
235
* and false otherwise.
236
236
*/
237
237
bool authSignedWrite (void ) const
@@ -242,8 +242,8 @@ class DiscoveredCharacteristic {
242
242
/* *
243
243
* Equal to operator for DiscoveredCharacteristic::Properties_t.
244
244
*
245
- * @param[in] lhs The left hand side of the equality expression
246
- * @param[in] rhs The right hand side of the equality expression
245
+ * @param[in] lhs The left hand side of the equality expression.
246
+ * @param[in] rhs The right hand side of the equality expression.
247
247
*
248
248
* @return true if operands are equals and false otherwise.
249
249
*/
@@ -284,8 +284,8 @@ class DiscoveredCharacteristic {
284
284
* of the characteristic.
285
285
*
286
286
* Read responses will be passed to the callback registered in
287
- * GattClient::onDataRead(). Read responses to read requests initiated by
288
- * this function call will have their GattReadCallbackParams::connHandle
287
+ * GattClient::onDataRead(). Read responses to read requests that this function
288
+ * call initiates will have their GattReadCallbackParams::connHandle
289
289
* field equal to the value returned by getConnectionHandle() and their
290
290
* GattReadCallbackParams::handle field equal to the value returned by
291
291
* getValueHandle().
@@ -310,7 +310,7 @@ class DiscoveredCharacteristic {
310
310
* - where the read operation begin.
311
311
*
312
312
* @param[in] onRead Completion callback which will accept the response of
313
- * the read request. The callback is copied, it is not necessary to keep it
313
+ * the read request. The callback is copied; it is unnecessary to keep it
314
314
* in memory after the call.
315
315
*
316
316
* @return BLE_ERROR_NONE if a read has been initiated.
@@ -320,7 +320,7 @@ class DiscoveredCharacteristic {
320
320
* @return BLE_ERROR_OPERATION_NOT_PERMITTED due to the characteristic's
321
321
* properties.
322
322
*
323
- * @note This function is similar to read(uint16_t) const however it uses
323
+ * @note This function is similar to read(uint16_t) const; however, it uses
324
324
* dynamic memory to store the use completion callback.
325
325
*/
326
326
ble_error_t read (
@@ -331,8 +331,8 @@ class DiscoveredCharacteristic {
331
331
/* *
332
332
* Perform a write without response procedure.
333
333
*
334
- * @note Write without responses are not acknowledged by the server and
335
- * therefore won't generate any event on the client side.
334
+ * @note The server does not acknowledge write without responses.
335
+ * Therefore, they won't generate any event on the client side.
336
336
*
337
337
* @param[in] length The amount of data being written.
338
338
* @param[in] value The bytes being written.
@@ -355,20 +355,20 @@ class DiscoveredCharacteristic {
355
355
* invoked with the descriptor discovered as parameter. When the process
356
356
* ends, the callback onTermination is invoked.
357
357
*
358
- * @param[in] onDescriptorDiscovered Callback invoked when a descriptor is
359
- * discovered
358
+ * @param[in] onDescriptorDiscovered Callback is invoked when a descriptor is
359
+ * discovered.
360
360
*
361
- * @param[in] onTermination Callback invoke when the discovery process ends.
361
+ * @param[in] onTermination Callback is invoked when the discovery process ends.
362
362
*
363
363
* @return BLE_ERROR_NONE if descriptor discovery is launched successfully;
364
364
* else an appropriate error.
365
365
*
366
- * @note This function is a shorthand for
367
- * GattClient::discoverCharacteristicDescriptors therefore
366
+ * @note This function is shorthand for
367
+ * GattClient::discoverCharacteristicDescriptors; therefore,
368
368
* GattClient::isCharacteristicDescriptorDiscoveryActive can be used to
369
- * determine if the descriptor discovery and
369
+ * determine the descriptor discovery and
370
370
* GattClient::terminateCharacteristicDescriptorDiscovery can be used to
371
- * ends the discovery process.
371
+ * end the discovery process.
372
372
*/
373
373
ble_error_t discoverDescriptors (
374
374
const CharacteristicDescriptorDiscovery::DiscoveryCallback_t &onDescriptorDiscovered,
@@ -378,16 +378,16 @@ class DiscoveredCharacteristic {
378
378
/* *
379
379
* Initiate a write procedure of the characteristic value.
380
380
*
381
- * Unlike write without responses (see writeWoResponse()) an acknowledgement
381
+ * Unlike write without responses (see writeWoResponse()), an acknowledgment
382
382
* is expected for this procedure. The response of the peer GATT server to
383
- * the write request will be passed to callbacks registered in
383
+ * the write request is passed to callbacks registered in
384
384
* GattClient::onDataWritten().
385
385
*
386
386
* Similarly to read responses, responses to write request of this
387
387
* characteristic can be identified by their connection handle (
388
- * GattWriteCallbackParams::connHandle) which will be equal to the value
388
+ * GattWriteCallbackParams::connHandle), which is equal to the value
389
389
* returned by getConnectionHandle() and their attribute handle (
390
- * GattWriteCallbackParams::handle) which will be equal to the value
390
+ * GattWriteCallbackParams::handle), which is equal to the value
391
391
* returned by getValueHandle().
392
392
*
393
393
* @param[in] length The amount of data being written.
@@ -402,16 +402,16 @@ class DiscoveredCharacteristic {
402
402
* @return BLE_ERROR_OPERATION_NOT_PERMITTED due to the characteristic's
403
403
* properties.
404
404
*
405
- * @note Internally the API use the write or long write procedure depending
405
+ * @note Internally, the API uses the write or long write procedure, depending
406
406
* on the number of bytes to write and the MTU size.
407
407
*/
408
408
ble_error_t write (uint16_t length, const uint8_t *value) const ;
409
409
410
410
/* *
411
411
* Initiate a write procedure of the characteristic value.
412
412
*
413
- * Same as write(uint16_t, const uint8_t *) const but accept a completion
414
- * callback which will be invoked when the server response is received.
413
+ * Same as write(uint16_t, const uint8_t *) const but accepts a completion
414
+ * callback, which is invoked when the server response is received.
415
415
*
416
416
* @param[in] length The amount of bytes to write.
417
417
* @param[in] value The bytes to write.
@@ -492,13 +492,13 @@ class DiscoveredCharacteristic {
492
492
/* *
493
493
* Return the last attribute handle of the characteristic definition.
494
494
*
495
- * The attribute layout of a characteristic definition is as follows :
496
- * - Declaration attribute (see #getDeclHandle)
497
- * - Value attribute (see #getValueHandle)
495
+ * The attribute layout of a characteristic definition is:
496
+ * - Declaration attribute (see #getDeclHandle).
497
+ * - Value attribute (see #getValueHandle).
498
498
* - Zero or more characteristic descriptors attribute.
499
499
*
500
500
* The last attribute handle is used internally to discover characteristic
501
- * descriptors. The discovery operate on the range [ValueHandle + 1 :
501
+ * descriptors. The discovery operates on the range [ValueHandle + 1 :
502
502
* LastHandle].
503
503
*
504
504
* @return The last handle of this characteristic definition.
@@ -511,19 +511,19 @@ class DiscoveredCharacteristic {
511
511
}
512
512
513
513
/* *
514
- * Get the GattClient which can operate on this characteristic.
514
+ * Get the GattClient, which can operate on this characteristic.
515
515
*
516
- * @return The GattClient which can operate on this characteristic.
516
+ * @return The GattClient, which can operate on this characteristic.
517
517
*/
518
518
GattClient* getGattClient ()
519
519
{
520
520
return gattc;
521
521
}
522
522
523
523
/* *
524
- * Get the GattClient which can operate on this characteristic.
524
+ * Get the GattClient, which can operate on this characteristic.
525
525
*
526
- * @return The GattClient which can operate on this characteristic.
526
+ * @return The GattClient, which can operate on this characteristic.
527
527
*/
528
528
const GattClient* getGattClient () const
529
529
{
@@ -534,7 +534,7 @@ class DiscoveredCharacteristic {
534
534
* @brief Get the connection handle to the GattServer containing this
535
535
* characteristic.
536
536
*
537
- * @return Connection handle to the GattServer which contain this
537
+ * @return Connection handle to the GattServer, which contains this
538
538
* characteristic.
539
539
*/
540
540
Gap::Handle_t getConnectionHandle () const
0 commit comments