Re: Serial port problems
From: Brad BARCLAY (bbarclay_at_jsyncmanager.org)
Date: 12/28/03
- Next message: - ions: "Adding ComboBox Items with a loop"
- Previous message: Brad BARCLAY: "Re: Anybody use Java with USB devices?"
- In reply to: mimisam: "Serial port problems"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: - ions: "Adding ComboBox Items with a loop"
- Previous message: Brad BARCLAY: "Re: Anybody use Java with USB devices?"
- In reply to: mimisam: "Serial port problems"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|