1

Topic: Write to device example?

Hey,

Im working on a project, and have been having some success with HidSharp. I can read from my device just fine, and can access the data i need from the IN reports.

However I totally cannot see how i can write OUT reports back to the device. I've trawled the internet, but no examples.

Ive found I can get the OUT report I need using the GetReport() method but i dont know how to write my values into it, or send it.

Any advice/help much appreciated.

2

Re: Write to device example?

Ok, so ive figured out sending bytes to the hidSteam is simple enough, and works fine for sending out reports. But its a manual process for me to put together the byte array for each report. Does the Report class not give me a way to write values for each element in the report, and then output the report object as a byte array for sending?

Herees some pseudocode of what id expect to be able to do...

Report report = ReportDescriptor.GetReport(REPORT_ID);
report.Button1 = 1;
report.Button2 = 0;
hidStream.Write(report.Bytes());