Software Support
© SYS TEC electronic GmbH 2007 L-1032e_9 65
Parameter:
pEthCanHandle_p: Address of the instance handle of the CAN-
Ethernet Gateway
This variable is a pointer of type tEthCanHandle. Upon successful
initialization, this address includes a valid hardware handle that also
serves as an instance handle. This instance handle should be secured
and identified as a return parameter when all other functions of this
instance are called.
pEthCanHwParam_p: Address to the hardware parameter structure
This variable is an address to a tEthCanHwParam hardware
parameter structure. It has the following structure:
typedef struct
{
DWORD m_dwIpAddress; //IP address
WORD m_wPort; //Port number
tUsedProtocol m_UsedProtocol; //Protocol (UDP or TCP)
DWORD m_dwReconnectTimeout; //Timeout for "Reconnect"
DWORD m_dwConnectTimeout; //Timeout for "Connect"
DWORD m_dwDisconnectTimeout; //Timeout for "Disconnect"
}tEthCanHwParam;
Figure 14: Hardware Parameter Structure Overview
This structure has to be filled out accordingly prior to a return to the
function. The IP address and port number correspond to the remote
address (IP address of the CAN-Ethernet Gateway) to which a
connection has to be established. The following format must be used:
#define IP_ADDR_DEFAULT ((192 << 0)+(168 << 8)+ (10 << 16)+(111 << 24))
#define IP_PORT_DEFAULT (8234)
UDP and TCP are available for the transfer protocol to be used.
typedef enum
{
kUseTCP = 0x00, // TCP Protocol
kUseUDP = 0x01 // UDP Protocol
}tUsedProtocol;
Figure 15: CAN-Ethernet-Gateway Transfer Protocols