CommandFusion Wiki

Documentation Resources

User Tools

Site Tools


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

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

hardware:cflink:on-board-rs232-port-protocol [2012/08/21 04:38]
jarrod
hardware:cflink:on-board-rs232-port-protocol [2015/07/02 05:09] (current)
jarrod [SPR - Serial Port Read]
Line 2: Line 2:
  
 This document defines the CFLink protocol for working with the on-board serial port found on the following CommandFusion hardware models: This document defines the CFLink protocol for working with the on-board serial port found on the following CommandFusion hardware models:
-  * [[hardware:​lan-bridge|LANBridge]] (RJ11+  * [[hardware:​lan-bridge|LAN Bridge]] (RJ12
-  * [[hardware:​cf-mini|CFMini]] (RJ11)+  * [[hardware:​cf-mini|CF Mini]] (RJ12)
   * [[hardware:​modular-base-units:​din-mod4|DIN-MOD4]] (DB9 Female)   * [[hardware:​modular-base-units:​din-mod4|DIN-MOD4]] (DB9 Female)
   * [[hardware:​modular-base-units:​mod4|MOD4]] (DB9 Female)   * [[hardware:​modular-base-units:​mod4|MOD4]] (DB9 Female)
 +  * [[hardware:​solo|Solo]] (2 x detachable 3-pin spring terminals)
 +
 +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 ===== ===== Queries =====
Line 19: Line 24:
 === Reply === === Reply ===
 <sxh cflink; light: true> <sxh cflink; light: true>
-< [F2]<​ID>​[F3]RCFXSPC[F4]<​MODE>:<​BAUD>:<​DATABITS>:<​PARITY>:<​STOP>:<​FLOWCTRL>​[F5][F5]+< [F2]<​ID>​[F3]RCFXSPC[F4]<​PORT>:​<​MODE>:<​BAUD>:<​DATABITS>:<​PARITY>:<​STOP>:<​FLOWCTRL>​[F5][F5]
 </​sxh>​ </​sxh>​
  
-See the ''​SPC''​ command for details on each returned data parameter.+See the [[#​spc-serial-port-configuration|''​SPC''​ command]] for details on each returned data parameter.
  
 === Example === === Example ===
 <sxh cflink; light: true> <sxh cflink; light: true>
-// Query the Serial Port configuration of a LANBridge ​on ID [02]+// Query the Serial Port configuration of a LAN Bridge ​on ID [02]
 > [F2][02][F3]QLANSPC[F4][F5][F5] > [F2][02][F3]QLANSPC[F4][F5][F5]
 // Reply with the configuration data, Serial Port is in Program mode // Reply with the configuration data, Serial Port is in Program mode
 < [F2][02][F3]RLANSPC[F4]PGM:​115200:​8:​N:​1:​0[F5][F5] < [F2][02][F3]RLANSPC[F4]PGM:​115200:​8:​N:​1:​0[F5][F5]
 +
 +// Query the Serial Port configuration of a Solo on ID [03]
 +> [F2][03][F3]QSOLSPC[F4][F5][F5]
 +// Reply with the configuration data for both on-board serial ports
 +< [F2][03][F3]RSOLSPC[F4]P01:​232:​115200:​8:​N:​1:​0|P02:​232:​115200:​8:​N:​1:​0[F5][F5]
 </​sxh>​ </​sxh>​
  
Line 36: Line 46:
 ==== SPC - Serial Port Configuration ==== ==== SPC - Serial Port Configuration ====
  
-The ''​SPC''​ (Serial Port Configuration) command is used to configure the properties of the serial port such as Port ModeBaud rate, Flow Control, etc.+The ''​SPC''​ (Serial Port Configuration) command is used to configure the properties of the serial port such as port modebaud rate, flow control, etc.
  
 === Data === === Data ===
 <sxh cflink; light: true> <sxh cflink; light: true>
-> [F2]<​ID>​[F3]CCFXSPC[F4]<​MODE>:<​BAUD>:<​DATABITS>:<​PARITY>:<​STOPBITS>:<​FLOWCTRL>​[F5][F5]+> [F2]<​ID>​[F3]CCFXSPC[F4]<​PORT>:​<​MODE>:<​BAUD>:<​DATABITS>:<​PARITY>:<​STOPBITS>:<​FLOWCTRL>​[F5][F5]
 </​sxh>​ </​sxh>​
  
 +  * **<​PORT>​** = Only required if the device has more than one on-board RS232 port, such as the [[hardware:​solo|Solo]].
   * **<​MODE>​** = The mode of the RS232 port:   * **<​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.     * ''​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 only to devices that are configured via the TGT command. 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.+    * ''​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 [[hardware:​solo|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:   * **<​BAUD>​** = The baud rate of the RS232 port:
     * 100     * 100
Line 53: Line 66:
     * 2400     * 2400
     * 4800     * 4800
-    * 9600+    * 9600 (Default baud rate for [[hardware:​solo|Solo]] RS232 ports)
     * 14400     * 14400
     * 19200     * 19200
Line 67: Line 80:
     * ''​E''​ = Even     * ''​E''​ = Even
   * **<​STOPBITS>​** = The stop bits of the RS232 port (''​1''​ or ''​2''​).   * **<​STOPBITS>​** = The stop bits of the RS232 port (''​1''​ or ''​2''​).
-  * **<​FLOWCONTROL>​** = The flow control of the RS232 port (''​0''​ = None, ''​1''​ = RTS/CTS).+  * **<​FLOWCONTROL>​** = The flow control of the RS232 port (''​0''​ = None, ''​1''​ = RTS/CTS). If flow control is enabled on Port 1 of the [[hardware:​solo|Solo]],​ Port 2 will be automatically disabled entirely. Note that flow control cannot be enabled on port 2 of the [[hardware:​solo|Solo]],​ only Port 1 on the [[hardware:​solo|Solo]] has flow control capabilities.
  
 === Reply === === Reply ===
-<code+<sxh cflink; light: true
-< [F2]<​ID>​[F3]RCFXSPC[F4]<​MODE>:<​BAUD>:<​DATABITS>:<​PARITY>:<​STOP>:<​FLOWCTRL>​[F5][F5] +< [F2]<​ID>​[F3]RCFXSPC[F4]<​PORT>:​<​MODE>:<​BAUD>:<​DATABITS>:<​PARITY>:<​STOP>:<​FLOWCTRL>​[F5][F5] 
-</code>+</sxh>
  
 === Example === === Example ===
-<code+<sxh cflink; light: true
-// Configure the on-board serial port for a LANBridge ​on ID [02] to be in RS232 mode, 9600 baud, 8:None:1.+// Configure the on-board serial port for a LAN Bridge ​on ID [02] to be in RS232 mode, 9600 baud, 8:None:1.
 > [F2][02][F3]CLANSPC[F4]232:​9600:​8:​N:​1:​0[F5][F5] > [F2][02][F3]CLANSPC[F4]232:​9600:​8:​N:​1:​0[F5][F5]
 // Reply // Reply
 < [F2][02][F3]RLANSPC[F4]232:​9600:​8:​N:​1:​0[F5][F5] < [F2][02][F3]RLANSPC[F4]232:​9600:​8:​N:​1:​0[F5][F5]
-</code>+ 
 +// Configure the on-board serial port for a Solo on ID [03] to enable Port 1 in RS232 mode, 9600 baud, 8:None:1. No changes made to Port 2. 
 +> [F2][03][F3]CSOLSPC[F4]P01:​232:​9600:​8:​N:​1:​0[F5][F5] 
 +// Reply 
 +< [F2][03][F3]RSOLSPC[F4]P01:​232:​9600:​8:​N:​1:​0|P02:​232:​115200:​8:​N:​1:​0[F5][F5] 
 +</sxh>
  
 === Error === === Error ===
Line 93: Line 111:
  
 === Data === === Data ===
-<code>+<sxh cflink; light: true>
 > [F2]<​ID>​[F3]CCFXTGT[F4]<​ID1>:<​ID2>:<​ID3>:<​ID4>:<​ID5>​[F5][F5] > [F2]<​ID>​[F3]CCFXTGT[F4]<​ID1>:<​ID2>:<​ID3>:<​ID4>:<​ID5>​[F5][F5]
-</code>+</sxh>
 **<​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). **<​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 === === Reply ===
-<code>+<sxh cflink; light: true>
 < [F2]<​ID>​[F3]RCFXTGT[F4]<​ID1>:<​ID2>:<​ID3>:<​ID4>:<​ID5>​[F5][F5] < [F2]<​ID>​[F3]RCFXTGT[F4]<​ID1>:<​ID2>:<​ID3>:<​ID4>:<​ID5>​[F5][F5]
-</code>+</sxh>
 === Example === === Example ===
-<code+<sxh cflink; light: true
-// Forward incoming data from the Serial Port on LANBridge ​ID [02] to devices on CFLink ID's [03], [04] and [05]+// Forward incoming data from the Serial Port on LAN Bridge ​ID [02] to devices on CFLink ID's [03], [04] and [05]
 > [F2][02][F3]CLANTGT[F4]03:​04:​05:​XX:​XX[F5][F5] > [F2][02][F3]CLANTGT[F4]03:​04:​05:​XX:​XX[F5][F5]
 // Reply (CFLink ID's [07] and [09] were already being targeted from an earlier configuration) // Reply (CFLink ID's [07] and [09] were already being targeted from an earlier configuration)
 < [F2][02][F3]RLANTGT[F4]03:​04:​05:​07:​09[F5][F5] < [F2][02][F3]RLANTGT[F4]03:​04:​05:​07:​09[F5][F5]
-</code>+</sxh>
 === Error === === Error ===
   * 051 = Invalid COM Targets   * 051 = Invalid COM Targets
Line 120: Line 138:
  
 === Data === === Data ===
-<code+<sxh cflink; light: true
-> [F2]<​ID>​[F3]TCFXSPW[F4]<​DATA>​[F5][F5] +> [F2]<​ID>​[F3]TCFXSPW[F4]<​PORT>:​<​DATA>​[F5][F5] 
-</code>+</sxh>
  
 +**<​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 [[hardware:​solo|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 **<​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 === === Reply ===
-<code>+<sxh cflink; light: true>
 // In an effort to reduce network traffic, the reply does not contain the data sent. // In an effort to reduce network traffic, the reply does not contain the data sent.
 < [F2]<​ID>​[F3]RCFXSPW[F4][F5][F5] < [F2]<​ID>​[F3]RCFXSPW[F4][F5][F5]
-</code>+</sxh>
  
 === Example === === Example ===
-<code>+<sxh cflink; light: true>
 // Send a command out the on-board serial port of a CFMini on CFLink ID [03] // Send a command out the on-board serial port of a CFMini on CFLink ID [03]
 > [F2][03][F3]TMINSPW[F4]Hello World!\x0D[F5][F5] > [F2][03][F3]TMINSPW[F4]Hello World!\x0D[F5][F5]
 // Reply // Reply
 < [F2][03][F3]RMINSPW[F4][F5][F5] < [F2][03][F3]RMINSPW[F4][F5][F5]
-</code>+ 
 +// Send a command out the second on-board serial port of a Solo on CFLink ID [03] 
 +> [F2][03][F3]TSOLSPW[F4]P02:​Hello World!\x0D[F5][F5] 
 +// Reply 
 +< [F2][03][F3]RSOLSPW[F4][F5][F5] 
 +</sxh>
  
 === Error === === Error ===
Line 152: Line 176:
  
 === Data === === Data ===
-<code+<sxh cflink; light: true
-< [F2]<​ID>​[F3]R<​DEVICE>​SPR[F4]<​DATA>​[F5][F5] +< [F2]<​ID>​[F3]R<​DEVICE>​SPR[F4]<​PORT>:​<​DATA>​[F5][F5] 
-</code>+</sxh> 
 + 
 +  * **<​PORT>​** = Only present if the device has more than one on-board RS232 port, such as the [[hardware:​solo|Solo]]. 
 +  * **<DATA>** = The data that was received.
  
 === Example === === Example ===
-<code>+<sxh cflink; light: true>
 // An incoming message "Hello World!"​ followed by a carriage return is received on the on-board serial port of a CFMini on CFLink ID [03]. // An incoming message "Hello World!"​ followed by a carriage return is received on the on-board serial port of a CFMini on CFLink ID [03].
 // The CFMini is configured to send incoming RS232 data to CFLink ID's [02], [04] and [07] // The CFMini is configured to send incoming RS232 data to CFLink ID's [02], [04] and [07]
Line 163: Line 190:
 < [F2][04][F3]RMINSPR[F4]Hello World!\x0D[F5][F5] < [F2][04][F3]RMINSPR[F4]Hello World!\x0D[F5][F5]
 < [F2][07][F3]RMINSPR[F4]Hello World!\x0D[F5][F5] < [F2][07][F3]RMINSPR[F4]Hello World!\x0D[F5][F5]
-</code>+ 
 +// An incoming message "Hello World!"​ followed by a carriage return is received on the first on-board serial port of a Solo on CFLink ID [03]. 
 +// The Solo is configured to send incoming RS232 data to all CFLink ID'​s. 
 +< [F2][FF][F3]RSOLSPR[F4]P01:​Hello World!\x0D[F5][F5] 
 +</sxh>
hardware/cflink/on-board-rs232-port-protocol.1345523890.txt.gz · Last modified: 2012/08/21 04:38 by jarrod