Moxa V2426A-C7 [62/88] V2400a series expansion modules software installation and programming guide

Moxa V2426A-C2-T-W7E [62/88] V2400a series expansion modules software installation and programming guide
V2400A Series Expansion Modules Software Installation and Programming Guide
4-42
int mxcan_get_stat (int fd, CANBST * stat)
Description Gets the statistics of an open port.
Input <fd> the open port
Output < stat > pointer to a container of the statistics
Return Value 0 on success; other numbers indicate failure
int mxcan_inqueue (int fd)
Description Gets the number of received bytes that are queued in the driver of an open port.
Input <fd> the open port
Return Value 0 on failure; otherwise the number of bytes
int mxcan_open (int port)
Description Open a can port given the port number.
Input <port> port number starting from 1; in Linux, open port 1 will open /dev/can0
Return Value -1 on failure; otherwise returns fd
int mxcan_outqueue (int fd)
Description Gets the number of bytes waiting to be transmitted to a CAN port.
Input <fd> the open port
Return Value -1 on failure; otherwise the number of bytes
int mxcan_purge_buffer (int fd, unsigned int purge)
Description Purges the buffers of an open port.
Input <fd> the open port
Output < purge> 1: received data buffer; 2: transmit data buffer; otherwise: both
Return Value 0 on success; otherwise failure
int mxcan_read (int fd, char * buffer, int size)
Description Reads data into a buffer from an open port (the size should be a multiple of the CANMSG size)
Input <fd> the open port
Output <buffer> pointer to the buffer
Return Value 0 on failure (data not available); otherwise the number of bytes read
int mxcan_set_bus_timing (int fd, unsigned int speed)
Description Sets the bus timing of an open port.
Input <fd> the open port
Output <speed> bus timing in Hz
Return Value 0 on success; otherwise returns a negative number
int mxcan_set_nonblocking (int fd)
Description Sets the open fd to be non-blocking.
Input <fd> the open port
Return Value 0 on success; otherwise returns a negative number
int mxcan_set_parameters (int fd, CANPRM * param)
Description Sets the parameters of an open port.
Input <fd> the open port
<param> pointer to the CANPRM structure
Output <speed> bus timing in Hz
Return Value 0 on success; otherwise returns a negative number

Содержание

Скачать