CAN – Ethernet Gateway
66 © SYS TEC electronic GmbH 2007 L-1032e_9
The member variable m_dwReconnectTime describes the duration
following a break in the connection before a new connection is
established automatically. If this time is 0, then no new connection is
established. The member variable m_dwConnectTimeout is only
relevant if the Init function is called in „Blocked Mode“. It describes
the time, after which the Init function returns if a successful
connection could not be established. If this time is 0, then a default
timeout of 5s is set.
The same applies for the member variable m_dwDisconnectTimeout,
which sets the timeout for the Deinit function, after which an active
connection must be established.
fpEthCanCbConnectFct_p:
Address of the Callback function for the connection status of the
CAN-Ethernet Gateway.
This value can be NULL when it is passed to the Init function, which
means that there is no Callback function.
If a Callback function is to be used to react to changes in the
connection status, the following declaration has to be made:
void PUBLIC EthCanConnectControlFct(
tEthCanHandle EthCanHandle_p,
DWORD dwConnectionState_p);
It is therefore possible for a single Callback function to be assigned
for the initialization of multiple instances. The Instance handle
(EthCanHadle_p), which is returned to the Callback function, is used
to determine at which instance the connection status changed.
However, there is the possibility of assigning a separate Callback
function for each initialized instance.
Note:
If a separate Callback function is created for each instance, it is
important to be sure that different function names are assigned to
prevent Compiler and Linker errors!