Closed EdisonDelgado closed 9 years ago
You might be falling foul of a quirk in Windows when writing report IDs of 0x00. Have a look at HidApi.write()
around line 369 with a debugger and see if it is affecting your situation.
I wrote my command with the following structure and worked without problems.
public int write(byte command) {
byte[] data;
if(PlatformUtils.isWindows()){
data = new byte[2];
data[0] = (byte) 0;
data[1] = command;
}
else{
data = new byte[1];
data[0] = command;
}
return currentDevice.write(data, data.length, REPORT_ID);
}
You write the message with different structure for Windows. My device doesn't work because the command becomes endpoint.
Thank you!!
Hi, thank so much for the Api is very useful for me.Actually i'm working in a device that have a set of external sensors like Temperature, Humidity, Light ,etc. It´s device report an array of byte when it is writing a command every x interval.
My trouble is only in Windows can't read the response from my device.
This method write a command in to device, REPORT_ID = (byte) 0
This try to read port every 100 ms.
I tested the same code in Mac and worked perfectly.
What am I doing wrong?
Thank in Advance.