Comments (9)
Hi @mohamnexus. Thanks for your interest in hid4java. Can you verify that you've read the README and installation instructions? There is a step-by-step guide to building it in the wiki linked there.
If your project uses Maven it will be very straightforward. If not then you can use one of the pre-built releases here: https://github.com/gary-rowe/hid4java/releases
from hid4java.
Hi again
I can use hid4java in my project and send data to usb, but i couldn't get data from hid usb.
I want to use getReport() method , please help me.
Thanks
from hid4java.
Can you provide a code sample indicating what you're trying to do? There is extensive documentation on the API detailing how to use it.
from hid4java.
Skip my previous question.
Send data to USB with trezor.write(message, PACKET_LENGTH, (byte) 0);
and get feature report with trezor.getFeatureReport(data, (byte) 0 ); is working
but when i change report ID to 0x1 , i can send data but i can't get data from usb.
why?
from hid4java.
When you change the report ID in USB then it changes the function of the device. You need to consult the documentation that comes with it in order to correctly determine which reports are supported and what they do.
from hid4java.
Thanks for your reply.
I have an application for usb device test (SimpleHIDWrite) that supporting getFeatureReport with 0x01 report id but i couldn't use getFeatureReport with hid4java library.
from hid4java.
Judging by the ArrayIndexOutOfBoundsException
and the structure of the getFeatureReport
method it seems that the hid_get_feature_report
native method is returning the full data.length + 1
which is too large for the buffer.
You've probably found a bug.
Can you build a copy of hid4java using the develop
branch code and try again? Remember to change the version to develop-SNAPSHOT
in your Maven configuration.
from hid4java.
This bug has been fixed in release 0.4.0 so closing here
from hid4java.
Hi @gary-rowe ,
As far as I know, GetReport mentioned by @mohamnexus is different from getFeatureReport.
I've used the latest hid4java-develop with develop-SNAPSHOT version and it works well on most of my handled projects using the USB HID interface to send/receive commands.
However, there're some specific platforms that require sending SetReport first and then sending another GetReport to obtain its results. It seems that the current hid4java-develop does not provide this GetReport API yet.
from hid4java.
Related Issues (20)
- setAutoDataRead(true) - nothing happens, program waits forever HOT 2
- Add module name HOT 3
- I am not scanning my device using UsbHidEnumerationExample. Do I need to do anything to set the MAC? HOT 6
- Event hidDataReceived not working. HOT 2
- Option to open device in non-exclusive mode HOT 1
- When will 0.8.0 be released as example code doesn't compile when tried with latest published jar? HOT 7
- Support for Raspberry pi 4 HOT 4
- MacOS ARM incompatible HOT 3
- Unable to open connection to multiple identical devices HOT 1
- HidApi.read returning -2(DEVICE_ERROR) and "Device not initialised" seen when trying to fetch SN, PID HOT 4
- Specify minimum JNA version required HOT 1
- hid4java always uses the libusb variant of libhidapi on linux-x86-64 HOT 1
- support hidapi 0.14.0 HOT 2
- Branch cleanup HOT 1
- Update MVN repository content
- USB HID Set Report and Get Report HOT 10
- How can i read the scanner data. HOT 3
- Pre-release checklist for 0.8.0
- Regression in `hidApiLibrary.hid_open_path(path)` v 0.8 HOT 6
- On Ubuntu 22.04 64bit `WideStringBuffer` is not applicable for `hid_error`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hid4java.