-
Notifications
You must be signed in to change notification settings - Fork 71
Max-style bluetooth slot handling #1414
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements "Max-style" Bluetooth slot handling to improve how the UHK manages Bluetooth device pairings. It allows newly paired devices to be assigned to regular host slots instead of a single generic slot, prevents unpairing of unknown devices during config saves, and adds the ability to unpair connections by holding the switch action for 3 seconds.
Key changes:
- Newly paired Bluetooth devices are allocated into regular host connection slots (Empty slots are used for unregistered devices)
- Long-press (3 seconds) on native switch connection actions unpairs the device and frees its slot
- New
unpairHostmacro command added with support for numeric slot IDs and connection names - OLED notifications for Bluetooth-related events (pairing, unpairing, slot allocation)
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| right/src/usb_report_updater.c | Adds long-press unpair functionality for switch host actions |
| right/src/host_connection.h | Adds new HostConnectionType_UnregisteredBtHid type and HostKnown enum, updates API signatures |
| right/src/host_connection.c | Implements slot allocation for unregistered devices, unpair logic, and connection name lookup |
| right/src/macros/commands.c | Adds unpairHost command with numeric slot and name support, adds numeric slot support to switchHost |
| right/src/macros/display.c | Adds UnNotify() function to hide notifications |
| right/src/macros/status_buffer.h | Declares UnNotify() function |
| device/src/keyboard/oled/widgets/widget_store.c | Updates target text display to handle unregistered BT HID connections |
| device/src/keyboard/oled/screens/notification_screen.* | Adds NotificationScreen_Hide() function |
| device/src/connections.h | Adds ConnectionType_UnusedUnregisteredHid enum value |
| device/src/connections.c | Updates Connections_MoveConnection to properly swap connections, adds allocation logic |
| device/src/usb/usb_compatibility.cpp | Removes ConnectionType_NewBtHid from switch cases, improves error message |
| device/src/bt_pair.h | Declares BtPair_AllocateUnregisteredBonds() |
| device/src/bt_pair.c | Adds bond allocation logic, marks old clear function as unused |
| device/src/bt_conn.c | Updates pairing flow to use new slot allocation, adds connection validation |
| right/src/usb_commands/usb_command_get_new_pairings.c | Updates to check for HostKnown_Registered specifically |
| right/src/config_parser/parse_config.c | Replaces bond clearing with bond allocation on config save |
| doc-dev/reference-manual.md | Documents new unpairHost command and numeric slot support |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Also, add `unpairHost` commands, and allow referencing hosts by slot numbers.
60b655b to
ae07a9e
Compare
836c6f9 to
d174a27
Compare
Changelog:
unpairHostmacro command.unpairHostandswitchHost, allow numeric slot ids.