FreeCalypso > hg > fc-rfcal-tools
comparison autocal/l1meas.c @ 45:98abe6bd2042
autocal: scw implemented for Rx cal
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 27 May 2017 05:48:04 +0000 |
parents | |
children | 201f27bd8dca |
comparison
equal
deleted
inserted
replaced
44:5018fd8eecce | 45:98abe6bd2042 |
---|---|
1 /* | |
2 * In this module we are going to implement the functions for making | |
3 * measurements on the DUT via L1TM. | |
4 */ | |
5 | |
6 #include <sys/types.h> | |
7 #include <stdio.h> | |
8 #include <stdlib.h> | |
9 #include <rvinterf/pktmux.h> | |
10 #include <rvinterf/tm3.h> | |
11 #include <rvinterf/l1tm.h> | |
12 #include <rvinterf/exitcodes.h> | |
13 | |
14 extern u_char rvi_msg[]; | |
15 extern int rvi_msg_len; | |
16 | |
17 do_scw(index, value) | |
18 { | |
19 u_char cmdpkt[7]; | |
20 | |
21 cmdpkt[1] = STATS_CONFIG_WRITE; | |
22 cmdpkt[2] = index; | |
23 cmdpkt[3] = index >> 8; | |
24 cmdpkt[4] = value; | |
25 cmdpkt[5] = value >> 8; | |
26 l1tm_pkt_exch(cmdpkt, 5); | |
27 if (rvi_msg[3]) { | |
28 fprintf(stderr, "DUT error %u in response to scw\n", | |
29 rvi_msg[3]); | |
30 exit(ERROR_TARGET); | |
31 } | |
32 if (rvi_msg_len != 6) { | |
33 fprintf(stderr, "DUT error: scw response wrong length\n"); | |
34 exit(ERROR_TARGET); | |
35 } | |
36 if (rvi_msg[4] != index) { | |
37 fprintf(stderr, "DUT error: scw response wrong index\n"); | |
38 exit(ERROR_TARGET); | |
39 } | |
40 return(0); | |
41 } |