Hi Richard,
You can limit the scope of a checksum like this: %1<xor8ff>
A checksum like %A.B<...> ignores A bytes at the beginning and B bytes
at the end.
For fixed-length input you can use maxInput=number_of_byes; instead of a
terminator.
Dirk
On 04.06.2018 16:30, Lucock, Richard M wrote:
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
- Replies:
- Re: Parsing problem with stream Lucock, Richard M
- References:
- Parsing problem with stream Lucock, Richard M
- Navigate by Date:
- Prev:
Parsing problem with stream Lucock, Richard M
- Next:
Re: Parsing problem with stream Florian Feldbauer
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
<2018>
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Parsing problem with stream Lucock, Richard M
- Next:
Re: Parsing problem with stream Lucock, Richard M
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
<2018>
2019
2020
2021
2022
2023
2024
|