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 | 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 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: stream device string/hex parsing |
From: | Dirk Zimoch <[email protected]> |
To: | Gerrit Kühn <[email protected]> |
Cc: | [email protected], [email protected] |
Date: | Thu, 26 Jul 2012 17:55:55 +0200 |
Hi Gerrit,I would not use extrainput=Ignore except when absolutely necessary, because this may hide some errors with incomplete input strings (e.g. because of bad connections).
Better ignore a known number of digits after your payload like %*5c%4x%*30xEven better do not ignore the checksum but check it. What is the checksum algorithm? (sum of all bytes)&0xff as 2 hex digits? See the %<> formats.
Dirk Gerrit Kühn wrote:
On Mon, 9 Jul 2012 17:19:25 +0000 <[email protected]> wrote about RE: stream device string/hex parsing: Peter, POAU> Have you setPOAU> extrainput = Ignore; POAU> In your protocol file?No, I did not recognize that this was needed, because matching %4c instead of %4x worked fine. But you are right, extrainput=ignore fixed the issue, also matching the rest of the string by %s makes it work. Thanks! POAU> Even so a better strategy would be to use redirection: Yes, that's already on my list of improvements to try out. I just wanted to get the "most simple" solution to work first, before trying something more sophisticated. Anyway, thanks for the hint. cu Gerrit