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

Fix bluetooth setting : emit the radio toggle message only if the value of the setting changed #2037

Merged
merged 1 commit into from
Mar 15, 2024

Conversation

JF002
Copy link
Collaborator

@JF002 JF002 commented Mar 14, 2024

Emit the message BleRadioEnableToggle to DisplayApp only if the enable state of the radio has actually changed.

This fixes an issue where the BLE connected logo would disappear when opening and closing the BLE setting (without changing it) while InfiniTime was already connected to a companion app.

This fix is based on the work done by @JustScott in #1972 and also thanks to the very detailed description of the issue by @rambonette in #1961.

I think this fix makes more sense since we do not actually need to call NimbleController::EnableRadio() again if the radio was previously enabled and need to stay enabled.

This change also removed the need to send the message in SettingBluetooth::~SettingBluetooth() by capturing this in the lambda (which is called in CheckboxList::~CheckboxList() which is destroyed before SettingBluetooth.

What do think about this @JustScott?

Fixes #1961.

Copy link

Build size and comparison to main:

Section Size Difference
text 377384B 0B
data 940B 0B
bss 63540B 0B

…e state of the radio has actually changed.

This fixes an issue where the BLE connected logo would disappear when opening and closing the BLE setting (without changing it) while InfiniTime was already connected to a companion app.

Co-authored-by: JustScott <development@justscott.me>
@JF002 JF002 force-pushed the emit-ble-radio-toggle-only-if-setting-changed branch from 2458aef to d3e5410 Compare March 14, 2024 20:05
@rambonette
Copy link

Glad to help! Wish I had more time to tackle these problems myself 😵‍💫

@JustScott
Copy link
Contributor

Glad I could help @JF002! Your solution address the issue at its core and works great on my pinetime!

@FintasticMan FintasticMan merged commit 4ca2112 into main Mar 15, 2024
7 checks passed
@FintasticMan FintasticMan added this to the 1.15.0 milestone Mar 15, 2024
Schweini07 pushed a commit to SleepTracking-for-PineTime/InfiniTime that referenced this pull request Mar 18, 2024
…e state of the radio has actually changed. (InfiniTimeOrg#2037)

This fixes an issue where the BLE connected logo would disappear when opening and closing the BLE setting (without changing it) while InfiniTime was already connected to a companion app.

Co-authored-by: JustScott <development@justscott.me>
Eve1374 pushed a commit to Eve1374/InfiniTime that referenced this pull request May 30, 2024
…e state of the radio has actually changed. (InfiniTimeOrg#2037)

This fixes an issue where the BLE connected logo would disappear when opening and closing the BLE setting (without changing it) while InfiniTime was already connected to a companion app.

Co-authored-by: JustScott <development@justscott.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bluetooth setting is behaving abnormally
4 participants