-
Notifications
You must be signed in to change notification settings - Fork 7
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
Yann/feature/ble/allow larger packet reception #1356
Yann/feature/ble/allow larger packet reception #1356
Conversation
🔖 Version comparison
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #1356 +/- ##
========================================
Coverage 98.70% 98.70%
========================================
Files 146 146
Lines 3795 3795
========================================
Hits 3746 3746
Misses 49 49 ☔ View full report in Codecov by Sentry. |
📈 Changes Impact Analysis Report📌 Info
🤖 Firmware impact analysis
Click to show memory sections
🔬 Detailed impact analysisClick to show detailed analysis for all targets
🗺️ Map files diff outputNo differenes where found in map files. |
7805280
to
c3856b9
Compare
📈 Changes Impact Analysis Report📌 Info
🤖 Firmware impact analysis
Click to show memory sections
🔬 Detailed impact analysisClick to show detailed analysis for all targets
🗺️ Map files diff outputNo differenes where found in map files. |
c3856b9
to
4610e3b
Compare
8794b46
to
1640964
Compare
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
9066aab
to
fbc72d7
Compare
Quality Gate passedIssues Measures |
fbc72d7
to
5ca6fdf
Compare
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.
I need better understanding of the values chosen, why the default ones where not good, the issues encountered and how you came up with the new values.
the explanations and details must be added to the commit messages.
@@ -15,6 +15,7 @@ | |||
"bluenrg_ms.SPI_nCS": "BLE_SPI_NSS", | |||
"bluenrg_ms.SPI_SCK": "BLE_SPI_SCK", | |||
"cordio.desired-att-mtu": 251, | |||
"cordio.max-prepared-writes": 1, |
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.
@YannLocatelli can you explain why the default value of 4
was not working and why the value of 1
is better?
my understanding is that a lower value might impact the efficiency of operations requiring multiple attribute writes.
is 1
used to avoid more than one thing happening at once? and to make sure each command are processed one at a time?
can you explain the issue you were encountering?
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.
I talked about it few months ago, with value of 4 it works but we have to handle it differently.
You receive 4 packets at the same time in the robot and since you write directly in the file the data you received, you have to handle writing + ordering at the same time
I tried some solutions but never succeed, if you have any idea, let me know.
config/mbed_app.json
Outdated
@@ -15,6 +15,7 @@ | |||
"bluenrg_ms.SPI_nCS": "BLE_SPI_NSS", | |||
"bluenrg_ms.SPI_SCK": "BLE_SPI_SCK", | |||
"cordio.desired-att-mtu": 251, | |||
"cordio.rx-acl-buffer-size": 189, |
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.
same here, it's not clear to me why the default value 70
was not working and why the value 189
is the one chosen.
my understanding (but I might be wrong) is that the value must be bigger than the desired-att-mtu
size.
what would happen with a value of 256
?
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.
Never said it does not work
It is a size for a "packet" and it was downed to 189 to fit with iPad max buffer size (modulo some header or wrapper related to BLE protocol probably)
As you suggest with ChatGPT, value of 259 works
5ca6fdf
to
73cd435
Compare
This setting determines how many prepare write requests can be queued before they are executed. Each prepare write request can contain a segment of the data to be written to an attribute. When cordio.max-prepared-writes is set to 1, it means your system can only hold one prepare write request at a time. This setting minimizes memory usage but can slow down the process if the device needs to wait for each segment to be confirmed before sending the next. Default value is 4 With the default value, we were often receiving 4 packets at the same time. For DFU, this meant adding more logic to handle the 4 packets correctly which we deemed too much work for now. Setting the value to 1 prevents mutliple packets from being received at once and breaking the DFU process.
This parameter configures the size of the buffer used for receiving ACL (Asynchronous Connection-Less) data packets. The size of this buffer should be large enough to accommodate the largest expected incoming data payload. Default is 70 In our case we wanted the maximum size of 251 bytes for the MTU. Here’s how to calculate an appropriate ACL buffer size: MTU Consideration: The ATT MTU size of 251 bytes means that the maximum size of data that can be sent in one ATT packet is 251 bytes. L2CAP Header: The L2CAP protocol uses a 4-byte header on each packet. HCI Header: When data is transmitted over the HCI interface, there is also an HCI header involved, typically adding an additional 4 bytes (for ACL-U packets). Given these, the total size for each ACL packet when transmitting maximum sized ATT packets would be: Total ACL packet size = ATT MTU + L2CAP Header + HCI Header So in our case: Total ACL packet size = 251 bytes (ATT MTU) + 4 bytes (L2CAP Header) + 4 bytes (HCI Header) = 259
73cd435
to
afdc6b2
Compare
Quality Gate passedIssues Measures |
Requirements