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
This commit is contained in:
parent
091c530555
commit
5bd8e88195
|
@ -67,6 +67,8 @@ type component OSMUX_Emulation_CT {
|
||||||
|
|
||||||
/* user-facing port for controlling the binding */
|
/* user-facing port for controlling the binding */
|
||||||
port OsmuxEM_CTRL_PT CTRL;
|
port OsmuxEM_CTRL_PT CTRL;
|
||||||
|
/* user-facing port for sniffing Osmux frames */
|
||||||
|
port OsmuxEM_DATA_PT DATA;
|
||||||
|
|
||||||
/* configurable by user, should be fixed */
|
/* configurable by user, should be fixed */
|
||||||
var OsmuxemConfig g_cfg := c_OsmuxemDefaultCfg;
|
var OsmuxemConfig g_cfg := c_OsmuxemDefaultCfg;
|
||||||
|
@ -190,6 +192,10 @@ type port OsmuxEM_CTRL_PT procedure {
|
||||||
OsmuxEM_stats_get, OsmuxEM_register_rxhandle, OsmuxEM_register_txhandle;
|
OsmuxEM_stats_get, OsmuxEM_register_rxhandle, OsmuxEM_register_txhandle;
|
||||||
} with { extension "internal" };
|
} 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) {
|
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.call(OsmuxEM_bind:{local_host, local_port}) {
|
||||||
[] pt.getreply(OsmuxEM_bind:{local_host, ?}) -> param (local_port) {};
|
[] pt.getreply(OsmuxEM_bind:{local_host, ?}) -> param (local_port) {};
|
||||||
|
@ -556,6 +562,9 @@ function f_main() runs on OSMUX_Emulation_CT
|
||||||
if (ispresent(g_cfg.rx_fixed_payload) and rx_osmux.msg.osmux_amr.data != payload_truncated) {
|
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;
|
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 */
|
/* process received Osmux Dummy if receiver enabled */
|
||||||
[g_rx_enabled] OSMUX.receive(tr_osmux_dummy) -> value rx_osmux {
|
[g_rx_enabled] OSMUX.receive(tr_osmux_dummy) -> value rx_osmux {
|
||||||
|
|
Loading…
Reference in New Issue