pt.citar.diablu.nxt.protocol
Class NXTCommBluetoothSerialChannelRXTX

java.lang.Object
  extended by pt.citar.diablu.nxt.protocol.NXTCommBluetoothSerialChannelRXTX
All Implemented Interfaces:
NXTCommChannel

public class NXTCommBluetoothSerialChannelRXTX
extends Object
implements NXTCommChannel

Author:
Jorge Cardoso

Constructor Summary
NXTCommBluetoothSerialChannelRXTX()
          Creates a new instance of NXTCommBluetoothChannel
NXTCommBluetoothSerialChannelRXTX(String commPort)
           
 
Method Summary
 void closeChannel()
           
 void flush()
           
 void openChannel(Object channel)
           
 int read()
           
 int read(byte[] buffer)
           
 NXTResponse sendCommand(NXTCommand command)
           
 void write(byte b)
           
 void write(byte[] buffer)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NXTCommBluetoothSerialChannelRXTX

public NXTCommBluetoothSerialChannelRXTX()
Creates a new instance of NXTCommBluetoothChannel


NXTCommBluetoothSerialChannelRXTX

public NXTCommBluetoothSerialChannelRXTX(String commPort)
                                  throws IOException,
                                         NoSuchPortException,
                                         PortInUseException,
                                         UnsupportedCommOperationException
Throws:
IOException
NoSuchPortException
PortInUseException
UnsupportedCommOperationException
Method Detail

sendCommand

public NXTResponse sendCommand(NXTCommand command)
                        throws IOException
Specified by:
sendCommand in interface NXTCommChannel
Throws:
IOException

openChannel

public void openChannel(Object channel)
                 throws UnsupportedCommOperationException,
                        NoSuchPortException,
                        PortInUseException,
                        IOException
Specified by:
openChannel in interface NXTCommChannel
Throws:
UnsupportedCommOperationException
NoSuchPortException
PortInUseException
IOException

closeChannel

public void closeChannel()
                  throws IOException
Specified by:
closeChannel in interface NXTCommChannel
Throws:
IOException

read

public int read()
         throws RuntimeException
Specified by:
read in interface NXTCommChannel
Throws:
RuntimeException

read

public int read(byte[] buffer)
         throws RuntimeException
Specified by:
read in interface NXTCommChannel
Throws:
RuntimeException

write

public void write(byte b)
           throws RuntimeException
Specified by:
write in interface NXTCommChannel
Throws:
RuntimeException

write

public void write(byte[] buffer)
           throws RuntimeException
Specified by:
write in interface NXTCommChannel
Throws:
RuntimeException

flush

public void flush()
           throws RuntimeException
Specified by:
flush in interface NXTCommChannel
Throws:
RuntimeException


Processing library NXTComm by Jorge C. S. Cardoso. (c) 2014