Software Library API naibrd 1.62
See all documentation at naii.docs.com
Transmit and Receive Operation Functions

Functions

NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_QueueTransmit (int32_t cardIndex, int32_t module, int32_t channel, bool_t ismodeA, int32_t msgid, uint8_t *buffer, int32_t length)
 Queues a message to transmit on a CAN A/B channel's Tx FIFO. The message will be sent once the TX_ENABLE bit is set in the channel's control register. If that bit is already set, the message will be transmitted immediately. If the Tx FIFO does not have enough space to hold the message, the function will return immediately with a value of NAI_ERROR_FULL. If the message is longer than NAI_AB_MAX_DATA_LEN, the function will return immediately with a value of NAI_ERROR_INVALID_RANGE.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_QueueTransmit_Ex (int32_t cardIndex, int32_t module, int32_t channel, bool_t ismodeA, int32_t msgid, uint32_t width, void *buffer, uint32_t length)
 Queues a CAN AB message for transmit on the channels FIFO. The message will be sent once the TX_ENABLE bit is set in the channel's control register. If that bit is already set, the message will be transmitted immediately. If the Tx FIFO does not have enough space to hold the message, the function will return immediately with a value of NAI_ERROR_FULL. If the message is longer than NAI_AB_MAX_DATA_LEN, the function will return immediately with a value of NAI_ERROR_INVALID_RANGE.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_Transmit (int32_t cardIndex, int32_t module, int32_t channel, bool_t ismodeA, int32_t msgid, uint8_t *buffer, int32_t length)
 Queues a message to transmit on a CAN A/B channel's Tx FIFO, then enables the transmit bit in the channel's control word.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_Transmit_Ex (int32_t cardIndex, int32_t module, int32_t channel, bool_t ismodeA, int32_t msgid, uint32_t width, void *buffer, uint32_t length)
 Queues a message to transmit on a CAN A/B channel's Tx FIFO, then enables the transmit bit in the channel's control word.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_Receive (int32_t cardIndex, int32_t module, int32_t channel, int32_t buflen, bool_t *outismodeA, int32_t *outmsgid, uint8_t *outbuffer, int32_t *outlength)
 Attempts to read a message off a CAN A/B channel's Rx FIFO. If there are no messages waiting, this function will return immediately with a value of NAI_ERROR_EMPTY. If the message exceeds the length of the buffer, the function will fill as much as it can, discard the rest of the message, and return NAI_ERROR_MORE_DATA. You can avoid this by passing a buffer of length NAI_AB_MAX_DATA_LEN.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_Receive_Ex (int32_t cardIndex, int32_t module, int32_t channel, uint32_t buflen, bool_t *outismodeA, int32_t *outmsgid, uint32_t width, void *outbuffer, uint32_t *outlength)
 Reads a CAN AB message off a channel. If there are no messages waiting, this function will return NAI_ERROR_EMPTY. If the format of the message on the fifo is invalid the function will return NAI_ERROR_MISMATCH. If the message exceeds buflen the function will fill as much as it can, discard the rest of the message, and return NAI_ERROR_MORE_DATA.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_QueueTransmit_J1939 (int32_t cardIndex, int32_t module, int32_t channel, int32_t PGN, int32_t priority, int32_t destination, uint8_t *buffer, int32_t length)
 Queues a message to transmit on a J1939 channel's Tx FIFO. The message will be sent once the TX_ENABLE bit is set in the channel's control register. If that bit is already set, the message will be transmitted immediately. If the Tx FIFO does not have enough space to hold the message, the function will return immediately with a value of NAI_ERROR_FULL. If the message is longer than NAI_J1939_MAX_DATA_LEN, the function will return immediately with a value of NAI_ERROR_INVALID_RANGE.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_QueueTransmit_J1939_Ex (int32_t cardIndex, int32_t module, int32_t channel, int32_t PGN, int32_t priority, int32_t destination, uint32_t width, void *buffer, uint32_t length)
 Queues a J1939 message, for transmit on the given channel. The message will be sent once the TX_ENABLE bit is set in the channel's control register. If that bit is already set, the message will be transmitted immediately. If the Tx FIFO does not have enough space to hold the message, the function will return immediately with a value of NAI_ERROR_FULL. If the message is longer than NAI_J1939_MAX_DATA_LEN, the function will return immediately with a value of NAI_ERROR_INVALID_RANGE.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_Transmit_J1939 (int32_t cardIndex, int32_t module, int32_t channel, int32_t PGN, int32_t priority, int32_t destination, uint8_t *buffer, int32_t length)
 Queues a message to transmit on a J1939 channel's Tx FIFO, then enables the transmit bit in the channel's control word.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_Transmit_J1939_Ex (int32_t cardIndex, int32_t module, int32_t channel, int32_t PGN, int32_t priority, int32_t destination, uint32_t width, void *buffer, uint32_t length)
 Queues a message to transmit on a J1939 channel's Tx FIFO, then enables the transmit bit in the channel's control word.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_Receive_J1939 (int32_t cardIndex, int32_t module, int32_t channel, int32_t buflen, int32_t *outPGN, int32_t *outsource, int32_t *outdestination, uint8_t *outbuffer, int32_t *outlength)
 Attempts to read a message off a J1939 channel's Rx FIFO. If there are no messages waiting, this function will return immediately with a value of NAI_ERROR_EMPTY. If the message exceeds the length of the buffer, the function will fill as much as it can, discard the rest of the message, and return NAI_ERROR_MORE_DATA. You can avoid this by passing a buffer of length NAI_J1939_MAX_DATA_LEN.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_Receive_J1939_Ex (int32_t cardIndex, int32_t module, int32_t channel, uint32_t buflen, int32_t *outPGN, int32_t *outsource, int32_t *outdestination, uint32_t width, void *outbuffer, uint32_t *outlength)
 Reads a J1939 message off a channel on a gen5 module. If there are no messages waiting, this function will return NAI_ERROR_EMPTY. If the format of the message on the fifo is invalid the function will return NAI_ERROR_MISMATCH. If the message exceeds buflen the function will fill as much as it can, discard the rest of the message, and return NAI_ERROR_MORE_DATA.
 

