From eb15866f5138fbba9c0142dd0af30dcd31535a30 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Thu, 28 May 2020 11:38:14 -0400 Subject: [PATCH] Fix #80, Checksum now matches cFS --- Subsystems/cmdUtil/cmdUtil.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Subsystems/cmdUtil/cmdUtil.c b/Subsystems/cmdUtil/cmdUtil.c index bf1508e..2f7e3cc 100644 --- a/Subsystems/cmdUtil/cmdUtil.c +++ b/Subsystems/cmdUtil/cmdUtil.c @@ -395,10 +395,11 @@ void CopyData(unsigned char *pkt, unsigned int *startbyte, char *in, unsigned in /****************************************************************************** * Calculate cFS Secondary Header Checksum + * Note - this matches cFS checksum calc in framework */ unsigned char CalcChecksum(unsigned char *bbuf, unsigned int nbytes) { - unsigned char checksum = 0; + unsigned char checksum = 0xFF; for (unsigned int i = 0; i < nbytes; i++) checksum ^= bbuf[i];