CanGetChannelAcceptance


Function

Get reception acceptance settings.

Format

Ret = CanGetChannelAcceptance ( Id , ChannelNo , MessageTypeMask , CanIdMask , CanIdCode )

Parameters

Id [ C: short ] [ Python: ctypes.c_short ]
Specify the device ID retrieved from CanInit.

ChannelNo [ C: unsigned short ] [ Python: ctypes.c_ushort ]
Specify the channel number.

MessageTypeMask [ C: unsigned int * ] [ Python: ctypes.POINTER(ctypes.c_uint) ]
Specifies the address of the variable that stores the message type settings for Do Not Receive.

CanIdMask [ C: unsigned int * ] [ Python: ctypes.POINTER(ctypes.c_uint) ]
Specify the address of the variable that stores the filter value of the CAN ID to be received.

CanIdCode [ C: unsigned int * ] [ Python: ctypes.POINTER(ctypes.c_uint) ]
Specify the address of the variable that stores the code settings to be received.
If the CAN ID targeted for reception by CanIdMask specification matches CanIdCode, it will be stored in the reception buffer.

Return Value

Ret [ C: long ] [ Python: ctypes.c_long ]

Definition

Value
[Dec]

Description

CAN_ERR_SUCCESS

0

Normality completion

CAN_ERR_DLL_INVALID_ID

10001

Invalid ID specified.

CAN_ERR_DLL_CALL_DRIVER

10002

Driver can't be called (Failed in the ioctl).

CAN_ERR_DLL_BUFF_ADDRESS

10100

Invalid data buffer address.

CAN_ERR_SYS_CH_NO

20101

Channel number is outside the settable range

The others (See also: Details of Error Code)

Initial Value

MessageTypeMask = 0x00 (CCAN_MSG_TYPE_DISABLE. Not specified (all message types will be received))
CanIdMask = 0x00000000 (All messages are stored in the receive buffer)
CanIdCode = 0x00000000

Remarks

Get reception acceptance settings.

For details on each parameter (MessageTypeMask, CanIdMask, CanIdCode), please refer to the parameters description in the CanSetChannelAcceptance topic.

Example

Get MessageTypeMask, CanIdMask and CanIdCode set to ChannelNo =1.

C

long Ret;

unsigned int MessageTypeMask;

unsigned int CanIdMask;

unsigned int CanIdCode;

Ret = CanGetChannelAcceptance ( Id , 1 , &MessageTypeMask , &CanIdMask, &CanIdCode );
 

Python

Ret = ctypes.c_long()

MessageTypeMask = ctypes.ctypes.c_uint()

CanIdMask = ctypes.ctypes.c_uint()

CanIdCode = ctypes.ctypes.c_uint()

Ret.value = ccan.CanGetChannelAcceptance ( Id , 1 , ctypes.byref(MessageTypeMask) , ctypes.byref(CanIdMask) , ctypes.byref(CanIdCode) )
 

See Also

CanSetChannelAcceptance