Shop OBEX P1 Docs P2 Docs Learn Events
Followup - Serial Port Hardware Flow Control and Java Comm API — Parallax Forums

Followup - Serial Port Hardware Flow Control and Java Comm API

ArchiverArchiver Posts: 46,084
edited 2004-05-07 17:04 in General Discussion
I posted here before about problems sending data from PC to BS2 using
hardware flow control. PC code in Java using Sun's Comm API.

Communication worked in some cases but other times the write operation
on the PC hung.

After a lot of testing, all I could see different between the working
case and the bad case was that when it worked, the BS2 was waiting
executing a SERIN command and CTS was set AT THE TIME THE PORT WAS
ALLOCATED/OPEN.

If CTS was not set when the port was allocated, all was lost. It
didn't matter if you waited for CTS to be set by the BS2 before trying
a write - it had to be set at port allocation/open time.

So I added code to loop, opening the port, checking CTS, if not set,
close the port and retry.

This has worked 100% for me so far.

My presumption now is that this is a bug or feature of Sun's Java Comm
API.

Thanks.

Harry
Sign In or Register to comment.