/
CanBusWrite
CanBusWrite
Description
This function is called by the application to send a CAN frame on the opened CAN bus. The function will wait for the buffer to empty out if the buffer is full. The function returns to the application if the buffer doesn't empty within the configured timeout. A timeout value of 0 (standard) means, that the calling function will wait forever for the buffer to empty out..
Prototype
CPU_INT16S CanBusWrite(CPU_INT16S busId, void *buffer, CPU_INT16U size);
Parameter | Meaning |
---|---|
| Unique bus identifier |
| Pointer to CAN frame of type CANFRM |
| Size of buffer in bytes (must be equal to sizeof(CANFRM)) |
Return Value
One of the error codes CAN_ERR_BUSID
, CAN_ERR_NULLPTR
, CAN_ERR_FRMSIZE
, CAN_ERR_OSSEMPEND
, CAN_ERR_OSALLOC
or CAN_ERR_OSQUEUE
if an error is detected. Otherwise the number of bytes of a CAN frame is returned.