I use this code with win8 and hidDevice.read(bytes, 10000); always returned by timeout.
On win 7 and Linux everything is working fine.
If i set HidApi.dropReportIdZero=false; then everything is working fine on win8!!!
This is strange because default on Win8 and win10 this flag is set to true.
private void sendMessage(HidDevice hidDevice) {
if (!hidDevice.isOpen()) {
if(!hidDevice.open()) throw new RuntimeException();
byte[] commandWrite = new byte[64];
commandWrite[0]=50;
int val = hidDevice.write(commandWrite, commandWrite.length, (byte) 0x00);
System.out.println("Num bytes: " + val);
if (val < 0) throw new RuntimeException();
byte[] bytes = new byte[64];
int read = hidDevice.read(bytes, 10000);
System.out.println("Num bytes: " + read);
if (val < 0) throw new RuntimeException();
}
}
I use this code with win8 and
hidDevice.read(bytes, 10000);
always returned by timeout. On win 7 and Linux everything is working fine.If i set HidApi.dropReportIdZero=false; then everything is working fine on win8!!! This is strange because default on Win8 and win10 this flag is set to true.