FreeCalypso > hg > fc-rfcal-tools
changeset 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 | |
files | autocal/txpwrmeas.c autocal/txstandchk.c |
diffstat | 2 files changed, 35 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/autocal/txpwrmeas.c Mon Dec 20 03:52:01 2021 +0000 +++ b/autocal/txpwrmeas.c Mon Dec 20 04:22:19 2021 +0000 @@ -2,8 +2,10 @@ * This module contains the Tx power measurement function. */ +#include <ctype.h> #include <stdio.h> #include <stdlib.h> +#include <rvinterf/exitcodes.h> extern char tsid_response[]; @@ -37,3 +39,31 @@ meas = atof(tsid_response + 1); return(meas); } + +double +tx_power_meas_ramp(rstat) + char **rstat; +{ + double meas; + char *cp; + + tsid_command("power-meas ramp\n"); + for (cp = tsid_response + 1; isspace(*cp); cp++) + ; + if (!*cp) { +inv: fprintf(stderr, + "error: bad TSID response to power-meas ramp\n"); + exit(ERROR_RFTEST); + } + meas = atof(cp); + while (*cp && !isspace(*cp)) + cp++; + if (!*cp) + goto inv; + while (isspace(*cp)) + cp++; + if (!*cp) + goto inv; + *rstat = cp; + return(meas); +}
--- a/autocal/txstandchk.c Mon Dec 20 03:52:01 2021 +0000 +++ b/autocal/txstandchk.c Mon Dec 20 04:22:19 2021 +0000 @@ -13,7 +13,7 @@ #include <rvinterf/exitcodes.h> #include "stdband.h" -extern double tx_power_meas(); +extern double tx_power_meas(), tx_power_meas_ramp(); static struct band { char *name; @@ -64,6 +64,7 @@ unsigned plnum; double meas; int spec_dbm; + char *ramp_status; socket_pathname_options(argc, argv); finish_cmdline(argc, argv); @@ -88,10 +89,10 @@ do_txpw(TX_PWR_LEVEL, plnum); pass_pcl_to_tester(plnum); usleep(20000); - meas = tx_power_meas(); + meas = tx_power_meas_ramp(&ramp_status); printf( - "Tx power level #%u: spec %d dBm, meas %.2f dBm (%+.2f)\n", - plnum, spec_dbm, meas, meas - spec_dbm); + "Tx power level #%u: spec %d dBm, meas %.2f dBm (%+.2f), ramp %s\n", + plnum, spec_dbm, meas, meas - spec_dbm, ramp_status); } printf("Stopping RF Tx on the DUT\n");