-
Notifications
You must be signed in to change notification settings - Fork 3k
Ble extended advertising fixes #8998
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
Conversation
While good this change breaks some old application that were adding GATT services before the initialisation of BLE. This patch revert temporarily this change for now
Previously, we were passing the event_properties as defined by the Bluetooth spec which is not what DmAdvConfig expect as the advertising type passed to DmAdvConfig is Cordio tailored (and incomplete).
@ARMmbed/mbed-os-maintainers Fix for ARMmbed/mbed-os-example-ble#200 will be included in that branch. |
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.
LGTM, just a couple of questions.
@@ -63,7 +63,7 @@ struct AdvertisingReportEvent { | |||
advertising_sid_t SID, | |||
advertising_power_t txPower, | |||
rssi_t rssi, | |||
periodic_interval_t periodicInterval, | |||
uint16_t periodicInterval, |
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.
Odd. Why not replace/update the constructor instead?
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.
As you can see, that constructor is not part of the documentation because it is not meant to be used by user code. We cannot use friend
in this case because friend
cannot be inherited and we don't know the vendor file that will use it. There is no reason for us to keep non usable constructor if it is not part of the public API.
To give a bit more context, the periodic interval returned in an advertising event can be equal to 0 if there is no periodic interval or a value comprised between [0x0006 : 0xFFFF]. The type periodic_interval_t
is not able to represent the absence of value as it normalizes values passed in input.
DmScanStart( | ||
scanning_phys.value(), | ||
DM_DISC_MODE_NONE, | ||
extended_scan_type, | ||
filter_duplicates.value(), // TODO: cordio API incomplete ??? | ||
filter_duplicates.value(), |
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.
Any more TODOs to update? 😜
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'm not sure why I removed it, the comment still stands 😆 . These TODO's and FIXME are important in our implementations and internal files when we work with APIs that do not implement all Bluetooth requirements or when we deliver subsets of BT features.
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.
Looks good to me!
{ | ||
pMsg->hdr.event = DM_ADV_PER_MSG_API_SET_DATA; | ||
pMsg->advHandle = advHandle; | ||
pMsg->op = op; | ||
pMsg->len = len; | ||
pMsg->pData = pData; | ||
memcpy(pMsg->pData, pData, len); |
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.
Let's make sure we upstream this
@cmonr are you happy with Vincent's responses ? We should get this into ci anyway I think |
The number of advertising sets supported is the minimum of advertising sets supported beween the host and the controller.
CI started |
CI stopped again awaiting Vincent's last fixes |
Test run: FAILEDSummary: 6 of 7 test jobs failed Failed test jobs:
|
@donatieng could you please re-review |
@adbridge There's an issue with the libs generated, they will be re generated shortly. |
@pan- Ping @ARMmbed/mbed-os-maintainers when this is ready for CI again. |
CI started |
CI aborted, will wait for @ARMmbed/mbed-os-pan to confirm this is ready for CI (noticed the last commit after CI started) |
sorry, still not ready we're have to figure out the ARM compiler problem first |
Test run: FAILEDSummary: 2 of 11 test jobs failed Failed test jobs:
|
ARM cc fix incoming within the hour |
wait |
good to go |
CI started |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
What actually was the problem here? Compiler deducing that Was initially puzzled because assert failures are also noreturn, but then this assert is true so doesn't do anything. I would have thought the code should be issuing an error in the calling code if |
Yes, a straight call to error seems to taint the weak function as a no return function and that attributes propagates seems to be propagated by the linker to the non weak version. More investigation would be required to find out the issue details but we didn't had the time to conduct that full investigation as we were urged to find a solution. As you pointed out, the assert statement in the weak function is not correct as it always return true. The pattern you described seems suited for our use and may be a long term fix (not sure of the behaviour if the weak factory and the non weak accessor are in the same source file ...). |
Your pattern is almost totally equivalent to what we've done in networking and other areas, so it would be nice to align it. After a couple of slightly varying iterations (1 layer/2 layer, pointer/reference), the final refined form I would suggest for you is
Code gated on TARGET_XXX (only) gets to override the Application or plug-in module code has the option of overriding |
Description
Second round of fixes discovered with the OOB and our testing.
It fixes: ARMmbed/mbed-os-example-ble#198 and many other bug discovered during our internal testing on the Cordio LL.
Pull request type