Move AMR defintions out of OSMUX_Types to its own file

This way they can be used without the need to import OSMUX related
modules.

Change-Id: I0edfbb7359516ba77180afab18c3e1ffb2d0c927
This commit is contained in:
Pau Espin 2022-09-02 18:51:19 +02:00
parent f7634dc706
commit 71ed463957
5 changed files with 41 additions and 24 deletions

38
library/AMR_Types.ttcn Normal file
View File

@ -0,0 +1,38 @@
/*
* (C) 2019-2022 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
* All rights reserved.
*
* Author: Pau Espin Pedrol <pespin@sysmocom.de>
*
* Released under the terms of GNU General Public License, Version 2 or
* (at your option) any later version.
*/
module AMR_Types {
import from General_Types all;
/* AMR voice frame type identifiers
* See also 3GPP TS 26.101, Table 1a: Interpretation of Frame Type, Mode
* Indication and Mode Request fields */
type enumerated AMRFT {
AMR_FT_0, /* 4.75 */
AMR_FT_1, /* 5.15 */
AMR_FT_2, /* 5.90 */
AMR_FT_3, /* 6.70 */
AMR_FT_4, /* 7.40 */
AMR_FT_5, /* 7.95 */
AMR_FT_6, /* 10.2 */
AMR_FT_7, /* 12.2 */
AMR_FT_SID /* SID */
};
/* AMR voice frame length (in bytes, rounded),
* See also RFC 3267, chapter 3.6 */
const integer c_AMRFT_len[9] := {12, 13, 15, 17, 19, 20, 26, 31, 5};
function f_amrft_payload_len(INT4b amr_ft) return integer {
return c_AMRFT_len[amr_ft];
}
} with { encode "RAW"}

View File

@ -55,6 +55,7 @@ import from General_Types all;
import from Osmocom_Types all;
import from IPL4asp_Types all;
import from Misc_Helpers all;
import from AMR_Types all;
import from OSMUX_Types all;
import from OSMUX_CodecPort all;
import from OSMUX_CodecPort_CtrlFunct all;

View File

@ -83,28 +83,4 @@ type union OSMUX_PDU {
)"
};
/* AMR voice frame type identifiers
* See also 3GPP TS 26.101, Table 1a: Interpretation of Frame Type, Mode
* Indication and Mode Request fields */
type enumerated AMRFT {
AMR_FT_0, /* 4.75 */
AMR_FT_1, /* 5.15 */
AMR_FT_2, /* 5.90 */
AMR_FT_3, /* 6.70 */
AMR_FT_4, /* 7.40 */
AMR_FT_5, /* 7.95 */
AMR_FT_6, /* 10.2 */
AMR_FT_7, /* 12.2 */
AMR_FT_SID /* SID */
};
/* AMR voice frame length (in bytes, rounded),
* See also RFC 3267, chapter 3.6 */
const integer c_AMRFT_len[9] := {12, 13, 15, 17, 19, 20, 26, 31, 5};
function f_amrft_payload_len(INT4b amr_ft) return integer {
return c_AMRFT_len[amr_ft];
}
} with { encode "RAW"}

View File

@ -24,6 +24,7 @@ module MGCP_Test {
import from OSMUX_CodecPort all;
import from OSMUX_CodecPort_CtrlFunct all;
import from OSMUX_Emulation all;
import from AMR_Types all;
import from IPL4asp_Types all;
import from General_Types all;
import from Native_Functions all;

View File

@ -40,6 +40,7 @@ gen_links $DIR $FILES
DIR=../library
FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn
MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc "
FILES+="AMR_Types.ttcn "
FILES+="RTP_CodecPort.ttcn RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_Emulation.ttcn IuUP_EncDec.cc "
FILES+="OSMUX_CodecPort.ttcn OSMUX_Emulation.ttcn OSMUX_Types.ttcn OSMUX_CodecPort_CtrlFunct.ttcn OSMUX_CodecPort_CtrlFunctDef.cc "
FILES+="Native_Functions.ttcn Native_FunctionDefs.cc IPCP_Types.ttcn "