Skip to content

BLE: Fix writing attributes larger than MTU size #13449

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 9 commits into from
Aug 21, 2020

Conversation

paul-szczepanek-arm
Copy link
Member

Summary of changes

Attribute writes for attributes longer than MTU are broken because prepare write flow is broken at multiple stages. This fixes all the bugs. I have added a test to cover this and test run result is below.

Impact of changes

Migration actions required

Documentation

none


Pull request type

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[x] Tests / results supplied as part of this PR

Reviewers


@paul-szczepanek-arm
Copy link
Member Author

paul-szczepanek-arm commented Aug 18, 2020

test_characteristic_read_write.py::test_write_characteristic_over_mtu[60] 
------------------------------ live log teardown -------------------------------
10:22:52.494   INFO   -->|peripheral| ble shutdown
10:22:52.500   INFO   <--|peripheral| {"status": 0}
10:22:52.500   INFO   <--|peripheral| retcode: 0
10:22:52.501   INFO   -->|peripheral| echo on
10:22:52.505   INFO   <--|peripheral| ECHO is on
10:22:52.506   INFO   <--|peripheral| retcode: 0
10:22:52.506   INFO   -->|peripheral| set --vt100 on
10:22:52.509   INFO   <--|peripheral| 
10:22:52.510   INFO   <--|peripheral| retcode: 0
10:22:52.511   INFO   Stopping "peripheral" runner...
10:22:52.511   INFO   -->|peripheral| set retcode false
10:22:52.545   INFO   <--|peripheral| />set retcode false
10:22:52.606   INFO   -->|central| ble shutdown
10:22:52.610   INFO   <--|central| {"status": 0}
10:22:52.612   INFO   <--|central| retcode: 0
10:22:52.612   INFO   -->|central| echo on
10:22:52.615   INFO   <--|central| ECHO is on
10:22:52.616   INFO   <--|central| retcode: 0
10:22:52.617   INFO   -->|central| set --vt100 on
10:22:52.620   INFO   <--|central| 
10:22:52.621   INFO   <--|central| retcode: 0
10:22:52.621   INFO   Stopping "central" runner...
10:22:52.622   INFO   -->|central| set retcode false
10:22:52.655   INFO   <--|central| />set retcode false

test_characteristic_read_write.py::test_write_characteristic_over_mtu[200] 
------------------------------ live log teardown -------------------------------
10:22:57.439   INFO   -->|peripheral| ble shutdown
10:22:57.445   INFO   <--|peripheral| {"status": 0}
10:22:57.446   INFO   <--|peripheral| retcode: 0
10:22:57.446   INFO   -->|peripheral| echo on
10:22:57.450   INFO   <--|peripheral| ECHO is on
10:22:57.451   INFO   <--|peripheral| retcode: 0
10:22:57.451   INFO   -->|peripheral| set --vt100 on
10:22:57.455   INFO   <--|peripheral| 
10:22:57.457   INFO   <--|peripheral| retcode: 0
10:22:57.457   INFO   Stopping "peripheral" runner...
10:22:57.457   INFO   -->|peripheral| set retcode false
10:22:57.492   INFO   <--|peripheral| />set retcode false
10:22:57.561   INFO   -->|central| ble shutdown
10:22:57.566   INFO   <--|central| {"status": 0}
10:22:57.567   INFO   <--|central| retcode: 0
10:22:57.567   INFO   -->|central| echo on
10:22:57.571   INFO   <--|central| ECHO is on
10:22:57.572   INFO   <--|central| retcode: 0
10:22:57.572   INFO   -->|central| set --vt100 on
10:22:57.577   INFO   <--|central| 
10:22:57.578   INFO   <--|central| retcode: 0
10:22:57.578   INFO   Stopping "central" runner...
10:22:57.578   INFO   -->|central| set retcode false
10:22:57.612   INFO   <--|central| />set retcode false


============================== 2 passed in 9.41s ===============================

Process finished with exit code 0

