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

Functions

NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_MtMsgDecodeRaw (int16_t device, const uint16_t *p_buffer, naibrd_1553_msgstruct_t *p_outdecodedMessage)
 Decode the raw MT message into the given structure.
 

Detailed Description

Function Documentation

◆ naibrd_1553_MtMsgDecodeRaw()

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

Decode the raw MT message into the given structure.

Note:

  • This function does not really require the logical number of the relevant device, which isn't removed only to stay compatible with DDC.
  • This function assumes that the given buffer is at least NAIBRD_1553_MAX_MESSAGE_SIZE_MT words long.
  • This function assumes that the given buffer has been previously filled by function naibrd_1553_MtMsgGetFromStackRaw.
  • In case given buffer contains a mode code message with data, this data word is returned as the first (and only) data word.
  • If the message is not a RT-to-RT message, then no more than a single RT is involved with the message. In such cases where only a single RT is involved, if this RT isn't currently monitored by the monitoring MT device, the message will not be recorded. For an RT-to-RT message there are two RTs involved. If both RTs are not currently monitored by the monitoring MT, the message will not be recorded. If only one of the RTs is currently monitored by the monitoring MT device, the message is recorded in the command and data stacks in a somewhat distorted way. Now, since there is the possibility that this function may be called a long while after the given raw message has been recorded, and meanwhile the list of monitored RTs could have changed, this function has no way to determine if and how a given raw message has been distorted. This function does not take into account such situations, and what can result is an incorrect decoding of raw RT-to-RT messages that have been recorded. This function behaves this way in order to stay compatible with DDC.
Parameters
device: (Input) Logical Device Number (0-31).
p_buffer: (Input) A pointer to a buffer in which a raw message is stored.
p_outdecodedMessage: (Output) A pointer to a structure into which a message is decoded.
Returns
  • NAI_SUCCESS when function is completed successfully
  • NAIBRD_1553_RC_INVALID_PARAMETER when p_outdecodedMessage and/or p_buffer are null pointers