WICG / webhid

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

sendReport method problem #116

Open 954514762 opened 1 year ago

954514762 commented 1 year ago

SendReport parameters have to be two? Like this selectedDevice.sendReport(reportId, reportData);

nondebug commented 1 year ago

Yes, there are two parameters to sendReport. The first parameter is the report ID, pass zero if the device does not use numbered reports. reportData contains the report data without the report ID byte.

What's the problem?

954514762 commented 1 year ago

Can carry multiple arguments

954514762 commented 1 year ago

Want to carry multiple parameters can achieve?

chengweih001 commented 1 year ago

Could you please elaborate an example how you wish sendReport to look like?

954514762 commented 1 year ago

For example: sendReport (args1 args2, data, length, end), custom and so on parameters, without limiting the number

nondebug commented 1 year ago

I don't understand how adding parameters would be useful.

What are args1 and args2 used for? If you're trying to send data to the device, it needs to be inside the reportData parameter which needs to follow the report layout defined in the device's report descriptor.

What are data, length, and end used for? There's already a reportData parameter which is a DataView so it already includes the extent.

Can you tell us more about the problem you're having that caused you to file this feature request?