Index: doc/formats.html
===================================================================
RCS file: /afs/psi.ch/user/z/zimoch/.cvsroot/StreamDevice2/doc/formats.html,v
retrieving revision 1.9
retrieving revision 1.10
diff -c -r1.9 -r1.10
*** doc/formats.html 8 Aug 2007 10:14:28 -0000 1.9
--- doc/formats.html 8 Aug 2007 10:16:45 -0000 1.10
***************
*** 364,369 ****
--- 364,371 ----
One byte. The bitwise inverse of the sum of all characters modulo 28.
%<XOR>
One byte. All characters xor'ed.
+ %<XOR7>
+ One byte. All characters xor'ed & 0x7F.
%<CRC8>
One byte. An often used 8 bit CRC checksum
(poly=0x07, init=0x00, xorout=0x00).
Index: src/ChecksumConverter.cc
===================================================================
RCS file: /afs/psi.ch/user/z/zimoch/.cvsroot/StreamDevice2/src/ChecksumConverter.cc,v
retrieving revision 1.16
retrieving revision 1.18
diff -c -r1.16 -r1.18
*** src/ChecksumConverter.cc 2 Oct 2006 08:42:06 -0000 1.16
--- src/ChecksumConverter.cc 8 Aug 2007 10:13:08 -0000 1.18
***************
*** 49,54 ****
--- 49,59 ----
return sum;
}
+ static ulong xor7(const uchar* data, ulong len, ulong sum)
+ {
+ return xor8(data, len, sum) & 0x7F;
+ }
+
static ulong crc_0x07(const uchar* data, ulong len, ulong crc)
{
// x^8 + x^2 + x^1 + x^0 (0x07)
***************
*** 447,452 ****
--- 452,458 ----
{"notsum", sum, 0x00, 0xff, 1}, // 0x22
{"~sum", sum, 0x00, 0xff, 1}, // 0x22
{"xor", xor8, 0x00, 0x00, 1}, // 0x31
+ {"xor7", xor7, 0x00, 0x00, 1}, // 0x31
{"crc8", crc_0x07, 0x00, 0x00, 1}, // 0xF4
{"ccitt8", crc_0x31, 0x00, 0x00, 1}, // 0xA1
{"crc16", crc_0x8005, 0x0000, 0x0000, 2}, // 0xFEE8