diff ater8/activate.c @ 48:3cc26391d24d

ater8: add support for data mode
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 13 Sep 2024 01:03:43 +0000
parents ff94d7fc5891
children
line wrap: on
line diff
--- a/ater8/activate.c	Thu Sep 12 23:37:47 2024 +0000
+++ b/ater8/activate.c	Fri Sep 13 01:03:43 2024 +0000
@@ -58,12 +58,37 @@
 
 	/* good to proceed now */
 	at->is_active = true;
+	at->is_data = false;
 	init_trau_ul_frame(nr);
 	at->ul_frame.c_bits[8] = dtxd;
 	trau_frame_from_record(init_frame, &at->ul_frame, &at->frame_has_taf);
 	free(init_frame);
 }
 
+void cmd_activate_csd(int argc, char **argv)
+{
+	int nr;
+	struct ater_subslot *at;
+
+	if (argc != 2) {
+usage:		fprintf(stderr, "usage: %s 0-7\n", argv[0]);
+		return;
+	}
+	if (argv[1][0] < '0' || argv[1][0] > '7' || argv[1][1])
+		goto usage;
+	nr = argv[1][0] - '0';
+
+	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;
+}
+
 void cmd_deact(int argc, char **argv)
 {
 	int nr;