Followup - Serial Port Hardware Flow Control and Java Comm API
Archiver
Posts: 46,084
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
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