diff autocal/l1tmops.c @ 47:e86779d5445c

autocal: preparations for receiving auto stats and rfe completion
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 27 May 2017 06:46:17 +0000
parents d6ef94518117
children c87067884da7
line wrap: on
line diff
--- a/autocal/l1tmops.c	Sat May 27 06:25:59 2017 +0000
+++ b/autocal/l1tmops.c	Sat May 27 06:46:17 2017 +0000
@@ -27,6 +27,14 @@
 		c ^= outbuf[i];
 	outbuf[i] = c;
 	target_pkt_exch(outbuf, outlen + 2);
+	l1tm_resp_sanity_check(outbuf[1]);
+	return(0);
+}
+
+l1tm_resp_sanity_check(cid)
+{
+	int i, c;
+
 	if (rvi_msg[1] != RVT_TM_HEADER) {
 		fprintf(stderr,
 			"DUT error: response packet is not on TM channel\n");
@@ -43,7 +51,7 @@
 		fprintf(stderr, "DUT error: TM response bad checksum\n");
 		exit(ERROR_TARGET);
 	}
-	if (rvi_msg[2] != outbuf[1]) {
+	if (rvi_msg[2] != cid) {
 		fprintf(stderr, "DUT error: TM response has wrong CID\n");
 		exit(ERROR_TARGET);
 	}