Subversion Repositories Programming Utils

Rev

Rev 97 | Blame | Compare with Previous | Last modification | View Log | RSS feed

package com.rm5248.serial;

import java.io.IOException;
import java.nio.channels.ByteChannel;

/**
 * An implementation of a serial port that uses NIO.
 *
 * @author rm5248
 *
 */

public class NIOSerialPort extends SerialPort {
       
        /* The channel that we read/write */
        private SerialByteChannel byteChannel;

        public NIOSerialPort(String portName, BaudRate rate, DataBits data,
                        StopBits stop, Parity parity, FlowControl flow)
                        throws NoSuchPortException, NotASerialPortException {
                super(portName, rate, data, stop, parity, flow);
                // TODO Auto-generated constructor stub
                byteChannel = new SerialByteChannel( handle, this );
        }

        public ByteChannel getByteChannel(){
                return byteChannel;
        }
}