Skip to content
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 SimpleAdvertisingBuilder moved functions out of mbed_assert calls #10270

Merged
merged 1 commit into from
Apr 1, 2019

Conversation

marcemmers
Copy link
Contributor

Description

I had an issue where advertising stopped working in release mode when using this code:

    ble::AdvertisingDataSimpleBuilder<0x1F> advertisingBuilder;

    advertisingBuilder.setFlags( GapAdvertisingData::BREDR_NOT_SUPPORTED | GapAdvertisingData::LE_GENERAL_DISCOVERABLE );
    advertisingBuilder.setName( DEVICE_NAME );
    advertisingBuilder.setLocalService( SERVICE_UUID, false );

Found out that the functions setFlags and setName were optimized away. This is caused by the functions are internally calling functions inside an mbed_assert call resulting in a nop when NDEBUG is defined.

I moved the function calls out of the mbed_assert calls and checked the result later.

Pull request type

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

@ciarmcom ciarmcom requested review from a team March 29, 2019 10:00
@ciarmcom
Copy link
Member

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

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.

Nice find!

@cmonr
Copy link
Contributor

cmonr commented Mar 29, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented Mar 30, 2019

Test run: SUCCESS

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

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 fixes.

@0xc0170 0xc0170 merged commit 1b4f6ae into ARMmbed:master Apr 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