Detailed Description


Function Documentation

◆ naibrd_CAN_QueueTransmit()

NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_QueueTransmit ( int32_t cardIndex,
int32_t module,
int32_t channel,
bool_t ismodeA,
int32_t msgid,
uint8_t * buffer,
int32_t length )

Queues a message to transmit on a CAN A/B channel's Tx FIFO. The message will be sent once the TX_ENABLE bit is set in the channel's control register. If that bit is already set, the message will be transmitted immediately. If the Tx FIFO does not have enough space to hold the message, the function will return immediately with a value of NAI_ERROR_FULL. If the message is longer than NAI_AB_MAX_DATA_LEN, the function will return immediately with a value of NAI_ERROR_INVALID_RANGE.

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]).
ismodeA: (Input) Mode (TRUE: CAN-A, FALSE: CAN-B.)
msgid: (Input) Message ID (11-bits for CAN-A, 29 bits for CAN-B).
buffer: (Input) Pointer to the buffer containing the message.
length: (Input) Length of the message (in bytes).
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_INVALID_RANGE when length of the message is invalid.
  • NAI_ERROR_FULL when the FIFO is out of space.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_CAN_QueueTransmit_Ex()

NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_QueueTransmit_Ex ( int32_t cardIndex,
int32_t module,
int32_t channel,
bool_t ismodeA,
int32_t msgid,
uint32_t width,
void * buffer,
uint32_t length )

