comparison ater/activate.c @ 47:13fffc41f989

ater: add support for HR-data-16k TRAU-UL frame output
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 12 Sep 2024 23:37:47 +0000
parents 16715bd149e0
children 40f781efdbe1
comparison
equal deleted inserted replaced
46:12415d7ce262 47:13fffc41f989
74 } 74 }
75 75
76 void cmd_activate_csd(int argc, char **argv) 76 void cmd_activate_csd(int argc, char **argv)
77 { 77 {
78 int nr; 78 int nr;
79 bool ir_16k; 79 bool ir_16k, is_hr;
80 struct ater_subslot *at; 80 struct ater_subslot *at;
81 81
82 if (argc != 3) { 82 if (argc < 3 || argc > 4) {
83 usage: fprintf(stderr, "usage: %s 0|1|2|3 8|16\n", argv[0]); 83 usage: fprintf(stderr, "usage: %s 0|1|2|3 8|16 [hr]\n", argv[0]);
84 return; 84 return;
85 } 85 }
86 if (argv[1][0] < '0' || argv[1][0] > '3' || argv[1][1]) 86 if (argv[1][0] < '0' || argv[1][0] > '3' || argv[1][1])
87 goto usage; 87 goto usage;
88 nr = argv[1][0] - '0'; 88 nr = argv[1][0] - '0';
90 ir_16k = false; 90 ir_16k = false;
91 else if (!strcmp(argv[2], "16")) 91 else if (!strcmp(argv[2], "16"))
92 ir_16k = true; 92 ir_16k = true;
93 else 93 else
94 goto usage; 94 goto usage;
95 if (argv[3]) {
96 if (strcmp(argv[3], "hr"))
97 goto usage;
98 is_hr = true;
99 } else
100 is_hr = false;
95 101
96 at = &subslots[nr]; 102 at = &subslots[nr];
97 if (at->is_active) { 103 if (at->is_active) {
98 fprintf(stderr, "error: subslot %d is already active\n", nr); 104 fprintf(stderr, "error: subslot %d is already active\n", nr);
99 return; 105 return;
100 } 106 }
101 107
102 /* good to proceed now */ 108 /* good to proceed now */
103 at->is_active = true; 109 at->is_active = true;
104 at->is_data = true; 110 at->is_data = true;
111 at->is_hr_data = is_hr;
105 init_trau_ul_frame_csd(nr, ir_16k); 112 init_trau_ul_frame_csd(nr, ir_16k);
106 } 113 }
107 114
108 void cmd_deact(int argc, char **argv) 115 void cmd_deact(int argc, char **argv)
109 { 116 {