FreeCalypso > hg > fc-rfcal-tools
comparison autocal/txchkmain.c @ 54:21f6dba5c4df
fc-rfcal-txcheck ready to test
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 27 May 2017 16:03:40 +0000 |
parents | bc2397f62bdb |
children | b313884c79fd |
comparison
equal
deleted
inserted
replaced
53:bc2397f62bdb | 54:21f6dba5c4df |
---|---|
4 | 4 |
5 #include <stdio.h> | 5 #include <stdio.h> |
6 #include <stdlib.h> | 6 #include <stdlib.h> |
7 #include <string.h> | 7 #include <string.h> |
8 #include <strings.h> | 8 #include <strings.h> |
9 #include <unistd.h> | |
9 #include <rvinterf/l1tm.h> | 10 #include <rvinterf/l1tm.h> |
10 #include <rvinterf/exitcodes.h> | 11 #include <rvinterf/exitcodes.h> |
11 #include "stdband.h" | 12 #include "stdband.h" |
13 | |
14 extern double tx_power_meas(); | |
12 | 15 |
13 static struct band { | 16 static struct band { |
14 char *name; | 17 char *name; |
15 unsigned rfpw_std_band; | 18 unsigned rfpw_std_band; |
16 unsigned default_arfcn; | 19 unsigned default_arfcn; |
64 } | 67 } |
65 | 68 |
66 main(argc, argv) | 69 main(argc, argv) |
67 char **argv; | 70 char **argv; |
68 { | 71 { |
72 unsigned plnum; | |
73 double meas; | |
74 | |
69 socket_pathname_options(argc, argv); | 75 socket_pathname_options(argc, argv); |
70 finish_cmdline(argc, argv); | 76 finish_cmdline(argc, argv); |
71 connect_rvinterf_socket(); | 77 connect_rvinterf_socket(); |
72 connect_tsid_socket(); | 78 connect_tsid_socket(); |
73 setlinebuf(stdout); /* to allow logging with tee */ | 79 setlinebuf(stdout); /* to allow logging with tee */ |
74 prepare_rf_test_system(); | 80 prepare_rf_test_system(); |
75 | 81 |
76 printf("Putting the DUT into Test Mode\n"); | 82 printf("Putting the DUT into Test Mode\n"); |
77 do_tms(1); | 83 do_tms(1); |
78 do_rfpw(STD_BAND_FLAG, selected_band->rfpw_std_band); | 84 do_rfpw(STD_BAND_FLAG, selected_band->rfpw_std_band); |
85 do_rfpw(TCH_ARFCN, arfcn); | |
86 do_rfpw(AFC_ENA_FLAG, 0); | |
87 printf("Starting RF Tx on the DUT\n"); | |
88 do_rfe(RX_TX_TCH); | |
79 | 89 |
90 for (plnum = selected_band->start_plnum; | |
91 plnum <= selected_band->end_plnum; plnum++) { | |
92 do_txpw(TX_PWR_LEVEL, plnum); | |
93 usleep(20000); | |
94 meas = tx_power_meas(); | |
95 printf("Tx power level #%u: %.2f dBm\n", plnum, meas); | |
96 } | |
80 | 97 |
98 printf("Stopping RF Tx on the DUT\n"); | |
99 do_rfe(STOP_ALL); | |
100 exit(0); | |
81 } | 101 } |