linux

canWrite

Syntax


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

Description

This function sends a CAN message. The call returns immediately after queuing the message to the driver.

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.
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

canWriteSync

An example.