Code Monkey home page Code Monkey logo

javahidapi's People

Contributors

alexsaveliev avatar birdowl avatar ludovicrousseau avatar signal11 avatar veelo avatar vvolokh avatar vzaliva avatar

Watchers

 avatar

javahidapi's Issues

Two identical devices, enumeration can fail (listDevices)

What steps will reproduce the problem?
1. Call listDevices()
2. See that no devices or only some of the HID devices are listed. Some or all 
devices are missing occasionally.


What is the expected output? What do you see instead?
1. All available devices should be listed.

What version of the product are you using? On what operating system?
December 2011 edition on Windows 7 Professional 32 bit.

Please provide any additional information below.

It is in the open call in hid.c it fails. In the open call you first try to 
open usb by path without sharing, and if it fails, you try to open with sharing 
(FILE_SHARE_READ | FILE_SHARE_WRITE). The first open call should be removed and 
the second inserted as the only one. That fixes the problem, and all devices 
are listed correct. 

Original issue reported on code.google.com by [email protected] on 6 Aug 2012 at 6:30

HIDManager listDevices is not changed on MAC

What steps will reproduce the problem?
1. On MAC 10.6
2. Connect USB  controller
2. Execute listDevices() ... Please note that you have you device in returned 
list 
3. Disconnect controller
4. Execute listDevices() ... Please note that you have you device in returned 
list 

lsitDevices does not change its value on connect/disconnec USB device 

What is the expected output? What do you see instead?

Correct list of devices that are currently  connected


Original issue reported on code.google.com by [email protected] on 1 Aug 2012 at 10:02

packaged test harnest throws IOException on linux (ubuntu)

