-
Notifications
You must be signed in to change notification settings - Fork 178
BLE: Add ATT_MTU and Data Length docs #937
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
11bcb20
184ca7d
3288074
6a551b7
a3e9ae1
b4fd1fb
3b2d5a0
6ec7367
5e84262
a297fe7
ec646b8
c4f6254
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
## GattServer | ||
|
||
A GattServer is a collection of GattServices. These services contain characteristics that a peer connected to the device may read or write. These characteristics may also emit updates to subscribed clients when their values change. | ||
Generic Attribute Profile (GATT) is used to discover services, characteristics and descriptors and to perform operations on them. The interaction happens between two peers, one of which is the client (who initiates interactions) and the other the server (which responds). Attribute Protocol (ATT) is used to implement this interaction. | ||
|
||
'GattServer' is a collection of GattServices. These services contain characteristics that a `GattClient` on the peer connected to the device may read or write. These characteristics may also emit updates to subscribed clients when their values change. | ||
|
||
#### Server layout | ||
|
||
|
@@ -14,6 +16,16 @@ You must access values of the characteristic and the characteristic descriptor p | |
|
||
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. | ||
|
||
#### Attribute Protocol Maximum Transmission Unit (ATT_MTU) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because this section is an exact duplicate, can we instead replace it with a link to the relevant section in GattClient.md? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK. The client version is the fuller one as this one shortens the paragraph about what the client does. How do I link? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The link to GattClient is "../apis/gattclient.html" |
||
|
||
ATT_MTU is the maximum size of the attribute protocol packet. Operation on attributes too large to fit into a single packet will be split across multiple operations. | ||
|
||
This is independent of the Data Length which controls the over-the-air packet payload size (which is dealt with in the GAP). An L2CAP packet containing the attribute protocol packet will be fragmented over many such packets if required. | ||
|
||
Only `GattClient` can trigger the exchange of ATT_MTU between client and server. If an exchange happens the biggest value possible across both devices will be used. | ||
|
||
ATT_MTU is at least 23 octets by default. If a larger size is negotiated the user application will be informed through the `onAttMtuChange` function called in the `GattServer::EventHandler` (`GattClient::EventHandler` will also be informed). | ||
|
||
#### Events | ||
|
||
You can register several event handlers with the GattServer that it will call to notify you of client (remote application connected to the server) and server activities: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is Because superior to Since in this case? Maybe I can try to choose the right one in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great question. "Since" shows time passed (for example, "We've been open since 1952"). "Because" shows cause and effect.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not trying to open a debate here (you know better than us @AnotherButler) but there is other usages of since (see https://dictionary.cambridge.org/us/grammar/british-grammar/as-because-or-since). Should we avoid these forms in our documentation ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do. We try to be consistent in our documentation, and our internal style guide states "Because implies causality; since implies the passing of time. Examples: The program ran because I did it right. Arm has been in business since the 1990s." and "But also note that using "as" when you mean "because" can confuse non-native speakers, so it's best to avoid it." Please don't hesitate to look up words in our style guide if you ever have questions. We can add to it if anything's missing.
We're also happy to answer questions like this one :)