Re: Serial port problems

From: Brad BARCLAY (bbarclay_at_jsyncmanager.org)
Date: 12/28/03


Date: Sun, 28 Dec 2003 03:05:07 GMT

mimisam wrote:

> I am using FileOutputStream and FileInputStream to send and receive
> data from the ports. When parallel port is used, I got the feedback
> when the printer is off(exception caught) or the drawer status
> changes. My problem is that for serial port, I can't get any feedback
> at all. No exception is caught and it hangs when I try to read in data
> from the COM port.

        Why on earth wuld you use FileInputStream and FileOutputStream for
talking to serial and parallel ports? Are you trying to use them
against PRN/LPTx and COMx?

        This is not how you should be communicating with serial and parallel
devices. If you want to do that, look at the Java Communications API,
which provides its own classes far talking directly to the
serial/parallel hardware, allowing you to set the necessary
communication parameters (speed, bits per byte, stop bits, handshaking,
etc.).

        To download and for more details, see:

                http://java.sun.com/products/javacomm/

        HTH!

Brad BARCLAY

-- 
=-=-=-=-=-=-=-=-=
 From the OS/2 WARP v4.5 Desktop of Brad BARCLAY.
The jSyncManager Project:  http://www.jsyncmanager.org


Relevant Pages

  • Re: Design Problem
    ... COM Port, and that the 'instructions' contain a destination flag ... The tasks are instructions to the BMS. ... Do you have 'feedback' within the Task? ... Send command Wait until some feedback then send another command ...
    (microsoft.public.vb.general.discussion)
  • Re: Design Problem
    ... COM Port, and that the 'instructions' contain a destination flag ... Do you have 'feedback' within the Task? ... Send command Wait until some feedback then send another command ... how to set up such a scheduler. ...
    (microsoft.public.vb.general.discussion)
  • Re: py3k feature proposal: field auto-assignment in constructors
    ... I appreciate everyone's feedback on the topic. ... creating more complexity is not the way to go. ... This is probably even more preposterous than @host, @port, but to me ...
    (comp.lang.python)
  • Serial port problems
    ... If the port chosen is wrong or the ... My problem is that for serial port, I can't get any feedback ... FileInputStream inputReader = null; ...
    (comp.lang.java)
  • Re: Printer port confusion
    ... indicates that pins 10 and 15 are inverted inputs, ... PC Parallel Port Mini-FAQ ... The data register is at IOBase+0. ...
    (sci.electronics.basics)