Acrosser Technology AR-V6002FL User Manual page 72

Hide thumbs Also See for AR-V6002FL:
Table of Contents

Advertisement

2. Syntax:
unsigned 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
ERROR_API_SUCC. If this function fails to open the CAN device node, it returns
ERROR_API_CAN_OPEN_FAIL. If this function has any problem with receiving the
CAN packages, it returns ERROR_API_CANGETMESSAGES.
Here is an example:
If the array 'canAry[]' of type 'canmsg_t' has been declared and allocated. The code
listed below will receive 30 CAN packages from the CAN bus subsystem and stores the
packages in the 'canAry[]'.
unsigned int result = 0;
canmsg_t canAry[30];
result = getCanMessages( canAry, 30 );
if( result == ERROR_API_CANGETMESSAGES ||
result == ERROR_API_CAN_OPEN_FAIL )
fprintf( stderr, "Send CAN package error!\n");
3. Syntax:
unsigned int configCan( i32 baud )
Description: This function sets up the speed ( Baud rate ) of sending and receiving
CAN packages.
Parameters: The parameter 'baud' could be: ( the unit is Kbps )
10 , 20 , 50 , 100 , 125 , 250 , 500 , 800 , 1000
72
Revision: 1.0

Advertisement

Table of Contents
loading

Table of Contents