java program read serial port data unstable at linux

Discussion in 'Java' started by Raine Wang, Nov 2, 2004.

  1. Raine Wang

    Raine Wang Guest

    Hi,

    My application needs to communicate with one external device at
    windows and linux. At windows, I use the package sun provided and run
    stably. But when the same program( of course, there is different with
    the device's name :) ) runs at linux(Redhat) using RxTx package, it
    always can't get data from port. My program need to send a lot of
    times quest to the device and read the response(data) from the serial
    port after each request. This process will repeat hundred times. But
    the program always can't fully executed. It sometimes will just stay
    at the read sentence and wait for data( I am sure the data should be
    arrived). When will the program blocked at the read sentence is not
    fixed.
    program sometimes is blocked at the first time, sometimes after read
    several times, sometimes no block at all. But my program running at
    windows don't have this kind of problem. :(

    Please give me some ideas. Thanks in advance.

    Raine
     
    Raine Wang, Nov 2, 2004
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Casey Bralla

    Read from Serial Port

    Casey Bralla, Jan 21, 2006, in forum: Python
    Replies:
    6
    Views:
    770
    Neil Benn
    Jan 23, 2006
  2. Pom
    Replies:
    2
    Views:
    2,141
    Bas-i
    Jan 31, 2007
  3. Robert Ngo

    read from serial port in c

    Robert Ngo, Aug 10, 2004, in forum: C Programming
    Replies:
    1
    Views:
    532
    -berlin.de
    Aug 10, 2004
  4. serial port communication (linux)

    , Dec 24, 2004, in forum: C Programming
    Replies:
    7
    Views:
    938
    Lawrence Kirby
    Dec 29, 2004
  5. Vivek Menon
    Replies:
    8
    Views:
    3,499
    bogdan
    Dec 6, 2006
  6. Replies:
    2
    Views:
    457
    Victor Bazarov
    May 22, 2006
  7. terry
    Replies:
    5
    Views:
    1,145
    Gabriel Genellina
    May 3, 2008
  8. msalerno
    Replies:
    3
    Views:
    632
    Ilmari Karonen
    Jul 14, 2005
Loading...