Moxa TC-SW04-M12-4P-T [40/43] Tc 6000 series expansion modules software installation and programming guide

Moxa TC-SP04-DB44-T [40/43] Tc 6000 series expansion modules software installation and programming guide
TC-6000 Series Expansion Modules Software Installation and Programming Guide
4-20
unsigned int mxcan_get_bus_timing (int fd)
Description Gets the bus timing of an open port.
Input <fd> the open port
Return Value 0 on failure, otherwise the bus speed in KHz
int mxcan_get_parameters (int fd, CANPRM * param)
Description Gets the parameter of an open port.
Input <fd> the open port
Output < param> pointer to the CANPRM structure
Return Value 0 on failure, otherwise returns a negative value
int mxcan_get_registers (int fd, unsigned char * buffer, int num)
Description Gets the register values of an open port.
Input <fd> the open port
Output < buffer > pointer to a buffer for these values
<num> number of register values; for a module with sja1000 chipset, the value must be 32
Return Value 0 on success; other numbers indicate failure
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

Содержание

Скачать