webhid icon indicating copy to clipboard operation
webhid copied to clipboard

sendReport method problem

Open 954514762 opened this issue 2 years ago • 6 comments

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

954514762 avatar Aug 31 '23 10:08 954514762

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?

nondebug avatar Aug 31 '23 18:08 nondebug

Can carry multiple arguments

954514762 avatar Sep 01 '23 00:09 954514762

Want to carry multiple parameters can achieve?

954514762 avatar Sep 04 '23 06:09 954514762

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

chengweih001 avatar Sep 06 '23 04:09 chengweih001

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

954514762 avatar Sep 06 '23 07:09 954514762

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?

nondebug avatar Sep 06 '23 21:09 nondebug