Queues a CAN AB message for transmit on the channels FIFO. The message will be sent once the TX_ENABLE bit is set in the channel's control register. If that bit is already set, the message will be transmitted immediately. If the Tx FIFO does not have enough space to hold the message, the function will return immediately with a value of NAI_ERROR_FULL. If the message is longer than NAI_AB_MAX_DATA_LEN, the function will return immediately with a value of NAI_ERROR_INVALID_RANGE.

This function provides optimized performance for 32 bit buffer writes.

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]).
ismodeA: (Input) Mode (TRUE: CAN-A, FALSE: CAN-B.)
msgid: (Input) Message ID (11-bits for CAN-A, 29 bits for CAN-B).
width: (Input) Word size of the buffer.
buffer: (Input) Pointer to the buffer containing the message. Buffer should either be of type uint16_t* or uint32_t*
length: (Input) Length of the message (in bytes).
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_INVALID_RANGE when length of the message is invalid.
  • NAI_ERROR_FULL when the FIFO is out of space.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_CAN_QueueTransmit_J1939()

NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_QueueTransmit_J1939 ( int32_t cardIndex,
int32_t module,
int32_t channel,
int32_t PGN,
int32_t priority,
int32_t destination,
uint8_t * buffer,
int32_t length )

Queues a message to transmit on a J1939 channel's Tx FIFO. The message will be sent once the TX_ENABLE bit is set in the channel's control register. If that bit is already set, the message will be transmitted immediately. If the Tx FIFO does not have enough space to hold the message, the function will return immediately with a value of NAI_ERROR_FULL. If the message is longer than NAI_J1939_MAX_DATA_LEN, the function will return immediately with a value of NAI_ERROR_INVALID_RANGE.

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]).
PGN: (Input) Parameter Group Number.
priority: (Input) Priority of the message (0 being highest and 7 being lowest).
destination: (Input) Destination of the message (0 to FE, or FF to broadcast).
buffer: (Input) Pointer to the buffer containing the message.
length: (Input) Length of the message (in bytes).
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_INVALID_RANGE when length of the message is invalid.
  • NAI_ERROR_FULL when the FIFO is out of space.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_CAN_QueueTransmit_J1939_Ex()

NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_QueueTransmit_J1939_Ex ( int32_t cardIndex,
int32_t module,
int32_t channel,
int32_t PGN,
int32_t priority,
int32_t destination,
uint32_t width,
void * buffer,
uint32_t length )

Queues a J1939 message, for transmit on the given channel. The message will be sent once the TX_ENABLE bit is set in the channel's control register. If that bit is already set, the message will be transmitted immediately. If the Tx FIFO does not have enough space to hold the message, the function will return immediately with a value of NAI_ERROR_FULL. If the message is longer than NAI_J1939_MAX_DATA_LEN, the function will return immediately with a value of NAI_ERROR_INVALID_RANGE.

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]).
PGN: (Input) Parameter Group Number.
priority: (Input) Priority of the message (0 being highest and 7 being lowest).
destination: (Input) Destination of the message (0 to FE, or FF to broadcast).
width: (Input) Word size of the buffer.
buffer: (Input) Pointer to the buffer containing the message. Buffer should either be of type uint16_t* or uint32_t*
length: (Input) Length of the message (in bytes).

This function provides optimized performance for 32 bit buffer writes.

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_INVALID_RANGE when length of the message is invalid.
  • NAI_ERROR_FULL when the FIFO is out of space.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.
  • NAI_ERROR_INVALID_VALUE when a parameter is invalid

◆ naibrd_CAN_Receive()

NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_Receive ( int32_t cardIndex,
int32_t module,
int32_t channel,
int32_t buflen,
bool_t * outismodeA,
int32_t * outmsgid,
uint8_t * outbuffer,
int32_t * outlength )

