36
36
/* *
37
37
* Construct and operates a GATT server.
38
38
*
39
- * A Gatt server is a collection of GattService; these services contains
40
- * characteristics that may be read or written by a peer connected to the device.
41
- * These characteristics may also emits updates to subscribed clients when their
42
- * value change.
39
+ * A Gatt server is a collection of GattService; these services contain
40
+ * characteristics that a peer connected to the device may read or write .
41
+ * These characteristics may also emit updates to subscribed clients when their
42
+ * values change.
43
43
*
44
44
* @p Server Layout
45
45
*
46
- * Application code can add GattService object to the server with the help of
46
+ * Application code can add a GattService object to the server with the help of
47
47
* the function addService(). That function registers all the GattCharacteristic
48
- * enclosed in the service as well as all the characteristics descriptors (see
49
- * GattAttribute) these characteristics contain. Service registration assign
48
+ * enclosed in the service, as well as all the characteristics descriptors (see
49
+ * GattAttribute) these characteristics contain. Service registration assigns
50
50
* a unique handle to the various attributes being part of the service; this
51
51
* handle should be used for subsequent read or write of these components.
52
52
*
53
- * There is no primitives defined to remove a single service; however a call to
54
- * the function reset() will remove all services previously registered in the
53
+ * There are no primitives defined to remove a single service; however, a call to
54
+ * the function reset() removes all services previously registered in the
55
55
* GattServer.
56
56
*
57
57
* @p Characteristic and attributes access
58
58
*
59
59
* Values of the characteristic and the characteristic descriptor present in the
60
- * GattServer must be accessed via the handle assigned to them when the service
60
+ * GattServer must be accessed through the handle assigned to them when the service
61
61
* has been registered; the GattServer class offers several flavors of read()
62
- * and write() function that retrieve or mutate an attribute value.
62
+ * and write() functions that retrieve or mutate an attribute value.
63
63
*
64
64
* Application code can query if a client has subscribed to a given
65
65
* characteristic's value update by invoking the function areUpdatesEnabled().
66
66
*
67
67
* @p Events
68
68
*
69
- * The GattServer allows application code to register several event handler that
69
+ * The GattServer allows application code to register several event handlers that
70
70
* can be used to monitor client and server activities:
71
- * - onDataSent(): Register an event handler that will be called when a
71
+ * - onDataSent(): Register an event handler that is called when a
72
72
* characteristic value update has been sent to a client.
73
- * - onDataWriten(): Register an event handler that will be called when a
73
+ * - onDataWriten(): Register an event handler that is called when a
74
74
* client has written an attribute of the server.
75
- * - onDataRead(): Register an event handler that will be called when a
75
+ * - onDataRead(): Register an event handler that is called when a
76
76
* client has read an attribute of the server.
77
- * - onUpdatesEnabled: Register an event handler that will be called when a
77
+ * - onUpdatesEnabled: Register an event handler that is called when a
78
78
* client subscribes to updates of a characteristic.
79
- * - onUpdatesDisabled: Register an event handler that will be called when a
79
+ * - onUpdatesDisabled: Register an event handler that is called when a
80
80
* client unsubscribes from updates of a characteristic.
81
- * - onConfimationReceived: Register an event handler that will be called
82
- * when a client acknowledge a characteristic value notification.
81
+ * - onConfimationReceived: Register an event handler that is called
82
+ * when a client acknowledges a characteristic value notification.
83
83
*
84
- * @note The term characteristic value update is used to represents
84
+ * @note The term characteristic value update is used to represent
85
85
* Characteristic Value Notification and Characteristic Value Indication when
86
86
* the nature of the server initiated is not relevant.
87
87
*/
@@ -152,7 +152,7 @@ class GattServer {
152
152
GattServerShutdownCallbackChain_t;
153
153
154
154
/* *
155
- * Event handler that handle subscription to characteristic updates,
155
+ * Event handler that handles subscription to characteristic updates,
156
156
* unsubscription from characteristic updates and notification confirmation.
157
157
*
158
158
* @see onUpdatesEnabled() onUpdateDisabled() onConfirmationReceived()
@@ -187,19 +187,19 @@ class GattServer {
187
187
* followed by the characteristic declarations (including characteristic
188
188
* descriptors) present in @p service.
189
189
*
190
- * The process assign a unique attribute handle to all the elements added
190
+ * The process assigns a unique attribute handle to all the elements added
191
191
* into the attribute table. This handle is an ID that must be used for
192
192
* subsequent interractions with the elements.
193
193
*
194
- * @note Their is no mirror function that removes a single service.
194
+ * @note There is no mirror function that removes a single service.
195
195
* Application code can remove all the registered services by calling
196
196
* reset().
197
197
*
198
198
* @important Service, characteristics and descriptors objects registered
199
199
* within the GattServer must remain reachable until reset() is called.
200
200
*
201
201
* @param[in] service The service to be added; attribute handle of services,
202
- * characteristic and characteristic descriptors will be updated by the
202
+ * characteristic and characteristic descriptors are updated by the
203
203
* process.
204
204
*
205
205
* @return BLE_ERROR_NONE if the service was successfully added.
@@ -288,9 +288,9 @@ class GattServer {
288
288
* @param[in] value A pointer to a buffer holding the new value.
289
289
* @param[in] size Size in bytes of the new value (in bytes).
290
290
* @param[in] localOnly If this flag is false and the attribute handle
291
- * written is a characteristic value then the server sends an update
291
+ * written is a characteristic value, then the server sends an update
292
292
* containing the new value to all clients that have subscribed to the
293
- * characteristic's notifications or indications. Otherwise the update does
293
+ * characteristic's notifications or indications. Otherwise, the update does
294
294
* not generate a single server initiated event.
295
295
*
296
296
* @return BLE_ERROR_NONE if the attribute value has been successfully
@@ -325,10 +325,10 @@ class GattServer {
325
325
* @param[in] value A pointer to a buffer holding the new value.
326
326
* @param[in] size Size of the new value (in bytes).
327
327
* @param[in] localOnly If this flag is false and the attribute handle
328
- * written is a characteristic value then the server sends an update
328
+ * written is a characteristic value, then the server sends an update
329
329
* containing the new value to the client identified by the parameter
330
330
* @p connectionHandle if it is subscribed to the characteristic's
331
- * notifications or indications. Otherwise the update does not generate a
331
+ * notifications or indications. Otherwise, the update does not generate a
332
332
* single server initiated event.
333
333
*
334
334
* @return BLE_ERROR_NONE if the attribute value has been successfully
@@ -359,7 +359,7 @@ class GattServer {
359
359
*
360
360
* @param[in] characteristic The characteristic.
361
361
* @param[out] enabledP Upon return, *enabledP is true if updates are
362
- * enabled for a connected client; otherwise *enabledP is false.
362
+ * enabled for a connected client; otherwise, *enabledP is false.
363
363
*
364
364
* @return BLE_ERROR_NONE if the connection and handle are found. False
365
365
* otherwise.
@@ -385,7 +385,7 @@ class GattServer {
385
385
* @param[in] characteristic The characteristic.
386
386
* @param[out] enabledP Upon return, *enabledP is true if the client
387
387
* identified by @p connectionHandle has subscribed to notifications or
388
- * indications of @p characteristic; otherwise *enabledP is false.
388
+ * indications of @p characteristic; otherwise, *enabledP is false.
389
389
*
390
390
* @return BLE_ERROR_NONE if the connection and handle are found. False
391
391
* otherwise.
@@ -443,7 +443,7 @@ class GattServer {
443
443
* Add an event handler that monitors emission of characteristic value
444
444
* updates.
445
445
*
446
- * @param[in] objPtr Pointer to the instance that will be used to invoke the
446
+ * @param[in] objPtr Pointer to the instance that is used to invoke the
447
447
* event handler.
448
448
* @param[in] memberPtr Event handler being registered. It is a member
449
449
* function.
@@ -465,8 +465,8 @@ class GattServer {
465
465
}
466
466
467
467
/* *
468
- * Set an event handler that will be called after an attribute has been
469
- * written by a connected peer.
468
+ * Set an event handler that is called after
469
+ * a connected peer has written an attribute .
470
470
*
471
471
* @param[in] callback The event handler being registered.
472
472
*
@@ -479,10 +479,10 @@ class GattServer {
479
479
}
480
480
481
481
/* *
482
- * Set an event handler that will be called after an attribute has been
483
- * written by a connected peer.
482
+ * Set an event handler that is called after
483
+ * a connected peer has written an attribute .
484
484
*
485
- * @param[in] objPtr Pointer to the instance that will be used to invoke the
485
+ * @param[in] objPtr Pointer to the instance that is used to invoke the
486
486
* event handler (@p memberPtr).
487
487
* @param[in] memberPtr Event handler being registered. It is a member
488
488
* function.
@@ -542,7 +542,7 @@ class GattServer {
542
542
/* *
543
543
* Set an event handler that monitors attribute reads from connected clients.
544
544
*
545
- * @param[in] objPtr Pointer to the instance that will be used to invoke the
545
+ * @param[in] objPtr Pointer to the instance that is used to invoke the
546
546
* event handler (@p memberPtr).
547
547
* @param[in] memberPtr Event handler being registered. It is a member
548
548
* function.
@@ -579,8 +579,8 @@ class GattServer {
579
579
/* *
580
580
* Set an event handler that monitors shutdown or reset of the GattServer.
581
581
*
582
- * The event handler will be invoked when the GattServer instance is about
583
- * to be shut down. This can result of a call to reset() or BLE::reset().
582
+ * The event handler is invoked when the GattServer instance is about
583
+ * to be shut down. This can result in a call to reset() or BLE::reset().
584
584
*
585
585
* @param[in] callback Event handler being registered.
586
586
*
@@ -597,10 +597,10 @@ class GattServer {
597
597
/* *
598
598
* Set an event handler that monitors shutdown or reset of the GattServer.
599
599
*
600
- * The event handler will be invoked when the GattServer instance is about
600
+ * The event handler is invoked when the GattServer instance is about
601
601
* to be shut down. This can result of a call to reset() or BLE::reset().
602
602
*
603
- * @param[in] objPtr Pointer to the instance that will be used to invoke the
603
+ * @param[in] objPtr Pointer to the instance that is used to invoke the
604
604
* event handler (@p memberPtr).
605
605
* @param[in] memberPtr Event handler being registered. It is a member
606
606
* function.
@@ -650,9 +650,9 @@ class GattServer {
650
650
}
651
651
652
652
/* *
653
- * Set up an event handler that monitors notification acknowledgement .
653
+ * Set up an event handler that monitors notification acknowledgment .
654
654
*
655
- * The event handler is called when a client send a confirmation that it has
655
+ * The event handler is called when a client sends a confirmation that it has
656
656
* correctly received a notification from the server.
657
657
*
658
658
* @param[in] callback Event handler being registered.
@@ -669,7 +669,7 @@ class GattServer {
669
669
* of a data written event.
670
670
*
671
671
* @important Vendor implementation must invoke this function after one of
672
- * the GattServer attribute has been written.
672
+ * the GattServer attributes has been written.
673
673
*
674
674
* @param[in] params The data written parameters passed to the registered
675
675
* handlers.
@@ -684,7 +684,7 @@ class GattServer {
684
684
* of a data read event.
685
685
*
686
686
* @important Vendor implementation must invoke this function after one of
687
- * the GattServer attribute has been read.
687
+ * the GattServer attributes has been read.
688
688
*
689
689
* @param[in] params The data read parameters passed to the registered
690
690
* handlers.
@@ -699,7 +699,7 @@ class GattServer {
699
699
* of updates enabled, updates disabled or confirmation received events.
700
700
*
701
701
* @important Vendor implementation must invoke this function when a client
702
- * subscribe to characteristic updates, unsubscribe from characteristic
702
+ * subscribes to characteristic updates, unsubscribes from characteristic
703
703
* updates or a notification confirmation has been received.
704
704
*
705
705
* @param[in] type The type of event that occurred.
@@ -750,7 +750,7 @@ class GattServer {
750
750
* Shut down the GattServer instance.
751
751
*
752
752
* This function notifies all event handlers listening for shutdown events
753
- * that the GattServer is about to be shut down; then it clear all
753
+ * that the GattServer is about to be shut down; then it clears all
754
754
* GattServer state.
755
755
*
756
756
* @note This function is meant to be overridden in the platform-specific
0 commit comments