API-FDX Linux Getting Started Manual
31
GmbH
Section 8 – Programming the API-FDX Module
8.1.7. Setting up a VL oriented Receiver
void MyFdxSetupRxPort()
{
TY_FDX_RX_MODE_CTRL_IN x_ModeCtrlIn;
TY_FDX_RX_MODE_CTRL_OUT x_ModeCtrlOut;
TY_FDX_RX_VL_CTRL x_VLControl;
TY_FDX_RX_VL_DESCRIPTION x_VLDesc;
TY_FDX_UDP_DESCRIPTION x_UdpDesc;
//--- Set AyI-FDX Port to VL-oriented mode
x_ModeCtrlIn.ul_ReceiveMode = FDX_RX_VL;
FdxCmdRxModeControl(g_ulPort2Handle, &x_ModeCtrlIn, &x_ModeCtrlOut);
//--- Enable capturing for the VL of interest (VL 60)
x_VLControl.ul_VLId = DEF_VL;
x_VLControl.ul_VLRange = 1;
x_VLControl.ul_EnableMode = FDX_RX_VL_ENA_EXT;
x_VLControl.ul_PayloadMode = FDX_PAYLOAD_FULL;
x_VLControl.ul_TCBIndex = 0;
x_VLDesc.ul_VerificationMode = FDX_RX_VL_CHECK_DISA;
x_VLDesc.ul_VLBufSize = 0x8000;
FdxCmdRxVLControl(g_ulPort2Handle, &x_VLControl, &x_VLDesc);
//--- Create a UDP sampling port to receive messages
x_UdpDesc.ul_PortType = FDX_UDP_SAMPLING;
x_UdpDesc.x_Quint.ul_IpDst = 0xe0e0003c; //Dest IP
224.224.0.60
x_UdpDesc.x_Quint.ul_IpSrc = 0x0a812101; //Src IP 10.129.33.1
x_UdpDesc.x_Quint.ul_UdpDst = 23; //UDP Dst 23
x_UdpDesc.x_Quint.ul_UdpSrc = 24; //UDP Src 24
x_UdpDesc.x_Quint.ul_VlId = 60; // VL 60
x_UdpDesc.ul_UdpNumBufMessages= 10;
x_UdpDesc.ul_UdpMaxMessageSize= 200; //Max UDP message
size
FdxCmdRxUDPCreatePort(g_ulPort2Handle, &x_UdpDesc, &g_Udp1Port2Handle);
//--- Create a UDP sampling port to receive messages
x_UdpDesc.ul_PortType = FDX_UDP_SAMPLING;
x_UdpDesc.x_Quint.ul_IpDst = 0xe0e0003c; //Dest IP
224.224.0.60
x_UdpDesc.x_Quint.ul_IpSrc = 0x0a812101; //Src IP 10.129.33.1
x_UdpDesc.x_Quint.ul_UdpDst = 25; //UDP Dst 25
x_UdpDesc.x_Quint.ul_UdpSrc = 26; //UDP Src 26
x_UdpDesc.x_Quint.ul_VlId = 60; // VL 60
x_UdpDesc.ul_UdpNumBufMessages= 10;
x_UdpDesc.ul_UdpMaxMessageSize= 200; //Max UDP message
size
FdxCmdRxUDPCreatePort(g_ulPort2Handle, &x_UdpDesc, &g_Udp2Port2Handle);
}