diff ater/activate.c @ 44:16715bd149e0

ater: add support for data mode
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 12 Sep 2024 09:01:50 +0000
parents 237687e2be6c
children 13fffc41f989
line wrap: on
line diff
--- a/ater/activate.c	Fri Aug 30 19:04:57 2024 +0000
+++ b/ater/activate.c	Thu Sep 12 09:01:50 2024 +0000
@@ -65,6 +65,7 @@
 
 	/* good to proceed now */
 	at->is_active = true;
+	at->is_data = false;
 	at->is_efr = is_efr;
 	init_trau_ul_frame(nr);
 	at->ul_frame.c_bits[16] = dtxd;
@@ -72,6 +73,38 @@
 	free(init_frame);
 }
 
+void cmd_activate_csd(int argc, char **argv)
+{
+	int nr;
+	bool ir_16k;
+	struct ater_subslot *at;
+
+	if (argc != 3) {
+usage:		fprintf(stderr, "usage: %s 0|1|2|3 8|16\n", argv[0]);
+		return;
+	}
+	if (argv[1][0] < '0' || argv[1][0] > '3' || argv[1][1])
+		goto usage;
+	nr = argv[1][0] - '0';
+	if (!strcmp(argv[2], "8"))
+		ir_16k = false;
+	else if (!strcmp(argv[2], "16"))
+		ir_16k = true;
+	else
+		goto usage;
+
+	at = &subslots[nr];
+	if (at->is_active) {
+		fprintf(stderr, "error: subslot %d is already active\n", nr);
+		return;
+	}
+
+	/* good to proceed now */
+	at->is_active = true;
+	at->is_data = true;
+	init_trau_ul_frame_csd(nr, ir_16k);
+}
+
 void cmd_deact(int argc, char **argv)
 {
 	int nr;