neptunas / javahidapi

Automatically exported from code.google.com/p/javahidapi
Other
0 stars 0 forks source link

Cannot read from device #30

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. I have a device connected via Bluetooth: Logitech diNovo Mini Keyboard and 
Mouse

2. I tried the java hid api
com.codeminders.hidapi.ClassPathLibraryLoader.loadNativeHIDLibrary();
HIDDeviceInfo[] devices = HIDManager.getInstance().listDevices();

Then I get 12 devices

devices[0]= Logitech USB Optical Mouse

devices 1-3: I don't know what is it:  serial_number=?, release_number=256, 
manufacturer_string=?, product_string=?

devices 4-12: Logitech diNovo Mini Keyboard

device[13]= BROADCOM Bluetooth Remote Control HID Device

3.
  for (int i = 0; i < devices.length; i++) {
        HIDDeviceInfo deviceInfo = devices[i];
        HIDDevice device = HIDManager.getInstance().openByPath(deviceInfo.getPath());

        if (device != null) {
        ...
        }
    }

With this I can connect only to device[8] and device[12], the others are null 
if I try to connect with openByPath().

What is the expected output? What do you see instead?
- If I hit some keys on the device, and I try device.read(), I cannot get any 
data.
- If i use device.readTimeout(), I get only zeros.
for example: 
byte[] buf = new byte[2048];
...(device.readTimeout(buf, 1000) > -1) {...}
- What could be the problem, or what mistakes have I made? Thanks!

What version of the product are you using? On what operating system?
hidapi-1.1, Windows 7 64 bit

Original issue reported on code.google.com by h.mih...@gmail.com on 28 Aug 2012 at 4:15

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Dear Sir, 

    I am, also facing same issue. I can detect device a but unable read and write. Please Guide us 

Rahul
rahulkumarnaik@gmail.com

Original comment by rahulkum...@gmail.com on 19 Nov 2012 at 5:35