Software Library API naibrd 2.24.0
See all documentation at naii.docs.com

Functions

NAIBRDFUNC nai_status_t NAIAPI naibrd_AR_CAN_GetMaxAcceptFilterCount (int32_t cardIndex, int32_t module, int32_t channel, int32_t *p_outmaxFilterCount)
 Retrieve the max filter count for the specified module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_AR_CAN_EnableAcceptFilters (int32_t cardIndex, int32_t module, int32_t channel, bool_t enableFilters)
 This enables/disables the filtering capability for the specified channel.This is "channel granularity" not "filter granularity". - i.e. either all of the filters for the specified channel are enabled or they are all disabled.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_AR_CAN_SetAcceptFilter (int32_t cardIndex, int32_t module, int32_t channel, int32_t filter, uint32_t msgId, bool_t isModeA, uint8_t *p_firstTwoBytes)
 This assigns the filter criteria to be used (compared to) after incoming messages pass through the corresponding filter mask. If all bits found in the filter match bits still enabled after passing through the filter mask, the message is "accepted" else the message is "rejected".
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_AR_CAN_GetAcceptFilter (int32_t cardIndex, int32_t module, int32_t channel, int32_t filter, uint32_t *p_outmsgId, bool_t *p_outisModeA, uint8_t *p_outfirstTwoBytes)
 This retrieve the current filter values for the specified filter index / position.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_AR_CAN_SetAcceptMask (int32_t cardIndex, int32_t module, int32_t channel, int32_t mask, uint32_t msgId, bool_t isModeA, uint8_t *p_firstTwoBytes)
 This assigns the mask criteria to be used - Incoming messages are passed through this mask and then compared to the corresponding filter after it is passed through this same mask. If all of the bits match, the message is accepted. If not the message is rejected.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_AR_CAN_GetAcceptMask (int32_t cardIndex, int32_t module, int32_t channel, int32_t mask, uint32_t *p_outmsgId, bool_t *p_outisModeA, uint8_t *p_outfirstTwoBytes)
 This retrieve the current mask values for the specified mask index / position.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_AR_CAN_RemoveAcceptFilter (int32_t cardIndex, int32_t module, int32_t channel, int32_t filter)
 Clears all filter settings for the specified Card, Module, Channel and Filter.
 

Detailed Description

Function Documentation

◆ naibrd_AR_CAN_EnableAcceptFilters()

NAIBRDFUNC nai_status_t NAIAPI naibrd_AR_CAN_EnableAcceptFilters ( int32_t cardIndex,
int32_t module,
int32_t channel,
bool_t enableFilters )

This enables/disables the filtering capability for the specified channel.This is "channel granularity" not "filter granularity". - i.e. either all of the filters for the specified channel are enabled or they are all disabled.

Parameters
cardIndex: (Input) Logical Card Index assigned to connect with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
channel: (Input) Channel Number of the channel to access (1 - [max channels for module]).
enableFilters: (Input) NAI_TRUE if enabling, NAI_FALSE otherwise.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_INVALID_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_AR_CAN_GetAcceptFilter()

NAIBRDFUNC nai_status_t NAIAPI naibrd_AR_CAN_GetAcceptFilter ( int32_t cardIndex,
int32_t module,
int32_t channel,
int32_t filter,
uint32_t * p_outmsgId,
bool_t * p_outisModeA,
uint8_t * p_outfirstTwoBytes )

This retrieve the current filter values for the specified filter index / position.

Parameters
cardIndex: (Input) Logical Card Index assigned to connect with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
channel: (Input) Channel Number of the channel to access (1 - [max channels for module]).
filter: (Input) Filter slot to set (0 based).
p_outmsgId: (Output) Msg Identifier - bits set here are compared to incoming CAN message identifiers after they are passed through the corresponding filter mask.
p_outisModeA: (Output) NAI_TRUE if 11 bit identifier; NAI_FALSE if 29 bit extended identifier.
p_outfirstTwoBytes: (Output) Pointer to first two bytes of the payload that were currently assigned to the specified filter index / position.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_INVALID_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_AR_CAN_GetAcceptMask()

NAIBRDFUNC nai_status_t NAIAPI naibrd_AR_CAN_GetAcceptMask ( int32_t cardIndex,
int32_t module,
int32_t channel,
int32_t mask,
uint32_t * p_outmsgId,
bool_t * p_outisModeA,
uint8_t * p_outfirstTwoBytes )

