To make a loop-back cable, first you need to go shopping for some stuff:
- USB/RS-232 adapter (TrendNet TU-S9) - works for Mac
- RS-232 female plug
- couple of inches thin wire
On the picture you can see the solution that worked for me. Just connect pins 2-3 and 7-8, you don't even need 1-4 but do it anyway. For testing ZTerm is good for Mac or what ever terminal client you like. Every thing is clear so far - good.
Not the thing with serial port is that two different applications try to read from is simultaneously, then only one of them actually receives the data and it's not guaranteed which one. Java library uses locking technic to allow only one app to access serial port. For my Mac locking files are located at /var/lock. Every time java app. opens serial port, it creates locking file into that folder and removes it after port is closed. To make one app to read from and another to write into serial port, what you do is first start reading app., then delete locking file and after that run you serial port writer. Simple, right!?
No comments:
Post a Comment