Hi all,
I am not sure that this is the right place to write this place,but i'll do it anyhow.
I want to send a signal to one of my usb ports so that it will reach the device connected to that port.
How can I send signal to usb port using java?
10x
Printable View
Hi all,
I am not sure that this is the right place to write this place,but i'll do it anyhow.
I want to send a signal to one of my usb ports so that it will reach the device connected to that port.
How can I send signal to usb port using java?
10x
What do you mean by a send a signal exactly?
I mean that I got a device that is connected to a usb port, and I need to send a number to that device(thats the signal)
10x
I would consider this more of a native level job, which may be handled via the JNI. However, depending on the operating system that you're using, all you may need to do is create a FileOutputStream. What I mean by this is that in Linux, everything is a file. All devices have a file equivalent. So all you would need to do is (permissions permitting) create a FileOutputStream to that file, write the data to it, and you should be done. An example of this would be
Code Java:FileOutputStream output = new FileOutputStream("/dev/bus/usb/002"); output.write(someData); output.flush();
But, this only works on Linux/Unix systems.