TIP810-SW-42 - VxWorks Device Driver
Page 16 of 36
msg_len
Receives the number of message data bytes (0...8).
data
This buffer receives up to 8 data bytes. Data[0] receives message Data 0, Data[1] receives
message Data 1 and so on.
timeout
Specifies the amount of time (in ticks) the caller is willing to wait for execution of read. A timeout
value of WAIT_FOREVER means wait indefinitely; a value of NO_WAIT means do not wait at
all.
status
This parameter receives status information about overrun conditions either in the CAN controller
or intermediate software FIFO.
Value
Description
T810_SUCCESS
No messages lost
T810_FIFO_OVERRUN
One or more messages was overwritten in the
receive queue FIFO. This problem occurs if the
FIFO is too small for the application read interval.
T810_MSGOBJ_OVERRUN
One or more messages were overwritten in the
CAN
controller
message
object
because
the
interrupt latency is too large. Reduce the CAN bit
rate or upgrade the system speed.
EXAMPLE
#include
“tip810.h”
int
fd;
int
num_bytes;
T810_MSG_BUF msg_buf;
msg_buf.timeout = 200; /* wait max. 200 ticks */
num_bytes = read(fd, &msg_buf, sizeof(msg_buf));
if (num_bytes != ERROR)
{
/* process received CAN message */
}