comparison 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
comparison
equal deleted inserted replaced
43:55f02d4aee79 44:16715bd149e0
28 memset(fr->c_bits + 5, 0, 6); 28 memset(fr->c_bits + 5, 0, 6);
29 memset(fr->c_bits + 15, 1, 6); 29 memset(fr->c_bits + 15, 1, 6);
30 memset(fr->t_bits, 1, 4); 30 memset(fr->t_bits, 1, 4);
31 } 31 }
32 32
33 void init_trau_ul_frame_csd(int nr, bool ir_16k)
34 {
35 struct ater_subslot *at = &subslots[nr];
36 struct osmo_trau_frame *fr = &at->ul_frame;
37
38 fr->type = OSMO_TRAU16_FT_DATA;
39 fr->dir = OSMO_TRAU_DIR_UL;
40 fr->c_bits[5] = ir_16k;
41 memset(fr->c_bits + 6, 1, 9);
42 memset(fr->d_bits, 1, 63 * 4);
43 }
44
33 static void handle_play(struct ater_subslot *at) 45 static void handle_play(struct ater_subslot *at)
34 { 46 {
35 if (at->play_wait_align) { 47 if (at->play_wait_align) {
36 if (at->mfrm_count) 48 if (at->mfrm_count)
37 return; 49 return;
56 68
57 if (!at->is_active) 69 if (!at->is_active)
58 return; 70 return;
59 if (at->play_buffer) 71 if (at->play_buffer)
60 handle_play(at); 72 handle_play(at);
61 at->mfrm_count++; 73 if (!at->is_data) {
62 if (at->mfrm_count >= 24) { 74 at->mfrm_count++;
63 at->mfrm_count = 0; 75 if (at->mfrm_count >= 24) {
64 fr->c_bits[14] = 1; 76 at->mfrm_count = 0;
65 } else { 77 fr->c_bits[14] = 1;
66 fr->c_bits[14] = 0; 78 } else {
79 fr->c_bits[14] = 0;
80 }
67 } 81 }
68 msg = msgb_alloc_c(g_ctx, 640, "TRAU-UL-frame"); 82 msg = msgb_alloc_c(g_ctx, 640, "TRAU-UL-frame");
69 if (!msg) 83 if (!msg)
70 return; 84 return;
71 len = osmo_trau_frame_encode(msg->tail, msgb_tailroom(msg), fr); 85 len = osmo_trau_frame_encode(msg->tail, msgb_tailroom(msg), fr);