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: fix scan timeout being called from interrupt #10219

Merged
merged 3 commits into from
Mar 27, 2019

Conversation

paul-szczepanek-arm
Copy link
Member

Description

Legacy scanning uses a timer to simulate a scan timeout event which causes the timeout to be called from the timer interrupt. This posts the call in the event queue.

Pull request type

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

Reviewers

@pan-

Release Notes

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 @paul-szczepanek-arm ; the change looks good but can be improved a bit.

_event_queue.post(
mbed::callback(
this,
&GenericGap<
Copy link
Member

Choose a reason for hiding this comment

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

What's wrong with &GenericGap:: process_legacy_scan_timeout ?

@@ -3263,6 +3280,7 @@ ble_error_t GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEve

_scan_timeout.detach();
if (duration.value()) {
/**/
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure that is required.

@ciarmcom ciarmcom requested review from pan- and a team March 25, 2019 18:00
@ciarmcom
Copy link
Member

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

@paul-szczepanek-arm
Copy link
Member Author

I don't understand the astyle failure

@cmonr
Copy link
Contributor

cmonr commented Mar 26, 2019

@paul-szczepanek-arm Sorry about that. We did some astyle work after finding out the current job was over-excluding files, but the fixes ended up over-including files.

Problems appear to have been fixed with #10222.

@cmonr
Copy link
Contributor

cmonr commented Mar 26, 2019

Info: This PR has now been rebased.

If this was made in error, feel free to force-push your local branch to restore the PR.

@cmonr
Copy link
Contributor

cmonr commented Mar 26, 2019

CI started

@cmonr
Copy link
Contributor

cmonr commented Mar 26, 2019

Making a note for future me.

New function added, but appears to be needed due to legacy callback reasons. Appears fine for patch.

cmonr pushed a commit to cmonr/mbed-os that referenced this pull request Mar 26, 2019
…scan-timeout

BLE: fix scan timeout being called from interrupt
@mbed-ci
Copy link

mbed-ci commented Mar 26, 2019

Test run: SUCCESS

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

@cmonr
Copy link
Contributor

cmonr commented Mar 27, 2019

@pan- A hunch, but before we merge this, would y'all mind testing this against the CY8CKIT_062_BLE target?

I was doing some testing to make sure all PRs RfM or in CI were alright with eachother, and found that this target was not liking one of the PRs. Logs for reference: https://mbed-os.mbedcloudtesting.com/job/mbed-os-ci_greentea-test/1612/#showFailuresLink|

(Sorry, no S3 links. As of right now, the job is still in progress.)

@pan-
Copy link
Member

pan- commented Mar 27, 2019

@cmonr The CY8CKIT_062_BLE doesn't even support BLE (yes, that is counter intuitive); code is this PR is not compiled in for that target. Your issue might be something else.

@cmonr cmonr merged commit 4cdc3b7 into ARMmbed:master Mar 27, 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.

5 participants