pespin submitted this change.

View Change

Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved
amr: Add struct definition for AMR BWE header

Change-Id: I4b44257605bc5967d862ee29076ea6260d9a6bd8
---
M include/osmocom/netif/amr.h
1 file 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:

To view, visit change 30695. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I4b44257605bc5967d862ee29076ea6260d9a6bd8
Gerrit-Change-Number: 30695
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-MessageType: merged