beautypg.com

Acrosser AIV-HM76V1FL User Manual

Page 54

background image

AIV-HM76V1FL Series User Manual

54

Acrosser Technology Co., Ltd.

Syntax:

i32 setCanMask(struct CanMask mask)

Description:

This function sets the bit patterns to the indicated mask.

The target mask is indicated by the ‘maskId’ field in a

CanMask variable.

Parameters:

This functions takes a variable of type ‘CanMask’. User set

the bit patterns they want to the ‘mask’ field in a ‘CanMask’

variable.

struct CanMask {

u8 maskId; // 0 or 1

u32 mask;

}

For example:

struct CanMask varMask;

i32 result;

varMask.maskId = 1;

varMask.mask = 0x12345678;

result = setCanMask(varMask);

Return Value:

If this function sets the mask setting successfully, it returns

0, any other returned value stands for error.

Syntax:

i32 getCanFilter(struct CanFilter *varFilter)

Description:

This function gets the current setting of the acceptance

filter. Use the ‘filterId’ field in a ‘CanFilter’ variable to

indicate the filter you want and the API puts the setting

of the indicated filter in the ‘filter’ field in the CanFilter

variable ‘varFilter’.

Parameters:

This function takes a pointer to a ‘CanFilter’ type variable.
For example:

struct CanFilter varFilter;

i32 result;

result = getCanFilter(&varFilter);

if(result != 0)

printf(“Fail to get the filter!\n”);

Return Value:

If this function gets the filter successfully, it returns 0, any

other returned value stands for error.