CanGetChannelAcceptance


Function

Get reception acceptance settings.

Format

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

Parameters

Id [ VB.NET: Short ] [ C, C++: short ] [ C#: short ]
Specify the device ID retrieved from CanInit.

ChannelNo [ VB.NET: UShort ] [ C, C++: unsigned short ] [ C#: ushort ]
Specify the channel number.

MessageTypeMask [ VB.NET: UInteger ] [ C, C++: unsigned long * ] [ C#: out uint ]
Specifies the address of the variable that stores the message type settings for Do Not Receive.

CanIdMask [ VB.NET: UInteger ] [ C, C++: unsigned long * ] [ C#: out uint ]
Specify the address of the variable that stores the filter value of the CAN ID to be received.

CanIdCode [ VB.NET: UInteger ] [ C, C++: unsigned long * ] [ C#: out 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 [ VB.NET: Integer ] [ C, C++: long ] [ C#: int ]

Definition

Value
[Dec]

Description

CAN_ERR_SUCCESS

0

Normality completion

CAN_ERR_SYS_RECOVERED_FROM_STANDBY

7

Execute CanResetDevice function because the device has recovered from standby mode.

CAN_ERR_DLL_INVALID_ID

10001

Invalid ID specified.

CAN_ERR_DLL_CALL_DRIVER

10002

Driver can't be called (Failed in the device I/O control).

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_DISABLEL. 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.

VB.NET

Dim Ret As Integer

Dim MessageTypeMask As UInteger

Dim CanIdMask As UInteger

Dim CanIdCode As UInteger

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

C, C++

long Ret;

unsigned long MessageTypeMask;

unsigned long CanIdMask;

unsigned long CanIdCode;

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

C#

int Ret;

ulong MessageTypeMask;

ulong CanIdMask;

ulong CanIdCode;

Ret = can.GetChannelAcceptance ( Id , 1 , out MessageTypeMask , out CanIdMask , out CanIdCode );
 

See Also

CanSetChannelAcceptance