Software Library API naibrd 1.62
See all documentation at naii.docs.com
1553 Bus Monitor (MT) Functions

Functions

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_MtInitialize (int16_t swDevice, uint16_t wStackMode, uint16_t wCommandStackSize, uint16_t wDataStackSize, uint32_t dwOptions)
 Initialize the 1553 device as a bus monitor (MT) with the given configuration options.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_MtStackGetOperationalStatistics (int16_t swDevice, naiStackOperationalStatisticsStruct *sosspStackOperationalStatistics, uint16_t wStackSelector, uint16_t bIsResetOfHighestRecordedPercentageRequired)
 Return performance information about the command stack of the MT.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_MtStackSwap (int16_t swDevice)
 Swap between the active and inactive stacks of given MT device.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_MtGetInformation (int16_t swDevice, naiMtInformationStruct *mispMtInformation)
 Return information about the configuration of given MT device.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_MtStart (int16_t swDevice)
 Start MT device.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_MtStop (int16_t swDevice)
 Stop MT device.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_MtPause (int16_t swDevice)
 Temporarily pause MT device.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_MtContinue (int16_t swDevice)
 Resume MT device after a temporary pause. The message capturing activity will continue from the same internal state that it was in at the moment of pausing.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_MtMessageMonitoringEnable (int16_t swDevice, uint16_t wRtAddress, uint16_t wMessageDirection, uint32_t dwRtSubaddressMask)
 Configure the 1553 MT to selectively monitor commands specified by the RT address, message direction and subaddress mask.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_MtMessageMonitoringDisable (int16_t swDevice, uint16_t wRtAddress, uint16_t wMessageDirection, uint32_t dwRtSubaddressMask)
 Configure the 1553 MT to avoid monitoring commands specified by the RT address, message direction and subaddress mask.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_MtMessageMonitoringGetStatus (int16_t swDevice, uint16_t wRtAddress, uint16_t wMessageDirection, uint32_t *dwpRtSubaddressMask)
 Get the current subaddress mask for a given RT address and message direction.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_MtMessageDecodeRaw (int16_t swDevice, uint16_t *wapBuffer, naiDecodedMessageStructure *dmspDecodedMessage)
 Decode the raw MT message into the given structure.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_MtMessageGetFromStackRaw (int16_t swDevice, uint16_t *wapBuffer, uint16_t wBufferSize, uint16_t wStackSelector)
 Reads raw messages off of the MT command stack. Each message read is NAI_1553_MAX_MESSAGE_SIZE_MT words long regardless of the data word count. The target MT stack entry is copied into the given buffer. The data stack pointer is replaced with a word in which the LSByte contains the type of message that was read (NAI_1553_MESSAGE_*), the MSBit (bit 7) of the MSByte is set if an error has been discovered in the data words, and bits 0-6 of the MSByte contain the count of data words in the message. The data words are stored right after the stack entry, which is at offset NAI_1553_MEMORY_OBJECT_SIZE_COMMAND_STACK_ENTRY_MT. For a mode code message with data, the data word is returned as the first (and only) data word.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_MtMessageGetFromStackDecoded (int16_t swDevice, naiDecodedMessageStructure *dmspDecodedMessage, uint16_t wMessageLocationAndRemoval, uint16_t wStackSelector)
 Read from given stack of given MT device the message at given location, decode it into given structure, and purge it if so required.
 

Detailed Description


Function Documentation

◆ naibrd_1553_MtContinue()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_MtContinue ( int16_t swDevice)

Resume MT device after a temporary pause. The message capturing activity will continue from the same internal state that it was in at the moment of pausing.

Equivalent DDC definition: aceMTContinue

Parameters
swDevice: (Input) Logical Device Number (0-31).
Returns
  • NAI_SUCCESS when function is completed successfully
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_INVALID_MODE when device mode is not set to MT
  • NAI_1553_RC_INVALID_STATE when device is in an invalid state

◆ naibrd_1553_MtGetInformation()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_MtGetInformation ( int16_t swDevice,
naiMtInformationStruct * mispMtInformation )

Return information about the configuration of given MT device.

Equivalent DDC definition: aceMTGetInfo

Parameters
swDevice: (Input) Logical Device Number (0-31).
mispMtInformation: (Output) A pointer to a structure to which the required configuration information is written.
Returns
  • NAI_SUCCESS when function is completed successfully
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_INVALID_MODE when device mode is not set to MT
  • NAI_1553_RC_INVALID_STATE when device is in an invalid state
  • NAI_1553_RC_INVALID_PARAMETER when the mispMtInformation pointer is null

◆ naibrd_1553_MtInitialize()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_MtInitialize ( int16_t swDevice,
uint16_t wStackMode,
uint16_t wCommandStackSize,
uint16_t wDataStackSize,
uint32_t dwOptions )

