Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: USB signal

  1. #1
    Junior Member
    Join Date
    Apr 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default USB signal

    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


  2. #2
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 287 Times in 225 Posts
    Blog Entries
    4

    Default Re: USB signal

    What do you mean by a send a signal exactly?
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

    Looking for a Java job? Visit - Java Programming Careers

  3. #3
    Junior Member
    Join Date
    Apr 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: USB signal

    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

  4. #4
    Junior Member
    Join Date
    May 2011
    Posts
    12
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Default Re: USB signal

    Quote Originally Posted by mp3rara View Post
    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
    FileOutputStream output = new FileOutputStream("/dev/bus/usb/002");
    output.write(someData);
    output.flush();

    But, this only works on Linux/Unix systems.

Similar Threads

  1. [SOLVED] Detect USB signal
    By mine0926 in forum Java Native Interface
    Replies: 2
    Last Post: February 4th, 2011, 06:46 PM
  2. Signal processing API.
    By ivanloes in forum Java Theory & Questions
    Replies: 4
    Last Post: December 18th, 2010, 04:56 PM
  3. How to display sound signal waveforms continously?
    By ces_31 in forum Java Theory & Questions
    Replies: 4
    Last Post: August 10th, 2009, 09:43 AM