-
Notifications
You must be signed in to change notification settings - Fork 69
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
Report routing revisited #1021
Comments
What you are asking for is to keep both connections alive at the same time, maintaining their state independently. That to me translates to having multiple instances of keyboard_app, etc, so when you swap between the transports, you take over the new transport's configuration (boot mode, more importantly caps/num/scroll lock, etc). Additionally, care should be taken that a switch happens at a time when the keys state is clear, so no key is stuck on the old transport. That means instead of having a keyboard_app::handle(), you will have ble_handle() and usb_handle(), where you can hook into their start and stop methods to know which transport is available, and use the sending method of the appropriate handle. |
Sounds about right. It also sounds like it might result in a lot of code duplication. If that is the case, then we should probably think about it a bit more deeply. (Like, what if we decide we want to maintain multiple ble hid connections at the same time?) (Please make it happen when time and priorities allow.) |
That's trickier actually, and another thing to consider altogether, it would need a significant rewrite of the BLE HID implementation in the c2usb library. |
Alright, me and Laszlo have agreed that:
If I understand you correctly:
To be clear, in case it simplifies matters, we don't strictly need simultaneous connection of the keyboard_app (mouse_app, control_app) over both HIDs. We just need for command_app to be connected to potentially different HID than the rest of the interfaces. Should I clarify / elaborate on anything? |
you do, in all areas
It would simplify matters indeed, as in the case of BLE, (due to Android limitation) the HID interfaces are all or nothing, while on USB we can pick and choose which interfaces are desired - with the caveat that the command interface's index will be shifting around if we do switch things around at runtime. I'm hoping that Agent doesn't have this hardcoded anymore, and instead searches for the HID usage code. Is this what you want as a first step? Have the agent command interface be always available via USB, even when BLE HID is connected? |
Sorry 😅.
No idea. @ert78gb ?
Yes, I think so. So we are talking about:
Or just part of them? |
Agent use |
@benedekkupper what is the state of affairs? From my point of view, current blockers are:
Other less important thoughts - if you have any comment, it is highly welcome:
|
What I implemented in the previous PR was only the concurrent agent operation over USB and BLE. Both can be used at the same time, since it's fully a request-response protocol, the response is always sent where the request comes from. @kareltucek Now on the |
@benedekkupper, we would like to have more control over the bt/usb HID interfaces.
Until now, whenever an unknown bluetooth device connected, we have (very naively) assumed it is a HID device, and disabled USB HID, and consequently, have treated the connection states as mutually exclusive. This doesn't fit the bill for muliple reasons.
void hidmgr_set_transport(const hid::transport* tp)
less naively)mouse_app.selec_destination(bt / usb);
would fit the bill nicely.)(Do we already have such ability? If now, what course of action do you suggest?)
The text was updated successfully, but these errors were encountered: