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

Functions

NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_J1939_SetAddress (int32_t cardIndex, int32_t module, int32_t channel, int32_t address)
 Set the CAN channel's SAE J1939 address. NOTE: In order for address assignment to work, all channels on the the bus need to be enabled for TX and RX so each channel can communicate with the channel requesting the address.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_J1939_GetAddress (int32_t cardIndex, int32_t module, int32_t channel, int32_t *p_outaddress, int32_t *p_outstatus)
 Get the CAN channel's SAE J1939 address.
 

Detailed Description

Function Documentation

◆ naibrd_CAN_J1939_GetAddress()

NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_J1939_GetAddress ( int32_t cardIndex,
int32_t module,
int32_t channel,
int32_t * p_outaddress,
int32_t * p_outstatus )

Get the CAN channel's SAE J1939 address.

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_outaddress: (Output) The returned SAE J1939 address.
p_outstatus: (Output) The returned SAE J1939 address status. 0: not claimed yet (in process) 1: failed to claim 2: claimed
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_J1939_SetAddress()

NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_J1939_SetAddress ( int32_t cardIndex,
int32_t module,
int32_t channel,
int32_t address )

Set the CAN channel's SAE J1939 address. NOTE: In order for address assignment to work, all channels on the the bus need to be enabled for TX and RX so each channel can communicate with the channel requesting the address.

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]).
address: (Input) The SAE J1939 address to set.
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_ADDRBOUND when claimed source address does not match desired address
  • NAI_ERROR_TIMEOUT when address was unable to be claimed in the allotted amount of time