16 October, 2009

Serial Port Magic vol.1 (programming)


At some point you will have a need to do some hardware programming and thats where you meet Serial Port (RS-232). Don't be afraid - that doesn't necessarily mean low level C/C# coding. There are plenty of higher level API's for Java (java.comm and rxtx) and even for PHP and Python. So, let me tell you how to get started.

I have tried out RxTx library and it worked perfectly. Just follow the instructions on their wiki page and you should be pretty much safe. There are also some code samples that you could use. Couple of things you might run into are:
  • make sure you have RXTXcomm.jar in your classpath!
  • also make sure lock file directory has a writing access
And there you go. Simple as 1-2-3 :)

No comments: