-
Notifications
You must be signed in to change notification settings - Fork 18
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
Question on connect/disconnect events #11
Comments
I've not tried those, but from the following comment I think they might not be implemented yet - https://bugs.chromium.org/p/chromium/issues/detail?id=890096#c38 |
Connect and disconnect events are not yet implemented. CC @nondebug |
I made the following a work around in ergometer-space.org:
- I frequently send hid messages to my device
- If one of the messages fails then I assume it is disconnected and I trigger the disconnect event.
This works fine for me
Tijmen
… On 30 Oct 2019, at 22:50, Robat Williams ***@***.***> wrote:
I've not tried those, but from the following comment I think they might not be implemented yet - https://bugs.chromium.org/p/chromium/issues/detail?id=890096#c38 <https://bugs.chromium.org/p/chromium/issues/detail?id=890096#c38>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#11?email_source=notifications&email_token=AAVG7NVUH6JS5WBSJWH2LXDQRH6TDA5CNFSM4JHAVTXKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECV4JJQ#issuecomment-548127910>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAVG7NWRW6N3BF2W3WDNJYDQRH6TDANCNFSM4JHAVTXA>.
|
Discussion is resolved by #11 (comment) |
Thx for the answers. In my case, USB HID input reports are sent infrequently by the device, either to indicate state changes or in response to output reports from the host (representing requests in upper protocol layers). So I think it would be the best to wait for implementation of connect/disconnect events. |
Hi @mame82, I think you can send to the device from the host, even if the device isn’t configured to receive, and the HID driver will either send the packet or error out if device is disconnected. Basically do the keep-alive, but have it host-originated. |
Yes, but afaik the respective (input) reports would end up as control transfers at ep0 and force an idle response from the device - or am I wrong in that? |
Hi,
as you have quit a bit of knowledge on WebHID, you could maybe answer my question.
O'm currently working on a Single Page App utilizing WebHID to interact with a custom device. Everything works well, so far (see
BLExy
videos on youtube for reference).What I don't get to work are the
disconnect
events onnavigator.hid
, which is an issue, as I'm not able to recognize removal of the USB device and sending reports simply fails (HIDDevice instance is left behind withopen
property set to true).I'm using latest Chrome 78 in Linux x64.
I hope you could drop a hint on how to detect device disconnection.
Cheers Marcus
The text was updated successfully, but these errors were encountered: