FreeCalypso > hg > fc-rfcal-tools
annotate autocal/l1meas.c @ 84:a2d4cab0a592
fc-rfcal-txband: works after a couple of bugfixes
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 15 Jul 2017 23:57:56 +0000 |
parents | 1a0dbc746d57 |
children |
rev | line source |
---|---|
45
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * In this module we are going to implement the functions for making |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * measurements on the DUT via L1TM. |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 */ |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 #include <sys/types.h> |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 #include <stdio.h> |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 #include <stdlib.h> |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 #include <rvinterf/pktmux.h> |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 #include <rvinterf/tm3.h> |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 #include <rvinterf/l1tm.h> |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 #include <rvinterf/exitcodes.h> |
48
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
13 #include "l1stats.h" |
45
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 extern u_char rvi_msg[]; |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 extern int rvi_msg_len; |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 do_scw(index, value) |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 { |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 u_char cmdpkt[7]; |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 cmdpkt[1] = STATS_CONFIG_WRITE; |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 cmdpkt[2] = index; |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 cmdpkt[3] = index >> 8; |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 cmdpkt[4] = value; |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 cmdpkt[5] = value >> 8; |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 l1tm_pkt_exch(cmdpkt, 5); |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 if (rvi_msg[3]) { |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 fprintf(stderr, "DUT error %u in response to scw\n", |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 rvi_msg[3]); |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 exit(ERROR_TARGET); |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 } |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 if (rvi_msg_len != 6) { |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 fprintf(stderr, "DUT error: scw response wrong length\n"); |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 exit(ERROR_TARGET); |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 } |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 if (rvi_msg[4] != index) { |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 fprintf(stderr, "DUT error: scw response wrong index\n"); |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 exit(ERROR_TARGET); |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 } |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 return(0); |
98abe6bd2042
autocal: scw implemented for Rx cal
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 } |
48
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
43 |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
44 collect_auto_stats(sb) |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
45 struct l1stats *sb; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
46 { |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
47 unsigned type, bitmask, offset; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
48 int expect_len; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
49 |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
50 collect_extra_pkt_from_target(); |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
51 l1tm_resp_sanity_check(STATS_READ); |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
52 if (rvi_msg[3]) { |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
53 fprintf(stderr, "DUT error %u in auto-stats message\n", |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
54 rvi_msg[3]); |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
55 exit(ERROR_TARGET); |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
56 } |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
57 if (rvi_msg_len < 9) { |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
58 fprintf(stderr, "DUT error: auto-stats msg too short\n"); |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
59 exit(ERROR_TARGET); |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
60 } |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
61 type = rvi_msg[4] | (rvi_msg[5] << 8); |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
62 bitmask = rvi_msg[6] | (rvi_msg[7] << 8); |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
63 if (type < 1 || type > 2) { |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
64 fprintf(stderr, "DUT error: invalid type in auto-stats msg\n"); |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
65 exit(ERROR_TARGET); |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
66 } |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
67 if (bitmask & 0x0300) { |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
68 fprintf(stderr, |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
69 "DUT error: invalid bitmask in auto-stats msg\n"); |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
70 exit(ERROR_TARGET); |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
71 } |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
72 expect_len = 9; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
73 if (bitmask & RSSI) |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
74 expect_len += 2; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
75 if (bitmask & DSP_PM) |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
76 expect_len += 2; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
77 if (bitmask & ANGLE_MEAN) |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
78 expect_len += 4; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
79 if (bitmask & ANGLE_VAR) |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
80 expect_len += 4; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
81 if (bitmask & ANGLE_MIN) |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
82 expect_len += 4; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
83 if (bitmask & ANGLE_MAX) |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
84 expect_len += 4; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
85 if (bitmask & SNR_MEAN) |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
86 expect_len += 4; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
87 if (bitmask & SNR_VAR) |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
88 expect_len += 4; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
89 if (bitmask & TOA_MEAN) |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
90 expect_len += 4; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
91 if (bitmask & TOA_VAR) |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
92 expect_len += 4; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
93 if (bitmask & FRAME_NUMBER) |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
94 expect_len += 4; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
95 if (bitmask & RUNS) |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
96 expect_len += 4; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
97 if (bitmask & SUCCESSES) |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
98 expect_len += 4; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
99 if (bitmask & BSIC) |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
100 expect_len += 2; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
101 if (rvi_msg_len != expect_len) { |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
102 fprintf(stderr, "DUT error: auto-stats msg wrong length\n"); |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
103 exit(ERROR_TARGET); |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
104 } |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
105 sb->type = type; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
106 sb->bitmask = bitmask; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
107 offset = 8; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
108 if (bitmask & RSSI) { |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
109 sb->rssi = rvi_msg[offset] | (rvi_msg[offset+1] << 8); |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
110 offset += 2; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
111 } |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
112 if (bitmask & DSP_PM) { |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
113 sb->dsp_pm = rvi_msg[offset] | (rvi_msg[offset+1] << 8); |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
114 offset += 2; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
115 } |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
116 if (bitmask & ANGLE_MEAN) { |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
117 sb->angle_mean = rvi_msg[offset] | (rvi_msg[offset+1] << 8) | |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
118 (rvi_msg[offset+2] << 16) | (rvi_msg[offset+3] << 24); |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
119 offset += 4; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
120 } |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
121 if (bitmask & ANGLE_VAR) { |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
122 sb->angle_var = rvi_msg[offset] | (rvi_msg[offset+1] << 8) | |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
123 (rvi_msg[offset+2] << 16) | (rvi_msg[offset+3] << 24); |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
124 offset += 4; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
125 } |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
126 if (bitmask & ANGLE_MIN) { |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
127 sb->angle_min = rvi_msg[offset] | (rvi_msg[offset+1] << 8) | |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
128 (rvi_msg[offset+2] << 16) | (rvi_msg[offset+3] << 24); |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
129 offset += 4; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
130 } |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
131 if (bitmask & ANGLE_MAX) { |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
132 sb->angle_max = rvi_msg[offset] | (rvi_msg[offset+1] << 8) | |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
133 (rvi_msg[offset+2] << 16) | (rvi_msg[offset+3] << 24); |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
134 offset += 4; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
135 } |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
136 if (bitmask & SNR_MEAN) { |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
137 sb->snr_mean = rvi_msg[offset] | (rvi_msg[offset+1] << 8) | |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
138 (rvi_msg[offset+2] << 16) | (rvi_msg[offset+3] << 24); |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
139 offset += 4; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
140 } |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
141 if (bitmask & SNR_VAR) { |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
142 sb->snr_var = rvi_msg[offset] | (rvi_msg[offset+1] << 8) | |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
143 (rvi_msg[offset+2] << 16) | (rvi_msg[offset+3] << 24); |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
144 offset += 4; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
145 } |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
146 if (bitmask & TOA_MEAN) { |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
147 sb->toa_mean = rvi_msg[offset] | (rvi_msg[offset+1] << 8) | |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
148 (rvi_msg[offset+2] << 16) | (rvi_msg[offset+3] << 24); |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
149 offset += 4; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
150 } |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
151 if (bitmask & TOA_VAR) { |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
152 sb->toa_var = rvi_msg[offset] | (rvi_msg[offset+1] << 8) | |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
153 (rvi_msg[offset+2] << 16) | (rvi_msg[offset+3] << 24); |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
154 offset += 4; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
155 } |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
156 if (bitmask & FRAME_NUMBER) { |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
157 sb->frame_number = rvi_msg[offset] | (rvi_msg[offset+1] << 8) | |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
158 (rvi_msg[offset+2] << 16) | (rvi_msg[offset+3] << 24); |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
159 offset += 4; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
160 } |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
161 if (bitmask & RUNS) { |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
162 sb->runs = rvi_msg[offset] | (rvi_msg[offset+1] << 8) | |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
163 (rvi_msg[offset+2] << 16) | (rvi_msg[offset+3] << 24); |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
164 offset += 4; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
165 } |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
166 if (bitmask & SUCCESSES) { |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
167 sb->successes = rvi_msg[offset] | (rvi_msg[offset+1] << 8) | |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
168 (rvi_msg[offset+2] << 16) | (rvi_msg[offset+3] << 24); |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
169 offset += 4; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
170 } |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
171 if (bitmask & BSIC) { |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
172 sb->bsic = rvi_msg[offset] | (rvi_msg[offset+1] << 8); |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
173 offset += 2; |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
174 } |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
175 return(0); |
201f27bd8dca
autocal/l1meas.c: implemented reading of auto-stats
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
176 } |
49
1a0dbc746d57
autocal: Rx cal main engine implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
48
diff
changeset
|
177 |
1a0dbc746d57
autocal: Rx cal main engine implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
48
diff
changeset
|
178 collect_rfe_completion() |
1a0dbc746d57
autocal: Rx cal main engine implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
48
diff
changeset
|
179 { |
1a0dbc746d57
autocal: Rx cal main engine implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
48
diff
changeset
|
180 collect_extra_pkt_from_target(); |
1a0dbc746d57
autocal: Rx cal main engine implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
48
diff
changeset
|
181 l1tm_resp_sanity_check(RF_ENABLE); |
1a0dbc746d57
autocal: Rx cal main engine implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
48
diff
changeset
|
182 if (rvi_msg[3] != 1) { |
1a0dbc746d57
autocal: Rx cal main engine implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
48
diff
changeset
|
183 fprintf(stderr, "DUT error %u in rfe completion message\n", |
1a0dbc746d57
autocal: Rx cal main engine implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
48
diff
changeset
|
184 rvi_msg[3]); |
1a0dbc746d57
autocal: Rx cal main engine implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
48
diff
changeset
|
185 exit(ERROR_TARGET); |
1a0dbc746d57
autocal: Rx cal main engine implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
48
diff
changeset
|
186 } |
1a0dbc746d57
autocal: Rx cal main engine implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
48
diff
changeset
|
187 return(0); |
1a0dbc746d57
autocal: Rx cal main engine implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
48
diff
changeset
|
188 } |