<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://rxtx.qbang.org/wiki/skins/common/feed.css?207"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>Rxtx - User contributions [en]</title>
		<link>http://rxtx.qbang.org/wiki/index.php/Special:Contributions/Goodness</link>
		<description>From Rxtx</description>
		<language>en</language>
		<generator>MediaWiki 1.15.4</generator>
		<lastBuildDate>Sun, 21 Jun 2026 14:52:16 GMT</lastBuildDate>
		<item>
			<title>User:Goodness</title>
			<link>http://rxtx.qbang.org/wiki/index.php/User:Goodness</link>
			<description>&lt;p&gt;Goodness:&amp;#32;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Goodness gratious me!&lt;/div&gt;</description>
			<pubDate>Mon, 03 Jul 2006 12:28:48 GMT</pubDate>			<dc:creator>Goodness</dc:creator>			<comments>http://rxtx.qbang.org/wiki/index.php/User_talk:Goodness</comments>		</item>
		<item>
			<title>Two way communcation with the serial port</title>
			<link>http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port</link>
			<description>&lt;p&gt;Goodness:&amp;#32;replace hardcoded &amp;quot;COM3&amp;quot; with portName&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Below is a simple program that shows how to open a connection to a serial device and then interact with it (receiving data and sending data). One thing to note is that the package gnu.io is used instead of javax.comm, though other than the change in package name the API follows the [http://java.sun.com/products/javacomm/ Java Communication API]. To find the names of the available, see the [[Discovering comm ports]] example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import gnu.io.CommPort;&lt;br /&gt;
