fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/33586 )


Change subject: [WIP] osmo-bts-trx: rx_tch[fh]_fn(): separate FACCH decoding
......................................................................

[WIP] osmo-bts-trx: rx_tch[fh]_fn(): separate FACCH decoding

Change-Id: I4c6736e84c271240d457998de688c0baf59fe578
---
M src/osmo-bts-trx/sched_lchan_tchf.c
1 file changed, 39 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/86/33586/1

diff --git a/src/osmo-bts-trx/sched_lchan_tchf.c 
b/src/osmo-bts-trx/sched_lchan_tchf.c
index ac6fbd1..3c34522 100644
--- a/src/osmo-bts-trx/sched_lchan_tchf.c
+++ b/src/osmo-bts-trx/sched_lchan_tchf.c
@@ -69,6 +69,36 @@

 extern const uint8_t sched_tchh_dl_amr_cmi_map[26];

+# if 0
+static int decode_facch(struct l1sched_ts *l1ts,
+                       const struct trx_ul_burst_ind *bi)
+{
+       struct l1sched_chan_state *l1cs = &l1ts->chan_state[bi->chan]
+       const sbit_t *bursts_p = chan_state->ul_bursts;
+       struct l1sched_meas_set meas_avg;
+       uint8_t data[GSM_MACBLOCK_LEN];
+       int n_errors, n_bits_total;
+       uint16_t ber10k;
+
+       rc = gsm0503_tch_fr_facch_decode(&data[0], BUFTAIL8(bursts_p),
+                                        &n_errors, &n_bits_total);
+       if (rc != GSM_MACBLOCK_LEN)
+               return rc;
+
+       /* average measurements of the last 8 bursts, obtain TDMA Fn of the 
first burst */
+       trx_sched_meas_avg(l1cs, &meas_avg, SCHED_MEAS_AVG_M_S8N8);
+       ber10k = compute_ber10k(n_bits_total, n_errors);
+
+       /* meas_avg.fn now contains TDMA frame number of the first burst */
+       _sched_compose_ph_data_ind(l1ts, meas_avg.fn, bi->chan,
+                                  &data[0], GSM_MACBLOCK_LEN,
+                                  meas_avg.rssi, meas_avg.toa256,
+                                  meas_avg.ci_cb, ber10k,
+                                  PRES_INFO_UNKNOWN);
+       return 0;
+}
+#endif
+
 /* Process a single Uplink TCH/F burst received by the PHY.
  * This function is visualized in file 'doc/trx_sched_tch.txt'. */
 int rx_tchf_fn(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi)

--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/33586
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I4c6736e84c271240d457998de688c0baf59fe578
Gerrit-Change-Number: 33586
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <[email protected]>
Gerrit-MessageType: newchange

Reply via email to