WICG / webhid

Web API for accessing Human Interface Devices (HID)
Other
142 stars 35 forks source link

Instant write failure on Windows #78

Closed slonopot closed 3 years ago

slonopot commented 3 years ago

Greetings!

I'm trying to create an interface for MSR605X magnetic stripe reader/writer. The issue is that it's impossible to write anything on Windows since the transfer instantly fails with either "DOMException: Failed to write the report" or "DOMException: Failed to write the feature report". Meanwhile, it works like a charm on a Mac.

The code is simple:

const filters = [{vendorId: 0x0801, productId: 0x0003}];
const [device] = await navigator.hid.requestDevice({filters});
await device.open();
await device.sendFeatureReport(0, new Uint8Array([0xc2, 0x1b, 0x61]));
Uncaught DOMException: Failed to write the feature report.
await device.sendReport(0, new Uint8Array([0xc2, 0x1b, 0x61]));
Uncaught DOMException: Failed to write the report.

Errors at chrome://device-log are unreadable:

[00:00:00] HID write failed.
[00:00:00] HID transfer failed: �������� ����� �������. (0x57)
[00:00:00] HID write failed: �������������� � ������� ���������� �� ��������. (0x1F)

Windows 10, Chrome 93.0.4577.82, HID=0801 & PID=0003 The device is using Microsoft HID driver 10.0.19041.868 (input.inf). I've tried replacing it with WinUSB with Zadig but it just reverts back. The same code (byte sequence and approach) works from C# using HidLibrary.

The question is if it's the platform limitation, Chromium issue or my bad? Please let me know if it's the wrong place to create a report.

Thanks in advance!

slonopot commented 3 years ago

Moved to https://bugs.chromium.org/p/chromium/issues/detail?id=1251640