This shows you the differences between two versions of the page.
hardware:cflink:cflink-introduction [2012/10/18 02:36] jarrod [Commands and Replies] |
hardware:cflink:cflink-introduction [2014/02/20 11:57] (current) jarrod [Commands and Replies] |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== CFLink Protocol Introduction ====== | ====== CFLink Protocol Introduction ====== | ||
This document is an overall view of the CFLink Protocol, used by CommandFusion hardware.\\ | This document is an overall view of the CFLink Protocol, used by CommandFusion hardware.\\ | ||
- | CFLink is a RS485 5-wire bus, used to interconnect various CommandFusion devices. For more details on the physical bus characteristics, please see the [[hardware:cflink:cflink-bus|CFLink Bus documentation]].\\ | + | CFLink is an RS485 5-wire bus, used to interconnect various CommandFusion devices. For more details on the physical bus characteristics, please see the [[hardware:cflink:cflink-bus|CFLink Bus documentation]].\\ |
===== Basic Structure ===== | ===== Basic Structure ===== | ||
Line 21: | Line 21: | ||
Then an ''[F4]'' byte, followed by optional Data associated with the command. The Data can be empty if the command does not require any associated data.\\ | Then an ''[F4]'' byte, followed by optional Data associated with the command. The Data can be empty if the command does not require any associated data.\\ | ||
Finally, all messages are terminated with two ''[F5]'' bytes.\\ | Finally, all messages are terminated with two ''[F5]'' bytes.\\ | ||
- | \\ | + | |
- | **NOTE: THROUGHOUT THIS DOCUMENTATION, ALL CFLINK EXAMPLES WILL START WITH > OR < - THIS IS NOT PART OF THE COMMAND, BUT JUST USED TO SIGNIFY THE START OF A NEW SENT OR RECEIVED PACKET.** | + | <WRAP center round important 80%> |
+ | **NOTE: THROUGHOUT THIS DOCUMENTATION, ALL CFLINK EXAMPLES WILL START WITH ''>'' (greater than) OR ''<'' (less than) - THIS IS NOT PART OF THE COMMAND, BUT JUST USED TO SIGNIFY THE START OF A NEW SENT OR RECEIVED PACKET WITHIN THE DOCUMENTATION.** | ||
+ | </WRAP> | ||
===== CFLink ID ===== | ===== CFLink ID ===== | ||
Line 33: | Line 35: | ||
In some circumstances, you may want to send a broadcast to all devices on the network. This can be done by using the Broadcast ID: ''[FF]''. | In some circumstances, you may want to send a broadcast to all devices on the network. This can be done by using the Broadcast ID: ''[FF]''. | ||
+ | <WRAP center round important 80%> | ||
**NOTE: BROADCAST MESSAGES CANNOT BE GUARANTEED TO BE DELIVERED TO ALL DEVICES ON LARGE NETWORKS. BROADCASTING IS ONLY RECOMMENDED FOR NON-CRITICAL MESSAGES.** | **NOTE: BROADCAST MESSAGES CANNOT BE GUARANTEED TO BE DELIVERED TO ALL DEVICES ON LARGE NETWORKS. BROADCASTING IS ONLY RECOMMENDED FOR NON-CRITICAL MESSAGES.** | ||
+ | </WRAP> | ||
===== Commands and Replies ===== | ===== Commands and Replies ===== | ||
The **<COMMAND>** part of each message is always 7 characters, always upper case, and formatted as follows: ''<TYPE><DEVICE><COMMAND_NAME>''\\ | The **<COMMAND>** part of each message is always 7 characters, always upper case, and formatted as follows: ''<TYPE><DEVICE><COMMAND_NAME>''\\ | ||
Line 40: | Line 43: | ||
* **<TYPE>** = 1 char, types are documented below.\\ | * **<TYPE>** = 1 char, types are documented below.\\ | ||
* **<DEVICE>** = 3 chars representing the model name of the device or type of port we are targeting (or the device/port type that the reply came from).\\ | * **<DEVICE>** = 3 chars representing the model name of the device or type of port we are targeting (or the device/port type that the reply came from).\\ | ||
- | * The **<DEVICE>** name ''CFX'' can be used to target any device. It is useful for when you are sending a command that any device should respond to, ''WHO'' for example.\\ | + | * The **<DEVICE>** name ''CFX'' can be used to target any device. It is very useful for when you are sending a command that any device should respond to, ''WHO'' for example.\\ It is also useful when you don't need to know the exact device type receiving the command, such as for [[hardware:cflink:on-board-rs232-port-protocol|on-board COM ports]] which share a common protocol across all devices.\\ 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). |
* **<COMMAND_NAME>** = 3 chars representing the name of the actual command being performed. | * **<COMMAND_NAME>** = 3 chars representing the name of the actual command being performed. | ||
- | |||
==== Queries ==== | ==== Queries ==== | ||
Line 108: | Line 110: | ||
When the protocol requires a port number to be defined, it is always written in P## format. The number must be two chars, 01-99 or ZZ.\\ | When the protocol requires a port number to be defined, it is always written in P## format. The number must be two chars, 01-99 or ZZ.\\ | ||
''P01'' = Port 1, ''P10'' = Port 10, etc.\\ | ''P01'' = Port 1, ''P10'' = Port 10, etc.\\ | ||
- | ''PZZ'' = All Ports. This allows you to manipulate all ports of a single type at once. eg. Open all relays in a CFMini. | + | ''PZZ'' = All Ports. This allows you to manipulate all ports of a single type at once. eg. Open all relays in a CF Mini. |
==== Module Definitions ==== | ==== Module Definitions ==== | ||
Line 138: | Line 140: | ||
// Port Separator example - Close relay port 1, open relay port 2 on a CF Mini on CFLink ID [04] | // Port Separator example - Close relay port 1, open relay port 2 on a CF Mini on CFLink ID [04] | ||
> [F2][04][F3]TRLYSET[F4]P01:1|P02:0[F5][F5] | > [F2][04][F3]TRLYSET[F4]P01:1|P02:0[F5][F5] | ||
- | // Port Separator example, with module number - Close relay port 1, open relay port 2 on Module 2 of a MOD4 on CFLink ID [04]> [F2][04][F3]TRLYSET[F4]M2|P01:1|P02:0[F5][F5] | + | // Port Separator example, with module number - Close relay port 1, open relay port 2 on Module 2 of a MOD4 on CFLink ID [04] |
+ | > [F2][04][F3]TRLYSET[F4]M2|P01:1|P02:0[F5][F5] | ||
</sxh> | </sxh> | ||
==== Data Separator ==== | ==== Data Separator ==== | ||
- | The data separator, '':'' (colon), is used to separate piece of data for a single target port or device.\\ | + | The data separator '':'' (colon), is used to separate pieces of data for a single target port or device.\\ |
<sxh cflink; light: true> | <sxh cflink; light: true> | ||
// Data Separator example - Device discovery reply for a LAN Bridge on ID [02] | // Data Separator example - Device discovery reply for a LAN Bridge on ID [02] |