MX Foundation 4
Channel Class

Accessing a physical ARINC 429 channel requires a handle to the channel.

A channel handle is a reference to a channel holding a physical resource (port). The channel handle is the first argument to be passed to many MXF channel oriented functions.

To get the handle to an ARINC 429 physical port regardless of the devices installed, use the mxfModuleChannelGet() function by specifying the physical port index.

You can also use the mxfModuleChannelAllGet() function with the chnClass argument MXF_CLASS_A429.

If MXF_DEVICE_ALL is specified with mxfSystemDeviceAllGet() function, all handles of detected devices are returned.

Protocol selection is made with Channel Class attribute.

int main()
{
HMXF_SERVER server;
HMXF_DEVICE device;
HMXF_MODULE module;
HMXF_CHANNEL channel;
uint64 direction, dev, mod, port;
uint64 count;
char * dir;
uint32 rc;
// Connects to the local server
rc = mxfServerConnect("0.0.0.0", "", "", FALSE, &server);
if (rc)
{
printf("Error connection 0x%08x", rc);
return rc;
}
// Inits MXF library
rc = mxfSystemInit(server);
if (!rc)
{
// Gets the device handle
rc = mxfSystemDeviceAllGet(server, MXF_DEVICE_ALL, 1, &count, &device);
if (!rc && count)
{
// Gets the module handle
rc = mxfDeviceModuleAllGet(device, MXF_MODULE_A429_EH, 1, &count, &module);
if (!rc && count)
// Gets the channel handle
rc = mxfModuleChannelAllGet(module, MXF_CLASS_A429, MXF_SCLASS_ALL, 1, &count, &channel);
}
// Queries channel infos using the channel handle
if (!rc && count)
{
rc = mxfChannelDirectionGet(channel, &direction);
// Gets the physical location of the channel
if (!rc)
{
rc = mxfChannelLocationGet(channel, &dev, &mod, &port);
// Shows information found on the channel
if (!rc)
{
printf("Channel location is Device:%llu Module:%llu Port:%llu\n", dev, mod, port);
switch (direction)
{
case MXF_CHANNEL_RX:
dir = "Rx";
break;
case MXF_CHANNEL_TX:
dir = "Tx";
break;
case MXF_CHANNEL_TXRX:
dir = "TxRx";
break;
}
printf("Channel direction is %s\n", dir);
}
}
}
}
// Checks for any previous errors
if (rc)
printf("Error code=0x%08x\n", rc);
}
Updated 10/23/2023