linux

canWriteWait

Syntax


#include <canlib.h>
canStatus canWriteWait(
    int handle, long id, 
    void* msg, unsigned int dlc, 
    unsigned int flag, long timeout);

Description

This function sends a CAN message. The call returns after queuing the message to the driver. If the queue is full, the call waits at most timeout milliseconds. If the queue is still full, canERR_TXBUFOFL is returned.

Input Parameters

handle
A handle to an open CAN circuit.
id
The identifier of the CAN message to send.
msg
A pointer to the message data, or NULL.
dlc
The length of the message. Can be at most 8.
timeout
Maximum number of milliseconds to wait before returning canERR_TXBUFOFL. -1 means wait indefinitly
flag
A combination of message flags, canMSG_xxx. Use this parameter to send extended (29-bit) frames and/or remote frames. Use canMSG_EXT and/or canMSG_RTR for this purpose.
Output Parameters

None.

Return Value

canOK (zero) if success
canERR_xxx (negative) if failure.

Notes

Related Topics

canWrite