FreeCalypso > hg > fc-rfcal-tools
comparison autocal/l1tmops.c @ 18:af77b95feeba
autocal/l1tmops.c: rxpw and txpw implemented
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 22 May 2017 18:36:26 +0000 |
parents | 0645344feee5 |
children | 7ac866c3baf6 |
comparison
equal
deleted
inserted
replaced
17:0645344feee5 | 18:af77b95feeba |
---|---|
133 fprintf(stderr, "DUT error: rfpw response wrong index\n"); | 133 fprintf(stderr, "DUT error: rfpw response wrong index\n"); |
134 exit(ERROR_TARGET); | 134 exit(ERROR_TARGET); |
135 } | 135 } |
136 return(0); | 136 return(0); |
137 } | 137 } |
138 | |
139 do_rxpw(index, value) | |
140 { | |
141 u_char cmdpkt[7]; | |
142 | |
143 cmdpkt[1] = RX_PARAM_WRITE; | |
144 cmdpkt[2] = index; | |
145 cmdpkt[3] = index >> 8; | |
146 cmdpkt[4] = value; | |
147 cmdpkt[5] = value >> 8; | |
148 l1tm_pkt_exch(cmdpkt, 5); | |
149 if (rvi_msg[3]) { | |
150 fprintf(stderr, "DUT error %u in response to rxpw\n", | |
151 rvi_msg[3]); | |
152 exit(ERROR_TARGET); | |
153 } | |
154 if (rvi_msg_len != 6) { | |
155 fprintf(stderr, "DUT error: rxpw response wrong length\n"); | |
156 exit(ERROR_TARGET); | |
157 } | |
158 if (rvi_msg[4] != index) { | |
159 fprintf(stderr, "DUT error: rxpw response wrong index\n"); | |
160 exit(ERROR_TARGET); | |
161 } | |
162 return(0); | |
163 } | |
164 | |
165 do_txpw(index, value) | |
166 { | |
167 u_char cmdpkt[7]; | |
168 | |
169 cmdpkt[1] = TX_PARAM_WRITE; | |
170 cmdpkt[2] = index; | |
171 cmdpkt[3] = index >> 8; | |
172 cmdpkt[4] = value; | |
173 cmdpkt[5] = value >> 8; | |
174 l1tm_pkt_exch(cmdpkt, 5); | |
175 if (rvi_msg[3]) { | |
176 fprintf(stderr, "DUT error %u in response to txpw\n", | |
177 rvi_msg[3]); | |
178 exit(ERROR_TARGET); | |
179 } | |
180 if (rvi_msg_len != 6) { | |
181 fprintf(stderr, "DUT error: txpw response wrong length\n"); | |
182 exit(ERROR_TARGET); | |
183 } | |
184 if (rvi_msg[4] != index) { | |
185 fprintf(stderr, "DUT error: txpw response wrong index\n"); | |
186 exit(ERROR_TARGET); | |
187 } | |
188 return(0); | |
189 } |