What steps will reproduce the problem?
1. download the distribution from the download section (or checkout trunk)
2. run: make -C linux
3. patch the build.xml (ant run assumes the "mac" subfolder in line 78) by 
replacing mac with linux.
4. run: ant
5. run: ant run (also: "sudo ant run" doesn't work)

What is the expected output? What do you see instead?
I would have expected a list (empty or at least one device), but instead, I see 
the following output:
someuser@ubuntu:~/Downloads/javahidapi$ sudo ant run
Buildfile: /home/someuser/Downloads/javahidapi/build.xml

init:

build-project:
     [echo] hidapi: /home/someuser/Downloads/javahidapi/build.xml

run:
     [java] /home/someuser/Downloads/javahidapi/linux
     [java] 
     [java] java.io.IOException: 
     [java]     at com.codeminders.hidapi.HIDManager.listDevices(Native Method)
     [java]     at com.codeminders.hidapi.HIDAPITest.listDevices(HIDAPITest.java:122)
     [java]     at com.codeminders.hidapi.HIDAPITest.main(HIDAPITest.java:34)
     [java] waiting connect/disconnect...


What version of the product are you using? On what operating system?
trunk and the available download. Ubuntu (latest)


Original issue reported on code.google.com by [email protected] on 8 Feb 2012 at 10:27

Unexpected feature report

I'm running the following code on an Emotive EEG on OS X Mountain Lion

            byte[] report = new byte[9];
            int wrote = dev.getFeatureReport(report);
            System.out.println(wrote + " --> " + Arrays.toString(report));

I expect to see

            // 0x00, 0xa0, 0xff, 0x1f, 0xff, 0x00, 0x00, 0x00, 0x00

but I'm actually getting either all zeros or

    32, -1, 31, -1, 30, 0, 0, 0

and everytime that 8 entries have been written (not the expected 9).

The device seems to work fine when run using the emokit C binary, which is 
using HIDAPI directly.

Original issue reported on code.google.com by [email protected] on 28 Dec 2012 at 12:52

Two devices with identical VID & PID returns same HIDDevice when opened simultaneously

What steps will reproduce the problem?
1. Insert two USB HID devices with same VID & PID
2. Call HIDManager.list_Devices() and call HIDDeviceInfo.open on each object 
that matches the VID & PID;
3. The two returned HIDDevice objects are equal, the peer is the same.

What is the expected output? What do you see instead?
Expected to see two different HIDObjects with different peers. But instead they 
have identical peers and both are working when reading/writing, but they reach 
the same device (as far as i can see the first that is enumerated). 

What version of the product are you using? On what operating system?
2011-12-21 build.
Windows 7 32 bit.

Please provide any additional information below.
Please tell me if you need more information or if this is a design choice. Some 
API's cannot handle multiple identical devices.

Original issue reported on code.google.com by [email protected] on 25 Apr 2012 at 10:08

ava.io.IOException:at com.codeminders.hidapi.HIDManager.listDevices(Native Method)

Hi,

I follow build instructions but...


What steps will reproduce the problem?
1. Compile with VS 2008 on Windows XP
2. add dll to jar directory
3. launch jar where I call lib: System.load(mypath + "hidapi-jni.dll")
4. call listDevices() method


What is the expected output? What do you see instead?

Expected: listing of devices.

Seen: jul 31, 2012 5:04:08 PM cbgp.hdi.AdministradorHDI getInstance
Grave: null
java.io.IOException:
        at com.codeminders.hidapi.HIDManager.listDevices(Native Method)
        at cbgp.hdi.AdministradorHDI.getInstance(AdministradorHDI.java:67)
        at cbgp.CodigoBarrasGP.main(CodigoBarrasGP.java:92)

Where AdministradorHDI extends HDIManager

What version of the product are you using? On what operating system?
- OS: windows XP
- javahidapi -> revision: 6b71216bf226

Please provide any additional information below.

- I tried to put hidapi-jni.dll in ALL system.java.path and use 
System.loadLibrary method -> doesn't work
I tried it in 64bits architecture and got expected message -> ok it's 
compilation for 32 bits OS.

I'm desesperated... I'm doing something wrong?

If there's no work around, please if someone could send me compiled 32bits 
windows dll it will save me from project disaster...

Cheers.

Original issue reported on code.google.com by [email protected] on 31 Jul 2012 at 3:58

Architecture x86_64 not supported on Mac OS X 10.7.3

What steps will reproduce the problem?
1. checked out the latest version from trunk
2. called "make -C mac"

What is the expected output? What do you see instead?
After executing make, I am getting the following error:
make -C mac
gcc  -I../hidapi -g -c -I.. -I../jni-impl 
-I/System/Library/Frameworks/JavaVM.framework/Headers  hid.c -o hid.o
g++  -I../hidapi -g -c -I.. -I../jni-impl 
-I/System/Library/Frameworks/JavaVM.framework/Headers  
../jni-impl/HIDManager.cpp -o HIDManager.o
g++  -I../hidapi -g -c -I.. -I../jni-impl 
-I/System/Library/Frameworks/JavaVM.framework/Headers  
../jni-impl/HIDDeviceInfo.cpp -o HIDDeviceInfo.o
g++  -I../hidapi -g -c -I.. -I../jni-impl 
-I/System/Library/Frameworks/JavaVM.framework/Headers  
../jni-impl/HIDDevice.cpp -o HIDDevice.o
g++  -I../hidapi -g -c -I.. -I../jni-impl 
-I/System/Library/Frameworks/JavaVM.framework/Headers  ../jni-impl/hid-java.cpp 
-o hid-java.o
g++  -g hid.o ../hidtest/hidtest.o HIDManager.o HIDDeviceInfo.o HIDDevice.o 
hid-java.o -framework IOKit -framework CoreFoundation -l iconv -o hidtest
ld: warning: ignoring file ../hidtest/hidtest.o, file was built for unsupported 
file format which is not the architecture being linked (x86_64)
Undefined symbols for architecture x86_64:
  "_main", referenced from:
      start in crt1.10.6.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [hidtest] Error 1

What version of the product are you using? On what operating system?
Trunk, on a i7 iMac with OS X 10.7.3 running.

Sorry to bother again...

Original issue reported on code.google.com by [email protected] on 9 Feb 2012 at 1:41

compiling win32 in x64 system (windows 7)

What steps will reproduce the problem?
1. open vs2008 sln
2. change to win32 platform
3. compile fails

What is the expected output? What do you see instead?
compile fails


What version of the product are you using? On what operating system?
hg snapshot on 29/02/2012
windows 7 64 bit
MS VS2008 9.0.21022.8RTM


Please provide any additional information below.
compilation of 64bit platform is ok

Original issue reported on code.google.com by [email protected] on 1 Mar 2012 at 2:50

jni.h is missing

What steps will reproduce the problem?
1. download sources
2.  compile hidapi dll for windows (Visual studio 2008) 
3. enjoy

What is the expected output? What do you see instead?

a clean compiled dll

What version of the product are you using? On what operating system?

current

Please provide any additional information below.

javahidapi\jni-impl\hid-java.cpp(3) : fatal error C1083: Datei (Include) kann 
nicht geöffnet werden: "jni.h": No such file or directory

Original issue reported on code.google.com by [email protected] on 4 Jul 2012 at 1:05

NullPointerException after opening device

What steps will reproduce the problem?
1. Compiled on 64bit Ubuntu 12.4, copied the libhidapi-jni.so to /usr/lib
2. Running HIDAPITest lists mouse/keyboard and DataLogic barcodescanner 
successfully (DataLogic under /dev/hidraw3)
3. Uncomment the command readDevice for appropriate vendorID/productID or use 
the openByPath method.

What is the expected output? What do you see instead?
I expect an actual object returned by openByPath/ById,
buth it returns null on any listed USB-device, generating 
anNullPointerException on the next line:
System.err.print("Manufacturer: " + dev.getManufacturerString() + "\n");


What version of the product are you using? On what operating system?
v2011-12-21 on Ubuntu 12.4 x64

Please provide any additional information below.
Is there something trivial I am doing wrong? Listing devices works fine, 
however opening a device not.

Original issue reported on code.google.com by [email protected] on 1 Jun 2012 at 9:58

Very busy read{Timeout}

When I JVisualVM profile my USB application, reading the USB device is eating 
up a whole thread – is there no way to make this asynchronous (or yield the 
thread until data is available) and save CPU cycles?

My device is running at about 170Hz and that means about 7 milliseconds wait 
per report acquisition. That's too low for me to be able to do anything 
sensible with Thread.sleep, but high enough that it's eating 93% of that 
thread's time.

Strategies to save cycles would be greatly appreciated.

Link to my project and the issue report there:

  https://github.com/fommil/emokit-java/issues/7

Original issue reported on code.google.com by [email protected] on 30 Dec 2012 at 3:18

Close not works properly

What steps will reproduce the problem?

1. HIDDevice dev;
   dev = HIDManager.openById(VENDOR_ID, PRODUCT_ID, null);
   dev.close();
   System.out.println("Close works");


What is the expected output? What do you see instead?

If the device close in correct way, then the output must be "Close works". but 
the aplication exit defore println(..).

What version of the product are you using? On what operating system?
version:javahidapi-20111221
Operating System: Ubuntu 10.04

Please provide any additional information below.

before close the device, the aplication works fine, but if I close de device 
(dev.close), the aplication exit.

Please help me.



Original issue reported on code.google.com by [email protected] on 27 Jul 2012 at 8:27

JVM Crash When Calling HIDManager.listDevices()

What steps will reproduce the problem? This happens randomly.

What is the expected output? What do you see instead?

Expected outcome is for the call to succeed and to return a bonafide list of 
the available devices.

What version of the product are you using? On what operating system?

Version 1.1 on Windows XP Build 2600 Service Pack 3

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 22 Jan 2013 at 8:35

Attachments:

Different results for same code in OSX 10.7.5 vs. Windows XP

What steps will reproduce the problem?
1. Same java code in OSX 10.7.5 and Windows XP
2. On a call to write(), passing in a byte[] as a parameter.
3. On 10.7.5 all works fine, on Windows XP an exception is raised 
"The parameter is incorrect".

What is the expected output? What do you see instead?
I would expect to see the same result for both Mac and Windows


What version of the product are you using? On what operating system?
1.1

Please provide any additional information below.
Error happens on line 96 of the attached code.  Again it only throws the 
exception with Windows XP not OSX 10.7.5


Original issue reported on code.google.com by [email protected] on 17 Dec 2012 at 7:21

Attachments:

Write Bytes to the HID Device

Hi Codeminders -Team,

if you have time, can you please look at this problem:

This is my code to write two bytes to my HID Device:

public void writetoHID(){
        try {
            HIDDevice hidevice = HIDManager.openById(VENDOR_ID, PRODUCT_ID, null);
            byte[] reset = new byte[]{0,8};
            hidevice.write(reset);
        } catch (IOException ex) {
            Logger.getLogger(DeviceCtrl.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

But i get this Exception and i don't know why

java.io.IOException: The supplied user buffer is not for the requested 
operation.
    at com.codeminders.hidapi.HIDDevice.write(Native Method)

Everything else works great.



Original issue reported on code.google.com by [email protected] on 19 Aug 2011 at 6:19

How to build from source

I've written some instructions for building this project from source which 
might be of interest to others:  http://angryelectron.com/building-javahidapi

(Please feel free to copy this info and add it to the Wiki if you like.)

Original issue reported on code.google.com by [email protected] on 31 Jan 2013 at 9:59

Two apps can't access one HID device. Windows Only (includes Fix)

I have modified the hidtest application to use the PID and VID of my HID 
device.  When run on a Mac and on Linux, the application is able to list and 
read the device.

On my Windows machine (Windows 7 32-bit, javahidapi-1.1, java 1.7.), there is a 
service running that is also trying to access the HID device.  The test 
application lists and reads properly when the service is stopped.  With the 
service running, the application can list, but HIDDevice.openById() returns 
null.

The issue is with the Windows native code, specifically hidapi's open_device(). 
 During the list() operation, open_device() calls CreateFileA() with 
FILE_SHARE_READ | FILE_SHARE_WRITE.  However, during the openById() operation, 
open_device() calls CreateFileA() with only FILE_SHARE_READ.

Perhaps read-only share mode was selected for a reason, but when the attached 
patch is applied (to always grant read and write sharing mode) the hidtest 
application runs successfully regardless if the service is running or not.



Original issue reported on code.google.com by [email protected] on 31 Jan 2013 at 1:03

Should work on ARM with cibuddy Library?

What steps will reproduce the problem?

Use javahidapi with cibuddy ARM library.

What is the expected output? What do you see instead?

Device should open, but "open" returns null.

What version of the product are you using? On what operating system?

javahidapi 1.1 on Raspbian Wheezy (Linex 3.2.27, armv6l)

Please provide any additional information below.

I'm trying to get the code working on a Raspberry Pi (ARM v6, soft floating 
point).

In the absence of an ARM binary as part of javahidapi I tried:

  https://github.com/cibuddy/cibuddy/tree/master/drivers/hid/src/main/resources/lib/linux/arm6

This looks hopeful as "listDevices" finds the device I'm interested in:

  HIDDeviceInfo [path=0001:0004:00, vendor_id=4062, product_id=51713, serial_number=null, release_number=770, manufacturer_string=null, product_string=null, usage_page=0, usage=0, interface_number=0]

However, when I "open" this device I get null.

Any inspirations, or plans to provide an ARM binary of your own?

Original issue reported on code.google.com by [email protected] on 1 Feb 2013 at 2:16

HID Test is not detecting IOWarrior device

What steps will reproduce the problem?
1. Run HIDTest using 'ant run'
2. Plug and unplug IOWarrior based device 
3. Nothing happens

What is the expected output? What do you see instead?
On running HIDTest and plugging/unplugging an IOWarrior based device the 
program does not detect anything.  The device is shown in dmesg but not 
HIDTest.  Other devices e.g. Apple keyboard and mouse show as expected in both 
dmesg and HIDTest.  I've attached a screenshot which shows the dmesg window top 
and HIDTest window bottom to illustrate.  Is there anything that you can think 
of that would be stopping this specific device from being detected?  Anything I 
can do to debug?  

What version of the product are you using? On what operating system?
I'm using the latest javahidapi release (20111220) on Ubuntu 12.04

Please provide any additional information below.
The website of the chipmaker is: http://www.codemercs.com/index.php?id=127&L=1  
I am an developer trying to add support for a device that uses this chip in my 
software so I know little about the chip.  However, I can pass any questions up 
to the manufacturer of the device who is likely to know more.  

Original issue reported on code.google.com by [email protected] on 3 Jul 2012 at 9:48

Attachments:

listDevices fails when Microsoft Nano transceiver is connected

What steps will reproduce the problem?
1. connect Microsoft Nano transceiver
2. call listDevices
3.

What is the expected output? What do you see instead?

I expect to get an array of devices instead an exception is thrown:

Exception in thread "main" java.lang.Error: iconv failed
    at com.codeminders.hidapi.HIDManager.listDevices(Native Method)

What version of the product are you using? On what operating system?

hidapi-1.1 / MacOS X 10.7.5/ JDK 1.7 Oracle

Please provide any additional information below.

Code:
ClassPathLibraryLoader.loadNativeHIDLibrary();
HIDManager manager = HIDManager.getInstance();
HIDDeviceInfo[] deviceInfos = manager.listDevices();

Device Information:

Microsoft® Nano Transceiver v1.0:

  Produkt-ID:   0x0745
  Hersteller-ID:    0x045e  (Microsoft Corporation)
  Version:   2.52
  Geschwindigkeit:  Bis zu 12 MBit/s
  Hersteller:   Microsoft
  Standort-ID:  0x04100000 / 2
  Verfügbare Stromstärke (mA):    500
  Erforderliche Stromstärke (mA):  100


Original issue reported on code.google.com by [email protected] on 25 Jan 2013 at 9:00

Not working on ubuntu 9.10

What steps will reproduce the problem?
1. List Devices
2. Open Device
3. Write a command
4. Nothing happens, it's as the command never reaches the device.

What is the expected output? What do you see instead?
The command is not sent to the device
Same code is working on windows

What version of the product are you using? On what operating system?
Latest, OS Ubuntu 9.10

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 14 Mar 2012 at 6:11

Please make 64-bit hidapi-jni.dll

What steps will reproduce the problem
1. 64-bit Win7 then run javahidapi\src\com\codeminders\hidapi .java code 
changing one line to System.load("g:\\HidApi2\\hidapi-jni.dll");
2.
3.

What is the expected output? What do you see instead?
G:\HidApi2\hidapi-jni.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform

What version of the product are you using? On what operating system?
javahidapi-20111221
64-bit Win7

Please provide any additional information below.
Tried to build 64-bit version in VS 2010 got -- "fatal error C1902: Program 
database manager mismatch."  Tried to pin down the miss match.  My best debug 
tricks failed.

Original issue reported on code.google.com by [email protected] on 11 Feb 2012 at 12:54

Could not find or load main class com.codeminders.hidapi.HIDAPITest

On OS X Mountain Lion, libhidapi installed in /usr/local and after "make -C 
mac":

$ant run

Buildfile: /Users/samuel/Documents/Projects/emokit/javahidapi/build.xml

init:

build-project:
     [echo] hidapi: /Users/samuel/Documents/Projects/emokit/javahidapi/build.xml

run:
     [java] Error: Could not find or load main class com.codeminders.hidapi.HIDAPITest

BUILD FAILED
/Users/samuel/Documents/Projects/emokit/javahidapi/build.xml:102: Java 
returned: 1

Total time: 1 second

Original issue reported on code.google.com by [email protected] on 27 Dec 2012 at 7:07

UnsatisfiedLinkError exception with included binaries

What steps will reproduce the problem?
1. Modify HIDAPITest to load hidapi-jni-32 or hidapi-jni-64
2. Set java.library.path to the location of the win binaries
3. Build and run HIDAPITest

What is the expected output? What do you see instead?
Expected HIDAPITest main to be executed.
Instead, the following exception is thrown

Exception in thread "main" java.lang.UnsatisfiedLinkError: 
com.codeminders.hidapi.HIDManager.init()V
    at com.codeminders.hidapi.HIDManager.init(Native Method)
    at com.codeminders.hidapi.HIDManager.<init>(HIDManager.java:53)
    at com.codeminders.hidapi.HIDManager.getInstance(HIDManager.java:121)
    at com.codeminders.hidapi.HIDAPITest.listDevices(HIDAPITest.java:98)
    at com.codeminders.hidapi.HIDAPITest.main(HIDAPITest.java:29)


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

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 16 Dec 2012 at 6:05

Error when trying to use the library

What steps will reproduce the problem?
1. Compile .sln in javahidapi/windows, creates hidapi-jni.dll correct.
2. Put PenTest.java in folder with javahidapi folder.
3. Trying to compile it, as shown under "additional information".
4. Getting the error 

What is the expected output? What do you see instead?
- Correct run of the program. I see there following: 
"Error: Could not find or load main class PenTest"


What version of the product are you using? On what operating system?
- javahidapi-20111221
- Windows 7 64-bit
- Java version 1.7.0_03
- Java is already added to PATH

Please provide any additional information below.
Output from cmd:
C:\>javac -cp .\javahidapi\bin PenTest.java

C:\>java -cp .\javahidapi\bin PenTest
Error: Could not find or load main class PenTest

Original issue reported on code.google.com by [email protected] on 19 Apr 2012 at 11:33

USB Connection/Disconnection event

Am using the C API without the Java code, as i had already written Java API for 
it. But the USB disconnection event is not being triggered properly.

In Windows, for the very first time when the USB is disconnected (for your 
info, have started my Java tool, loaded the hid dll for windows, and while 
loading the dll itself, have registered for the usb event callback.) am not 
able to detect the event. Am using Windows 7 OS. But when the USB is connected 
and disconnected again (for the second time), am getting a successful interrupt 
in my java tool.

In Mac, am not able to create a static library file for its debugging, however, 
while getting the return value for usb event registration in my custom java 
tool, i get a return value of -1, which basically indicates the event 
registration itself is unsuccessful. In Windows, i am able to get 0 for usb 
event registration, which (hopefully) indicates successful registration.

Am using MingW compiler for creation of dll file (Am not using C++ compiler, or 
MS VS for compiling the code).

Am i missing some thing here which would help me in successful detection of the 
event?

Original issue reported on code.google.com by [email protected] on 3 May 2012 at 12:33

Can't subclass HIDManager because it has no public constructor

The wiki tells people to subclass HIDManager, but HIDManager has a private 
default constructor and no other, so it can't trivially be subclassed. Also, 
HIDManager does not have the deviceAdded() and deviceRemoved() methods 
described in the Wiki as needing to be overridden. Please clarify this.

Original issue reported on code.google.com by [email protected] on 29 Oct 2012 at 12:00

Compile project for Linux 10.04

Good evening, I am trying to run this libraries in my Ubuntu 10.04 system but I 
have some problems when I compile project.

when I execute make -C linux i receive the following message:


g++ -Wall -g hid-libusb.o ../hidtest/hidtest.o HIDManager.o HIDDeviceInfo.o 
HIDDevice.o hid-java.o `pkg-config libusb-1.0 libudev --libs`  -o hidtest
Package libudev was not found in the pkg-config search path.
Perhaps you should add the directory containing `libudev.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libudev' found

How to solve this problem?

Cheers

Original issue reported on code.google.com by [email protected] on 10 Aug 2011 at 4:16

ant build file for run

What steps will reproduce the problem?
1. Compiler for Linux
2. on command line type "ant run"
3. you get library not found

What is the expected output? What do you see instead?
list of devices

Please provide any additional information below.
build file is specific to mac for run you need to add an argument to ant file 
to tell run command line where to get the library from (mac, linux or windows 
etc)



Original issue reported on code.google.com by [email protected] on 12 Apr 2012 at 10:00

Two HID's, openByPath seems to work, write does not return error, but write appears not to happen

What steps will reproduce the problem?
1.
Use two HID devices.
2.
Open both HIDDevice's in two separate threads.  This appears to be successful.  


What is the expected output? What do you see instead?
When used individually they each work as expected, writing to them produces the 
expected result.  If both are plugged in, only one works.  The openByPath 
returns an instance of each, the write returns the number of bytes written 
correctly, but the device appears not to be receiving the data.  


What version of the product are you using? On what operating system?
1.1 on Mac OS X v10.7.5

Please provide any additional information below.
The operating system shows both devices when both are plugged in.  The 
hid_mgr.listDevices() function shows both, the openByPath() is successful and 
the byteswritten = dev.write(sendbuf1) returns the proper number of bytes.


Original issue reported on code.google.com by [email protected] on 30 Mar 2013 at 5:38

hidapi.sln not compatible with Visual C++ Express 2010

What steps will reproduce the problem?
1. Check out newest source with: hg clone https://code.google.com/p/javahidapi/

2. Open windows/hidapi.sln as project in Visual C++ Express 2010


What is the expected output? What do you see instead?
The project is converted to 2010 format. But it says the project
is corrupt instead and fails the conversion.

What version of the product are you using? On what operating system?
Visual C++ Express 2010, Windows 7 32-bit

Please provide any additional information below.
If i download the project under "Downloads" it compiles fine, it is just the 
project that is retrieved with "hg clone.."

Original issue reported on code.google.com by [email protected] on 22 Apr 2012 at 3:37

More of a question than issue

What steps will reproduce the problem?
1. Set up an Mac 10.7 environment to interface with a HID device.  Put 
libraries in the appropriate places (libhidapi-jni.jnilib in the 
/Library/Java/Extensions/ folder and include the hidapi-1.1.jar in the 
Referenced Libraries in Eclipse.
2. Export a runnable .jar 
3. The .jar runs fine and preforms as expected on the Mac development computer 
with the libraries installed.
4. Move the .jar to a Windows computer with Java install.  The jar runs but the 
HID functions are not working.

Do I need to install something to the standard Java install on any machine I 
expect to deploy the application on?  If so, what files and where?

What is the expected output? What do you see instead?
Expected the .jar to have all that was needed to run enclosed within it.  The 
HID functions don't work.


What version of the product are you using? On what operating system?
Mac 1.1,  PC ?

Please provide any additional information below.
I guess I'm asking if I would need to provide a custom install to put the 
required extension libraries into the appropriate folders for an end user 
deploy.

Original issue reported on code.google.com by [email protected] on 17 Dec 2012 at 5:21

Opening an opened device succeeds

What steps will reproduce the problem?
1. Plug two identical devices and list the devices
2. Open device #1 ( By first opening all devices one by one to identify the 
desired one )
3. Open device #2 ( By first opening all devices one by one to identify the 
desired one )
   This causes device#1 to get opened ( API does not return null where it should be)
4. Writing to device #1 throws IO operations since the handle is lost.

Note: Step #3 most of the times is reproducible only when closing one of the 
devices and opening it again.

What is the expected output? What do you see instead?
If the device is opened ( busy ), it should return null

What version of the product are you using? On what operating system?
Version 1.1, OS: Linux Ubuntu 9.10 

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 30 Oct 2012 at 8:50

java.lang.UnsatisfiedLinkError: com.codeminders.hidapi.HIDManager.init()V

Hi,

i am getting the following error message when I try to run the HIDAPITest 
program provided in the source folder:

run:
Exception in thread "main" java.lang.UnsatisfiedLinkError: 
com.codeminders.hidapi.HIDManager.init()V
    at com.codeminders.hidapi.HIDManager.init(Native Method)
    at com.codeminders.hidapi.HIDManager.<init>(HIDManager.java:65)
    at com.codeminders.hidapi.HIDManagerTest.<init>(HIDManagerTest.java:19)
    at com.codeminders.hidapi.HIDAPITest.main(HIDAPITest.java:33)
Java Result: 1
BUILD SUCCESSFUL (total time: 1 second)

I am using NetBeans 7.1 and running on Mac OSX 10.7.4.  JRE is 1.6

Libraries (hidapi.jar and libhidapi-jni.jnilib) are installed in 
/System/Library/Java/Extensions.  The libraries appear to be properly loaded 
and I am getting a "clean" build.  But when I attempt to run the program, I get 
the exception stated above.

Is there something else that needs to be done to get the native interface 
library working for the runtime?

Thanks,

Len



Original issue reported on code.google.com by [email protected] on 6 Jun 2012 at 6:37

hidapi-jni 64-bits needed

What steps will reproduce the problem?
1. When I compile your's HIDAPITest, I get an expect, listed below...
2.
3.

What is the expected output? What do you see instead?
java.lang.UnsatisfiedLinkError: 
C:\Users\Viktor\Documents\NetBeansProjects\HIDAPITest\src\hidapi-jni.dll: Can't 
load IA 32-bit .dll on a AMD 64-bit platform
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1807)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1703)
    at java.lang.Runtime.load0(Runtime.java:770)
    at java.lang.System.load(System.java:1003)
    at hidapitest.HIDAPITest.<clinit>(HIDAPITest.java:25)
Could not find the main class: hidapitest.HIDAPITest.  Program will exit.
Exception in thread "main" Java Result: 1


What version of the product are you using? On what operating system?
javahidapi-20111221
Windows7
JAVA build 1.6.0_29-b11 64 bits


Please provide any additional information below.

Thank's , Viktor

Original issue reported on code.google.com by [email protected] on 13 Mar 2012 at 9:44

ARM binary

An ARM binary would be fantastic, so that this works on a Raspberry Pi.

Original issue reported on code.google.com by [email protected] on 29 Dec 2012 at 12:34

diferent behavior between windows and OSX

I got a Problem like this

http://stackoverflow.com/questions/13921742/is-there-a-difference-in-byte-data-t
ype-for-osx-and-windows-solved

Why is there a difference in the behavior  of the api between Windows and Mac ? 
this should be solved by the JNI Wrapper so I don't have to write OS specific 
code in JAVA.


Original issue reported on code.google.com by [email protected] on 10 Apr 2013 at 3:18

HIDManager.openById fails for USB devices that have gone dormant

My HID powers off after a period of time of non-use.  When that happens the 
next time I attempt to call 'openById' it will fail.

My only recourse is to load the native communication software that came with 
the device.  Once I do that the openById call will succeed until the device 
powers down again.

Unfortunately I don't have the error as it's somewhat difficult for me to 
reproduce. I will attach the error the next time this occurs, but I think it 
may just be that openById returns null.

Original issue reported on code.google.com by [email protected] on 28 Mar 2012 at 4:27

suggestion

It would be very useful to implement a method that returns weather a device is 
opened or not:

boolean isOpenedById(int vendor_id, int product_id, String serial_number)

boolean isOpenedByPath(String path)


thanks

Original issue reported on code.google.com by [email protected] on 4 Mar 2012 at 11:48

Windows x64


Whem I compile (x64) the hidapi files, I get the following errors with Visual 
Studio:

1>hid-java.obj : error LNK2019: unresolved external symbol 
__imp_WideCharToMultiByte referenced in function convertToUTF8
1>MSVCRTD.lib(_error_.obj) : error LNK2001: unresolved external symbol 
__imp_WideCharToMultiByte
1>hid.obj : error LNK2019: unresolved external symbol 
__imp_SetupDiDestroyDeviceInfoList referenced in function hid_enumerate
1>MSVCRTD.lib(_error_.obj) : error LNK2001: unresolved external symbol 
__imp_GetProcAddress
1>MSVCRTD.lib(_pdblkup_.obj) : error LNK2001: unresolved external symbol 
__imp_GetProcAddress
1>hid.obj : error LNK2019: unresolved external symbol __imp_LoadLibraryA 
referenced in function lookup_functions
1>hid.obj : error LNK2019: unresolved external symbol __imp_LocalFree 
referenced in function register_error
1>hid.obj : error LNK2019: unresolved external symbol __imp_WriteFile 
referenced in function hid_write
1>hid.obj : error LNK2019: unresolved external symbol __imp_CancelIo referenced 
in function hid_read
....... and so on 

1>C:\***********\javahidapi\windows\Debug\hidapi-jni.dll : fatal error LNK1120: 
46 unresolved externals

Does anyone have the solution for this problem? 

What version of the product are you using? On what operating system?
Visual Studio 2010 Express
Windows 7



Original issue reported on code.google.com by [email protected] on 31 Oct 2011 at 3:52

openById misnomer

I have a USB dongle which creates two devices of identical vendor and product 
id. To distinguish, I have to look at the report after opening.

It took me a long time to narrow this down because openById implies that vendor 
/ product is unique. I suggest that this method be @deprecated and replaced 
with the following

    public List<HIDDeviceInfo> findDevices(int vendor, int product) throws IOException {
        HIDDeviceInfo[] infos = manager.listDevices();
        List<HIDDeviceInfo> devs = new ArrayList<HIDDeviceInfo>(infos.length);
        for (HIDDeviceInfo info: infos) {
            if (info.getVendor_id() == vendor && info.getProduct_id() == product)
                devs.add(info);
        }
        return devs;
    }

Original issue reported on code.google.com by [email protected] on 28 Dec 2012 at 1:28

Callback Event creation uses the wrong class loader in HIDManager.cpp

What steps will reproduce the problem?
1. Create a custom "defining" class loader (I used an OSGi FW for that)
2. Create an implementation of the HIDManager and overwrite call back methods
3. Load this HIDManagerImpl with the custom ClassLoader together with all 
depending classes (like HIDDeviceInfo f.i.)
4. Call listDevices (from this class loader) -> everything works as expected
5. Un-plug/Plug-in a device -> You'll see a CNFE:

Exception in thread "Thread-4" java.lang.NoClassDefFoundError: 
com/codeminders/hidapi/HIDDeviceInfo
Caused by: java.lang.ClassNotFoundException: 
com.codeminders.hidapi.HIDDeviceInfo
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Exception in thread "Thread-6" java.lang.NoClassDefFoundError: 
com/codeminders/hidapi/HIDDeviceInfo
Caused by: java.lang.ClassNotFoundException: 
com.codeminders.hidapi.HIDDeviceInfo
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

My unqualified assumption is that you are using the system class loader and not 
the class loader of the HIDManagerImpl to load the class (which by definition 
has to have access to the class file). I guess it should be a rather simple fix 
when you know where to look for it. Unfortunately my C++ is a bit rusty. 
However, I was able to verify that the HIDManager could be loaded in the 
"hid_device_jni_callback" in HIDManager.cpp, but it fails loading the 
HIDDeviceInfo. I assume a similar approach to the "getPeer" is required here or 
the classloaders in the system have to be queried, which one is capable of 
loading the class definition... Just my 2 cents.

I was using the trunk from about Dec 20. 2011. And I am running on Mac OS X.

I hope that helps...


Original issue reported on code.google.com by [email protected] on 10 Jan 2012 at 12:00

Touble building ControlTower example in Eclipse

What steps will reproduce the problem?
I imported all the source files into a new project and added the jar library 
files hidapi.jar, JavaDrone-1.1.jar, log4j-1.2.16.jar,  and 
libhdiapi-jni-64.jnilib to the build path. 

What is the expected output? What do you see instead?
I would expect I could simply build the project but I can't. I get these errors 
and can't figure out why.

Description Resource    Path    Location    Type
Archive for required library: 
'/Users/username/code/eclipse/Test/lib/mac/libhidapi-jni-64.jnilib' in project 
'Test' cannot be read or is not a valid ZIP file    Test        Build path  Build Path 
Problem

Description Resource    Path    Location    Type
The project cannot be built until build path errors are 
resolved    Test        Unknown Java Problem


What version of the product are you using? On what operating system?
Eclipse SDK
Version: 3.7.2
Mac OSX 10.6.8


Original issue reported on code.google.com by [email protected] on 6 Apr 2012 at 3:09

Cannot read from device

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 [email protected] on 28 Aug 2012 at 4:15

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.