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

Functions

NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_BcGetMsgByIdRaw (int16_t device, int16_t messageId, uint16_t *p_outbuffer, uint16_t isPurgeRequired)
 Reads a BC message (specified by the message ID) into a user supplied buffer in raw format.
 
NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_BcMsgGetByIdDecoded (int16_t device, int16_t messageId, naibrd_1553_msgstruct_t *p_outdecodedMessage, uint16_t isPurgeRequired)
 Read either the next unread message or the latest message received on the stack based on the message ID.
 
NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_BcMsgDecodeRaw (int16_t device, const uint16_t *p_buffer, naibrd_1553_msgstruct_t *p_outdecodedMessage)
 Decode a BC message in raw format into a decoded message structure.
 

Detailed Description

Function Documentation

◆ naibrd_1553_BcGetMsgByIdRaw()

NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_BcGetMsgByIdRaw ( int16_t device,
int16_t messageId,
uint16_t * p_outbuffer,
uint16_t isPurgeRequired )

Reads a BC message (specified by the message ID) into a user supplied buffer in raw format.

Parameters
device: (Input) Logical Device Number (0-31).
messageId: (Input) Unique message ID.
p_outbuffer: (Output) User supplied buffer that will contain the raw message.
isPurgeRequired: (Input) 1 = Purge message after reading. 0 = Do not purge.
Returns
  • 1 when function is completed successfully
  • NAIBRD_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAIBRD_1553_RC_INVALID_MODE when device mode is not set to BC
  • NAIBRD_1553_RC_INVALID_STATE when device is in an invalid state
  • NAIBRD_1553_RC_INVALID_PARAMETER when an invalid messageId is specified, or when a message with messageId is not defined, or when p_buffer is null

◆ naibrd_1553_BcMsgDecodeRaw()

NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_BcMsgDecodeRaw ( int16_t device,
const uint16_t * p_buffer,
naibrd_1553_msgstruct_t * p_outdecodedMessage )

Decode a BC message in raw format into a decoded message structure.

Parameters
device: (Input) Logical Device Number (0-31).
p_buffer: (Input) Buffer containing the raw 16-bit messages.
p_outdecodedMessage: (Output) Decoded Message Structure containing the following members:
* type                         Message type
* blockStatus                 Block status word
* timeTag                      Time tag - 1st word
* commandWord1                 First command word
* commandWord2                 Second command word
* isCommandWord1Relevant       A flag that says if first command word is relevant (always NAI_TRUE)
* isCommandWord2Relevant       A flag that says if second command word is relevant
* status1                      The [first] status word that's actually identified on the bus
* status2                      The second status word that's actually identified on the bus
* isStatus1Relevant            A flag that says if first status word is relevant
* isStatus2Relevant            A flag that says if second status word is relevant
* dataWordCount                The number of valid data words that have been received for this message
* data[32]                     An Array containing the data words
* bcControlWord                Control word (BC only)
* bcGapTime                    Message gap time (BC only)
* bcLoopbackWord1              The echo of the last word transmitted by the BC (BC only)
* unused01                     An unused field, kept only in order to be compatible with DDC
* isBcLoopbackWord1Relevant    A flag that says if first loopback word is relevant (BC only)
* unused02                     An unused field, kept only in order to be compatible with DDC
* 
Returns
  • NAI_SUCCESS when function is completed successfully
  • NAIBRD_1553_RC_INVALID_PARAMETER when p_outdecodedMessage or p_outbuffer is null

◆ naibrd_1553_BcMsgGetByIdDecoded()

NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_BcMsgGetByIdDecoded ( int16_t device,
int16_t messageId,
naibrd_1553_msgstruct_t * p_outdecodedMessage,
uint16_t isPurgeRequired )

Read either the next unread message or the latest message received on the stack based on the message ID.

Parameters
device: (Input) Logical Device Number (0-31).
messageId: (Input) Unique message ID.
p_outdecodedMessage: (Output) Decoded Message Structure containing the following members:
* type                         Message type
* blockStatus                 Block status word
* timeTag                      Time tag - 1st word
* commandWord1                 First command word
* commandWord2                 Second command word
* isCommandWord1Relevant       A flag that says if first command word is relevant (always NAI_TRUE)
* isCommandWord2Relevant       A flag that says if second command word is relevant
* status1                      The [first] status word that's actually identified on the bus
* status2                      The second status word that's actually identified on the bus
* isStatus1Relevant            A flag that says if first status word is relevant
* isStatus2Relevant            A flag that says if second status word is relevant
* dataWordCount                The number of valid data words that have been received for this message
* data[32]                     An Array containing the data words
* bcControlWord                Control word (BC only)
* bcGapTime                    Message gap time (BC only)
* bcLoopbackWord1              The echo of the last word transmitted by the BC (BC only)
* unused01                     An unused field, kept only in order to be compatible with DDC
* isBcLoopbackWord1Relevant    A flag that says if first loopback word is relevant (BC only)
* unused02                     An unused field, kept only in order to be compatible with DDC
* 
isPurgeRequired: (Input) 1 = Purge message after reading. 0 = Do not purge.
Returns
  • 1 when function is completed successfully
  • NAIBRD_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAIBRD_1553_RC_INVALID_MODE when device mode is not set to BC
  • NAIBRD_1553_RC_INVALID_STATE when device is in an invalid state
  • NAIBRD_1553_RC_INVALID_PARAMETER when an invalid messageId is specified, the message associated with messageId is undefined or p_outdecodedMessage is null