Skip to content

Sending Data

vstarlinger edited this page Aug 29, 2017 · 2 revisions

Sending of data is currently only available via the SerialComm class and consequently only over the serial communication interface.

Serial

For setting up the serial port please refer to the Receiving Data section in this wiki.

Sending commands is done using the void send(String msg) method in the SerialComm class. If the port is not connected or the sending fails, error messages are reported to the GUI.

The sending is done using the following line of code:

    serialPort.writeBytes(msg.getBytes(StandardCharsets.US_ASCII)); 

The bytes sent are currently encoded in US_ASCII. This can be changed by defining a different Charset in the getBytes method.

Clone this wiki locally