|
Page Edited :
MINA :
Serial Tutorial
Serial Tutorial has been edited by Ashish Paliwal (Dec 07, 2008). Content:With the upcoming MINA 2.0 you are able to connect to serial port like you use to connect to a TCP/IP port with MINA. Getting MINA 2.0For now MINA 2.0 final isn't released, but you you can download the latest built version (2.0.0-M3). If you prefer to build the code from the trunk, and need assistance to do so, please consult the Developer Guide. Prerequisite
Connecting to a serial portSerial communication for MINA provide only an IoConnector, due to the point-to-point nature of the communication media. At this point you are supposed to have already read the MINA tutorial. Now for connecting to a serial port you need a SerialConnector : // create your connector IoConnector connector = new SerialConnector() connector.setHandler( ... here your buisness logic IoHandler ... ); Nothing very different of a SocketConnector.
Once it's done, connect the connector to the address : ConnectFuture future = connector.connect( portAddress ); future.await(); IoSession sessin = future.getSession();
And voila ! Everything else is as usual, you can plug your filters and codecs. for learn more about RS232 : http://en.wikipedia.org/wiki/RS232 |
Unsubscribe or edit your notifications preferences
