Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

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

busId

Unique bus identifier

buffer

Pointer to CAN frame of type CANFRM

size

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.

  • No labels