Hi,
I am having problems parsing data from a serial device (ie
obtained using asyn & stream). The normal protocol is to send a
message (with checksum), wait for an ACK character, then read the
reply (which has a checksum).
If I read the ACK and the reply on one line, using the protocol below:
read_version {
out STX, "001?f" ETX, "%<xor8ff>";
in ACK, STX, "001 f%[^\003]", ETX, "%<xor8ff>";
}
then I get the correct data into my 'stringin' record, but the shell
reports that the checksum is wrong (presumably because the ACK has
been included in the calculation). If I separate out the ACK and the
reply inputs:
read_version {
out STX, "001?f" ETX, "%<xor8ff>";
in ACK;
in STX, "001 f%[^\003]", ETX, "%<xor8ff>";
}
then the shell reports no errors, but nothing is placed in my
'stringin' record.
The messages have no terminators, which I guess is part of the
problem. I have tried playing about with 'extrainput', 'maxinput' and
'wait', with no luck. Does anyone have any suggestions for dealing
with this ?
Thanks,
Richard