-
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:
|
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: |
Have you restarted Agent? Agent still doesnt support multiple dongles as far as I know, not even when they are connected one at a time |
As for the |
c81a036
to
cfb40f9
Compare
(No changes to code, just rebased onto master to resolve conflicts.) |
For some reason, Agent now succeeded pairing both dongles. My connections: My macros on the Fn2 layer which contain the macro actions of the same content as the macro names: With When switching to "Production Dongle", is it expected that I get the following?
When trying to switch to "My PC", I can't, and I get:
In the meantime, even though "Dev Dongle" shouldn't be involved at this point, outputs:
I can't switch to "Dev Dongle", either. Right half log:
"Dev Dongle" log:
|
No. Only those whose connections are active - i.e., dongles that are blue, and maybe usb or ble hid. As for usb vs ble hid, they are mutually exclusive for the moment, and they act quirky anyways. I am waiting for @benedekkupper's response about that at #1021 Whenever posting dongle-related issues please include following when possible:
(This is for next time, don't waste time by re-testing the above ;-).) |
However you should be able to reach any dongle when asking for it specifically by name. Will investigate. |
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"
.