FreeCalypso > hg > fc-rfcal-tools
annotate autocal/rvinterf.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 | 724e16223187 |
children |
rev | line source |
---|---|
13 | 1 /* |
2 * Interface to the DUT via rvinterf | |
3 */ | |
4 | |
5 #include <sys/types.h> | |
6 #include <sys/socket.h> | |
7 #include <sys/un.h> | |
8 #include <stdio.h> | |
9 #include <string.h> | |
10 #include <strings.h> | |
11 #include <stdlib.h> | |
12 #include <unistd.h> | |
13 #include <rvinterf/pktmux.h> | |
14 #include <rvinterf/localsock.h> | |
15
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
15 #include <rvinterf/limits.h> |
13 | 16 #include <rvinterf/exitcodes.h> |
17 | |
18 char *rvif_socket_pathname = "/tmp/rvinterf_socket"; | |
19 int rvif_socket; | |
20 | |
15
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
21 int rx_enable_state; |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
22 u_char rvi_msg[LOCALSOCK_MAX_MSG]; |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
23 int rvi_msg_len; |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
24 |
13 | 25 connect_rvinterf_socket() |
26 { | |
27 /* local socket binding voodoo copied from osmocon */ | |
28 struct sockaddr_un local; | |
29 unsigned int namelen; | |
30 int rc; | |
31 | |
32 rvif_socket = socket(AF_UNIX, SOCK_STREAM, 0); | |
33 if (rvif_socket < 0) { | |
34 perror("socket(AF_UNIX, SOCK_STREAM, 0)"); | |
35 exit(ERROR_UNIX); | |
36 } | |
37 | |
38 local.sun_family = AF_UNIX; | |
39 strncpy(local.sun_path, rvif_socket_pathname, sizeof(local.sun_path)); | |
40 local.sun_path[sizeof(local.sun_path) - 1] = '\0'; | |
41 | |
42 /* we use the same magic that X11 uses in Xtranssock.c for | |
43 * calculating the proper length of the sockaddr */ | |
44 #if defined(BSD44SOCKETS) || defined(__UNIXWARE__) | |
45 local.sun_len = strlen(local.sun_path); | |
46 #endif | |
47 #if defined(BSD44SOCKETS) || defined(SUN_LEN) | |
48 namelen = SUN_LEN(&local); | |
49 #else | |
50 namelen = strlen(local.sun_path) + | |
51 offsetof(struct sockaddr_un, sun_path) + 1; | |
52 #endif | |
53 | |
54 rc = connect(rvif_socket, (struct sockaddr *) &local, namelen); | |
55 if (rc != 0) { | |
56 perror(rvif_socket_pathname); | |
57 exit(ERROR_RVINTERF); | |
58 } | |
59 | |
60 return(0); | |
61 } | |
15
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
62 |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
63 static void |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
64 collect_bytes_from_rvi(buf, nbytes) |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
65 u_char *buf; |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
66 { |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
67 int cc; |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
68 |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
69 while (nbytes) { |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
70 cc = read(rvif_socket, buf, nbytes); |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
71 if (cc <= 0) { |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
72 perror("read from rvinterf socket"); |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
73 exit(ERROR_RVINTERF); |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
74 } |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
75 buf += cc; |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
76 nbytes -= cc; |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
77 } |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
78 } |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
79 |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
80 collect_rvi_msg() |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
81 { |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
82 u_char lenbuf[2]; |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
83 |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
84 collect_bytes_from_rvi(lenbuf, 2); |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
85 rvi_msg_len = lenbuf[0] << 8 | lenbuf[1]; |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
86 if (rvi_msg_len < 1 || rvi_msg_len > LOCALSOCK_MAX_MSG) { |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
87 fprintf(stderr, "Invalid length from rvinterf: %02X%02X\n", |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
88 lenbuf[0], lenbuf[1]); |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
89 exit(ERROR_RVINTERF); |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
90 } |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
91 collect_bytes_from_rvi(rvi_msg, rvi_msg_len); |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
92 return(0); |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
93 } |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
94 |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
95 send_rvimisc_command(cmdpkt, cmdlen) |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
96 u_char *cmdpkt; |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
97 { |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
98 u_char lenbuf[2]; |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
99 |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
100 lenbuf[0] = 0; |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
101 lenbuf[1] = cmdlen; |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
102 write(rvif_socket, lenbuf, 2); |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
103 write(rvif_socket, cmdpkt, cmdlen); |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
104 } |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
105 |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
106 rx_control(enable) |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
107 { |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
108 u_char cmdpkt[2]; |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
109 int cmdlen; |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
110 |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
111 /* are we already in the desired state? */ |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
112 if (rx_enable_state == enable) |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
113 return(0); |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
114 /* no, do the work */ |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
115 if (enable) { |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
116 cmdpkt[0] = CLI2RVI_WANT_MUXPROTO; |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
117 cmdpkt[1] = RVT_TM_HEADER; |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
118 cmdlen = 2; |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
119 } else { |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
120 cmdpkt[0] = CLI2RVI_RESET_PACKET_RX; |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
121 cmdlen = 1; |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
122 } |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
123 send_rvimisc_command(cmdpkt, cmdlen); |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
124 collect_rvi_msg(); |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
125 if (rvi_msg[0] != RVI2CLI_LOCAL_CMD_RESP || rvi_msg_len < 2) { |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
126 fprintf(stderr, |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
127 "error: unexpected response to rvinterf local command\n"); |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
128 exit(ERROR_RVINTERF); |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
129 } |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
130 if (rvi_msg[1] != '+') { |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
131 fprintf(stderr, "Error from rvinterf: %.*s\n", rvi_msg_len - 1, |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
132 rvi_msg + 1); |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
133 exit(ERROR_RVINTERF); |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
134 } |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
135 rx_enable_state = enable; |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
136 return(0); |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
137 } |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
138 |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
139 send_pkt_to_target(pkt, pktlen) |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
140 u_char *pkt; |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
141 { |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
142 u_char hdrbuf[3]; |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
143 int len1; |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
144 |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
145 len1 = pktlen + 1; |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
146 hdrbuf[0] = len1 >> 8; |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
147 hdrbuf[1] = len1 & 0xFF; |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
148 hdrbuf[2] = CLI2RVI_PKT_TO_TARGET; |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
149 write(rvif_socket, hdrbuf, 3); |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
150 write(rvif_socket, pkt, pktlen); |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
151 } |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
152 |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
153 target_pkt_exch(outpkt, outpktlen) |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
154 u_char *outpkt; |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
155 { |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
156 rx_control(1); |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
157 send_pkt_to_target(outpkt, outpktlen); |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
158 collect_rvi_msg(); |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
159 if (rvi_msg[0] != RVI2CLI_PKT_FROM_TARGET) { |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
160 fprintf(stderr, |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
161 "error: unexpected response type from rvinterf\n"); |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
162 exit(ERROR_RVINTERF); |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
163 } |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
164 return(0); |
724e16223187
autocal/rvinterf.c now has all essential code for talking to rvinterf
Mychaela Falconia <falcon@freecalypso.org>
parents:
13
diff
changeset
|
165 } |
47
e86779d5445c
autocal: preparations for receiving auto stats and rfe completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
166 |
e86779d5445c
autocal: preparations for receiving auto stats and rfe completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
167 collect_extra_pkt_from_target() |
e86779d5445c
autocal: preparations for receiving auto stats and rfe completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
168 { |
e86779d5445c
autocal: preparations for receiving auto stats and rfe completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
169 collect_rvi_msg(); |
e86779d5445c
autocal: preparations for receiving auto stats and rfe completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
170 if (rvi_msg[0] != RVI2CLI_PKT_FROM_TARGET) { |
e86779d5445c
autocal: preparations for receiving auto stats and rfe completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
171 fprintf(stderr, "error: unexpected message from rvinterf\n"); |
e86779d5445c
autocal: preparations for receiving auto stats and rfe completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
172 exit(ERROR_RVINTERF); |
e86779d5445c
autocal: preparations for receiving auto stats and rfe completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
173 } |
e86779d5445c
autocal: preparations for receiving auto stats and rfe completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
174 return(0); |
e86779d5445c
autocal: preparations for receiving auto stats and rfe completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
175 } |