310
Platforms
©2000-2008 Tibbo Technology Inc.
character with code of escape character is transmitted as two identical characters
with the same ASCII code.
Example: supposing you have the following setup:
...
sock.inbandcommands= YES
sock.escchar=`$`
sock.endchar=`%`
...
Now, you have the following data stream coming into the socket:
ABCD$#inband commqand%EFG$$123
The socket will interpret this stream as including one inband command: "$#inband
command%". Regular data, placed into the RX buffer of the socket will be
"ABCDEFG$123". The first '$' character is interpreted as the beginning of the
inband message because this character is followed by some other character ('#').
The second occurrence of the '$' character is interpreted as data, since this
character is followed by another 'S' character. Resulting data stream contains only
a single '$' character- the socket takes care of removing the second one
automatically.
When sending data from the TX buffer, the socket also automatically doubles all
data characters with the ASCII code of the escape character. So, if you want to
send this string: "Outbound$!" what will actually be sent is:
Outbound$$!
Inband messages are not our invention. Many programs, such as the
HyperTerminal, treat the character with code 255 as an escape
character.
Inband-related Buffers (CMD, RPL, and TX2)
Three buffers are required for inband message processing. On startup, these
buffers are not allocated any memory, so you have to do it if you are planning to
send and receive inband messages.
The CMD buffer- used to store incoming inband messages (we call them "inband
commands"). Use the
method to allocate memory for this
buffer. Usually, inband commands are not very long so allocating a minimum
space of 1 page is typically sufficient.
The RPL buffer- used to store outgoing inband messages (we call them "inband
replies"). Use the
method to allocate memory for this buffer.
again, inband commands are usually not very long so allocating a minimum
space of 1 page will probably be sufficient.
The TX2 buffer- used internally by the socket when inband commands are
enabled. You don't have to do anything with this buffer other than allocate
memory for it. We recommend allocating as much space as you did for the TX
329
349