MX Foundation 4
Attributes

ASYNC parameters such as bus speed, word parity and loopback can be read or modified using the mxfAttributeUint64Get(), mxfAttributeDoubleGet(), mxfAttributeUint64Set() and mxfAttributeDoubleSet() functions, passing the handle (device, module or channel) and attribute key-value pair.

See the section Attributes Reference for a description of all supported attributes.

Some other utility functions are used for getting more information about attributes;

The following code shows how to configure an ASYNC channel speed with the maximum value available.

{
MXF_ATTRIBUTE_INFO_UINT64_DETAILS info; // Attribute detail structure
HMXF_SERVER server; // Server handle
HMXF_DEVICE device; // Device handle
HMXF_MODULE module; // Module handle
HMXF_CHANNEL tx; // Channel handle
uint64 deviceIdx = 0; // Device index #0
uint64 moduleType = MXF_MODULE_ASYNC_EH; // ASYNC-ENHANCED module
uint64 chnClass = MXF_CLASS_ASYNC_ENHANCED; // ASYNC
uint64 subClass = MXF_SCLASS_TX_CHANNEL; // Transmitter
uint64 moduleCount;
uint64 channelCount;
uint32 rc;
//Connects to the server
rc=mxfServerConnect("0.0.0.0", "", "", 0, &server);
if (!rc)
//MXF initialization
rc = mxfSystemInit(server);
if(!rc)
//Obtains the first device handle
rc = mxfSystemDeviceGet(server, deviceIdx, &device);
if(!rc)
//Obtains the first module handle
rc = mxfDeviceModuleAllGet(device, moduleType, 1, &moduleCount, &module);
if(!rc && moduleCount)
//Obtains channel handle
rc = mxfModuleChannelAllGet(module, chnClass, subClass, 1, &channelCount, &tx);
if(!rc)
//Obtains the max speed value
rc = mxfAttributeInfoDetailsGet(tx, KMXF_ASYNCEH_SPEED, &info);
if(!rc)
//Sets the channel speed with the max speed value
rc = mxfAttributeUint64Set(tx, KMXF_ASYNCEH_SPEED, info.details.range.max);
}

The following code shows how to change the transmission bit-rate and parity for a given channel.

{
HMXF_SERVER server; // Server handle
HMXF_DEVICE device; // Device handle
HMXF_MODULE module; // Module handle
HMXF_CHANNEL tx; // Channel handle
uint64 deviceIdx = 0; // Device index #0
uint64 moduleType = MXF_MODULE_ASYNC_EH; // ASYNC-ENHANCED module
uint64 chnClass = MXF_CLASS_ASYNC_ENHANCED; // ASYNC
uint64 subClass = MXF_SCLASS_TX_CHANNEL; // Transmitter
uint64 moduleCount;
uint64 channelCount;
uint32 rc;
//Connects to the server
rc=mxfServerConnect("0.0.0.0", "", "", 0, &server);
if (!rc)
//MXF initialization
rc = mxfSystemInit(server);
if(!rc)
//Obtains the first device handle
rc = mxfSystemDeviceGet(server, deviceIdx, &device);
if(!rc)
//Obtains the first module handle
rc = mxfDeviceModuleAllGet(device, moduleType, 1, &moduleCount, &module);
if(!rc && moduleCount)
//Obtains channel handle
rc = mxfModuleChannelAllGet(module, chnClass, subClass, 1, &channelCount, &tx);
if (!rc)
//Sets high speed bit rate
rc = mxfAttributeUint64Set(tx, KMXF_ASYNCEH_SPEED, VMXF_ASYNCEH_SPEED_MAX);
if (!rc)
//Sets EVEN parity
rc = mxfAttributeUint64Set(tx, KMXF_ASYNCEH_PARITY, VMXF_ASYNCEH_PARITY_EVEN);
}
Updated 10/23/2023