aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2022-12-19 17:37:49 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2022-12-19 17:38:35 +0100
commit8997fe8251ea9bc6aaaa32f081efa87b562e94dc (patch)
tree34dea77819aed1e11ae7c29982f65604fc0af9fb
parent09e62cc563bfeffe0340a6f4458d14cba1658458 (diff)
amr: Add struct definition for AMR BWE header
-rw-r--r--include/osmocom/netif/amr.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/osmocom/netif/amr.h b/include/osmocom/netif/amr.h
index 382c66a..c7ca5bb 100644
--- a/include/osmocom/netif/amr.h
+++ b/include/osmocom/netif/amr.h
@@ -15,6 +15,34 @@
*/
/*
+ * 4.3. Bandwidth-Efficient Mode:
+ *
+ * Summary from 4.3.4: Same as Octet aligned (see below) but without padding after header and ToC:
+ * 0 1
+ * 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | CMR |F| FT |Q|X X X X X X|
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *
+ * X means AMR payload (padding in case of FT=NO_DATA).
+ */
+struct amr_hdr_bwe {
+#if OSMO_IS_LITTLE_ENDIAN
+ uint8_t ft_hi:3, /* coding mode highest part */
+ f:1,
+ cmr:4; /* Codec Mode Request */
+ uint8_t data_start:6,
+ q:1, /* OK (not damaged) at origin? */
+ ft_lo:1; /* coding mode lowest bit */
+#elif OSMO_IS_BIG_ENDIAN
+/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
+ uint8_t cmr:4, f:1, ft_hi:3;
+ uint8_t ft_lo:1, q:1, data_start:6;
+#endif
+ uint8_t data[0];
+} __attribute__((packed));
+
+/*
* 4.4. Octet-aligned Mode:
*
* 4.4.1. The Payload Header: