Skip to content

Conversation

@kareltucek
Copy link
Collaborator

Changelog:

  • Assign newly paired bluetooth connections into regular host slots.
  • Don't unpair unknown devices upon config saves.
  • Show bluetooth relevant events on the oled screen.
  • If native switch connection action is held for 3 seconds, unpair the connection and free its slot for other devices.
  • Add unpairHost macro command.
  • For unpairHost and switchHost, allow numeric slot ids.

Copy link
Contributor

Copilot AI left a 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 unpairHost macro 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.
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.

2 participants