Skip to content

Ble conf #9790

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 100 commits into from
Mar 1, 2019
Merged

Ble conf #9790

merged 100 commits into from
Mar 1, 2019

Conversation

paul-szczepanek-arm
Copy link
Member

Description

Allow users to configure the BLE feature to disable functionality not needed by the device to save memory.

Pull request type

[ ] Fix
[ ] Refactor
[ ] Target update
[x] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@pan-

Release Notes

No changes made to existing programs. By default all options are enabled which is the current state.

@paul-szczepanek-arm
Copy link
Member Author

Please add needs work.
This PR relies on a previous PR which is not yet made. This PR for now is for review and visibility.

@ciarmcom
Copy link
Member

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

@pan-
Copy link
Member

pan- commented Feb 25, 2019

@0xc0170 We need the 5.12 tag please.

pan- added 16 commits February 26, 2019 13:18
The event handler has been extracted out of the monitor declaration.
The event handler has been taken out of Gap declaration and the instantiation must provide an implementation and the type that plays the event handler role.
The event handler has been taken out of GattClient declaration and an instantiation requires the actual implementation and the type that handle events.
The event handler has been extracted out of SecurityManager declaration and instantion of the interface requires the implementation and event handler type.
The event handler has been extracted out of SigningEventMonitor declaration and SigningEventMonitor instantion requires the implementation and event handler type.
The interface definition now lives in ::ble::interface::LegacyGap. Implementation must export the implementation type as ble::impl::LegacyGap.
The interface definition now lives in ::ble::interface::Gap.
The implementation must export the implementation types as ::ble::impl::Gap.
Interface definition now lives in ble::interface::GattClient. An implementation must export the implementation type in ::ble::impl::GattClient.
The interface is defined in ::ble::interface::GattServer and an implementation must export the implementation type ::ble::impl::GattServer.
The interface now lives in ::ble::interface::SecurityManager. The implementation type is expectected to exported as ble ::ble::impl::SecurityManager by the implementation.
@@ -14,11 +14,6 @@
* limitations under the License.
*/

#include "BLERoles.h"

#if BLE_FEATURE_GATT_SERVER
Copy link
Member Author

Choose a reason for hiding this comment

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

why? does not compile now

Copy link
Member

Choose a reason for hiding this comment

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

addressed

@@ -14,11 +14,6 @@
* limitations under the License.
*/

#include "BLERoles.h"

#if BLE_FEATURE_GATT_SERVER
Copy link
Member Author

Choose a reason for hiding this comment

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

does in fact need gattserver

@@ -14,11 +14,6 @@
* limitations under the License.
*/

#include "BLERoles.h"

#if BLE_FEATURE_GATT_SERVER
Copy link
Member Author

Choose a reason for hiding this comment

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

reinstate pls

@pan-
Copy link
Member

pan- commented Feb 28, 2019

@paul-szczepanek-arm I've addressed your comments and benchmarked our examples:

Example TEXT BSS DATA
BLE_BatteryLevel 32947 (-66510) 162 (-29) 4817 (-1343)
BLE_Beacon 16240 (-82745) 66 (-125) 3613 (-2547)
BLE_Button 32943 (-66510) 162 (-29) 4817 (-1343)
BLE_GAP 36162 (-63960) 67 (-124) 3958 (-2202)
BLE_GapButton 22680 (-77003) 66 (-125) 3889 (-2271)
BLE_GattClient 34278 (-65255) 78 (-113) 4353 (-1807)
BLE_GattServer 32567 (-66532) 162 (-29) 4817 (-1343)
BLE_Heartrate 32975 (-66512) 162(-29) 4817(-1343)
BLE_LED 32701 (-66752) 162 (-29) 4817 (-1343)
BLE_LEDBlinker 33905 (-64905) 78 (-113) 4360 (-1800)
BLE_PeriodicAdvertising 45953 (-53851) 163 (-28) 4886 (-1274)
BLE_Privacy 52012 (-47160) 94 (-97) 4717 (-1448)
BLE_SM 49652 (-49560) 94 (-97) 4702 (-6160)
BLE_Thermometer 33005 (-66518) 162 (-29) 4817 (-1343)

Note: Numbers provided are just for the BLE API

@@ -25,6 +25,8 @@

#endif

#if BLE_FEATURE_GATT_SERVER

Copy link
Member Author

Choose a reason for hiding this comment

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

still fails

Suggested change
#if BLE_ROLE_BROADCASTER

@donatieng
Copy link
Contributor

@armmbed/mbed-os-maintainers this one should be ready for CI

@cmonr
Copy link
Contributor

cmonr commented Feb 28, 2019

@donatieng Pending a successful merge dryrun test, #9727 will be getting merged. Wanted to wait before that was in.

@cmonr
Copy link
Contributor

cmonr commented Feb 28, 2019

ETA ~20 mins

@donatieng
Copy link
Contributor

Sounds good, thanks @cmonr

@cmonr
Copy link
Contributor

cmonr commented Mar 1, 2019

Well then. Really glad I did that. A couple things appear to have broken. Checking it out.

Will update when able.

@cmonr
Copy link
Contributor

cmonr commented Mar 1, 2019

#9790 (comment)

@pan- Thanks for the diff.

@cmonr
Copy link
Contributor

cmonr commented Mar 1, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented Mar 1, 2019

Test run: SUCCESS

Summary: 13 of 13 test jobs passed
Build number : 1
Build artifacts

@@ -0,0 +1,866 @@
/* mbed Microcontroller Library
Copy link
Contributor

Choose a reason for hiding this comment

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

Ooohhh. This was deleted, renamed, then added.

I was wondering why it looked like the GH interface was being weird.

git mv <file>{cpp,tpp} appears to not have been done.

Copy link
Contributor

@cmonr cmonr left a comment

Choose a reason for hiding this comment

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

This is a really nice refactor!

@cmonr cmonr merged commit f8d254f into ARMmbed:master Mar 1, 2019
@cmonr cmonr removed the needs: CI label Mar 1, 2019
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.

8 participants