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

feat: Add support for switching to previously used bluetooth profile #2497

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

willelind
Copy link

@willelind willelind commented Sep 23, 2024

This is a PR to make it possible to switch to the index of the previously used profile. This is a feature I will need for my project (swapping between RPi and computer)

There are previous PRs offering this functionality, but they have comments that they didn't bother to fix, so I did it in this one.

I switched LAST_DEV to PRV_DEV as I think LAST could be misinterpreted to mean the last index of the list of profiles.

I also didn't add flash save for the previous_profile as exists for the active_profile. Instead I added initialize to 0, so each time you boot, the PRV_DEV will take you to index 0 for the first time, unless you switch profiles before pressing it with the other profile options. Maybe it should be saved but I thought it was a bit overkill for this, tell me if you want me to add this feature.

Fixes #767

@willelind willelind requested review from a team as code owners September 23, 2024 16:26
@caksoylar caksoylar added behaviors bluetooth Bluetooth related items labels Sep 23, 2024
@Nick-Munnich
Copy link
Contributor

Regarding saving to memory, I think if you could get it to save both the current and previous profiles in a single write action to the same block, then it would be worth doing so. I'm not sure if that's possible, though, not looked into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
behaviors bluetooth Bluetooth related items
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Select previously active Bluetooth profile
3 participants