FreeCalypso > hg > fc-rfcal-tools
comparison autocal/txbandmain.c @ 75:93653fe9b4ef
fc-rfcal-txband started
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 15 Jul 2017 19:22:30 +0000 |
parents | |
children | 5c3574f8c8c1 |
comparison
equal
deleted
inserted
replaced
74:d388732c2f73 | 75:93653fe9b4ef |
---|---|
1 /* | |
2 * This module contains the main() function for fc-rfcal-txband. | |
3 */ | |
4 | |
5 #include <stdio.h> | |
6 #include <stdlib.h> | |
7 #include <string.h> | |
8 #include <strings.h> | |
9 #include <unistd.h> | |
10 #include <rvinterf/l1tm.h> | |
11 #include <rvinterf/exitcodes.h> | |
12 #include "txband.h" | |
13 #include "stdband.h" | |
14 | |
15 struct tx_calchan_range tx_calchan_850[] = { | |
16 {128, 134, 131}, | |
17 {135, 150, 143}, | |
18 {151, 166, 159}, | |
19 {167, 182, 175}, | |
20 {183, 197, 190}, | |
21 {198, 213, 206}, | |
22 {214, 229, 222}, | |
23 {230, 251, 241} | |
24 }; | |
25 | |
26 struct tx_calchan_range tx_calchan_900[] = { | |
27 { 0, 27, 14}, | |
28 { 28, 47, 40}, | |
29 { 48, 66, 57}, | |
30 { 67, 85, 76}, | |
31 { 86, 104, 95}, | |
32 { 105, 124, 114}, | |
33 { 975, 994, 985}, | |
34 { 995, 1023, 1009} | |
35 }; | |
36 | |
37 struct tx_calchan_range tx_calchan_1800[] = { | |
38 {512, 553, 533}, | |
39 {554, 594, 574}, | |
40 {595, 636, 615}, | |
41 {637, 677, 657}, | |
42 {678, 720, 700}, | |
43 {721, 760, 740}, | |
44 {761, 802, 781}, | |
45 {803, 885, 844} | |
46 }; | |
47 | |
48 struct tx_calchan_range tx_calchan_1900[] = { | |
49 {512, 549, 531}, | |
50 {550, 586, 568}, | |
51 {587, 623, 605}, | |
52 {624, 697, 660}, | |
53 {698, 726, 712}, | |
54 {727, 754, 740}, | |
55 {755, 782, 768}, | |
56 {783, 810, 796} | |
57 }; | |
58 | |
59 struct txcal_band txcal_band_list[] = { | |
60 {"850", RFPW_STD_BAND_850, 190, 5, 19, tx_calchan_850, 4}, | |
61 {"900", RFPW_STD_BAND_900, 40, 5, 19, tx_calchan_900, 1}, | |
62 {"1800", RFPW_STD_BAND_1800, 700, 0, 15, tx_calchan_1800, 4}, | |
63 {"1900", RFPW_STD_BAND_1900, 660, 0, 15, tx_calchan_1900, 3}, | |
64 {0, 0, 0, 0, 0, 0, 0} | |
65 }; | |
66 | |
67 struct txcal_band *txcal_band; | |
68 char *txlevels_profile; | |
69 | |
70 struct tx_basis_point tx_basis[MAX_BASIS_POINTS]; | |
71 unsigned num_basis_points; | |
72 | |
73 struct tx_level tx_levels[MAX_TX_LEVELS]; | |
74 | |
75 finish_cmdline(argc, argv) | |
76 char **argv; | |
77 { | |
78 extern int optind; | |
79 struct txcal_band *band; | |
80 | |
81 if (argc - optind != 2) { | |
82 fprintf(stderr, "usage: %s band txlevels-profile\n", argv[0]); | |
83 exit(ERROR_USAGE); | |
84 } | |
85 for (band = txcal_band_list; band->name; band++) | |
86 if (!strcmp(band->name, argv[optind])) | |
87 break; | |
88 if (!band->name) { | |
89 fprintf(stderr, "error: \"%s\" is not a known band\n", | |
90 argv[optind]); | |
91 exit(ERROR_USAGE); | |
92 } | |
93 txcal_band = band; | |
94 txlevels_profile = argv[optind+1]; | |
95 return(0); | |
96 } | |
97 | |
98 main(argc, argv) | |
99 char **argv; | |
100 { | |
101 socket_pathname_options(argc, argv); | |
102 finish_cmdline(argc, argv); | |
103 connect_rvinterf_socket(); | |
104 connect_tsid_socket(); | |
105 setlinebuf(stdout); /* to allow logging with tee */ | |
106 printf("Preparing RF test system for %s MHz Tx calibration\n", | |
107 txcal_band->name); | |
108 do_txpwr_cal_setup(txcal_band->name, txcal_band->main_arfcn); | |
109 | |
110 printf("Putting the DUT into Test Mode\n"); | |
111 do_tms(1); | |
112 do_rfpw(STD_BAND_FLAG, txcal_band->rfpw_std_band); | |
113 do_rfpw(TCH_ARFCN, txcal_band->main_arfcn); | |
114 do_rfpw(AFC_ENA_FLAG, 0); | |
115 | |
116 | |
117 } |