# HG changeset patch # User Mychaela Falconia # Date 1495867577 0 # Node ID e86779d5445c6bf143e86d427fba7e0e24712578 # Parent 751f8d9efed0783694941749ef59862c5929b74a autocal: preparations for receiving auto stats and rfe completion diff -r 751f8d9efed0 -r e86779d5445c autocal/l1stats.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/autocal/l1stats.h Sat May 27 06:46:17 2017 +0000 @@ -0,0 +1,23 @@ +/* + * Here we define our internal structure in which we pass + * the stats read from L1TM. + */ + +struct l1stats { + int type; + unsigned bitmask; + unsigned rssi; + unsigned dsp_pm; + int angle_mean; + unsigned angle_var; + int angle_min; + int angle_max; + unsigned snr_mean; + unsigned snr_var; + unsigned toa_mean; + unsigned toa_var; + unsigned frame_number; + unsigned runs; + unsigned successes; + unsigned bsic; +}; diff -r 751f8d9efed0 -r e86779d5445c autocal/l1tmops.c --- 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); } diff -r 751f8d9efed0 -r e86779d5445c autocal/rvinterf.c --- a/autocal/rvinterf.c Sat May 27 06:25:59 2017 +0000 +++ b/autocal/rvinterf.c Sat May 27 06:46:17 2017 +0000 @@ -163,3 +163,13 @@ } return(0); } + +collect_extra_pkt_from_target() +{ + collect_rvi_msg(); + if (rvi_msg[0] != RVI2CLI_PKT_FROM_TARGET) { + fprintf(stderr, "error: unexpected message from rvinterf\n"); + exit(ERROR_RVINTERF); + } + return(0); +}