FreeCalypso > hg > fc-rfcal-tools
comparison autocal/txpwrmeas.c @ 133:c99b1dce04ec default tip
fc-rfcal-txcheck: check and report ramp tolerance
| author | Mychaela Falconia <falcon@freecalypso.org> |
|---|---|
| date | Mon, 20 Dec 2021 04:22:19 +0000 |
| parents | 94e8a410d6bd |
| children |
comparison
equal
deleted
inserted
replaced
| 132:94e8a410d6bd | 133:c99b1dce04ec |
|---|---|
| 1 /* | 1 /* |
| 2 * This module contains the Tx power measurement function. | 2 * This module contains the Tx power measurement function. |
| 3 */ | 3 */ |
| 4 | 4 |
| 5 #include <ctype.h> | |
| 5 #include <stdio.h> | 6 #include <stdio.h> |
| 6 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 #include <rvinterf/exitcodes.h> | |
| 7 | 9 |
| 8 extern char tsid_response[]; | 10 extern char tsid_response[]; |
| 9 | 11 |
| 10 do_txpwr_cal_setup(band, arfcn) | 12 do_txpwr_cal_setup(band, arfcn) |
| 11 char *band; | 13 char *band; |
| 35 | 37 |
| 36 tsid_command("power-meas\n"); | 38 tsid_command("power-meas\n"); |
| 37 meas = atof(tsid_response + 1); | 39 meas = atof(tsid_response + 1); |
| 38 return(meas); | 40 return(meas); |
| 39 } | 41 } |
| 42 | |
| 43 double | |
| 44 tx_power_meas_ramp(rstat) | |
| 45 char **rstat; | |
| 46 { | |
| 47 double meas; | |
| 48 char *cp; | |
| 49 | |
| 50 tsid_command("power-meas ramp\n"); | |
| 51 for (cp = tsid_response + 1; isspace(*cp); cp++) | |
| 52 ; | |
| 53 if (!*cp) { | |
| 54 inv: fprintf(stderr, | |
| 55 "error: bad TSID response to power-meas ramp\n"); | |
| 56 exit(ERROR_RFTEST); | |
| 57 } | |
| 58 meas = atof(cp); | |
| 59 while (*cp && !isspace(*cp)) | |
| 60 cp++; | |
| 61 if (!*cp) | |
| 62 goto inv; | |
| 63 while (isspace(*cp)) | |
| 64 cp++; | |
| 65 if (!*cp) | |
| 66 goto inv; | |
| 67 *rstat = cp; | |
| 68 return(meas); | |
| 69 } |
