CommandFusion Wiki

Documentation Resources

User Tools

Site Tools


hardware:cflink:on-board-rs232-port-protocol

On-Board RS232 Port Protocol

This document defines the CFLink protocol for working with the on-board serial port found on the following CommandFusion hardware models:

Anywhere that MOD, LAN, MIN or SOL are used in outgoing commands, you can safely interchange with CFX.
This goes for all commands sent to any CFLink device.
However, all replies/notifications will be sent with the correct 3 character device identifier for the device sending the data (CFX is never used in replies except from bootloader notifications).

Queries

SPC - Query Serial Port Configuration

The SPC query requests the current on-board RS232 port settings of a device.

Data

The SPC query does not have any associated data.

Reply

See the ''SPC'' command for details on each returned data parameter.

Example

Configuration Messages

SPC - Serial Port Configuration

The SPC (Serial Port Configuration) command is used to configure the properties of the serial port such as port mode, baud rate, flow control, etc.

Data

  • <PORT> = Only required if the device has more than one on-board RS232 port, such as the Solo.
  • <MODE> = The mode of the RS232 port:
    • OFF (Disabled) means the serial port is turned off, disabled entirely.
    • PGM (Program Mode) means incoming data must be valid CFLink formatted commands, and allows you to send data to any device on the CFLink network via RS232. All CFLink data received by the device will also be sent out the RS232 port in this mode.
    • 232 (RS232 Mode) means incoming data is sent to devices that are configured via the TGT command, as well as any network sockets on the device itself. The incoming RS232 data will be wrapped in a SPR reply before being sent to the target devices. Data is sent to the RS232 port using the SPW command when in this mode.
    • TCP SOLO ONLY (RS232 Mode with TCP Server) is the same as 232 mode, except that a TCP Server socket is opened (TCP port 10208 for Serial Port 1, TCP port 10209 for Serial Port 2). Up to 4 TCP Clients can connect to each port, and data is simply piped between the TCP Client and the RS232 port. This is essentially turning the Solo into an RS232 to Ethernet adapter. Data does NOT need to be wrapped in CFLink packets to be sent/received in this mode. The data received via the TCP Socket is piped directly to the RS232 port unchanged.
  • <BAUD> = The baud rate of the RS232 port:
    • 100
    • 300
    • 600
    • 1200
    • 2400
    • 4800
    • 9600 (Default baud rate for Solo RS232 ports)
    • 14400
    • 19200
    • 38400
    • 57600
    • 115200 (Default Program Mode baud rate)
    • 128000
    • 256000
  • <DATABITS> = The data bits of the RS232 port, always 8.
  • <PARITY> = The parity of the RS232 port (single uppercase char):
    • N = None
    • O = Odd
    • E = Even
  • <STOPBITS> = The stop bits of the RS232 port (1 or 2).
  • <FLOWCONTROL> = The flow control of the RS232 port (0 = None, 1 = RTS/CTS). If flow control is enabled on Port 1 of the Solo, Port 2 will be automatically disabled entirely. Note that flow control cannot be enabled on port 2 of the Solo, only Port 1 on the Solo has flow control capabilities.

Reply

Example

Error

  • 050 = Invalid COM Mode

TGT - Configure Notifications Targets

The TGT command configures which CFLink ID's on the CFLink network will receive incoming messages when data is received on the serial port whilst in RS232 mode 232.
If the serial port is in Programming Mode PGM, then this configuration is ignored, no data is sent to the target devices. Instead all incoming data is handled by the device with the Serial Port, and must be a valid CFLink message or it will be ignored.

Data

<ID1-5> = The target CFLink ID to forward incoming serial port data to. Use the No Change Option XX to leave a specific ID unchanged. The ID's should be in plain text format, 2 chars (A-F, 0-9).

Reply

Example

Error

  • 051 = Invalid COM Targets

Transmission Messages

SPW - Serial Port Write

The SPW (Serial Port Write) command is used to write data to a device connected to the on-board serial port. This command is ignored in PGM mode.

Data

<PORT> = The port number to send the data to. Only used for devices that have more than one on-board RS232 port, such as the Solo. <DATA> = The data to be written out the on-board serial port. Hex bytes must be entered in \xFF format. eg. A carriage return is written as \x0D

Reply

Example

Error

  • 052 = COM Buffer Overflow

Notifications

SPR - Serial Port Read

The SPR notification contains incoming serial data, received from the on-board RS232 port when in RS232 Mode 232.
The reply is only sent to the CFLink ID's configured via the TGT command. This reply is never generated when serial port is in Program Mode PGM.

Data

  • <PORT> = Only present if the device has more than one on-board RS232 port, such as the Solo.
  • <DATA> = The data that was received.

Example

hardware/cflink/on-board-rs232-port-protocol.txt · Last modified: 2015/07/02 05:09 by jarrod