public class SerialCommunicator
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
SerialCommunicator.SerialReader
Handles the input coming from the serial port.
|
class |
SerialCommunicator.SerialWriter
Class for sending data to the serial port.
|
Constructor and Description |
---|
SerialCommunicator(GUIPanel gp) |
Modifier and Type | Method and Description |
---|---|
void |
connect(java.lang.String portName)
Estabilish connection with a module, located on serial port of the given
name (such as "COM1" on win or "/dev/ttyUSB0/" on Linux)
|
static void |
fillCheckSum(byte[] data)
Take the data array and append a crc-8 checksum to the end.
|
PacketHandler |
getPacketHandler() |
SerialCommunicator.SerialReader |
getReader() |
SerialCommunicator.SerialWriter |
getWriter() |
public SerialCommunicator(GUIPanel gp)
public SerialCommunicator.SerialReader getReader()
public SerialCommunicator.SerialWriter getWriter()
public PacketHandler getPacketHandler()
PacketHandler
object assigned to this
SerialCommunicator
public void connect(java.lang.String portName) throws java.lang.Exception
portName
- the name of the port to openjava.lang.Exception
- when no such port exists or its busy or something else
went wrongCommPortIdentifier.getPortIdentifier(java.lang.String)
public static void fillCheckSum(byte[] data)