Initialize the 1553 device as a bus monitor (MT) with the given configuration options.

Parameters
swDevice: (Input) Logical Device Number (0-31).
wStackMode: (Input) Stack Mode (NAI_1553_MT_STACK_OPT_SINGLE or NAI_1553_MT_STACK_OPT_DOUBLE).
wCommandStackSize: (Input) Size of command stack.
NAI_1553_MT_CMD_STACK_SIZE_256        (DDC: ACE_MT_CMDSTK_256)
256 words (64 messages)

NAI_1553_MT_CMD_STACK_SIZE_1024       (DDC: ACE_MT_CMDSTK_1K)
1024 words (256 messages)

NAI_1553_MT_CMD_STACK_SIZE_4096       (DDC: ACE_MT_CMDSTK_4K)
4096 words (1024 messages)

NAI_1553_MT_CMD_STACK_SIZE_16384      (DDC: ACE_MT_CMDSTK_16K)
16384 words (4096 messages)
wDataStackSize: (Input) Size of data stack.
NAI_1553_MT_DATA_STACK_SIZE_512       (DDC: ACE_MT_DATASTK_512)
512 words

NAI_1553_MT_DATA_STACK_SIZE_1024      (DDC: ACE_MT_DATASTK_1K)
1024 words

NAI_1553_MT_DATA_STACK_SIZE_2048      (DDC: ACE_MT_DATASTK_2K)
2048 words

NAI_1553_MT_DATA_STACK_SIZE_4096      (DDC: ACE_MT_DATASTK_4K)
4096 words

NAI_1553_MT_DATA_STACK_SIZE_8192      (DDC: ACE_MT_DATASTK_8K)
8192 words

NAI_1553_MT_DATA_STACK_SIZE_16384     (DDC: ACE_MT_DATASTK_16K)
16384 words

NAI_1553_MT_DATA_STACK_SIZE_32768     (DDC: ACE_MT_DATASTK_32K)
32768 words
dwOptions: (Input) MT options (NAI_1553_MT_OPT_1553A_MODE_CODES_ENABLED or 0).
Returns
  • NAI_SUCCESS when function is completed successfully
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_INVALID_MODE when device mode is not set to MT
  • NAI_1553_RC_INVALID_STATE when device is in an invalid state
  • NAI_1553_RC_MT_INVALID_STACK_OPTION when an invalid wStackMode is specified
  • NAI_1553_RC_MT_INVALID_COMMAND_STACK_SIZE when an invalid wCommandStackSize is specified
  • NAI_1553_RC_MT_INVALID_DATA_STACK_SIZE when an invalid wDataStackSize is specified

◆ naibrd_1553_MtMessageDecodeRaw()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_MtMessageDecodeRaw ( int16_t swDevice,
uint16_t * wapBuffer,
naiDecodedMessageStructure * dmspDecodedMessage )

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 NAI_1553_MAX_MESSAGE_SIZE_MT words long.
  • This function assumes that the given buffer has been previously filled by function naibrd_1553_MtMessageGetFromStackRaw.
  • 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
swDevice: (Input) Logical Device Number (0-31).
wapBuffer: (Input) A pointer to a buffer in which a raw message is stored.
dmspDecodedMessage: (Output) A pointer to a structure into which a message is decoded.
Returns
  • NAI_SUCCESS when function is completed successfully
  • NAI_1553_RC_INVALID_PARAMETER when dmspDecodedMessage and/or wapBuffer are null pointers

◆ naibrd_1553_MtMessageGetFromStackDecoded()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_MtMessageGetFromStackDecoded ( int16_t swDevice,
naiDecodedMessageStructure * dmspDecodedMessage,
uint16_t wMessageLocationAndRemoval,
uint16_t wStackSelector )

Read from given stack of given MT device the message at given location, decode it into given structure, and purge it if so required.

Equivalent DDC definition: aceMTGetStkMsgDecoded

Parameters
swDevice: (Input) Logical Device Number (0-31).
dmspDecodedMessage: (Output) A pointer to a structure into which a message is decoded.
wMessageLocationAndRemoval: (Input) Location in the stack to read from and removal instructions. NAI_1553_MT_MESSAGE_LOC_NEXT_PURGE NAI_1553_MT_MESSAGE_LOC_NEXT_NO_PURGE NAI_1553_MT_MESSAGE_LOC_LATEST_PURGE NAI_1553_MT_MESSAGE_LOC_LATEST_NO_PURGE
wStackSelector: (Input) A selector that specifies the stack to read from. NAI_1553_MT_STACK_ACTIVE NAI_1553_MT_STACK_INACTIVE NAI_1553_MT_STACK_STACK_A NAI_1553_MT_STACK_STACK_B
Returns
  • 1 if the device has been initialized successfully and a new message was read and decoded
  • 0 if the device has been initialized successfully and no new message was read
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_INVALID_MODE when device mode is not set to MT or RTMT
  • NAI_1553_RC_INVALID_STATE when device is in an invalid state
  • NAI_1553_RC_INVALID_PARAMETER when wMessageLocationAndRemoval is invalid and/or dmspDecodedMessage is a null pointer
  • NAI_1553_RC_MT_INVALID_STACK_SELECTOR when wStackSelector is invalid