Attempts to read a message off a CAN A/B channel's Rx FIFO. If there are no messages waiting, this function will return immediately with a value of NAI_ERROR_EMPTY. If the message exceeds the length of the buffer, the function will fill as much as it can, discard the rest of the message, and return NAI_ERROR_MORE_DATA. You can avoid this by passing a buffer of length NAI_AB_MAX_DATA_LEN.

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]).
buflen: (Input) Number of bytes allocated to the buffer passed in.
outismodeA: (Output) Pointer to a bool_t indicating CAN mode A or B (TRUE: CAN-A, FALSE: CAN-B).
outmsgid: (Output) Pointer to an integer to store the message ID.
outbuffer: (Output) Buffer containing the received message.
outlength: (Output) Pointer to an integer containing the received message size (in bytes).
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_RANGE when the message exceeds NAI_AB_MAX_DATA_LEN.
  • NAI_ERROR_MORE_DATA when more data than the length of the buffer passed in.

◆ naibrd_CAN_Receive_Ex()

NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_Receive_Ex ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t buflen,
bool_t * outismodeA,
int32_t * outmsgid,
uint32_t width,
void * outbuffer,
uint32_t * outlength )

Reads a CAN AB message off a channel. If there are no messages waiting, this function will return NAI_ERROR_EMPTY. If the format of the message on the fifo is invalid the function will return NAI_ERROR_MISMATCH. If the message exceeds buflen the function will fill as much as it can, discard the rest of the message, and return NAI_ERROR_MORE_DATA.

This function provides optimized performance for 32 bit buffers.

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]).
buflen: (Input) Number of bytes allocated to the buffer passed in.
outismodeA: (Output) Pointer to a bool_t indicating CAN mode A or B (TRUE: CAN-A, FALSE: CAN-B).
outmsgid: (Output) Pointer to an integer to store the message ID.
width: (Input) Message Width.
outbuffer: (Output) Buffer containing the received message. Buffer should be either type uint16_t* or uint32_t*
outlength: (Output) Pointer to an integer containing the received message size (in bytes).
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_EMPTY when there is no data on the fifo
  • NAI_ERROR_MESSAGE_MISMATCH when the can frame being read on the fifo is invalid.
  • NAI_ERROR_MORE_DATA when the amount of data in the can frame being read exceeds the buflen
  • NAI_ERROR_INVALID_VALUE when a param has an invalid value

◆ naibrd_CAN_Receive_J1939()

NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_Receive_J1939 ( int32_t cardIndex,
int32_t module,
int32_t channel,
int32_t buflen,
int32_t * outPGN,
int32_t * outsource,
int32_t * outdestination,
uint8_t * outbuffer,
int32_t * outlength )

Attempts to read a message off a J1939 channel's Rx FIFO. If there are no messages waiting, this function will return immediately with a value of NAI_ERROR_EMPTY. If the message exceeds the length of the buffer, the function will fill as much as it can, discard the rest of the message, and return NAI_ERROR_MORE_DATA. You can avoid this by passing a buffer of length NAI_J1939_MAX_DATA_LEN.

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]).
buflen: (Input) Number of bytes allocated to the buffer passed in.
outPGN: (Output) Pointer to a integer to store the Parameter Group Number.
outsource: (Output) Pointer to an integer to store the source of the message.
outdestination: (Output) Pointer to an integer to store the destination of the message (0 to FE, or FF to broadcast).
outbuffer: (Output) Buffer containing the received message.
outlength: (Output) Pointer to an integer containing the received message size (in bytes).
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_RANGE when the message exceeds NAI_J1939_MAX_DATA_LEN.
  • NAI_ERROR_MORE_DATA when more data than the length of the buffer passed in.

◆ naibrd_CAN_Receive_J1939_Ex()

NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_Receive_J1939_Ex ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t buflen,
int32_t * outPGN,
int32_t * outsource,
int32_t * outdestination,
uint32_t width,
void * outbuffer,
uint32_t * outlength )

