On Tue, 31 Jul 2012 16:30:05 +0200 Dirk Zimoch <[email protected]> wrote
about Re: stream device string/hex parsing:
DZ> > The documentation says the packet LRC is the two's complement of the
DZ> > sum over the packet's parameter and command bytes. Each binary data
DZ> > byte is transmitted as two hex digits which have to be transformed
DZ> > into binary form before adding them. So, looking at the available
DZ> > checksum algorithms, this calls for something like %<neghexsum8>,
DZ> > which does not exist...
DZ> %0<negsum>
Hm... not quite:
2012/08/01 14:33:43.162 ADC16_W Input byte 0xE7 does not match checksum
0xFC
2012/08/01 14:33:43.162 ADC16_S Input byte 0xEC does not match
checksum 0x01
2012/08/01 14:33:41.162 ADC16_C Input byte 0xD7 does not match checksum
0xFB
The description for <negsum> is
---
One byte. The negative of the sum of all characters modulo 2^8
---
However, I do not need to sum over all characters, I need to interpret
every two characters as hex value, sum over these, invert and compare the
result with the hex value represented by the two checksum characters. Or
am I misunderstanding something here?
cu
Gerrit
- Replies:
- Re: stream device string/hex parsing Dirk Zimoch
- References:
- stream device string/hex parsing Gerrit Kühn
- RE: stream device string/hex parsing peter.owens
- Re: stream device string/hex parsing Gerrit Kühn
- Re: stream device string/hex parsing Dirk Zimoch
- Re: stream device string/hex parsing Gerrit Kühn
- Re: stream device string/hex parsing Dirk Zimoch
- Navigate by Date:
- Prev:
Matlab choices S. Stein
- Next:
Re: CSS BOY Dynamic Strip Charts with Macros Kasemir, Kay
- 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:
Re: stream device string/hex parsing Dirk Zimoch
- Next:
Re: stream device string/hex parsing Dirk Zimoch
- 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
|