-------------------------------- live log setup --------------------------------
10:22:48.297   INFO   Starting runner threads for "central"
10:22:48.818   INFO   <--|central| ARM Ltd
10:22:49.409   INFO   -->|central| set --retcode true
10:22:49.446   INFO   <--|central| />set --retcode true
10:22:49.448   INFO   <--|central| retcode: 0
10:22:49.448   INFO   -->|central| echo off
10:22:49.464   INFO   <--|central| />echo off
10:22:49.464   INFO   <--|central| ECHO is off
10:22:49.464   INFO   <--|central| retcode: 0
10:22:49.465   INFO   -->|central| set --vt100 off
10:22:49.468   INFO   <--|central| retcode: 0
10:22:49.469   INFO   -->|central| ble init
10:22:49.487   INFO   <--|central| {"status": 0}
10:22:49.487   INFO   <--|central| retcode: 0
10:22:49.489   INFO   Starting runner threads for "peripheral"
10:22:50.005   INFO   <--|peripheral| ARM Ltd
10:22:50.603   INFO   -->|peripheral| set --retcode true
10:22:50.639   INFO   <--|peripheral| />set --retcode true
10:22:50.641   INFO   <--|peripheral| retcode: 0
10:22:50.641   INFO   -->|peripheral| echo off
10:22:50.654   INFO   <--|peripheral| />echo off
10:22:50.656   INFO   <--|peripheral| ECHO is off
10:22:50.657   INFO   <--|peripheral| retcode: 0
10:22:50.657   INFO   -->|peripheral| set --vt100 off
10:22:50.662   INFO   <--|peripheral| retcode: 0
10:22:50.662   INFO   -->|peripheral| ble init
10:22:50.680   INFO   <--|peripheral| {"status": 0}
10:22:50.681   INFO   <--|peripheral| retcode: 0
-------------------------------- live log call ---------------------------------
10:22:50.682   INFO   -->|peripheral| gattServer declareService 65531
10:22:50.689   INFO   <--|peripheral| {"status": 0}
10:22:50.690   INFO   <--|peripheral| retcode: 0
10:22:50.691   INFO   -->|peripheral| gattServer declareCharacteristic 57007
10:22:50.698   INFO   <--|peripheral| {"status": 0}
10:22:50.699   INFO   <--|peripheral| retcode: 0
10:22:50.699   INFO   -->|peripheral| gattServer setCharacteristicProperties read write
10:22:50.707   INFO   <--|peripheral| {"status": 0}
10:22:50.708   INFO   <--|peripheral| retcode: 0
10:22:50.709   INFO   -->|peripheral| gattServer setCharacteristicValue AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
10:22:50.728   INFO   <--|peripheral| {"status": 0}
10:22:50.729   INFO   <--|peripheral| retcode: 0
10:22:50.729   INFO   -->|peripheral| gattServer setCharacteristicVariableLength false
10:22:50.737   INFO   <--|peripheral| {"status": 0}
10:22:50.738   INFO   <--|peripheral| retcode: 0
10:22:50.739   INFO   -->|peripheral| gattServer commitService
10:22:50.774   INFO   <--|peripheral| {"status": 0,"result": {"UUID": 65531,"handle": 11,"characteristics": [{"UUID": 57007,"value_handle": 13,"properties": ["read","write"],"length": 60,"max_length": 60,"has_variable_length": false,"value": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","descriptors": []}]}}
10:22:50.775   INFO   <--|peripheral| retcode: 0
10:22:50.775   INFO   -->|peripheral| advDataBuilder clear
10:22:50.780   INFO   <--|peripheral| {"status": 0}
10:22:50.781   INFO   <--|peripheral| retcode: 0
10:22:50.782   INFO   -->|peripheral| advDataBuilder setFlags LE_GENERAL_DISCOVERABLE
10:22:50.789   INFO   <--|peripheral| {"status": 0}
10:22:50.790   INFO   <--|peripheral| retcode: 0
10:22:50.790   INFO   -->|peripheral| advDataBuilder setFlags BREDR_NOT_SUPPORTED
10:22:50.798   INFO   <--|peripheral| {"status": 0}
10:22:50.799   INFO   <--|peripheral| retcode: 0
10:22:50.799   INFO   -->|peripheral| gap applyAdvPayloadFromBuilder 0
10:22:50.806   INFO   <--|peripheral| {"status": 0}
10:22:50.807   INFO   <--|peripheral| retcode: 0
10:22:50.807   INFO   -->|peripheral| advParams setType CONNECTABLE_UNDIRECTED
10:22:50.814   INFO   <--|peripheral| {"status": 0}
10:22:50.815   INFO   <--|peripheral| retcode: 0
10:22:50.815   INFO   -->|peripheral| gap setAdvertisingParameters 0
10:22:50.821   INFO   <--|peripheral| {"status": 0}
10:22:50.822   INFO   <--|peripheral| retcode: 0
10:22:50.823   INFO   -->|peripheral| gap getAddress
10:22:50.834   INFO   <--|peripheral| {"status": 0,"result": {"address_type": "RANDOM","address": "D8:E2:FB:7F:0A:A8"}}
10:22:50.835   INFO   <--|peripheral| retcode: 0
10:22:50.835   INFO   -->|peripheral| gap startAdvertising 0 0 0
10:22:50.842   INFO   <--|peripheral| {"status": 0}
10:22:50.843   INFO   <--|peripheral| retcode: 0
10:22:50.846   INFO   -->|central| gap connect RANDOM D8:E2:FB:7F:0A:A8
10:22:50.846   INFO   -->|peripheral| gap waitForConnection 10000
10:22:51.509   INFO   <--|central| {"status": 0,"result": {"status": "BLE_ERROR_NONE","peer_address_type": "RANDOM","peer_address": "D8:E2:FB:7F:0A:A8","interval": 56,"latency": 0,"supervision_timeout": 100,"connection_handle": 1,"own_role": "CENTRAL","master_clock_accuracy": 0}}
10:22:51.510   INFO   <--|peripheral| {"status": 0,"result": {"status": "BLE_ERROR_NONE","peer_address_type": "RANDOM","peer_address": "D3:A6:95:6A:3B:56","interval": 56,"latency": 0,"supervision_timeout": 100,"connection_handle": 1,"own_role": "PERIPHERAL","master_clock_accuracy": 0}}
10:22:51.511   INFO   <--|central| retcode: 0
10:22:51.511   INFO   <--|peripheral| retcode: 0
10:22:51.524   INFO   <--|peripheral| <<< {"type": "event","name": "advertising_end","value": {"advertising_handle": 0,"completed_events": 0,"is_connected": true,"connection_handle": 0}}
10:22:51.612   INFO   -->|central| gattClient write 1 13 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
10:22:52.341   INFO   <--|central| {"status": 0,"result": {"connection_handle": 1,"attribute_handle": 13,"offset": 0,"length": 0,"write_operation_type": "OP_WRITE_REQ","data": ""}}
10:22:52.342   INFO   <--|central| retcode: 0
10:22:52.343   INFO   -->|central| gattClient readCharacteristicValue 1 13
10:22:52.491   INFO   <--|central| {"status": 0,"result": {"connection_handle": 1,"attribute_handle": 13,"offset": 0,"status": "BLE_ERROR_NONE","length": 60,"data": "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"}}
10:22:52.493   INFO   <--|central| retcode: 0
PASSED                                                                   [ 50%]
-------------------------------- live log setup --------------------------------
10:22:52.720   INFO   Starting runner threads for "central"
10:22:53.232   INFO   <--|central| ARM Ltd
10:22:53.839   INFO   -->|central| set --retcode true
10:22:53.875   INFO   <--|central| />set --retcode true
10:22:53.877   INFO   <--|central| retcode: 0
10:22:53.877   INFO   -->|central| echo off
10:22:53.891   INFO   <--|central| />echo off
10:22:53.893   INFO   <--|central| ECHO is off
10:22:53.894   INFO   <--|central| retcode: 0
10:22:53.894   INFO   -->|central| set --vt100 off
10:22:53.899   INFO   <--|central| retcode: 0
10:22:53.900   INFO   -->|central| ble init
10:22:53.917   INFO   <--|central| {"status": 0}
10:22:53.918   INFO   <--|central| retcode: 0
10:22:53.920   INFO   Starting runner threads for "peripheral"
10:22:54.423   INFO   <--|peripheral| ARM Ltd
10:22:55.033   INFO   -->|peripheral| set --retcode true
10:22:55.070   INFO   <--|peripheral| />set --retcode true
10:22:55.072   INFO   <--|peripheral| retcode: 0
10:22:55.072   INFO   -->|peripheral| echo off
10:22:55.085   INFO   <--|peripheral| />echo off
10:22:55.087   INFO   <--|peripheral| ECHO is off
10:22:55.088   INFO   <--|peripheral| retcode: 0
10:22:55.088   INFO   -->|peripheral| set --vt100 off
10:22:55.092   INFO   <--|peripheral| retcode: 0
10:22:55.092   INFO   -->|peripheral| ble init
10:22:55.110   INFO   <--|peripheral| {"status": 0}
10:22:55.111   INFO   <--|peripheral| retcode: 0
-------------------------------- live log call ---------------------------------
10:22:55.112   INFO   -->|peripheral| gattServer declareService 65531
10:22:55.118   INFO   <--|peripheral| {"status": 0}
10:22:55.119   INFO   <--|peripheral| retcode: 0
10:22:55.119   INFO   -->|peripheral| gattServer declareCharacteristic 57007
10:22:55.126   INFO   <--|peripheral| {"status": 0}
10:22:55.126   INFO   <--|peripheral| retcode: 0
10:22:55.127   INFO   -->|peripheral| gattServer setCharacteristicProperties read write
10:22:55.135   INFO   <--|peripheral| {"status": 0}
10:22:55.136   INFO   <--|peripheral| retcode: 0
10:22:55.137   INFO   -->|peripheral| gattServer setCharacteristicValue AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
10:22:55.184   INFO   <--|peripheral| {"status": 0}
10:22:55.185   INFO   <--|peripheral| retcode: 0
10:22:55.186   INFO   -->|peripheral| gattServer setCharacteristicVariableLength false
10:22:55.193   INFO   <--|peripheral| {"status": 0}
10:22:55.194   INFO   <--|peripheral| retcode: 0
10:22:55.195   INFO   -->|peripheral| gattServer commitService
10:22:55.254   INFO   <--|peripheral| {"status": 0,"result": {"UUID": 65531,"handle": 11,"characteristics": [{"UUID": 57007,"value_handle": 13,"properties": ["read","write"],"length": 200,"max_length": 200,"has_variable_length": false,"value": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","descriptors": []}]}}
10:22:55.255   INFO   <--|peripheral| retcode: 0
10:22:55.256   INFO   -->|peripheral| advDataBuilder clear
10:22:55.261   INFO   <--|peripheral| {"status": 0}
10:22:55.262   INFO   <--|peripheral| retcode: 0
10:22:55.263   INFO   -->|peripheral| advDataBuilder setFlags LE_GENERAL_DISCOVERABLE
10:22:55.271   INFO   <--|peripheral| {"status": 0}
10:22:55.272   INFO   <--|peripheral| retcode: 0
10:22:55.273   INFO   -->|peripheral| advDataBuilder setFlags BREDR_NOT_SUPPORTED
10:22:55.280   INFO   <--|peripheral| {"status": 0}
10:22:55.281   INFO   <--|peripheral| retcode: 0
10:22:55.281   INFO   -->|peripheral| gap applyAdvPayloadFromBuilder 0
10:22:55.288   INFO   <--|peripheral| {"status": 0}
10:22:55.289   INFO   <--|peripheral| retcode: 0
10:22:55.289   INFO   -->|peripheral| advParams setType CONNECTABLE_UNDIRECTED
10:22:55.298   INFO   <--|peripheral| {"status": 0}
10:22:55.299   INFO   <--|peripheral| retcode: 0
10:22:55.299   INFO   -->|peripheral| gap setAdvertisingParameters 0
10:22:55.314   INFO   <--|peripheral| {"status": 0}
10:22:55.322   INFO   <--|peripheral| retcode: 0
10:22:55.323   INFO   -->|peripheral| gap getAddress
10:22:55.332   INFO   <--|peripheral| {"status": 0,"result": {"address_type": "RANDOM","address": "D8:E2:FB:7F:0A:A8"}}
10:22:55.333   INFO   <--|peripheral| retcode: 0
10:22:55.334   INFO   -->|peripheral| gap startAdvertising 0 0 0
10:22:55.342   INFO   <--|peripheral| {"status": 0}
10:22:55.342   INFO   <--|peripheral| retcode: 0
10:22:55.343   INFO   -->|peripheral| gap waitForConnection 10000
10:22:55.343   INFO   -->|central| gap connect RANDOM D8:E2:FB:7F:0A:A8
10:22:56.010   INFO   <--|central| {"status": 0,"result": {"status": "BLE_ERROR_NONE","peer_address_type": "RANDOM","peer_address": "D8:E2:FB:7F:0A:A8","interval": 56,"latency": 0,"supervision_timeout": 100,"connection_handle": 1,"own_role": "CENTRAL","master_clock_accuracy": 0}}
10:22:56.012   INFO   <--|peripheral| {"status": 0,"result": {"status": "BLE_ERROR_NONE","peer_address_type": "RANDOM","peer_address": "D3:A6:95:6A:3B:56","interval": 56,"latency": 0,"supervision_timeout": 100,"connection_handle": 1,"own_role": "PERIPHERAL","master_clock_accuracy": 0}}
10:22:56.012   INFO   <--|central| retcode: 0
10:22:56.012   INFO   <--|peripheral| retcode: 0
10:22:56.025   INFO   <--|peripheral| <<< {"type": "event","name": "advertising_end","value": {"advertising_handle": 0,"completed_events": 0,"is_connected": true,"connection_handle": 0}}
10:22:56.114   INFO   -->|central| gattClient write 1 13 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
10:22:56.842   INFO   <--|central| {"status": 0,"result": {"connection_handle": 1,"attribute_handle": 13,"offset": 0,"length": 0,"write_operation_type": "OP_WRITE_REQ","data": ""}}
10:22:56.844   INFO   <--|central| retcode: 0
10:22:56.844   INFO   -->|central| gattClient readCharacteristicValue 1 13
10:22:57.437   INFO   <--|central| {"status": 0,"result": {"connection_handle": 1,"attribute_handle": 13,"offset": 0,"status": "BLE_ERROR_NONE","length": 200,"data": "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"}}
10:22:57.438   INFO   <--|central| retcode: 0
PASSED                                                                   [100%]

@ciarmcom ciarmcom added the release-type: patch Indentifies a PR as containing just a patch label Aug 18, 2020
@ciarmcom ciarmcom requested a review from a team August 18, 2020 09:30
@ciarmcom
Copy link
Member

@paul-szczepanek-arm, thank you for your changes.
@ARMmbed/mbed-os-maintainers please review.

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 PR @paul-szczepanek-arm it looks good. I left few comments.

if (write_happened) {
WsfTaskLock();

memcpy((pAttr->pValue + offset), pValue, len);
Copy link
Member

Choose a reason for hiding this comment

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

Out of curiosity, I see no memcpy in the diff what was writing to memory before ?
Wouldn't it make sense to memcpy after the authorization code ?

Copy link
Member Author

Choose a reason for hiding this comment

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

in the diff it was inside:

AttsSetAttr(handle, len, pValue)

Copy link
Member Author

Choose a reason for hiding this comment

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

but good catch, that's bug number 5 in the over mtu flow

uint16_t attribute_handle,
uint8_t* data,
uint16_t write_length,
uint16_t chunk_size
Copy link
Member

Choose a reason for hiding this comment

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

Do we beed to expose this parameter ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't understand your question

Copy link
Member

Choose a reason for hiding this comment

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

chunk_size, does it has to be exposed in the constructor ?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, I need to know how big the elements being sent are

Copy link
Member Author

Choose a reason for hiding this comment

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

It sends prep writes at this size, and when it gets to through all data it sends exec write, I need to know the chunk size so I know when I'm done

Copy link
Member Author

Choose a reason for hiding this comment

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

In my defence, mtu was already queried before the call, ready and available so I passed it in instead of querying it again inside.

Copy link
Member

Choose a reason for hiding this comment

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

That would clarify the API. I was confused at first by what was expected for this parameter.

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, I changed it to an even better combination, now it uses the reported length from the packet since that is now correct

Copy link
Member

Choose a reason for hiding this comment

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

I believe you forgot to push that commit. Everything looks good besides this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I did push but didn't notice the error: Authentication failed.

@paul-szczepanek-arm
Copy link
Member Author

paul-szczepanek-arm commented Aug 19, 2020

I have rerun the tests to verify and it still works, log is the same so I'm not posting it

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.

LGTM

@mergify mergify bot added needs: CI and removed needs: review labels Aug 21, 2020
@0xc0170
Copy link
Contributor

0xc0170 commented Aug 21, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Aug 21, 2020

Jenkins CI Test : ✔️ SUCCESS

Build Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_build-ARM ✔️
jenkins-ci/mbed-os-ci_build-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️
jenkins-ci/mbed-os-ci_dynamic-memory-usage ✔️
jenkins-ci/mbed-os-ci_cloud-client-pytest ✔️

@mbedmain mbedmain removed release-type: patch Indentifies a PR as containing just a patch Release-pending labels Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants