-
Notifications
You must be signed in to change notification settings - Fork 67
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
Implement connection manager. #1031
base: master
Are you sure you want to change the base?
Conversation
b348832
to
70b31b1
Compare
@kareltucek I delay reviewing this until Benedek's PR is merged unless you say otherwise. |
Yes, this will need reworking. |
6b17356
to
3343c07
Compare
When renaming the current connection and saving the configuration, the new name doesn't get reflected on the OLED display. When connecting my production dongle to USB, the OLED display switches to disconnected, HID events don't have any effect, and the following is shown in the Zephyr log upon every HID event:
Simultaneously, Agent displays the following, which shouldn't be displayed: |
What do you mean by "production dongle"? You mean that you haven't updated it to the corresponding branch firmware? If so, which commit are they running? |
Also, have you tried to delete the connection and pair it again? |
I'm on the tip of the Experience various issues regarding connection switching. I haven't used the mentioned macro commands yet. Please try to connect/disconnect your UHK 80 / dongle via USB, which should trigger the following when pressing keys:
or
When seeing the above errors, my UHK usually doesn't send events to the host, and sometimes the mouse interface froze. Can you reproduce these issues? |
No. Please try to give more detailed reproduction steps. And maybe more log context. |
When the user configuration is empty, the UHK 80 is disconnected, even after reboot or after reconnecting USB. No wireless devices have ever been paired until this point.
|
Upon trying to pair my dongle, Agent errors out with "Cannot write to hid device". Agent log:
Right half log:
Dongle log:
|
# Conflicts: # device/prj.conf # device/src/bt_conn.c # device/src/bt_scan.c # device/src/dongle_leds.c # device/src/dongle_leds.h # device/src/keyboard/uart.c # device/src/messenger.c # device/src/usb/usb.cpp # device/src/usb/usb_compatibility.cpp # right/src/stubs.h
3343c07
to
808a90c
Compare
(For the moment, it is only rebased. No point testing now.) |
FYI: The UltimateHackingKeyboard/agent#2450 PR works well for me with this PR |
This is a semi-stable state. Will look into it further. However, any testing is welcome. |
ecc43e7
to
e1f540e
Compare
I've tried to pair my dongle which resulted in "device pairing timeout" in Agent master. Is this expected? Before sending a bunch of logs, I need to know whether I should test with UltimateHackingKeyboard/agent#2450 |
No. Please test with UltimateHackingKeyboard/agent#2450 |
e1f540e
to
b6a39b2
Compare
I can't pair one of my dongles because the pairing notification is not displayed in Agent. I think I have paired this dongle previously, and the host connection has been removed in Agent in the meantime, possibly when the dongle wasn't connected. The dongle displays violet light, and the right half keeps outputting frequent log messages while it's connected:
Regardless of the dongle, upon every keypress and release, the following message is displayed in the right's half console, which is a bit annoying: |
This contains a refactor of connection handling - both host connections and other connections (like bridge) are now managed by one central module.
Changes:
switchHost { next | previous | last }
macro can be used to iterate over connected hosts (blue dongles)switchHost "name"
can be used to select a specific host connection (i.e., blue and violet dongles) to connect to even when the host is not connected (e.g., because there are more active dongles than the available peripheral connection slots) . In such case, the least recently used host is disconnected, and advertisement is started with a whitelist for the one selected host.Please note the
CONFIG_BT_CTLR_SDC_PERIPHERAL_COUNT
prj.conf value and experiment with it. Reasonable values are 1, 2, and 3. In practice, it means the number of dongles that can be in blue and green modes at the same time.With 1 the switchover takes around 1 second and switching over is done by disconnecting current dongle, applying an allow list filter, and starting advertising with that list, which however doesn't work very well in practice, as the dongles try to connect anyways. (The upside is that keeping a list of active dongles wouldn't be hard.)
With 2 or more, the user experience is a bit better, but I fear decreased responsivity. In this case, either all dongles can be connected in standby (blue) (if their number is smaller than the connection count), or some blue, some violet, and the whitelist approach is in practice used on one free slot obtained by disconnecting one of the blue dongles.
Known issues / missing features:
switchHost next
. Violet dongles can still be reached by (e.g.)switchHost "MyDevDongle"
.