Revision: 1.23
59
4.3 API List and Descriptions
4.3.1 CAN Bus
Under linux platform:
1. Syntax:
void sendCanMessages( canmsg_t *buffer, u8 count )
Description: This function sends out CAN packages over the CAN bus.
Parameters: If there is more than one CAN package to send, these CAN packages are stored in
a ‘canmsg_t’ array. This function sends out packages in a sequential fashion. The memory
address of the first CAN package to send is pointed at by the parameter ‘buffer’. The number of
CAN packages to send is indicated by the parameter ‘count’. If the resource of sending out the
CAN packages is temporarily unavailable, the process which invokes this function will be
blocked ( Block I/O) until the resource is available again.
Return Value: None.
2. Syntax:
int getCanMessages( canmsg_t *buffer, u8 count )
Description: This function receives CAN packages from the CAN bus subsystem.
Parameters: This function stores received CAN packages sequentially at an array of type
‘canmsg_t’. The number of packages to receive is indicated by the parameter ‘count’. Before
finishing receiving ‘count’ packages, the process which invokes this function will be
temporarily blocked (Block I/O) if there is no incoming CAN package.
Return Value: If this function receives the packages successfully, it returns 0. If this function
fails not 0.
3. Syntax:
int CanSetBaudRate( unsigned long Baud )