aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2019-02-27 12:17:02 +0100
committerPhilipp Maier <pmaier@sysmocom.de>2019-03-01 09:12:20 +0100
commit0fe9b3664a8d0b74d5e1c67593b350d67de3f98f (patch)
treefcffd779321005375fcd1139e0a53f6445ad8d45 /src
parent05db1909c8c299a58538b664d60c2ce2b0993cbe (diff)
AMR: add define constants for AMR payload length
AMR uses different payload sizes, those sizes are well defined in RFC 3267. Lets add define constants and replace the magic values with the define constants. Also correct the value for AMR_FT_SID in amr_ft_to_bytes from 6 to 5 (39bits / 8 = 4.875 bytes ==> 5 byte, see also RFC 3267, chapter 3.6) Change-Id: I65b5da920d58015b875d6dcf17aacdc04b58955e
Diffstat (limited to 'src')
-rw-r--r--src/amr.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/amr.c b/src/amr.c
index 6f94a69..06cf429 100644
--- a/src/amr.c
+++ b/src/amr.c
@@ -28,15 +28,15 @@
*/
static size_t amr_ft_to_bytes[AMR_FT_MAX] = {
- [AMR_FT_0] = 12,
- [AMR_FT_1] = 13,
- [AMR_FT_2] = 15,
- [AMR_FT_3] = 17,
- [AMR_FT_4] = 19,
- [AMR_FT_5] = 20,
- [AMR_FT_6] = 26,
- [AMR_FT_7] = 31,
- [AMR_FT_SID] = 6,
+ [AMR_FT_0] = AMR_FT_0_LEN,
+ [AMR_FT_1] = AMR_FT_1_LEN,
+ [AMR_FT_2] = AMR_FT_2_LEN,
+ [AMR_FT_3] = AMR_FT_3_LEN,
+ [AMR_FT_4] = AMR_FT_4_LEN,
+ [AMR_FT_5] = AMR_FT_5_LEN,
+ [AMR_FT_6] = AMR_FT_6_LEN,
+ [AMR_FT_7] = AMR_FT_7_LEN,
+ [AMR_FT_SID] = AMR_FT_SID_LEN,
};
size_t osmo_amr_bytes(uint8_t amr_ft)