MX Foundation 4
Bridging

A bridge is a connection between an input port and an output port. It allows the routing of all or selected messages from one RX port to a TX port.

The user application defines which TX buffer/RX channel pair needs to be connected, but is not involved later on in the data transfer.

In addition to the redirection of traffic, a bridge can also snoop the ARINC 429 words and provides the following services:

  • Data Filtering
  • Data Modification based on mask.
Note
The bridge implementation supports the ARINC 429 channel class only.

Example

The code below shows how to create a simple bridge to connect one RX port to a TX port.

The example connects the ports using mxfBridgeCreate() and starts the routing using mxfBridgeStart().

For the sake of simplicity, in the example below, the receive channel is assumed to be an acquisition channel that was allocated previously and the transmit channel an aperiodic channel.
ar429_embedded_bridge.c

#define MAX_CHANNELS 2
HMXF_SERVER server;
HMXF_BRIDGE bridge;
HMXF_CHANNEL txChannel[MAX_CHANNELS]; // txChannel[0] = application transmit channel
// txChannel[1] = bridge channel linked to rxChannel[0]
HMXF_CHANNEL rxChannel[MAX_CHANNELS]; // rxChannel[0] = receive bridge channel
// rxChannel[1] = application receive channel
char mask[36] = "DM:XXXXXXXXXXXXXXXXXXXXXXXX10101010";
uint64 modulo=1;
uint64 i;
uint32 rc;
HMXF_BUFFER txBuffer[MAX_CHANNELS];
...
// Sets timebase to 64-bit microseconds
if (!rc)
rc = mxfSystemTimeBaseSet(server, MXF_TIMEBASE_DEVICE_USEC);
// Creates the Embedded Bridge:
// - the source is the first RX channel.
// - the destination is the transmission buffer of the second TX channel.
if(!rc)
rc = mxfBridgeCreate(rxChannel[0], txBuffer[1], &bridge);
// Sets the internal transit delay to 1.5ms
if (!rc)
rc = mxfBridgeConfigSet(bridge, 1500);
// For all data received on rxChannel[0] with a label<50,
// they are bridged to txChannel[1] on label 0252 (ARINC 429 Label Octal 1010101b=0252)
for (i=0; i<=50 && !rc; i++)
rc = mxfBridgeSelectSet(bridge, i, modulo, mask);
// Starts the bridge.
if(!rc)
rc = mxfBridgeStart(bridge);
...
// Stops the bridge process and delete the object
if (!rc)
rc = mxfBridgeStop(bridge);
if (!rc)
rc = mxfBridgeTerminate(bridge);
...
Updated 10/23/2023