You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/api/connectivity/bluetooth/GattServer.md
+10-10Lines changed: 10 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -4,26 +4,26 @@ A GattServer is a collection of GattServices. These services contain characteris
4
4
5
5
#### Server layout
6
6
7
-
Application code can add a GattService object to the server with the help of the function `addService()`. That function registers all the GattCharacteristics enclosed in the service, as well as all the characteristic descriptors (see GattAttribute) that these characteristics contain. Service registration assigns a unique handle to the various attributes that are part of the service, and this handle should be used to subsequently read or write these components.
7
+
Application code can add a GattService object to the server with the help of the function `addService()`. That function registers all the GattCharacteristics enclosed in the service, as well as all the characteristic descriptors (see GattAttribute) that these characteristics contain. Service registration assigns a unique handle to the various attributes that are part of the service. The user must use this handle to read or write these components.
8
8
9
9
There are no defined primitives that remove a single service; however, a call to the function `reset()` removes all services previously registered in the GattServer.
10
10
11
11
#### Characteristic and attributes access
12
12
13
-
Values of the characteristic and the characteristic descriptor present in the GattServer must be accessed through the handle assigned to them when the service has been registered. The GattServer class offers several flavours of `read()` and `write()` functions that retrieve or mutate an attribute value.
13
+
You must access values of the characteristic and the characteristic descriptor present in the GattServer through the handle assigned to them when you registered the service. The GattServer class offers several types of `read()` and `write()` functions that retrieve or mutate an attribute value.
14
14
15
-
If a client has subscribed to a given characteristic's value update, then the application code can query by invoking the function `areUpdatesEnabled()`.
15
+
You can query the server by invoking the function `areUpdatesEnabled()` to find out if a client has subscribed to a given characteristic's value update.
16
16
17
17
#### Events
18
18
19
-
The GattServer allows application code to register several event handlers that can be used to monitor client and server activities:
19
+
You can register several event handlers with the GattServer that will be used to notify you of client (remote application connected to the server) and server activities:
20
20
21
-
-`onDataSent`: Register an event handler that is called when a characteristic value update has been sent to a client.
22
-
-`onDataWriten`: Register an event handler that is called when a client has written an attribute of the server.
23
-
-`onDataRead`: Register an event handler that is called when a client has read an attribute of the server.
24
-
-`onUpdatesEnabled`: Register an event handler that is called when a client subscribes to updates for a characteristic.
25
-
-`onUpdatesDisabled`: Register an event handler that is called when a client unsubscribes from updates for a characteristic.
26
-
-`onConfimationReceived`: Register an event handler that is called when a client acknowledges a characteristic value notification.
21
+
-`onDataSent`: Register an event handler with the GattServer that will be called by it when it sends a characteristic value update to a client.
22
+
-`onDataWriten`: Register an event handler with the GattServer that will be called by it when a client has written an attribute of the server.
23
+
-`onDataRead`: Register an event handler with the GattServer that will be called by it when a client has read an attribute of the server.
24
+
-`onUpdatesEnabled`: Register an event handler with the GattServer that will be called by it when a client subscribes to updates for a characteristic.
25
+
-`onUpdatesDisabled`: Register an event handler with the GattServer that will be called by it when a client unsubscribes from updates for a characteristic.
26
+
-`onConfimationReceived`: Register an event handler with the GattServer that will be called by it when a client acknowledges a characteristic value notification.
27
27
28
28
The term characteristic value update represents Characteristic Value Notification and Characteristic Value Indication when the nature of the server initiated is not relevant.
0 commit comments