This retrieve the current mask values for the specified mask index / position.

Parameters
cardIndex: (Input) Logical Card Index assigned to connect with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
channel: (Input) Channel Number of the channel to access (1 - [max channels for module]).
mask: (Input) Mask slot to set (0 based).
p_outmsgId: (Input) Msg Identifier - bits set here are compared to incoming CAN message identifiers after they are passed through this filter mask.
p_outisModeA: (Output) NAI_TRUE if 11 bit identifier; NAI_FALSE if 29 bit extended identifier.
p_outfirstTwoBytes: (Input) Pointer to first two bytes of the payload that were currently assigned to the specified mask index / position.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_INVALID_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_AR_CAN_GetMaxAcceptFilterCount()

NAIBRDFUNC nai_status_t NAIAPI naibrd_AR_CAN_GetMaxAcceptFilterCount ( int32_t cardIndex,
int32_t module,
int32_t channel,
int32_t * p_outmaxFilterCount )

Retrieve the max filter count for the specified module.

Parameters
cardIndex: (Input) Logical Card Index assigned to connect with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
channel: (Input) Channel Number of the channel to access (1 - [max channels for module]).
p_outmaxFilterCount: (Output) Maximum number filters that can be configured for given Module ID.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_INVALID_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_AR_CAN_RemoveAcceptFilter()

NAIBRDFUNC nai_status_t NAIAPI naibrd_AR_CAN_RemoveAcceptFilter ( int32_t cardIndex,
int32_t module,
int32_t channel,
int32_t filter )

Clears all filter settings for the specified Card, Module, Channel and Filter.

Parameters
cardIndex: (Input) Logical Card Index assigned to connect with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
channel: (Input) Channel Number of the channel to access (1 - [max channels for module]).
filter: (Input) Filter index value specifying which filter to remove configuration (0 based).
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_INVALID_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.
  • NAI_ERROR_INVALID_VALUE when enableFilterCount is < 0 or > GetMaxFilterCount

◆ naibrd_AR_CAN_SetAcceptFilter()

NAIBRDFUNC nai_status_t NAIAPI naibrd_AR_CAN_SetAcceptFilter ( int32_t cardIndex,
int32_t module,
int32_t channel,
int32_t filter,
uint32_t msgId,
bool_t isModeA,
uint8_t * p_firstTwoBytes )

This assigns the filter criteria to be used (compared to) after incoming messages pass through the corresponding filter mask. If all bits found in the filter match bits still enabled after passing through the filter mask, the message is "accepted" else the message is "rejected".

Parameters
cardIndex: (Input) Logical Card Index assigned to connect with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
channel: (Input) Channel Number of the channel to access (1 - [max channels for module]).
filter: (Input) Filter slot to set (0 based).
msgId: (Input) Msg Identifier - bits set here are compared to incoming CAN message identifiers after they are passed through the corresponding filter mask.
isModeA: (Input) Indicates if dealing with 11 bit identifier (ModeA) or 29 bit (Extended)
p_firstTwoBytes: (Input) Pointer to first two bytes of the payload. Caller can specify what the 1st two bytes of the data should look like in order to be accepted. Again, the bits set will be used to compare against incoming message payloads after the incoming message payload passes through the corresponding filter mask.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_INVALID_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_AR_CAN_SetAcceptMask()

NAIBRDFUNC nai_status_t NAIAPI naibrd_AR_CAN_SetAcceptMask ( int32_t cardIndex,
int32_t module,
int32_t channel,
int32_t mask,
uint32_t msgId,
bool_t isModeA,
uint8_t * p_firstTwoBytes )

This assigns the mask criteria to be used - Incoming messages are passed through this mask and then compared to the corresponding filter after it is passed through this same mask. If all of the bits match, the message is accepted. If not the message is rejected.

Parameters
cardIndex: (Input) Logical Card Index assigned to connect with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
channel: (Input) Channel Number of the channel to access (1 - [max channels for module]).
mask: (Input) Mask slot to set (0 based).
msgId: (Input) Msg Identifier - bits set here are compared to incoming CAN message identifiers.
isModeA: (Input) Indicates if dealing with 11 bit identifier (ModeA) or 29 bit (Extended)
p_firstTwoBytes: (Input) Pointer to first two bytes of the payload. Caller can specify what the 1st two bytes of the data should look like in order to be accepted. Again, the bits set will be used to compare against incoming message payload.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_INVALID_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.