pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/29273 )
Change subject: Osmux_Emulation: Add DATA port ......................................................................
Osmux_Emulation: Add DATA port
Similar to what's already present in RTPEM_Emulation, this allows tests to retrieve the Osmux messages received.
Related: OS#5987 Change-Id: Id9aa3a0a02ef5a5e39b4df8a1c165f35255829ab --- M library/OSMUX_Emulation.ttcn 1 file changed, 9 insertions(+), 0 deletions(-)
Approvals: Jenkins Builder: Verified fixeria: Looks good to me, approved osmith: Looks good to me, but someone else must approve
diff --git a/library/OSMUX_Emulation.ttcn b/library/OSMUX_Emulation.ttcn index 10338d2..c6999de 100644 --- a/library/OSMUX_Emulation.ttcn +++ b/library/OSMUX_Emulation.ttcn @@ -67,6 +67,8 @@
/* user-facing port for controlling the binding */ port OsmuxEM_CTRL_PT CTRL; + /* user-facing port for sniffing Osmux frames */ + port OsmuxEM_DATA_PT DATA;
/* configurable by user, should be fixed */ var OsmuxemConfig g_cfg := c_OsmuxemDefaultCfg; @@ -190,6 +192,10 @@ OsmuxEM_stats_get, OsmuxEM_register_rxhandle, OsmuxEM_register_txhandle; } with { extension "internal" };
+type port OsmuxEM_DATA_PT message { + inout OSMUX_PDU; +} with { extension "internal" }; + function f_osmuxem_bind(OsmuxEM_CTRL_PT pt, in HostName local_host, inout PortNumber local_port) { pt.call(OsmuxEM_bind:{local_host, local_port}) { [] pt.getreply(OsmuxEM_bind:{local_host, ?}) -> param (local_port) {}; @@ -556,6 +562,9 @@ if (ispresent(g_cfg.rx_fixed_payload) and rx_osmux.msg.osmux_amr.data != payload_truncated) { g_stat.num_pkts_rx_err_payload := g_stat.num_pkts_rx_err_payload + 1; } + if (DATA.checkstate("Connected")) { + DATA.send(rx_osmux.msg); + } } /* process received Osmux Dummy if receiver enabled */ [g_rx_enabled] OSMUX.receive(tr_osmux_dummy) -> value rx_osmux {
3 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one.