Reads a J1939 message off a channel on a gen5 module. If there are no messages waiting, this function will return NAI_ERROR_EMPTY. If the format of the message on the fifo is invalid the function will return NAI_ERROR_MISMATCH. If the message exceeds buflen the function will fill as much as it can, discard the rest of the message, and return NAI_ERROR_MORE_DATA.

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]).
buflen: (Input) Number of bytes allocated to the buffer passed in.
outPGN: (Output) Pointer to a integer to store the Parameter Group Number.
outsource: (Output) Pointer to an integer to store the source of the message.
outdestination: (Output) Pointer to an integer to store the destination of the message (0 to FE, or FF to broadcast).
width: (Input) Word size of the outbuffer
outbuffer: (Output) Buffer containing the received message. Only the first byte of each word in the outbuffer contains the data.
outlength: (Output) Pointer to an integer containing the received message size (in bytes).
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_EMPTY when there is no data on the fifo
  • NAI_ERROR_MESSAGE_MISMATCH when the can frame being read on the fifo is invalid.
  • NAI_ERROR_MORE_DATA when the amount of data in the can frame being read exceeds the buflen
  • NAI_ERROR_INVALID_VALUE when a parameter is invalid

◆ naibrd_CAN_Transmit()

NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_Transmit ( int32_t cardIndex,
int32_t module,
int32_t channel,
bool_t ismodeA,
int32_t msgid,
uint8_t * buffer,
int32_t length )

Queues a message to transmit on a CAN A/B channel's Tx FIFO, then enables the transmit bit in the channel's control word.

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]).
ismodeA: (Input) Mode (TRUE: CAN-A, FALSE: CAN-B.)
msgid: (Input) Message ID (11-bits for CAN-A, 29 bits for CAN-B).
buffer: (Input) Pointer to the buffer containing the message.
length: (Input) Length of the message (in bytes).
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_CAN_Transmit_Ex()

NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_Transmit_Ex ( int32_t cardIndex,
int32_t module,
int32_t channel,
bool_t ismodeA,
int32_t msgid,
uint32_t width,
void * buffer,
uint32_t length )

Queues a message to transmit on a CAN A/B channel's Tx FIFO, then enables the transmit bit in the channel's control word.

This function provides optimized performance for 32 bit buffer writes.

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]).
ismodeA: (Input) Mode (TRUE: CAN-A, FALSE: CAN-B.)
msgid: (Input) Message ID (11-bits for CAN-A, 29 bits for CAN-B).
width: (Input) Word size of the buffer.
buffer: (Input) Pointer to the buffer containing the message. Buffer should either be of type uint16_t* or uint32_t*
length: (Input) Length of the message (in bytes).
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 a param has an invalid value.

◆ naibrd_CAN_Transmit_J1939()

NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_Transmit_J1939 ( int32_t cardIndex,
int32_t module,
int32_t channel,
int32_t PGN,
int32_t priority,
int32_t destination,
uint8_t * buffer,
int32_t length )

Queues a message to transmit on a J1939 channel's Tx FIFO, then enables the transmit bit in the channel's control word.

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]).
PGN: (Input) Parameter Group Number.
priority: (Input) Priority of the message (0 being highest and 7 being lowest).
destination: (Input) Destination of the message (0 to FE, or FF to broadcast).
buffer: (Input) Pointer to the buffer containing the message.
length: (Input) Length of the message (in bytes).
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_CAN_Transmit_J1939_Ex()

NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_Transmit_J1939_Ex ( int32_t cardIndex,
int32_t module,
int32_t channel,
int32_t PGN,
int32_t priority,
int32_t destination,
uint32_t width,
void * buffer,
uint32_t length )

Queues a message to transmit on a J1939 channel's Tx FIFO, then enables the transmit bit in the channel's control word.

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]).
PGN: (Input) Parameter Group Number.
priority: (Input) Priority of the message (0 being highest and 7 being lowest).
destination: (Input) Destination of the message (0 to FE, or FF to broadcast).
width: (Input) word size of buffer.
buffer: (Input) Pointer to the buffer containing the message. Buffer should be of type uint16_t* or uint32_t*
length: (Input) Length of the message (in bytes).
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.