Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This resolves #33.
This pull request has two changes:
timer.start()
in the BLE thread loop. Without this,timer.read_high_resolution_us()
always returns 0.Note: the issue is also present in the mbed sample code the HCI transport was based on: https://github.com/ARMmbed/mbed-os-cordio-hci-passthrough/blob/fix-wsf-msg/main.cpp#L86 (@facchinm should we inform them?)
WSF_MS_PER_TICK
needs to match the value mbed was compiled with for the supervision timeout to match: https://github.com/ARMmbed/mbed-os/blob/19e762298f9a020606f7358539bb653be0de8e4f/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_conn.c#L1168-L1174@facchinm I think we should measure the power consumption again. Then re-compile mbed if we need to adjust the value.
It's currently set to 1 ms:
however, the default appears to 10 ms: https://github.com/arduino/ArduinoCore-nRF528x-mbedos/blob/beac74ca3cd9d07363f66cf9cda6b143e4385cd2/cores/arduino/mbed/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/wsf_timer.h#L40