comparison autocal/txchkmain.c @ 71:784ce9f3a80a

fc-rfcal-txcheck: spec and error values added to the output
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 14 Jul 2017 06:58:36 +0000
parents b313884c79fd
children
comparison
equal deleted inserted replaced
70:e35da125c937 71:784ce9f3a80a
17 char *name; 17 char *name;
18 unsigned rfpw_std_band; 18 unsigned rfpw_std_band;
19 unsigned default_arfcn; 19 unsigned default_arfcn;
20 unsigned start_plnum; 20 unsigned start_plnum;
21 unsigned end_plnum; 21 unsigned end_plnum;
22 int spec_max_dbm;
22 } bands[] = { 23 } bands[] = {
23 {"850", RFPW_STD_BAND_850, 190, 5, 19}, 24 {"850", RFPW_STD_BAND_850, 190, 5, 19, 33},
24 {"900", RFPW_STD_BAND_900, 40, 5, 19}, 25 {"900", RFPW_STD_BAND_900, 40, 5, 19, 33},
25 {"1800", RFPW_STD_BAND_1800, 700, 0, 15}, 26 {"1800", RFPW_STD_BAND_1800, 700, 0, 15, 30},
26 {"1900", RFPW_STD_BAND_1900, 660, 0, 15}, 27 {"1900", RFPW_STD_BAND_1900, 660, 0, 15, 30},
27 {0, 0, 0} 28 {0, 0, 0}
28 }; 29 };
29 static struct band *selected_band; 30 static struct band *selected_band;
30 static unsigned arfcn; 31 static unsigned arfcn;
31 32
58 main(argc, argv) 59 main(argc, argv)
59 char **argv; 60 char **argv;
60 { 61 {
61 unsigned plnum; 62 unsigned plnum;
62 double meas; 63 double meas;
64 int spec_dbm;
63 65
64 socket_pathname_options(argc, argv); 66 socket_pathname_options(argc, argv);
65 finish_cmdline(argc, argv); 67 finish_cmdline(argc, argv);
66 connect_rvinterf_socket(); 68 connect_rvinterf_socket();
67 connect_tsid_socket(); 69 connect_tsid_socket();
76 do_rfpw(TCH_ARFCN, arfcn); 78 do_rfpw(TCH_ARFCN, arfcn);
77 do_rfpw(AFC_ENA_FLAG, 0); 79 do_rfpw(AFC_ENA_FLAG, 0);
78 printf("Starting RF Tx on the DUT\n"); 80 printf("Starting RF Tx on the DUT\n");
79 do_rfe(RX_TX_TCH); 81 do_rfe(RX_TX_TCH);
80 82
83 spec_dbm = selected_band->spec_max_dbm;
81 for (plnum = selected_band->start_plnum; 84 for (plnum = selected_band->start_plnum;
82 plnum <= selected_band->end_plnum; plnum++) { 85 plnum <= selected_band->end_plnum; plnum++, spec_dbm -= 2) {
83 do_txpw(TX_PWR_LEVEL, plnum); 86 do_txpw(TX_PWR_LEVEL, plnum);
84 usleep(20000); 87 usleep(20000);
85 meas = tx_power_meas(); 88 meas = tx_power_meas();
86 printf("Tx power level #%u: %.2f dBm\n", plnum, meas); 89 printf(
90 "Tx power level #%u: spec %d dBm, meas %.2f dBm (%+.2f)\n",
91 plnum, spec_dbm, meas, meas - spec_dbm);
87 } 92 }
88 93
89 printf("Stopping RF Tx on the DUT\n"); 94 printf("Stopping RF Tx on the DUT\n");
90 do_rfe(STOP_ALL); 95 do_rfe(STOP_ALL);
91 exit(0); 96 exit(0);