◆ naibrd_1553_MtMessageGetFromStackRaw()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_MtMessageGetFromStackRaw ( int16_t swDevice,
uint16_t * wapBuffer,
uint16_t wBufferSize,
uint16_t wStackSelector )

Reads raw messages off of the MT command stack. Each message read is NAI_1553_MAX_MESSAGE_SIZE_MT words long regardless of the data word count. The target MT stack entry is copied into the given buffer. The data stack pointer is replaced with a word in which the LSByte contains the type of message that was read (NAI_1553_MESSAGE_*), the MSBit (bit 7) of the MSByte is set if an error has been discovered in the data words, and bits 0-6 of the MSByte contain the count of data words in the message. The data words are stored right after the stack entry, which is at offset NAI_1553_MEMORY_OBJECT_SIZE_COMMAND_STACK_ENTRY_MT. For a mode code message with data, the data word is returned as the first (and only) data word.

Equivalent DDC definition: aceMTGetStkMsgsRaw

Parameters
swDevice: (Input) Logical Device Number (0-31).
wapBuffer: (Output) A pointer to a buffer in which a raw message is stored.
wBufferSize: (Input) The size (in words) of the data buffer that is pointed by wapBuffer (>=NAI_1553_MAX_MESSAGE_SIZE_MT).
wStackSelector: (Input) A selector that specifies the stack to read from (NAI_1553_MT_STACK_ACTIVE, NAI_1553_MT_STACK_INACTIVE, NAI_1553_MT_STACK_STACK_A or NAI_1553_MT_STACK_STACK_B).
Returns
  • A non-negative number indicating the number of messages read, if the device has been initialized successfully
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_INVALID_MODE when device mode is not set to MT or RTMT
  • NAI_1553_RC_INVALID_STATE when device is in an invalid state
  • NAI_1553_RC_INVALID_PARAMETER when dmspDecodedMessage and/or wapBuffer are null pointers
  • NAI_1553_RC_INVALID_BUFFER when wBufferSize is invalid
  • NAI_1553_RC_MT_INVALID_STACK_SELECTOR when wStackSelector is invalid

◆ naibrd_1553_MtMessageMonitoringDisable()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_MtMessageMonitoringDisable ( int16_t swDevice,
uint16_t wRtAddress,
uint16_t wMessageDirection,
uint32_t dwRtSubaddressMask )

Configure the 1553 MT to avoid monitoring commands specified by the RT address, message direction and subaddress mask.

Parameters
swDevice: (Input) Logical Device Number (0-31).
wRtAddress: (Input) RT Address (0-31).
wMessageDirection: (Input) RT-related message direction (NAI_1553_MT_FILTER_RX, NAI_1553_MT_FILTER_TX or NAI_1553_MT_FILTER_ALL).
dwRtSubaddressMask: (Input) OR'ed combination of subaddresses 0-31, where bit i corresponds to subaddress i.
Returns
  • NAI_SUCCESS when function is completed successfully
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_INVALID_MODE when device mode is not set to MT or RTMT
  • NAI_1553_RC_INVALID_STATE when device is in an invalid state
  • NAI_1553_RC_INVALID_RT_ADDRESS when invalid wRtAddress is specified
  • NAI_1553_RC_INVALID_DIRECTION_BIT when invalid wMessageDirection parameter is specified

◆ naibrd_1553_MtMessageMonitoringEnable()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_MtMessageMonitoringEnable ( int16_t swDevice,
uint16_t wRtAddress,
uint16_t wMessageDirection,
uint32_t dwRtSubaddressMask )

Configure the 1553 MT to selectively monitor commands specified by the RT address, message direction and subaddress mask.

Parameters
swDevice: (Input) Logical Device Number (0-31).
wRtAddress: (Input) RT Address (0-31).
wMessageDirection: (Input) RT-related message direction (NAI_1553_MT_FILTER_RX, NAI_1553_MT_FILTER_TX or NAI_1553_MT_FILTER_ALL).
dwRtSubaddressMask: (Input) OR'ed combination of subaddresses 0-31, where bit i corresponds to subaddress i.
Returns
  • NAI_SUCCESS when function is completed successfully
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_INVALID_MODE when device mode is not set to MT or RTMT
  • NAI_1553_RC_INVALID_STATE when device is in an invalid state
  • NAI_1553_RC_INVALID_RT_ADDRESS when invalid wRtAddress is specified
  • NAI_1553_RC_INVALID_DIRECTION_BIT when invalid wMessageDirection parameter is specified

