Generic HID Host Applications in JAVA

Author
sylam
New Member
  • Total Posts : 11
  • Reward points : 0
  • Joined: 2007/04/02 18:43:25
  • Location: Hong Kong
  • Status: offline
2007/08/30 00:31:49 (permalink)
0

Generic HID Host Applications in JAVA

This piece of work was ported from the example codes on "The HID Page" of www.lvr.com.
#1

4 Replies Related Threads

    DarioG
    Scheisse Menschen
    • Total Posts : 52256
    • Reward points : 0
    • Joined: 2006/02/25 08:58:22
    • Location: hi there
    • Status: offline
    RE: Generic HID Host Applications in JAVA 2007/08/30 01:42:18 (permalink)
    0
    Cool, it might be useful to be used in some circumstances.
    I'll take a look at it.

    Thanks

    Dario Greggio
    --
    Wouldn't it be wonderful, if you lost one son for every promise you don't keep?
    #2
    lbodnar
    Super Member
    • Total Posts : 1148
    • Reward points : 0
    • Joined: 2005/12/18 06:06:09
    • Location: UK
    • Status: offline
    RE: Generic HID Host Applications in JAVA 2007/08/30 03:28:34 (permalink)
    0
    Few years ago I have looked into Java for cross-platform USB application development but at the time there was no compatible multiplatform USB support libraries.  Java itself does not have USB support classes built in.

    Is the situation still the same?

    Leo
    #3
    xiaofan
    Super Member
    • Total Posts : 6247
    • Reward points : 0
    • Joined: 2005/04/14 07:05:25
    • Location: Singapore
    • Status: offline
    RE: Generic HID Host Applications in JAVA 2007/08/30 05:37:13 (permalink)
    0
    Your best bet is still libusb. But libusb is not so good for cross-platform HID support. libhid authors have some good thoughts (using native APIs) but no time to implement it. Personally I like libusb very much and I monitor both libusb and libusb-win32 mailing list.
     
    There are some work on Java USB: http://javax-usb.org/ . There seems to be some codes released but I am no so sure about the usability.
     
    Apparently Sun recognized this as a problem and even commit some engineers to fork libusb to a new project openusb but there are no usable codes released yet after some hot initial disscussions on the API early this year in libusb mailing list.
    http://openusb.sourceforge.net/
     
    #4
    bahatay
    New Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2011/07/18 07:22:10
    • Location: 0
    • Status: offline
    RE: Generic HID Host Applications in JAVA 2011/08/08 01:35:46 (permalink)
    0


    Hi there, firstly I am very grateful for your piece of code.

    However I am encountering some problems and your help will be grately appreciated. Your program is able to

    - Find HID device
    - Get input, output and feature report size
    - Read data from the device
    - write data from the device (I did not test if it sends correctly or not but I dont care)

    My purpose is to send a piece of string to PIC as send data command and to read the data sent by PIC. So I just altered your code for my purpose. However the problem I am facing is also true for your code. The problem is when write command runs, java gives ntdll.dll error and it gets out of JVM. After some tries, it does not gets out of JVM on some occasions (without touching code)

    In PIC coding I added a delay of 1 second between (get command and send data to PC) and it improved the chance of successive run.

    I have a tool that can monitor the HID port coming data. So when I run write command from the java, it surely sends to PIC and the PIC starts to send data as a response but java gives error after write command is done.

    I think I miss a point in PIC programming.  I just use functions of find device, read(doread), write(dowrite). As feature report byte it is always null.
    #5
    Jump to:
    © 2017 APG vNext Commercial Version 4.5