RN1810 WiFly Command Reference User’s Guide
2.4.8 set comm match <value> <flag>
This command sets the match character where <value> is a decimal number from 0 to
127 or a hex number from 0x00 to 0x7F. The parameter <flag> is either ‘0’ or ‘1’,
where ‘0’ excludes the match character in the datastream and ‘1’ includes the match
character in the datastream.
Upon receiving the match character in the datastream, WiFly flushes its UART RX
queue and sends the data to the Wi-Fi network in an IP packet. The match character
itself is optionally sent in the datastream based on the value of the <flag>.
Setting the match character to ‘0’ disables the Match method (cannot use ‘0’ as a
match character).
When the Match method is selected, the Size method is automatically active as a
'fall-back' flush method. The algorithm is:
IF match character received AND including match character
Send bytes in UART RX buffer to Wi-Fi network followed by match character
ELSE IF match character received AND not including match character
Send bytes in UART RX buffer to Wi-Fi network
ELSE IF number of UART RX bytes equals Size
Send bytes in UART RX buffer to Wi-Fi network
ENDIF
In short, when the Match method is active, the UART RX bytes are transmitted when
the match character is received or size bytes are received, whichever occurs first.
If the Match method is active, and the Match value is set to ‘0’ during runtime, then the
Match method is disabled and the WiFly module automatically reverts to the Size
method. For more information, refer to Section 3.4“TX Flush Methods”.
Default:
0 (Match method disabled)
Example:
set comm match 0x1b 0 // Flush UART RX buffer when a 0x1b is received,
// but do not send the match character in the
// data stream
set comm match 0x1b 1 // Flush UART RX buffer when a 0x1b is received
// and send the match character in the datastream
set comm match 25 0
set comm match 0 0
// Flush UART RX buffer when a 25 is received, but
// do not send the match character in the data stream
// Disables the Match method and goes back to the
// size flush method
2.4.9 set comm open <string>
This command sets the ASCII string that is sent to the host UART when a TCP port is
opened, where <string> is between 1 and 32 characters. If the output requires no
string, set <string> to 0.
Default:
hello
Example:
set comm open TCP_OPEN // Send “TCP_OPEN” to host UART upon opening a
// TCP connection
set comm open 0
// Do not send any string upon opening a
// TCP connection
DS50002467A-page 14
2016 Microchip Technology Inc.