import gnu.io.CommPortIdentifier;&lt;br /&gt;
import gnu.io.SerialPort;&lt;br /&gt;
&lt;br /&gt;
import java.io.FileDescriptor;&lt;br /&gt;
import java.io.IOException;&lt;br /&gt;
import java.io.InputStream;&lt;br /&gt;
import java.io.OutputStream;&lt;br /&gt;
&lt;br /&gt;
public class TwoWaySerialComm&lt;br /&gt;
{&lt;br /&gt;
    public TwoWaySerialComm()&lt;br /&gt;
    {&lt;br /&gt;
        super();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    void connect ( String portName ) throws Exception&lt;br /&gt;
    {&lt;br /&gt;
        CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName);&lt;br /&gt;
        if ( portIdentifier.isCurrentlyOwned() )&lt;br /&gt;
        {&lt;br /&gt;
            System.out.println(&amp;quot;Error: Port is currently in use&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            CommPort commPort = portIdentifier.open(this.getClass().getName(),2000);&lt;br /&gt;
            &lt;br /&gt;
            if ( commPort instanceof SerialPort )&lt;br /&gt;
            {&lt;br /&gt;
                SerialPort serialPort = (SerialPort) commPort;&lt;br /&gt;
                serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE);&lt;br /&gt;
                &lt;br /&gt;
                InputStream in = serialPort.getInputStream();&lt;br /&gt;
                OutputStream out = serialPort.getOutputStream();&lt;br /&gt;
                &lt;br /&gt;
                (new Thread(new SerialReader(in))).start();&lt;br /&gt;
                (new Thread(new SerialWriter(out))).start();&lt;br /&gt;
&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                System.out.println(&amp;quot;Error: Only serial ports are handled by this example.&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }     &lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /** */&lt;br /&gt;
    public static class SerialReader implements Runnable &lt;br /&gt;
    {&lt;br /&gt;
        InputStream in;&lt;br /&gt;
        &lt;br /&gt;
        public SerialReader ( InputStream in )&lt;br /&gt;
        {&lt;br /&gt;
            this.in = in;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        public void run ()&lt;br /&gt;
        {&lt;br /&gt;
            byte[] buffer = new byte[1024];&lt;br /&gt;
            int len = -1;&lt;br /&gt;
            try&lt;br /&gt;
            {&lt;br /&gt;
                while ( ( len = this.in.read(buffer)) &amp;gt; -1 )&lt;br /&gt;
                {&lt;br /&gt;
                    System.out.print(new String(buffer,0,len));&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            catch ( IOException e )&lt;br /&gt;
            {&lt;br /&gt;
                e.printStackTrace();&lt;br /&gt;
            }            &lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /** */&lt;br /&gt;
    public static class SerialWriter implements Runnable &lt;br /&gt;
    {&lt;br /&gt;
        OutputStream out;&lt;br /&gt;
        &lt;br /&gt;
        public SerialWriter ( OutputStream out )&lt;br /&gt;
        {&lt;br /&gt;
            this.out = out;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        public void run ()&lt;br /&gt;
        {&lt;br /&gt;
            try&lt;br /&gt;
            {                &lt;br /&gt;
                int c = 0;&lt;br /&gt;
                while ( ( c = System.in.read()) &amp;gt; -1 )&lt;br /&gt;
                {&lt;br /&gt;
                    this.out.write(c);&lt;br /&gt;
                }                &lt;br /&gt;
            }&lt;br /&gt;
            catch ( IOException e )&lt;br /&gt;
            {&lt;br /&gt;
                e.printStackTrace();&lt;br /&gt;
            }            &lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    public static void main ( String[] args )&lt;br /&gt;
    {&lt;br /&gt;
        try&lt;br /&gt;
        {&lt;br /&gt;
            (new TwoWaySerialComm()).connect(&amp;quot;COM3&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        catch ( Exception e )&lt;br /&gt;
        {&lt;br /&gt;
            // TODO Auto-generated catch block&lt;br /&gt;
            e.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</description>
			<pubDate>Mon, 03 Jul 2006 12:27:40 GMT</pubDate>			<dc:creator>Goodness</dc:creator>			<comments>http://rxtx.qbang.org/wiki/index.php/Talk:Two_way_communcation_with_the_serial_port</comments>		</item>
		<item>
			<title>Installation for Windows</title>
			<link>http://rxtx.qbang.org/wiki/index.php/Installation_for_Windows</link>
			<description>&lt;p&gt;Goodness:&amp;#32;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Short Install Instructions for Windows'''&lt;br /&gt;
&lt;br /&gt;
* Copy RXTXcomm.jar to {java.home}\lib\ext&lt;br /&gt;
* Copy rxtxSerial.dll to {java.home}\bin&lt;br /&gt;
&lt;br /&gt;
Where {java.home} is the location of the &amp;quot;java.home&amp;quot; system property, for&lt;br /&gt;
example &amp;quot;C:\Program Files\Java\j2re1.4.1_02&amp;quot;&lt;/div&gt;</description>
			<pubDate>Mon, 03 Jul 2006 11:04:17 GMT</pubDate>			<dc:creator>Goodness</dc:creator>			<comments>http://rxtx.qbang.org/wiki/index.php/Talk:Installation_for_Windows</comments>		</item>
		<item>
			<title>Main Page</title>
			<link>http://rxtx.qbang.org/wiki/index.php/Main_Page</link>
			<description>&lt;p&gt;Goodness:&amp;#32;Fix INSTALL File link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the RXTX wiki!&lt;br /&gt;
&lt;br /&gt;
This is intended to be by and for RXTX users and developers.  To get things started, we will put the INSTALL information here.  But feel free to add your own content.&lt;br /&gt;
&lt;br /&gt;
*[http://www.rxtx.org RXTX home page]&lt;br /&gt;
*[[Installation|INSTALL File]] (RXTX 2.1)&lt;br /&gt;
*[[Installation for Windows]] (RXTX 2.1)&lt;br /&gt;
*[[Using RXTX]]&lt;br /&gt;
*[[Development]]&lt;br /&gt;
*[http://bugzilla.qbang.org/ Reporting Bugs]&lt;br /&gt;
*[[Projects]] using RXTX&lt;br /&gt;
&lt;br /&gt;
If you don't find an answer to your questions, create one here and ask on the rxtx [http://mailman.qbang.org/mailman/listinfo/rxtx mail-list].&lt;br /&gt;
&lt;br /&gt;
We can fill it in from there.&lt;/div&gt;</description>
			<pubDate>Mon, 03 Jul 2006 10:59:00 GMT</pubDate>			<dc:creator>Goodness</dc:creator>			<comments>http://rxtx.qbang.org/wiki/index.php/Talk:Main_Page</comments>		</item>
		<item>
			<title>Main Page</title>
			<link>http://rxtx.qbang.org/wiki/index.php/Main_Page</link>
			<description>&lt;p&gt;Goodness:&amp;#32;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the RXTX wiki!&lt;br /&gt;
&lt;br /&gt;
This is intended to be by and for RXTX users and developers.  To get things started, we will put the INSTALL information here.  But feel free to add your own content.&lt;br /&gt;
&lt;br /&gt;
*[http://www.rxtx.org RXTX home page]&lt;br /&gt;
*[[INSTALL File]] (RXTX 2.1)&lt;br /&gt;
*[[Installation for Windows]] (Rxtx 2.1)&lt;br /&gt;
*[[Using RXTX]]&lt;br /&gt;
*[[Development]]&lt;br /&gt;
*[http://bugzilla.qbang.org/ Reporting Bugs]&lt;br /&gt;
*[[Projects]] using RXTX&lt;br /&gt;
&lt;br /&gt;
If you don't find an answer to your questions, create one here and ask on the rxtx [http://mailman.qbang.org/mailman/listinfo/rxtx mail-list].&lt;br /&gt;
&lt;br /&gt;
We can fill it in from there.&lt;/div&gt;</description>
			<pubDate>Mon, 03 Jul 2006 10:57:05 GMT</pubDate>			<dc:creator>Goodness</dc:creator>			<comments>http://rxtx.qbang.org/wiki/index.php/Talk:Main_Page</comments>		</item>
	</channel>
</rss>