| ///////////////////////////////////////////////////////////////////////////////
|
| // //
|
| // Copyright (c) 2000-2017 Ericsson Telecom AB // |
| // // |
| // All rights reserved. This program and the accompanying materials // |
| // are made available under the terms of the Eclipse Public License v1.0 // |
| // which accompanies this distribution, and is available at // |
| // http://www.eclipse.org/legal/epl-v10.html //
|
| ///////////////////////////////////////////////////////////////////////////////
|
|
|
| ///////////////////////////////////////////////////////////
|
| // Module: EPTF_SimpleHello_Transport_Functions
|
| //
|
| // Purpose:
|
| // This module contains functions for SimpleHello transport components.
|
| //
|
| // Module Parameters:
|
| // -
|
| //
|
| // Module depends on:
|
| // <EPTF_SimpleHello_LGen_Definitions>
|
| // <EPTF_SimpleHello_Transport_Definitions>
|
| // <EPTF_SimpleHello_Definitions>
|
| // <EPTF_CLL_Base_Definitions>
|
| // <EPTF_CLL_Base_Functions>
|
| // <EPTF_CLL_Common_Definitions>
|
| // <EPTF_CLL_TransportCommPortUDP_Definitions>
|
| // <EPTF_CLL_TransportCommPortUDP_Functions>
|
| // <EPTF_CLL_HashMapInt2Int_Functions>
|
| // <EPTF_CLL_TransportRouting_Definitions>
|
| // <EPTF_CLL_TransportRouting_Functions>
|
| // <EPTF_SimpleHello_Logger_Definitions>
|
| // <EPTF_SimpleHello_Logger_Functions>
|
| // <EPTF_CLL_LoggingUI_Definitions>
|
| // <EPTF_CLL_LoggingUI_Functions>
|
| // <EPTF_CLL_LoggingUI_PrivateFunctions>
|
| // <EPTF_CLL_Variable_Functions>
|
| // <EPTF_CLL_UIHandler_Definitions>
|
| // <EPTF_CLL_UIHandler_WidgetFunctions>
|
| // <EPTF_CLL_UIHandlerClient_Functions>
|
| // <EPTF_CLL_LoggingUIClient_Functions>
|
| // <EPTF_CLL_Logging_Functions>
|
| // <EPTF_CLL_Logging_Definitions>
|
| // <XTDP_PDU_Defs>
|
| //
|
| // Current Owner:
|
| // Attila Fulop (EFLOATT), Bence Molnar(EBENMOL)
|
| //
|
| // Last Review Date:
|
| // 2009-04-03
|
| //
|
| // Detailed Comments:
|
| // This module contains functions for SimpleHello transport components.
|
| //
|
| ///////////////////////////////////////////////////////////////
|
| module EPTF_SimpleHello_Transport_Functions
|
| {
|
|
|
| //=========================================================================
|
| // Import Part
|
| //=========================================================================
|
|
|
| import from EPTF_SimpleHello_LGen_Definitions all;
|
| import from EPTF_SimpleHello_Transport_Definitions all;
|
| import from EPTF_SimpleHello_Definitions all;
|
| import from EPTF_CLL_Base_Definitions all;
|
| import from EPTF_CLL_Base_Functions all;
|
| import from EPTF_CLL_Common_Definitions all;
|
| import from EPTF_CLL_TransportCommPortUDP_Definitions all;
|
| import from EPTF_CLL_TransportCommPortUDP_Functions all;
|
| import from EPTF_CLL_HashMapInt2Int_Functions all;
|
| import from EPTF_CLL_TransportRouting_Definitions all;
|
| import from EPTF_CLL_TransportRouting_Functions all;
|
|
|
| import from EPTF_SimpleHello_Logger_Definitions all;
|
| import from EPTF_SimpleHello_Logger_Functions all;
|
| import from EPTF_CLL_LoggingUI_Definitions all;
|
| import from EPTF_CLL_LoggingUI_Functions all;
|
| import from EPTF_CLL_LoggingUI_PrivateFunctions all;
|
| import from EPTF_CLL_Variable_Functions all;
|
| import from EPTF_CLL_UIHandler_Definitions all;
|
| import from EPTF_CLL_UIHandler_WidgetFunctions all;
|
| import from EPTF_CLL_UIHandlerClient_Functions all;
|
| import from EPTF_CLL_LoggingUIClient_Functions all;
|
| import from EPTF_CLL_Logging_Functions all;
|
| import from EPTF_CLL_Logging_Definitions all;
|
| import from XTDP_PDU_Defs language "ASN.1:2002" all;
|
|
|
| ///////////////////////////////////////////////////////////
|
| // Group: EPTF_SimpleHello_LocalTransport_Functions
|
| //
|
| // Purpose:
|
| // This group defines the functions of the local transport
|
| //
|
| ///////////////////////////////////////////////////////////
|
| group EPTF_SimpleHello_LocalTransport_Functions
|
| {
|
|
|
| ///////////////////////////////////////////////////////////
|
| // Function: f_EPTF_SimpleHello_LocalTransport_init_CT
|
| //
|
| // Purpose:
|
| // Function to initialize the LocalTranport component and set the function references
|
| //
|
| // Parameters:
|
| // - pl_receiveFunction - *in* - <f_EPTF_SimpleHello_messageProcess_FT> - The receive callback function
|
| // - pl_loggingUIComponentRef - *in* <EPTF_LoggingUI_CT> - The component reference of the LoggingUI component which will handle Logger_CT
|
| // - pl_UIHandlerComponentRef - *in* <EPTF_UIHandler_CT> - The component reference of the UIHandler component which will handle Logger_CT
|
| // - pl_mainTabBox - *in charstring* - The name of the main tab box where Logger_CT buttons will be put
|
| //
|
| // Return Value:
|
| // - integer - if the component initialize already the return value will be -1
|
| //
|
| // Errors:
|
| // -
|
| //
|
| // Detailed Comments:
|
| // -
|
| //
|
| ///////////////////////////////////////////////////////////
|
| function f_EPTF_SimpleHello_LocalTransport_init_CT(
|
| in f_EPTF_SimpleHello_messageProcess_FT pl_receiveFunction,
|
| in EPTF_LoggingUI_CT pl_loggingUIComponentRef := null,
|
| in EPTF_UIHandler_CT pl_UIHandlerComponentRef := null,
|
| in charstring pl_mainTabBox := ""
|
| )
|
| runs on EPTF_SimpleHello_LocalTransport_CT
|
| return integer
|
| {
|
| if (v_EPTF_SimpleHello_LocalTransport_initialized)
|
| {
|
| f_EPTF_SimpleHello_Transport_loggingWarning(%definitionId&": "& "The LocalTransport component already initialized!");
|
| return -1;
|
| }
|
|
|
| v_EPTF_SimpleHello_LocalTransport_initialized := true;
|
|
|
| vf_EPTF_SimpleHello_LocalTransport_receive := pl_receiveFunction;
|
|
|
| // log masks for SimpleHello Transport
|
| v_EPTF_SimpleHello_Transport_loggingMaskId :=
|
| f_EPTF_Logging_registerComponentMasks(
|
| tsp_EPTF_SimpleHello_Transport_loggingComponentMask,
|
| c_EPTF_SimpleHello_Transport_loggingEventClasses,
|
| EPTF_Logging_CLL);
|
|
|
| if (tsp_EPTF_SimpleHello_loggingEnable)
|
| {
|
| f_EPTF_Logging_enableLocalMask(
|
| v_EPTF_SimpleHello_Transport_loggingMaskId,
|
| c_EPTF_SimpleHello_Transport_loggingClassIdx_Debug);
|
| }
|
| else
|
| {
|
| f_EPTF_Logging_disableLocalMask(
|
| v_EPTF_SimpleHello_Transport_loggingMaskId,
|
| c_EPTF_SimpleHello_Transport_loggingClassIdx_Debug);
|
| }
|
|
|
| // Logger
|
| f_EPTF_Var_newBool("Logger Enabled",false,v_EPTF_SimpleHello_LocalTransport_loggingEnabled);
|
| f_EPTF_Var_adjustContent(v_EPTF_SimpleHello_LocalTransport_loggingEnabled,{boolVal := tsp_EPTF_SimpleHello_loggingEnable});
|
|
|
| // put logger to the GUI if GUI exists
|
| if (pl_loggingUIComponentRef != null and pl_UIHandlerComponentRef != null)
|
| {
|
| v_EPTF_SimpleHello_LocalTransport_guiEnabled := true;
|
| var XTDP_XML_Tag pl_xul;
|
|
|
| f_EPTF_LoggingUIClient_init_CT("SimpleHello LoggerClient",pl_loggingUIComponentRef,pl_UIHandlerComponentRef);
|
|
|
| // Creates global Tab with 2 columns(name,checkbox):
|
| f_EPTF_LoggingUI_createTabPanel("logger","SimpleHello Logger Logging",pl_xul);
|
| f_EPTF_UIHandlerClient_addElementToGUI(pl_xul, pl_mainTabBox);
|
|
|
| f_EPTF_LoggingUI_createLoggingCheckBoxTable("SimpleHello_CheckBox", "Component Name",{},pl_xul);
|
| f_EPTF_UIHandlerClient_addElementToGUI(pl_xul, "logger");
|
|
|
| f_EPTF_LoggingUI_createLoggingCheckBoxTableRow("SimpleHello_Logger_Log", "SimpleHello Component",{},pl_xul);
|
| f_EPTF_UIHandlerClient_addElementToGUI(pl_xul, "SimpleHello_CheckBox");
|
|
|
| f_EPTF_UIHandlerClient_subscribeMe("Logger Enabled","Logger Enabled Widget","SimpleHello_Logger_Log_Enable",realtime);
|
| }
|
|
|
| f_EPTF_SimpleHello_LoggerClient_init_CT(refers(f_EPTF_SimpleHello_LocalTransport_sendMessageToLogger));
|
|
|
| //f_EPTF_CommPort_UDP_setReceive( ASP_UDP:?, refers(f_EPTF_SimpleHello_LocalTransport_receiveMessage));
|
|
|
| f_EPTF_Base_init_CT("SimpleHello LocalTransport");
|
| f_EPTF_Base_registerCleanup(refers(f_EPTF_SimpleHello_LocalTransport_cleanup_CT));
|
| f_EPTF_Base_registerCleanup(refers(f_EPTF_SimpleHello_LoggerClient_cleanup_CT));
|
|
|
| f_EPTF_SimpleHello_Transport_loggingDebug("The initialization of the SimpleHello LocalTransport component is ready");
|
| return 1;
|
|
|
| }
|
|
|
| ///////////////////////////////////////////////////////////
|
| // Function: f_EPTF_SimpleHello_LocalTransport_cleanup_CT
|
| //
|
| // Purpose:
|
| // Function to clean The LocalTransport component
|
| //
|
| // Parameters:
|
| // -
|
| //
|
| // Return Value:
|
| // -
|
| //
|
| // Errors:
|
| // -
|
| //
|
| // Detailed Comments:
|
| // -
|
| //
|
| ///////////////////////////////////////////////////////////
|
| function f_EPTF_SimpleHello_LocalTransport_cleanup_CT()
|
| runs on EPTF_SimpleHello_LocalTransport_CT
|
| {
|
| if (not v_EPTF_SimpleHello_LocalTransport_initialized) { return }
|
| v_EPTF_SimpleHello_LocalTransport_initialized:= false;
|
|
|
| vf_EPTF_SimpleHello_LocalTransport_receive := null;
|
| v_EPTF_SimpleHello_LocalTransport_loggingEnabled := -1;
|
|
|
| v_EPTF_SimpleHello_LocalTransport_guiEnabled := false;
|
| f_EPTF_SimpleHello_Transport_loggingDebug("The cleanup of the SimpleHello LocalTransport component is ready");
|
| }
|
|
|
| ///////////////////////////////////////////////////////////
|
| // Function: f_EPTF_SimpleHello_LocalTransport_sendMessage
|
| //
|
| // Purpose:
|
| // Function to send the encoded PDU message over the internal testport
|
| //
|
| // Parameters:
|
| // pl_data - *in* *octetstring* - the encoded PDU message
|
| //
|
| ///////////////////////////////////////////////////////////
|
| function f_EPTF_SimpleHello_LocalTransport_sendMessage(
|
| in octetstring pl_Message)
|
| runs on EPTF_SimpleHello_LocalTransport_CT
|
| {
|
| //f_EPTF_CommPort_UDP_send(pl_Message);
|
| vf_EPTF_SimpleHello_LoggerClient_sendFunction.apply( {pl_Message, true} );
|
| }
|
|
|
| ///////////////////////////////////////////////////////////
|
| // Function: f_EPTF_SimpleHello_LocalTransport_receiveMessage
|
| //
|
| // Purpose:
|
| // Function to receive the encoded PDU message
|
| //
|
| // Parameters:
|
| // pl_data - *in* *octetstring* - the encoded PDU message
|
| //
|
| ///////////////////////////////////////////////////////////
|
| function f_EPTF_SimpleHello_LocalTransport_receiveMessage(
|
| in octetstring pl_message )
|
| runs on EPTF_SimpleHello_LocalTransport_CT
|
| {
|
| vf_EPTF_SimpleHello_LocalTransport_receive.apply(pl_message);
|
| vf_EPTF_SimpleHello_LoggerClient_sendFunction.apply( { pl_message, true} );
|
| }
|
|
|
| ///////////////////////////////////////////////////////////
|
| // Function: f_EPTF_SimpleHello_LocalTransport_sendMessageToLogger
|
| //
|
| // Purpose:
|
| // Function to send the interface messages to the logger component
|
| //
|
| // Parameters:
|
| // pl_message - *in <EPTF_SimpleHello_LoggerMessage> - The interface message
|
| //
|
| // Return Value:
|
| // -
|
| //
|
| // Errors:
|
| // -
|
| //
|
| // Detailed Comments:
|
| // -
|
| //
|
| ///////////////////////////////////////////////////////////
|
| function f_EPTF_SimpleHello_LocalTransport_sendMessageToLogger (
|
| in EPTF_SimpleHello_LoggerMessage pl_message)
|
| runs on EPTF_SimpleHello_LocalTransport_CT
|
| {
|
| if (f_EPTF_Var_getBoolValue(v_EPTF_SimpleHello_LocalTransport_loggingEnabled))
|
| {
|
| SimpleHello_LoggerClient_PCO.send(pl_message);
|
| }
|
| else
|
| {
|
| f_EPTF_SimpleHello_Transport_loggingDebug("The logging mechanism is not enabled");
|
| }
|
| }
|
| }
|
|
|
| ///////////////////////////////////////////////////////////
|
| // Group: EPTF_SimpleHello_RemoteTransport_Functions
|
| //
|
| // Purpose:
|
| // This group defines the functions of the remote transport
|
| //
|
| ///////////////////////////////////////////////////////////
|
| group EPTF_SimpleHello_RemoteTransport_Functions
|
| {
|
| ///////////////////////////////////////////////////////////
|
| // Altstep: as_EPTF_SimpleHello_RemoteTransport_Handler
|
| //
|
| // Purpose:
|
| // Altstep to handle the messages between the remote and mapper transport component
|
| //
|
| ///////////////////////////////////////////////////////////
|
| altstep as_EPTF_SimpleHello_RemoteTransport_Handler()
|
| runs on EPTF_SimpleHello_RemoteTransport_CT
|
| {
|
| [] SimpleHello_PCO.receive (octetstring:?) -> value v_EPTF_SimpleHello_RemoteTransport_message
|
| {
|
| // f_EPTF_SimpleHello_Transport_loggingDebug("The received message is: "&log2str(v_SimpleHello_RemoteTransport_message));
|
| vf_EPTF_SimpleHello_RemoteTransport_handleReceive.apply(v_EPTF_SimpleHello_RemoteTransport_message);
|
| repeat;
|
| }
|
| }
|
|
|
| ///////////////////////////////////////////////////////////
|
| // Function: f_EPTF_SimpleHello_RemoteTransport_init_CT
|
| //
|
| // Purpose:
|
| // Function to initialize the RemoteTransport component
|
| //
|
| // Parameters:
|
| // pl_handleReceive - *in* <f_EPTF_SimpleHello_handleReceive_FT> - function reference to the applib handle function
|
| //
|
| // Return Value:
|
| // *integer* - if the component initialize already the return value will be -1
|
| //
|
| // Errors:
|
| // -
|
| //
|
| // Detailed Comments:
|
| // -
|
| //
|
| ///////////////////////////////////////////////////////////
|
| function f_EPTF_SimpleHello_RemoteTransport_init_CT(
|
| in f_EPTF_SimpleHello_messageProcess_FT pl_handleReceive)
|
| runs on EPTF_SimpleHello_RemoteTransport_CT
|
| return integer
|
| {
|
| if (v_EPTF_SimpleHello_RemoteTransport_initialized) {
|
| //f_EPTF_SimpleHello_Transport_loggingDebug("The SimpleHello RemoteTransport component is initialized already");
|
| return -1;
|
| }
|
| v_EPTF_SimpleHello_RemoteTransport_initialized := true;
|
|
|
| v_EPTF_SimpleHello_RemoteTransport_default := activate(as_EPTF_SimpleHello_RemoteTransport_Handler());
|
| vf_EPTF_SimpleHello_RemoteTransport_handleReceive := pl_handleReceive;
|
|
|
| // log masks for SimpleHello Transport
|
| v_EPTF_SimpleHello_Transport_loggingMaskId :=
|
| f_EPTF_Logging_registerComponentMasks(
|
| tsp_EPTF_SimpleHello_Transport_loggingComponentMask,
|
| c_EPTF_SimpleHello_Transport_loggingEventClasses,
|
| EPTF_Logging_CLL);
|
|
|
| if (tsp_EPTF_SimpleHello_loggingEnable)
|
| {
|
| f_EPTF_Logging_enableLocalMask(
|
| v_EPTF_SimpleHello_Transport_loggingMaskId,
|
| c_EPTF_SimpleHello_Transport_loggingClassIdx_Debug);
|
| }
|
| else
|
| {
|
| f_EPTF_Logging_disableLocalMask(
|
| v_EPTF_SimpleHello_Transport_loggingMaskId,
|
| c_EPTF_SimpleHello_Transport_loggingClassIdx_Debug);
|
| }
|
|
|
| f_EPTF_Base_registerCleanup(refers(f_EPTF_SimpleHello_RemoteTransport_cleanup_CT));
|
|
|
| f_EPTF_SimpleHello_Transport_loggingDebug("The initialization of the SimpleHello RemoteTransport component is ready");
|
|
|
| return 1;
|
| }
|
|
|
| ///////////////////////////////////////////////////////////
|
| // Function: f_EPTF_SimpleHello_RemoteTransport_sendMessage
|
| //
|
| // Purpose:
|
| // Function to send the messages to the mapper component
|
| //
|
| // Parameters:
|
| // pl_data - *in* *octetstring* - the encoded PDU
|
| //
|
| ///////////////////////////////////////////////////////////
|
| function f_EPTF_SimpleHello_RemoteTransport_sendMessage(
|
| in octetstring pl_Message)
|
| runs on EPTF_SimpleHello_RemoteTransport_CT
|
| {
|
| SimpleHello_PCO.send(pl_Message);
|
| //f_EPTF_SimpleHello_Transport_loggingDebug(%definitionId&" : SimpleHello request sent on SimpleHello_PCO of RemoteTransport. "&log2str(pl_Message));
|
| }
|
|
|
| ///////////////////////////////////////////////////////////
|
| // Function: f_EPTF_SimpleHello_RemoteTransport_cleanup_CT
|
| //
|
| // Purpose:
|
| // Function to clean the RemoteTransport component
|
| //
|
| // Parameters:
|
| // -
|
| //
|
| // Return Value:
|
| // -
|
| //
|
| // Errors:
|
| // -
|
| //
|
| // Detailed Comments:
|
| // -
|
| //
|
| ///////////////////////////////////////////////////////////
|
| function f_EPTF_SimpleHello_RemoteTransport_cleanup_CT()
|
| runs on EPTF_SimpleHello_RemoteTransport_CT
|
| {
|
| if (not v_EPTF_SimpleHello_RemoteTransport_initialized) { return }
|
| v_EPTF_SimpleHello_RemoteTransport_initialized := false;
|
|
|
| v_EPTF_SimpleHello_RemoteTransport_default := null;
|
| vf_EPTF_SimpleHello_RemoteTransport_handleReceive := null;
|
| f_EPTF_SimpleHello_Transport_loggingDebug("The cleanup of the SimpleHello RemoteTransport component is ready");
|
| }
|
|
|
| }//group EPTF_SimpleHello_RemoteTransport_Functions
|
|
|
| ///////////////////////////////////////////////////////////
|
| // Group: EPTF_SimpleHello_Mapper_Functions
|
| //
|
| // Purpose:
|
| // This group defines the functions of the mapper component
|
| //
|
| ///////////////////////////////////////////////////////////
|
| group EPTF_SimpleHello_Mapper_Functions
|
| {
|
| ///////////////////////////////////////////////////////////
|
| // Altstep: as_EPTF_SimpleHello_Mapper_Handler
|
| //
|
| // Purpose:
|
| // Altstep to handle the messages between the remote and mapper transport component
|
| //
|
| ///////////////////////////////////////////////////////////
|
| altstep as_EPTF_SimpleHello_Mapper_Handler()
|
| runs on EPTF_SimpleHello_Mapper_CT
|
| {
|
| [] SimpleHello_PCO.receive (octetstring:?) -> value v_EPTF_SimpleHello_Mapper_message sender v_EPTF_SimpleHello_Mapper_SendercomponentRef
|
| {
|
| //f_EPTF_SimpleHello_Transport_loggingDebug("The outgoing message is: "&log2str(v_EPTF_SimpleHello_Mapper_message));
|
| //f_EPTF_SimpleHello_Transport_loggingDebug("The message sender is: "&log2str(v_EPTF_SimpleHello_Mapper_SendercomponentRef));
|
|
|
| f_EPTF_SimpleHello_LocalTransport_sendMessage(v_EPTF_SimpleHello_Mapper_message);
|
| v_EPTF_SimpleHello_senderID := oct2int(v_EPTF_SimpleHello_Mapper_message[c_SimpleHello_SenderIdOffset4Request]);
|
| f_EPTF_Routing_processOutgoingMessage();
|
| repeat;
|
| }
|
| }
|
|
|
| ///////////////////////////////////////////////////////////
|
| // Function: f_EPTF_SimpleHello_Mapper_init_CT
|
| //
|
| // Purpose:
|
| // Function to initialize the Mapper component
|
| //
|
| // Parameters:
|
| // - pl_selfName - *in charstring* - the name of the component
|
| // - pl_loggingUIComponentRef - *in* <EPTF_LoggingUI_CT> - The component reference of the loggingUI component
|
| // - pl_UIHandlerComponentRef - *in* <EPTF_UIHandler_CT> - The component reference of the UIHandler component
|
| // - pl_mainTabBox - *in charstring* - The name of the main tab box
|
| //
|
| // Return Value:
|
| // *integer* - if the component initialize already the return value will be -1
|
| //
|
| // Errors:
|
| // -
|
| //
|
| // Detailed Comments:
|
| // -
|
| //
|
| ///////////////////////////////////////////////////////////
|
| function f_EPTF_SimpleHello_Mapper_init_CT(
|
| in charstring pl_selfName := "",
|
| in EPTF_LoggingUI_CT pl_loggingUIComponentRef := null,
|
| in EPTF_UIHandler_CT pl_UIHandlerComponentRef := null,
|
| in charstring pl_mainTabBox := ""
|
| )
|
| runs on EPTF_SimpleHello_Mapper_CT
|
| return integer
|
| {
|
| if (v_EPTF_SimpleHello_Mapper_initialized) {
|
| f_EPTF_SimpleHello_Transport_loggingDebug("The SimpleHello Mapper component is initialized already");
|
| return -1;
|
| }
|
| v_EPTF_SimpleHello_Mapper_initialized := true;
|
|
|
| f_EPTF_int2int_HashMap_Init();
|
| v_EPTF_SimpleHello_Mapper_default := activate(as_EPTF_SimpleHello_Mapper_Handler());
|
| v_EPTF_SimpleHello_Mapper_hashMapIdx := f_EPTF_int2int_HashMap_New(c_EPTF_SimpleHello_Mapper_routingHashMapName);
|
| v_EPTF_SimpleHello_senderID := -1;
|
|
|
| f_EPTF_SimpleHello_LocalTransport_init_CT(refers(f_EPTF_SimpleHello_Mapper_receiveMsg),pl_loggingUIComponentRef,pl_UIHandlerComponentRef,pl_mainTabBox);
|
| f_EPTF_Routing_init_CT(refers(f_EPTF_SimpleHello_Mapper_processOutgoingMessage),refers(f_EPTF_SimpleHello_Mapper_processIncomingMessage));
|
|
|
| f_EPTF_Base_init_CT(pl_selfName);
|
| f_EPTF_Base_registerCleanup(refers(f_EPTF_SimpleHello_Mapper_cleanup_CT));
|
|
|
| f_EPTF_SimpleHello_Transport_loggingDebug("The initialization of the SimpleHello Mapper component is ready");
|
|
|
| return 1;
|
| }
|
|
|
| ///////////////////////////////////////////////////////////
|
| // Function: f_EPTF_SimpleHello_Mapper_cleanup_CT
|
| //
|
| // Purpose:
|
| // Function to clean the Mapper component
|
| //
|
| // Parameters:
|
| // -
|
| //
|
| // Return Value:
|
| // -
|
| //
|
| // Errors:
|
| // -
|
| //
|
| // Detailed Comments:
|
| // -
|
| //
|
| ///////////////////////////////////////////////////////////
|
| function f_EPTF_SimpleHello_Mapper_cleanup_CT()
|
| runs on EPTF_SimpleHello_Mapper_CT
|
| {
|
| if (not v_EPTF_SimpleHello_Mapper_initialized) { return }
|
| v_EPTF_SimpleHello_Mapper_initialized := false;
|
|
|
| v_EPTF_SimpleHello_senderID := -1;
|
| v_EPTF_SimpleHello_Mapper_hashMapIdx := -1;
|
| f_EPTF_int2int_HashMap_Delete(c_EPTF_SimpleHello_Mapper_routingHashMapName);
|
| v_EPTF_SimpleHello_Mapper_default := null;
|
| f_EPTF_SimpleHello_Transport_loggingDebug("The cleanup of the SimpleHello Mapper component is ready");
|
| }
|
|
|
| ///////////////////////////////////////////////////////////
|
| // Function: f_EPTF_SimpleHello_Mapper_processOutgoingMessage
|
| //
|
| // Purpose:
|
| // Function to process the outgoing messages
|
| //
|
| // Parameters:
|
| // -
|
| //
|
| // Return Value:
|
| // -
|
| //
|
| // Errors:
|
| // -
|
| //
|
| // Detailed Comments:
|
| // -
|
| //
|
| ///////////////////////////////////////////////////////////
|
| function f_EPTF_SimpleHello_Mapper_processOutgoingMessage()
|
| runs on EPTF_SimpleHello_Mapper_CT
|
| {
|
| f_EPTF_int2int_HashMap_Insert(v_EPTF_SimpleHello_Mapper_hashMapIdx, v_EPTF_SimpleHello_senderID, f_EPTF_Base_upcast(v_EPTF_SimpleHello_Mapper_SendercomponentRef));
|
| }
|
|
|
| ///////////////////////////////////////////////////////////
|
| // Function: f_EPTF_SimpleHello_Mapper_processIncomingMessage
|
| //
|
| // Purpose:
|
| // Function to process the incoming messages
|
| //
|
| // Parameters:
|
| // -
|
| //
|
| // Return Value:
|
| // -
|
| //
|
| // Errors:
|
| // -
|
| //
|
| // Detailed Comments:
|
| // -
|
| //
|
| ///////////////////////////////////////////////////////////
|
| function f_EPTF_SimpleHello_Mapper_processIncomingMessage()
|
| runs on EPTF_SimpleHello_Mapper_CT
|
| {
|
| var integer vl_EPTF_SimpleHello_routingId;
|
|
|
| if(f_EPTF_int2int_HashMap_Find(v_EPTF_SimpleHello_Mapper_hashMapIdx,v_EPTF_SimpleHello_senderID,vl_EPTF_SimpleHello_routingId))
|
| {
|
| v_EPTF_SimpleHello_Mapper_ReceiverComponentRef := f_EPTF_Base_downcast(vl_EPTF_SimpleHello_routingId)
|
| } else {
|
| f_EPTF_SimpleHello_Transport_loggingWarning(%definitionId &
|
| ": Sender id (" & int2str(v_EPTF_SimpleHello_senderID) &
|
| ") not found in hash map! Possibly connection closed remotely on Free port!");
|
| }
|
| }
|
|
|
| ///////////////////////////////////////////////////////////
|
| // Function: f_EPTF_SimpleHello_Mapper_receiveMsg
|
| //
|
| // Purpose:
|
| // Function to handle the received message
|
| //
|
| // Parameters:
|
| // pl_data - *in* <octetstring> - the received PDU message
|
| //
|
| ///////////////////////////////////////////////////////////
|
| function f_EPTF_SimpleHello_Mapper_receiveMsg(
|
| in octetstring pl_Message)
|
| runs on EPTF_SimpleHello_Mapper_CT
|
| {
|
| v_EPTF_SimpleHello_senderID := oct2int(pl_Message[c_SimpleHello_SenderIdOffset4Response]);
|
| f_EPTF_Routing_processIncomingMessage();
|
|
|
| SimpleHello_PCO.send(pl_Message) to v_EPTF_SimpleHello_Mapper_ReceiverComponentRef;
|
| }
|
| }//group EPTF_SimpleHello_Mapper_Functions
|
|
|
| ///////////////////////////////////////////////////////////////////////////////
|
| // Group: EPTF_SimpleHello_Transport_Logging
|
| //
|
| // Purpose:
|
| // The functions of the EPTF SimpleHello Logging
|
| // Wrapper functions for logging debug, error, warning, etc.
|
| //
|
| ///////////////////////////////////////////////////////////////////////////////
|
| group EPTF_SimpleHello_Transport_Logging
|
| {
|
|
|
| ///////////////////////////////////////////////////////////
|
| // Function: f_EPTF_SimpleHello_Transport_loggingError
|
| //
|
| // Purpose:
|
| // Function to log an error from the transport of SimpleHello Applib.
|
| //
|
| // Parameters:
|
| // - pl_message - *in* *charstring* - the message to log
|
| //
|
| // Return Value:
|
| // -
|
| //
|
| // Errors & assertions:
|
| // -
|
| //
|
| // Detailed Comments:
|
| // -
|
| //
|
| ///////////////////////////////////////////////////////////
|
| function f_EPTF_SimpleHello_Transport_loggingError(
|
| in charstring pl_message)
|
| runs on EPTF_SimpleHello_Transport_Logging_CT
|
| {
|
| f_EPTF_Logging_errorV2(pl_message,
|
| v_EPTF_SimpleHello_Transport_loggingMaskId,
|
| {c_EPTF_SimpleHello_Transport_loggingClassIdx_Error});
|
| f_EPTF_Base_stopAll();
|
| }
|
|
|
| ///////////////////////////////////////////////////////////
|
| // Function: f_EPTF_SimpleHello_Transport_loggingWarning
|
| //
|
| // Purpose:
|
| // Function to log a warning from the transport of SimpleHello Applib.
|
| //
|
| // Parameters:
|
| // - pl_message - *in* *charstring* - the message to log
|
| //
|
| // Return Value:
|
| // -
|
| //
|
| // Errors & assertions:
|
| // -
|
| //
|
| // Detailed Comments:
|
| // -
|
| //
|
| ///////////////////////////////////////////////////////////
|
| function f_EPTF_SimpleHello_Transport_loggingWarning(
|
| in charstring pl_message)
|
| runs on EPTF_SimpleHello_Transport_Logging_CT
|
| {
|
| f_EPTF_Logging_warningV2(pl_message,
|
| v_EPTF_SimpleHello_Transport_loggingMaskId,
|
| {c_EPTF_SimpleHello_Transport_loggingClassIdx_Warning});
|
| }
|
|
|
| ///////////////////////////////////////////////////////////
|
| // Function: f_EPTF_SimpleHello_Transport_loggingDebug
|
| //
|
| // Purpose:
|
| // Function to log a debug message from the transport of SimpleHello Applib.
|
| //
|
| // Parameters:
|
| // - pl_message - *in* *charstring* - the message to log
|
| //
|
| // Return Value:
|
| // -
|
| //
|
| // Errors & assertions:
|
| // -
|
| //
|
| // Detailed Comments:
|
| // -
|
| //
|
| ///////////////////////////////////////////////////////////
|
| function f_EPTF_SimpleHello_Transport_loggingDebug(
|
| in charstring pl_message)
|
| runs on EPTF_SimpleHello_Transport_Logging_CT
|
| {
|
| f_EPTF_Logging_debugV2(pl_message,
|
| v_EPTF_SimpleHello_Transport_loggingMaskId,
|
| {c_EPTF_SimpleHello_Transport_loggingClassIdx_Debug});
|
| }
|
|
|
| ///////////////////////////////////////////////////////////
|
| // Function: f_EPTF_SimpleHello_Transport_debugEnabled
|
| //
|
| // Purpose:
|
| // Function to check if debug is enabled for the transport of SimpleHello Applib
|
| //
|
| // Parameters:
|
| // -
|
| //
|
| // Return Value:
|
| // *boolean* - true if debug enabled
|
| //
|
| // Errors & assertions:
|
| // -
|
| //
|
| // Detailed Comments:
|
| // -
|
| //
|
| ///////////////////////////////////////////////////////////
|
| function f_EPTF_SimpleHello_Transport_debugEnabled()
|
| runs on EPTF_SimpleHello_Transport_Logging_CT
|
| return boolean
|
| {
|
| return f_EPTF_Logging_isEnabled(
|
| v_EPTF_SimpleHello_Transport_loggingMaskId,
|
| c_EPTF_SimpleHello_Transport_loggingClassIdx_Debug);
|
| }
|
| } // group Transport_Logging
|
|
|
| } //end-of-module
|