pt.citar.diablu.nxt.protocol
Class NXTCommBluetoothSerialChannelRXTX
java.lang.Object
pt.citar.diablu.nxt.protocol.NXTCommBluetoothSerialChannelRXTX
- All Implemented Interfaces:
- NXTCommChannel
public class NXTCommBluetoothSerialChannelRXTX
- extends Object
- implements NXTCommChannel
- Author:
- Jorge Cardoso
NXTCommBluetoothSerialChannelRXTX
public NXTCommBluetoothSerialChannelRXTX()
- Creates a new instance of NXTCommBluetoothChannel
NXTCommBluetoothSerialChannelRXTX
public NXTCommBluetoothSerialChannelRXTX(String commPort)
throws IOException,
NoSuchPortException,
PortInUseException,
UnsupportedCommOperationException
- Throws:
IOException
NoSuchPortException
PortInUseException
UnsupportedCommOperationException
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