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

Functions

NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_RtMsgGetFromStackRaw (int16_t device, uint16_t *p_outbuffer, uint16_t bufferLength)
 Reads raw messages off of the RT command stack. Each message read is NAIBRD_1553_MAX_MESSAGE_SIZE_RT words long (4 words stack entry, 32 words data) regardless of the data word count. Messages will be read until the internal pointer value is equal to the current command stack pointer value, or until the words read surpass bufferLength. The data stack pointer (3rd word in message) is replaced with a word such that the MSByte contains the count of data words for the read message and the LSByte contains the type of message that was read.
 
NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_RtMsgDecodeRaw (int16_t device, const uint16_t *p_buffer, naibrd_1553_msgstruct_t *p_outdecodedMessage)
 Decodes a raw message into a message structure.
 
NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_RtMsgGetFromStackDecoded (int16_t device, naibrd_1553_msgstruct_t *p_outdecodedMessage, uint16_t messageLocationAndRemoval)
 Gets a message from the RT Command Stack and decodes it into a message structure.
 

Detailed Description

Function Documentation

◆ naibrd_1553_RtMsgDecodeRaw()

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

Decodes a raw message into a message structure.

Parameters
device: (Input) Logical Device Number (0-31).
p_buffer: (Input) Pointer to a buffer containing the raw message.
p_outdecodedMessage: (Output) Pointer to a naibrd_1553_msgstruct_t that contains the decoded message. This structure contains the following member variables:
* 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 the p_outdecodedMessage pointer and/or p_buffer are null

◆ naibrd_1553_RtMsgGetFromStackDecoded()

NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_RtMsgGetFromStackDecoded ( int16_t device,
naibrd_1553_msgstruct_t * p_outdecodedMessage,
uint16_t messageLocationAndRemoval )

Gets a message from the RT Command Stack and decodes it into a message structure.

Parameters
device: (Input) Logical Device Number (0-31).
p_outdecodedMessage: (Output) Pointer to a naibrd_1553_msgstruct_t that will contain the decoded message. This structure contains the following member variables:
* 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
* 
messageLocationAndRemoval: (Input) Location in the stack to read from and removal instructions. NAIBRD_1553_RT_MESSAGE_LOC_NEXT_PURGE NAIBRD_1553_RT_MESSAGE_LOC_NEXT_NO_PURGE NAIBRD_1553_RT_MESSAGE_LOC_LATEST_PURGE NAIBRD_1553_RT_MESSAGE_LOC_LATEST_NO_PURGE
Returns
  • 1 when a message was read and decoded
  • 0 when no message is available and no error occurred
  • NAIBRD_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAIBRD_1553_RC_INVALID_MODE when device mode is not set to RT or RT/MT
  • NAIBRD_1553_RC_INVALID_STATE when device is in an invalid state
  • NAIBRD_1553_RC_INVALID_PARAMETER when the p_outdecodedMessage pointer is null and/or messageLocationAndRemoval is invalid

◆ naibrd_1553_RtMsgGetFromStackRaw()

NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_RtMsgGetFromStackRaw ( int16_t device,
uint16_t * p_outbuffer,
uint16_t bufferLength )

Reads raw messages off of the RT command stack. Each message read is NAIBRD_1553_MAX_MESSAGE_SIZE_RT words long (4 words stack entry, 32 words data) regardless of the data word count. Messages will be read until the internal pointer value is equal to the current command stack pointer value, or until the words read surpass bufferLength. The data stack pointer (3rd word in message) is replaced with a word such that the MSByte contains the count of data words for the read message and the LSByte contains the type of message that was read.

Parameters
device: (Input) Logical Device Number (0-31).
p_outbuffer: (Output) Pointer to a buffer where the raw messages are stored.
bufferLength: (Input) Length (in words) of the data buffer pointed to by p_outbuffer.
Returns
  • A non-negative number indicating the number of messages read, if the device has been initialized 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 RT or RT/MT
  • NAIBRD_1553_RC_INVALID_STATE when device is in an invalid state
  • NAIBRD_1553_RC_INVALID_PARAMETER when the p_outbuffer pointer is null and/or bufferLength is less than NAIBRD_1553_MAX_MESSAGE_SIZE_RT