comparison 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
comparison
equal deleted inserted replaced
46:751f8d9efed0 47:e86779d5445c
25 c = 0; 25 c = 0;
26 for (i = 1; i <= outlen; i++) 26 for (i = 1; i <= outlen; i++)
27 c ^= outbuf[i]; 27 c ^= outbuf[i];
28 outbuf[i] = c; 28 outbuf[i] = c;
29 target_pkt_exch(outbuf, outlen + 2); 29 target_pkt_exch(outbuf, outlen + 2);
30 l1tm_resp_sanity_check(outbuf[1]);
31 return(0);
32 }
33
34 l1tm_resp_sanity_check(cid)
35 {
36 int i, c;
37
30 if (rvi_msg[1] != RVT_TM_HEADER) { 38 if (rvi_msg[1] != RVT_TM_HEADER) {
31 fprintf(stderr, 39 fprintf(stderr,
32 "DUT error: response packet is not on TM channel\n"); 40 "DUT error: response packet is not on TM channel\n");
33 exit(ERROR_TARGET); 41 exit(ERROR_TARGET);
34 } 42 }
41 c ^= rvi_msg[i]; 49 c ^= rvi_msg[i];
42 if (c) { 50 if (c) {
43 fprintf(stderr, "DUT error: TM response bad checksum\n"); 51 fprintf(stderr, "DUT error: TM response bad checksum\n");
44 exit(ERROR_TARGET); 52 exit(ERROR_TARGET);
45 } 53 }
46 if (rvi_msg[2] != outbuf[1]) { 54 if (rvi_msg[2] != cid) {
47 fprintf(stderr, "DUT error: TM response has wrong CID\n"); 55 fprintf(stderr, "DUT error: TM response has wrong CID\n");
48 exit(ERROR_TARGET); 56 exit(ERROR_TARGET);
49 } 57 }
50 return(0); 58 return(0);
51 } 59 }