-
Notifications
You must be signed in to change notification settings - Fork 3k
Ble conditional compilation #13811
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
Ble conditional compilation #13811
Conversation
Previously (most) of the code was not pulled in because the pal interface was not virtual.
Depends on the role (central or peripheral), signing enabled and secure connection enabled.
These events are not used nor triggered by any of our APIs. It saves ~1.4k of flash
@pan-, thank you for your changes. |
@@ -217,6 +217,7 @@ static const hciEvtParse_t hciEvtParseFcnTbl[] = | |||
hciEvtParseLeConnCteReqEnableCmdCmpl, | |||
hciEvtParseLeConnCteRspEnableCmdCmpl, | |||
hciEvtParseLeReadAntennaInfoCmdCmpl, | |||
#if 0 |
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.
there's a #define that you can use that selects the ble version 5.1 which compiles cis/bis etc. out
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 haven't seen any in the host.
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.
if this is landing in mbed-os then we should make one
I guess you could change the size of the array to avoid the nulls
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 improved this in the last commit.
@@ -1135,11 +1146,12 @@ ble_error_t Gap::reset() | |||
_connectable_payload_size_exceeded.clear(); | |||
_set_is_connectable.clear(); | |||
|
|||
#if BLE_FEATURE_EXTENDED_ADVERTISING |
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.
this is not human parsable anymore, I can't even work out if the curly brace below creates a mismatch
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 will rework this one. I agree it is a mess.
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.
done.
Disable 5.2 event handling if not enabled.
@paul-szczepanek-arm I improved the PR based on your suggestions, please review. |
CI started |
Jenkins CI Test : ✔️ SUCCESSBuild Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & ArtifactsCLICK for Detailed Summary
|
Summary of changes
This PR improves code size of the BLE solution when central, secure connection and signing are disabled.
It saves about 8K of code size when these conditions are met. The saving are achieved using conditional compilation. This previously wasn't required at the pal classes where concrete and not virtual.
It also disable handling of BT5.2 events at the HCI level, this handling was disabled in layer above
Impact of changes
Code size reduction when peripheral, central, secure connection, extended advertising, periodic advertising or signing are disabled.
Migration actions required
None
Documentation
Pull request type
Test results
Reviewers