Skip to content

BLE - Notify HCI driver of host stack inactivity #10162

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 3 commits into from
Mar 27, 2019

Conversation

pan-
Copy link
Member

@pan- pan- commented Mar 19, 2019

Description

This PR adds a new function to the CordioHCIDriver interface: on_host_stack_inactivity. That function is called by the host stack when it becomes inactive. It leave the opportunity to the driver to put the controller to sleep if all the conditions are met. Activity is resumed whenever CordioHCIDriver::write is called.

This PR also fixes the type of the timeout local to cardio::BLE::callDispatcher .

Pull request type

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

Reviewers

@paul-szczepanek-arm @ARMmbed/team-cypress

pan- added 3 commits March 19, 2019 16:08
This callback should be called by the host stack when it has no pending activities. It allows a driver to put its controller to sleep.
@ciarmcom ciarmcom requested review from paul-szczepanek-arm and a team March 19, 2019 18:00
@ciarmcom
Copy link
Member

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

@@ -564,6 +564,9 @@ void BLE::callDispatcher()
timestamp_t nextTimestamp = (timestamp_t) (WsfTimerNextExpiration(&pTimerRunning) * WSF_MS_PER_TICK) * 1000;
if (pTimerRunning) {
nextTimeout.attach_us(timeoutCallback, nextTimestamp);
} else {
critical_section.disable();
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this, or CriticalSectionLock critical_section; needed to begin with?

Copy link
Member Author

Choose a reason for hiding this comment

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

In our case wsfOsReadyToSleep and WsfTimerNextExpiration needs to be called within a critical section.

@cmonr
Copy link
Contributor

cmonr commented Mar 26, 2019

CI started

@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 pushed a commit to cmonr/mbed-os that referenced this pull request Mar 26, 2019
…ivity

BLE - Notify HCI driver of host stack inactivity
@cmonr cmonr merged commit 365cf11 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.

6 participants