◆ naibrd_1553_MtMessageMonitoringGetStatus()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_MtMessageMonitoringGetStatus ( int16_t swDevice,
uint16_t wRtAddress,
uint16_t wMessageDirection,
uint32_t * dwpRtSubaddressMask )

Get the current subaddress mask for a given RT address and message direction.

Parameters
swDevice: (Input) Logical Device Number (0-31).
wRtAddress: (Input) RT Address (0-31).
wMessageDirection: (Input) RT-related message direction (NAI_1553_MT_FILTER_RX or NAI_1553_MT_FILTER_TX).
dwpRtSubaddressMask: (Output) OR'ed combination of subaddresses 0-31, where bit i corresponds to subaddress i.
Returns
  • NAI_SUCCESS when function is completed successfully
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_INVALID_MODE when device mode is not set to MT or RTMT
  • NAI_1553_RC_INVALID_STATE when device is in an invalid state
  • NAI_1553_RC_INVALID_RT_ADDRESS when device is set to an invalid RT address
  • NAI_1553_RC_INVALID_DIRECTION_BIT when invalid wMessageDirection parameter is specified
  • NAI_1553_RC_INVALID_PARAMETER when dwpRtSubaddressMask pointer is null

◆ naibrd_1553_MtPause()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_MtPause ( int16_t swDevice)

Temporarily pause MT device.

Equivalent DDC definition: aceMTPause

Parameters
swDevice: (Input) Logical Device Number (0-31).
Returns
  • NAI_SUCCESS when function is completed successfully
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_INVALID_MODE when device mode is not set to MT
  • NAI_1553_RC_INVALID_STATE when device is in an invalid state

◆ naibrd_1553_MtStackGetOperationalStatistics()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_MtStackGetOperationalStatistics ( int16_t swDevice,
naiStackOperationalStatisticsStruct * sosspStackOperationalStatistics,
uint16_t wStackSelector,
uint16_t bIsResetOfHighestRecordedPercentageRequired )

Return performance information about the command stack of the MT.

Parameters
swDevice: (Input) Logical Device Number (0-31).
sosspStackOperationalStatistics: (Output) A pointer to the stack operational statistics structure into which the required operational statistics are written.
wStackSelector: (Input) A selector that specifies the stack(s) whose information is required.
NAI_1553_MT_STACK_ACTIVE        (DDC: ACE_MT_STKLOC_ACTIVE)
Use the active stack

NAI_1553_MT_STACK_INACTIVE      (DDC: ACE_MT_STKLOC_INACTIVE)
Use the inactive stack

NAI_1553_MT_STACK_STACK_A       (DDC: ACE_MT_STKLOC_STKA)
Use stack A

NAI_1553_MT_STACK_STACK_B       (DDC: ACE_MT_STKLOC_STKB)
Use stack B
bIsResetOfHighestRecordedPercentageRequired: (Input) A flag that says whether the record of the highest percentage reached by now should be reset.
Returns
  • NAI_SUCCESS when function is completed successfully
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_INVALID_MODE when device mode is not set to MT or RTMT
  • NAI_1553_RC_INVALID_STATE when device is in an invalid state
  • NAI_1553_RC_INVALID_PARAMETER when wStackSelector is invalid or sosspStackOperationalStatistics is null
  • NAI_1553_RC_OPERATIONAL_STATISTICS_NOT_ENABLED when operational statistics is not enabled on the device

◆ naibrd_1553_MtStackSwap()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_MtStackSwap ( int16_t swDevice)

Swap between the active and inactive stacks of given MT device.

Equivalent DDC definition: aceMTSwapStks

Parameters
swDevice: (Input) Logical Device Number (0-31).
Returns
  • NAI_1553_MT_ACTIVE_STACK_A or NAI_1553_MT_ACTIVE_STACK_B to indicate the new active stack, if function is completed successfully
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_INVALID_MODE when device mode is not set to MT
  • NAI_1553_RC_INVALID_STATE when device is in an invalid state

◆ naibrd_1553_MtStart()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_MtStart ( int16_t swDevice)

Start MT device.

Equivalent DDC definition: aceMTStart

Parameters
swDevice: (Input) Logical Device Number (0-31).
Returns
  • NAI_SUCCESS when function is completed successfully
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_INVALID_MODE when device mode is not set to MT
  • NAI_1553_RC_INVALID_STATE when device is in an invalid state

◆ naibrd_1553_MtStop()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_MtStop ( int16_t swDevice)

Stop MT device.

Equivalent DDC definition: aceMTStop

Parameters
swDevice: (Input) Logical Device Number (0-31).
Returns
  • NAI_SUCCESS when function is completed successfully
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_INVALID_MODE when device mode is not set to MT
  • NAI_1553_RC_INVALID_STATE when device is in an invalid state