CAN – Ethernet Gateway
68
©
SYS TEC electronic GmbH 2007 L-1032e_9
Application Example:
#define
IP_ADDR_DEFAULT ((192 << 0)+(168 << 8)+ (10 << 16)+(111 << 24))
#define
IP_PORT_DEFAULT (8234)
DWORD dwRetcode;
tEthCanHandle EthCanHandle;
tEthCanHwParam EthCanHwParam;
EthCanHwParam.m_dwReconnectTimeout = 120000;//120s
EthCanHwParam.m_dwIpAddress = IP_ADDR_DEFAULT;
EthCanHwParam.m_wPort = IP_PORT_DEFAULT;
EthCanHwParam.m_dwConnectTimeout = 5000;//5s
EthCanHwParam.m_dwDisConnectTimeout = 5000;//5s
without Callback Function:
// initialize a CAN-Ethernet Gateway without a Callback function
dwRetcode = EthCanInitHardware (&EthCanHandle,&EthCanHwParam,NULL,NULL);
with Callback Function:
void
PUBLIC
EthCanConnectControlFct (tEthCanHandle EthCanHandle_p,
DWORD dwConnectionState_p,
void*
pArg_p)
{
switch(dwConnectionState_p)
{
//Connection
in
process
case
kConnecting:………………………
break;
//Connection
Established
case
kEstablished:……………………
break;
//Disconnecting
case
kClosing:………………………………
break;
//Disconnected
case
kClosed:…………………………………
break;
}
}
//initializes a CAN-Ethernet Gateway with Callback function
dwRetcode = EthCanInitHardware (&EthCanHandle, &EthCanHwParam,
EthCanConnectControlFct,NULL);
Summary of Contents for GW-003
Page 5: ...Contents SYS TEC electronic GmbH 2007 L 1032e_9 Index 97 ...
Page 8: ...CAN Ethernet Gateway SYS TEC electronic GmbH 2007 L 1032e_9 ...
Page 14: ...CAN Ethernet Gateway 6 SYS TEC electronic GmbH 2007 L 1032e_9 ...
Page 56: ...CAN Ethernet Gateway 48 SYS TEC electronic GmbH 2007 L 1032e_9 ...
Page 66: ...CAN Ethernet Gateway 58 SYS TEC electronic GmbH 2007 L 1032e_9 ...
Page 100: ...CAN Ethernet Gateway 92 SYS TEC electronic GmbH 2007 L 1032e_9 ...
Page 108: ...Published by SYS TEC electronic GmbH 2007 Ordering No L 1032e_9 Printed in Germany ...