laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34066 )
Change subject: PCUIF: Add support for PCU_IF_SAPI_AGCH_2 ......................................................................
PCUIF: Add support for PCU_IF_SAPI_AGCH_2
In PCUIF v.11 it will be possible to get confirmations for IMMEDIATE ASSIGNMENT messages sent through the AGCH.
Related: OS#5927 Change-Id: I40e05a2e68cca77d3c2f41df9af8d35762488abf --- M library/PCUIF_CodecPort.ttcn M library/PCUIF_Types.ttcn 2 files changed, 76 insertions(+), 1 deletion(-)
Approvals: Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve laforge: Looks good to me, approved
diff --git a/library/PCUIF_CodecPort.ttcn b/library/PCUIF_CodecPort.ttcn index d180f17..b49c513 100644 --- a/library/PCUIF_CodecPort.ttcn +++ b/library/PCUIF_CodecPort.ttcn @@ -196,6 +196,51 @@ } }
+/* This function can be used to transmit arbitrary GSM MAC blocks via the AGCH. The BTS will only confirm those MAC + * blocks that contain actually a valid immediate assignment message. Otherweise no confirmation is sent back */ +function f_PCUIF_tx_mac_block_agch(PCUIF_CODEC_PT pt, integer conn_id, octetstring mac_block, boolean confirm := true, + uint8_t bts_nr := 0, boolean wait_for_cnf := true, OCT4 msg_id := '01020304'O) { + var PCUIF_send_data sd; + timer T := 3.0; + + if (mp_pcuif_version < 11) { + if (wait_for_cnf == true) { + setverdict(fail, "confirmation for AGCH not supported in PCUIF v.10 or earlier"); + } + pt.send(t_SD_PCUIF(conn_id, + ts_PCUIF_DATA_REQ(bts_nr, 0, 0, 0, 0, PCU_IF_SAPI_AGCH, mac_block))); + } else { + var PCUIF_agch agch; + agch.msg_id := msg_id; + agch.data := mac_block; + agch.confirm := confirm; + pt.send(t_SD_PCUIF(conn_id, ts_PCUIF_DATA_REQ(bts_nr, 0, 0, 0, 0, PCU_IF_SAPI_AGCH_2, enc_PCUIF_agch(agch)))); + } + + /* Exit early when the caller is not interested in the confirmation message */ + if (wait_for_cnf == false) { + return; + } + + T.start; + alt { + [] pt.receive(t_SD_PCUIF(conn_id, tr_PCUIF_DATA_CNF_2(bts_nr, PCU_IF_SAPI_AGCH_2))) -> value sd { + if (mp_pcuif_version < 11) { + setverdict(fail, "got tr_PCUIF_DATA_CNF_DT, but AGCH confirmation is not supported in PCUIF v.10 or earlier"); + mtc.stop; + } else { + log("IMM.ASS was sent on AGCH"); + return; + } + } + [] pt.receive { repeat; } + [] T.timeout { + setverdict(fail, "Timeout waiting for PCU DATA.cnf (AGCH)"); + mtc.stop; + } + } + return; +}
diff --git a/library/PCUIF_Types.ttcn b/library/PCUIF_Types.ttcn index 509c93c..b8bd6e9 100644 --- a/library/PCUIF_Types.ttcn +++ b/library/PCUIF_Types.ttcn @@ -54,7 +54,8 @@ PCU_IF_SAPI_PDTCH ('05'O), PCU_IF_SAPI_PRACH ('06'O), PCU_IF_SAPI_PTCCH ('07'O), - PCU_IF_SAPI_PCH_2 ('08'O) + PCU_IF_SAPI_PCH_2 ('08'O), + PCU_IF_SAPI_AGCH_2 ('09'O) } with { variant "FIELDLENGTH(8)" };
type record PCUIF_Flags { @@ -321,6 +322,22 @@ external function dec_PCUIF_pch(in octetstring stream) return PCUIF_pch with { extension "prototype(convert) decode(RAW)" };
+/* Record to send a (confirmed) IMMEDIATE ASSIGNMENT message via AGCH. The record is sent by the PCU to the BTS as a + * data request (data_req) under SAPI PCU_IF_SAPI_AGCH_2. */ +type record PCUIF_agch { + OCT4 msg_id, + octetstring data length(23), + boolean confirm +} with { + variant (msg_id) "BYTEORDER(last)" + variant (data) "FIELDLENGTH(23)" +}; + +external function enc_PCUIF_agch(in PCUIF_agch pdu) return octetstring + with { extension "prototype(convert) encode(RAW)" }; +external function dec_PCUIF_agch(in octetstring stream) return PCUIF_agch + with { extension "prototype(convert) decode(RAW)" }; + type union PCUIF_MsgUnion { PCUIF_data data_req, PCUIF_data data_cnf,