hid4java
hid4java copied to clipboard
WriteFile: (0x00000005) Access is denied
trafficstars
Hi I use Wireshark for reverse engineering the mice's application codes . I tried to send a set report request to the mice by using your lib . I faced a problem after sending Write request to the device , it returns this Error : WriteFile: (0x00000005) Access is denied.
Here's My Code :
HidServices hidServices = HidManager.getHidServices();
HidDevice device = hidServices.getHidDevice(20051, 21510, null);
byte[] message = {0x21, 0x09, 0x07, 0x03, 0x01, 0x00 ,0x08, 0x00};
byte reportid=0x07;
int val = device.write(message, 8,reportid);
if (val != -1) {
System.out.println("> [" + val + "]");
} else {
System.err.println(device.getLastErrorMessage());
}
Any hint is greatly appreciated