WirelessUART
WirelessUART performs serial communication.
ACT Features.
Communicate between two UART-connected TWELITEs in ASCII format.
how to use act
Required TWELITE
Two of the following devices serially connected to a PC.
TWELITE DIP connected to UART with TWELITE R products/TWE-Lite-DIP/index.html) etc.
Packets addressed to the Parent Node can also be received by Parent_MONOSTICK
.
Explanation of ACT
setup()
Interactive settings mode is initialized. This sample provides two or more devices that have different logical device IDs (LIDs) from each other.
Initialize serial parser.
loop()
When data input from the serial is received, one byte is input to the serial parser. When the ASCII format is accepted to the end, SerialParser.parse()
returns true
.
The SerialParser
can access the internal buffer with smplbuf
. In the example above, the first byte of the buffer is taken as the destination address, and the second byte to the end is passed to the transmit()
function.
on_rx_packet()
When a packet is received, a buffer smplbuf_u8<128> buf
containing the payload followed by the source as the first byte is created and output serially from the serial parser serparser_attach pout
for output.
command for testing
Test data must be entered into the terminal using the paste function. This is because there is a timeout for input.
Note: To paste in TWE Programmer or TeraTerm, use Alt+V.
CR LF is required at the end of the input.
At first try a series ending in X where CR LF can be omitted. If no terminating string is entered, the series will be ignored.
example
Send 00112233
to any Child Node.
example
Send AABBCC00112233
to Child Node #3.
example
Sent to any Parent Node or Child Node (0xFF
) and to the Parent Node (0x00
).
最終更新