Skip to content

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

Merged
merged 12 commits into from
Feb 19, 2019

Conversation

paul-szczepanek-arm
Copy link
Member

No description provided.

@pan-
Copy link
Member

pan- commented Feb 4, 2019

Corresponding PR in mbed-os: ARMmbed/mbed-os#9537 .

@@ -16,6 +16,14 @@ As a result of the discovery process, the client can start interacting with the

Mbed BLE abstracts read and write operations to offer a single API that can be used to read or write characteristic values. The application code does not have to handle the necessary fragmentation or reassembly process if the attribute value to be transported can't fit in a single data packet.

#### ATT_MTU

ATT_MTU is the maximum size of the attribute that can fit in an L2CAP packet. 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 will be fragmented over many such packets if required.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can improve the first sentence. What do you think of:
The GATT Maximum Transmission Unit (MTU) is the maximum size of a GATT packet exchanged between a client and a server. Then mention L2CAP as a protocol that allows segmentation and reassembly, ...


ATT_MTU is the maximum size of the attribute that can fit in an L2CAP packet. 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 will be fragmented over many such packets if required.

Only `GattClient` can trigger the exchange of ATT_MTU between client and server. The host may trigger the exchange which may also be requested manually using `negotiateAttMtu`. If an exchange happens the biggest value possible across both devices will be used. Negotiation is only a best effort process and does not guarantee a higher value being set.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be interesting to detail the negotiation behaviour and clarify the term host.

@paul-szczepanek-arm
Copy link
Member Author

thanks for the comments, hopefully I have integrated them to your satisfaction

Copy link
Member

@pan- pan- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the change. It looks good.

Rearrange content for flow, and edit mostly for precise language and international spelling.

In addition to modulation schemes, MTU (Maximum Transmission Unit) size also strongly affects throughput. Newer controllers will allow you to negotiate bigger MTUs. Since each packet contains overhead bigger packets maximise throughput.
In addition to modulation schemes, Maximum Transmission Unit (MTU) size also strongly affects throughput. Newer controllers allow you to negotiate bigger MTUs. Because each packet contains overhead, bigger packets maximize throughput.
Copy link
Member Author

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.

Copy link
Contributor

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.

Copy link
Member

@pan- pan- Feb 5, 2019

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 ?

Copy link
Contributor

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 :)

Amanda Butler added 2 commits February 5, 2019 15:19
Make minor edits, mostly for active voice.
Edit file, mostly for active voice.
@@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The 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?

Copy link
Member Author

Choose a reason for hiding this comment

The 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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The link to GattClient is "../apis/gattclient.html"

@paul-szczepanek-arm
Copy link
Member Author

Code this documents has been merged

@AnotherButler
Copy link
Contributor

To clarify, this should only go into 5.12, right? Not 5.11?

@paul-szczepanek-arm
Copy link
Member Author

paul-szczepanek-arm commented Feb 19, 2019

yes, corresponding PR merged into master for 5.12

Add one sentence of context in link to GattClient.md.
Copy link
Contributor

@AnotherButler AnotherButler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the great work on this 👍

@AnotherButler AnotherButler merged commit ae53ff0 into ARMmbed:development Feb 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants