On Thu, 26 Jul 2012 17:55:55 +0200 Dirk Zimoch <firstname.lastname@example.org> wrote
about Re: stream device string/hex parsing:
DZ> I would not use extrainput=Ignore except when absolutely necessary,
DZ> because this may hide some errors with incomplete input strings (e.g.
DZ> because of bad connections).
DZ> Better ignore a known number of digits after your payload like
Thanks for the hint. I have changed to a pattern like this now (without
ignoring extra input):
# set block 0: 00000000
# sample block 0
First I set digital outputs to drive an external multiplexer, then I read
8 AD channels and parse the answer into channels. This is then repeated
for other multiplexer settings (and different channel names). Appear to
work fine now.
DZ> Even better do not ignore the checksum but check it. What is the
DZ> checksum algorithm? (sum of all bytes)&0xff as 2 hex digits? See the %
DZ> <> formats.
I did not yet look into the checksumming at all. For sending commands, the
".." can be used to turn crc off, for receiving, I use the %*2c now to
The documentation says the packet LRC is the two's complement of the sum
over the packet's parameter and command bytes. Each binary data byte is
transmitted as two hex digits which have to be transformed into binary
form before adding them. So, looking at the available checksum algorithms,
this calls for something like %<neghexsum8>, which does not exist...