library/IPA: split t_ASP_IPA_EVT_UD into send / receive templates
Change-Id: Ib5494bff3f9aa0ac396b729c326e7b4a64c5a5dd
diff --git a/library/IPA_Emulation.ttcnpp b/library/IPA_Emulation.ttcnpp
index 6658ca8..0edc0a7 100644
--- a/library/IPA_Emulation.ttcnpp
+++ b/library/IPA_Emulation.ttcnpp
@@ -88,7 +88,11 @@
ASP_IPA_EventType up_down
}
-template ASP_IPA_Event t_ASP_IPA_EVT_UD(ASP_IPA_EventType ud) := {
+template (value) ASP_IPA_Event ts_ASP_IPA_EV(ASP_IPA_EventType ud) := {
+ up_down := ud
+}
+
+template ASP_IPA_Event tr_ASP_IPA_EV(template ASP_IPA_EventType ud) := {
up_down := ud
}
@@ -291,7 +295,7 @@
data := char2oct(payload) & '00'O
}
-private function f_send_IPA_EVT(template ASP_IPA_Event evt) runs on IPA_Emulation_CT {
+private function f_send_IPA_EVT(template (value) ASP_IPA_Event evt) runs on IPA_Emulation_CT {
if (IPA_SP_PORT.checkstate("Connected")) {
IPA_SP_PORT.send(evt);
}
@@ -410,7 +414,7 @@
f_ccm_tx(valueof(ts_IPA_PONG));
}
case (IPAC_MSGT_ID_ACK) {
- f_send_IPA_EVT(t_ASP_IPA_EVT_UD(ASP_IPA_EVENT_ID_ACK));
+ f_send_IPA_EVT(ts_ASP_IPA_EV(ASP_IPA_EVENT_ID_ACK));
}
case (IPAC_MSGT_ID_GET) {
f_ccm_tx(f_ccm_make_id_resp(ccm));
@@ -432,7 +436,7 @@
* the TCP connection is established. Other implementations may differ.
* We currently ignore it completely - but actually we should make sure that
* one ID_ACK is received by the server at some point */
- f_send_IPA_EVT(t_ASP_IPA_EVT_UD(ASP_IPA_EVENT_ID_ACK));
+ f_send_IPA_EVT(ts_ASP_IPA_EV(ASP_IPA_EVENT_ID_ACK));
}
case (IPAC_MSGT_ID_RESP) {
log("IPA ID RESP: ", ccm.u.resp);
@@ -488,7 +492,7 @@
/* we're a client: Send ID_ACK immediately after connect */
f_ccm_tx(valueof(ts_IPA_ACK));
}
- f_send_IPA_EVT(t_ASP_IPA_EVT_UD(ASP_IPA_EVENT_UP));
+ f_send_IPA_EVT(ts_ASP_IPA_EV(ASP_IPA_EVENT_UP));
ScanEvents();
}
@@ -666,7 +670,7 @@
[] IPA_PORT.receive(ASP_Event:{connOpened:=?}) -> value asp_evt {
log("IPA: Connected");
g_ipa_conn_id := asp_evt.connOpened.connId;
- f_send_IPA_EVT(t_ASP_IPA_EVT_UD(ASP_IPA_EVENT_UP));
+ f_send_IPA_EVT(ts_ASP_IPA_EV(ASP_IPA_EVENT_UP));
if (g_mode == IPA_MODE_SERVER and g_ccm_enabled) {
select (g_init_behavior) {
case (IPA_INIT_SEND_IPA_ID_GET) {
@@ -682,14 +686,14 @@
[] IPA_PORT.receive(ASP_Event:{connClosed:=?}) -> value asp_evt {
log("IPA: Closed");
g_ipa_conn_id := -1;
- f_send_IPA_EVT(t_ASP_IPA_EVT_UD(ASP_IPA_EVENT_DOWN));
+ f_send_IPA_EVT(ts_ASP_IPA_EV(ASP_IPA_EVENT_DOWN));
self.stop;
}
[] IPA_PORT.receive(Socket_API_Definitions.PortEvent:{result:={errorCode:=ERROR_SOCKET, connId:=?, os_error_code:=?, os_error_text:=?}}) -> value port_evt {
log("PortEvent: ERROR_SOCKET: ", port_evt);
g_ipa_conn_id := -1;
- f_send_IPA_EVT(t_ASP_IPA_EVT_UD(ASP_IPA_EVENT_DOWN));
+ f_send_IPA_EVT(ts_ASP_IPA_EV(ASP_IPA_EVENT_DOWN));
self.stop;
}
@@ -774,7 +778,7 @@
port IPA_SP_PT IPA_SP_PORT;
}
-function waiter_main(template ASP_IPA_Event wait_for := t_ASP_IPA_EVT_UD(ASP_IPA_EVENT_ID_ACK))
+function waiter_main(template ASP_IPA_Event wait_for := tr_ASP_IPA_EV(ASP_IPA_EVENT_ID_ACK))
runs on IPA_EventWaiter_CT {
alt {