diff ater/tx_func.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 2742dbea95f1
children 13fffc41f989
line wrap: on
line diff
--- a/ater/tx_func.c	Fri Aug 30 19:04:57 2024 +0000
+++ b/ater/tx_func.c	Thu Sep 12 09:01:50 2024 +0000
@@ -30,6 +30,18 @@
 	memset(fr->t_bits, 1, 4);
 }
 
+void init_trau_ul_frame_csd(int nr, bool ir_16k)
+{
+	struct ater_subslot *at = &subslots[nr];
+	struct osmo_trau_frame *fr = &at->ul_frame;
+
+	fr->type = OSMO_TRAU16_FT_DATA;
+	fr->dir = OSMO_TRAU_DIR_UL;
+	fr->c_bits[5] = ir_16k;
+	memset(fr->c_bits + 6, 1, 9);
+	memset(fr->d_bits, 1, 63 * 4);
+}
+
 static void handle_play(struct ater_subslot *at)
 {
 	if (at->play_wait_align) {
@@ -58,12 +70,14 @@
 		return;
 	if (at->play_buffer)
 		handle_play(at);
-	at->mfrm_count++;
-	if (at->mfrm_count >= 24) {
-		at->mfrm_count = 0;
-		fr->c_bits[14] = 1;
-	} else {
-		fr->c_bits[14] = 0;
+	if (!at->is_data) {
+		at->mfrm_count++;
+		if (at->mfrm_count >= 24) {
+			at->mfrm_count = 0;
+			fr->c_bits[14] = 1;
+		} else {
+			fr->c_bits[14] = 0;
+		}
 	}
 	msg = msgb_alloc_c(g_ctx, 640, "TRAU-UL-frame");
 	if (!msg)