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

Add function to manage low power mode status #327

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

leonardocavagnis
Copy link

@leonardocavagnis leonardocavagnis commented Oct 11, 2023

Adding the function BLE.setLowPowerMode(bool) to manage the lower power mode status of the BLE chip.

The function BLE.setLowPowerMode(bool)(true: to enable, false: to disable) must be called before executing the BLE.begin() function. Using this function after the BLE stack initialization will not have any effect.
The function does not directly control the entry and exit from low power mode but enables or disables the chip's feature.

Low power mode is enabled by default.

@sebromero Check it out if function name sounds good. Another proposal could be using two different functions: enableLowPowerMode() and disableLowPowerMode().

This PR is based on the arduino/mbed-os PR #32.

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Oct 11, 2023
Copy link

@sebromero sebromero left a comment

Choose a reason for hiding this comment

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

Thank you for the PR! I'd recommend naming the user facing function setLowPowerModeEnabled or as discussed disableLowPowerMode() if re-enabling it makes no sense. For the other functions I suggest avoiding abbreviations that leave room for ambiguity.

src/local/BLELocalDevice.cpp Outdated Show resolved Hide resolved
src/local/BLELocalDevice.h Outdated Show resolved Hide resolved
src/utility/HCI.h Show resolved Hide resolved
src/utility/HCICordioTransport.cpp Show resolved Hide resolved
src/local/BLELocalDevice.cpp Outdated Show resolved Hide resolved
src/utility/HCITransport.h Show resolved Hide resolved
src/utility/HCIUartTransport.cpp Show resolved Hide resolved
src/utility/HCIUartTransport.h Show resolved Hide resolved
src/utility/HCIVirtualTransportAT.cpp Show resolved Hide resolved
src/utility/HCIVirtualTransport.h Show resolved Hide resolved
leonardocavagnis and others added 3 commits October 25, 2023 11:37
Co-authored-by: Sebastian Romero <s.romero.zh@gmail.com>
Co-authored-by: Sebastian Romero <s.romero.zh@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PMC freeze when using ArduinoBLE with Arduino_MachineControl included.
3 participants