A664InitProxyPort
CAPL Functions » AFDX » A664InitProxyPort Valid for: CANoe DE • CANoe4SW DEFunction Syntax
Description
Opens a windows socket based server (Winsock Server) on a windows network adapter which is characterized by the IP address<ipAddr> and the UDP port <udpPort>. Additionally, a pair of AFDX messages from a specific channel <channel> is assigned to this socket. Data received from the client is further transferred with the defined Tx message <inMsgId>. Data originating from the Rx message <outMsgId> is transferred to the client. Calling a664CloseProxyPort closes the port.
An external application may be connected to this socket in order to realize protocols like TFTP or SNMP (via messages of SAP type).
Usually an external client connects to this socket and initiates transmission by sending an initial packet. The source IP address and source UDP port of those incoming requests are then used as the destination address parameters for the server’s responses.
However, in some use cases the data transfer is not requested by any client but is triggered from the server side (e.g. with SNMP traps). Therefore the function allows specifying the additional (optional) address parameters <destIP> and <destPort>.
Note: In order to map communication and points unambiguously a socket shall be assigned to a unique pair of channel <channel> and Rx message <outMsgId>.
Parameters
<channel>: AFDX-channel (1 to 16) to which socket packets should be mapped to (sent and observed).<ipAddr>: IPv4-address on which the socket is waiting for incoming packets. It must correspond to the assigned IPv4-address of an existing network adapter.<udpPort>: UDP port on which the socket is waiting for incoming packets.<outMsgID>: messageID which is observed on AFDX-channel and transferred to the socket if detected.<inMsgID>: When a packet is received on the socket, a corresponding AFDX message is created from its content and put to the AFDX-bus specified by<channel>.<destPort>: Used to define the external client address for cases, when the client does not initiate the communication. (e.g. to collect SNMP alarms on an external trap monitor). Set to 0 otherwise.<destIP>: Used to define the external client address for cases, when the client does not initiate the communication. Set to 0 otherwise.<options>: Optional flag to specify socket options. (Currently not used)
Return Values
>= 0: Socket handle which can be used in other CAPL functions for raw socket access.-1: Error-2: error-3: error