CAN-ETH C/C++ API
Version 2.0
|
This module documents the available CAN-ETH API functions. More...
Functions | |
int | canEthInit (void) |
Initialises the CAN-ETH Ethernet interface. More... | |
void | canEthShutdown (void) |
Shutdown the CAN-ETH Ethernet interface. More... | |
CanHandle | canEthOpen (const char *const hostName) |
Open a CAN channel to a remote CAN-ETH gateway. More... | |
int | canEthInstallRecvCallBack (CanHandle hdl, void(*func)(CanHandle hdl)) |
Install a receive notification handler. More... | |
void | canEthClose (CanHandle hdl) |
Close a CAN receive channel. More... | |
int | canEthRecv (CanHandle hdl, CanMsg *msg) |
Retrieves a CAN message from the receive buffer. More... | |
int | canEthSendMsg (CanHandle hdl, const CanMsg *const msg) |
Send a CAN message. More... | |
This module documents the available CAN-ETH API functions.
int canEthInit | ( | void | ) |
Initialises the CAN-ETH Ethernet interface.
A background receive thread is created and started.
void canEthShutdown | ( | void | ) |
Shutdown the CAN-ETH Ethernet interface.
The background receive thread is terminated and all CAN channels closed.
CanHandle canEthOpen | ( | const char *const | hostName | ) |
Open a CAN channel to a remote CAN-ETH gateway.
hostName | String with IP address or host name of the remote CAN-ETH gateway. |
int canEthInstallRecvCallBack | ( | CanHandle | hdl, |
void(*)(CanHandle hdl) | func | ||
) |
Install a receive notification handler.
Must be called after canEthOpen
hdl | Handle to identify CAN channel |
func | Pointer to callback function |
void canEthClose | ( | CanHandle | hdl | ) |
Close a CAN receive channel.
hdl | Handle to identify CAN channel |
int canEthRecv | ( | CanHandle | hdl, |
CanMsg * | msg | ||
) |
Retrieves a CAN message from the receive buffer.
If no messages if available, CANETH_NO_MSG is returned.
hdl | Handle to identify CAN channel |
msg | Pointer to container for received CAN message |
References CanMsg::data, CanMsg::ext, CanMsg::id, CanMsg::len, and CanMsg::rtr.
int canEthSendMsg | ( | CanHandle | hdl, |
const CanMsg *const | msg | ||
) |
Send a CAN message.
hdl | Handle to identify CAN channel |
msg | Pointer to CAN message to be sent |
References CanMsg::data, CanMsg::ext, CanMsg::id, CanMsg::len, and CanMsg::rtr.