MX Foundation 4
|
Functions | |
uint32 | mxfSystemInitAttributeUint64CallbackHandler (HMXF_SERVER server, MXF_SYSTEM_INIT_ATTRIBUTE_UINT64_HANDLER handler) |
uint32 | mxfSystemInitAttributeUint64CallbackHandlerWithContext (void *context, HMXF_SERVER server, MXF_SYSTEM_INIT_ATTRIBUTE_UINT64_HANDLER_WITH_CONTEXT handler) |
uint32 | mxfSystemInit (HMXF_SERVER server) |
uint32 | mxfSystemsInit (uint64 count, HMXF_SERVER servers[]) |
uint32 | mxfSystemTerminate (HMXF_SERVER server) |
uint32 | mxfSystemsTerminate (uint64 count, HMXF_SERVER servers[]) |
uint32 mxfSystemInitAttributeUint64CallbackHandler | ( | HMXF_SERVER | server, |
MXF_SYSTEM_INIT_ATTRIBUTE_UINT64_HANDLER | handler | ||
) |
Allows the changing of some device initialization attribute values before MXF library initialization. This function must be called before MX-Foundation's library initialization (before the mxfSystemInit() or mxfSystemResourcesInit() function).
This handler is mandatory to change the value of the attributes below. The other attributes value must be changed after MX-Foundation library initialization using the mxfAttributeUint64Set() or mxfAttributeDoubleSet() functions.
The callback is called multiple times, once for each attribute that can be changed at initialization time for each channel/module/device combination.
[in] | server | server handle |
[in] | handler | attribute callback handler function to update the attribute value |
The callback handler function is defined as follow:
[in] server: server handle
[in] deviceIndex: index of device on the server
[in] moduleIndex: index of module on the device
[in] channelIndex: index of channel on the module
[in] attrib: attribute to be changed.
The attributes that can be modified are listed here.
[in/out] value: Gives the current value. Can be overridden with the new value that must be set. If a new value needs to be set, the handler must return TRUE, otherwise the new value will be ignored and the attribute will keep the current value.
This attribute reserves a memory area for an embedded application code and data that will be loaded dynamically by the client application on the device using the mxfEmbeddedCodeDownload() and mxfEmbeddedDataDownload() functions. In the handler, the attrib parameter to be changed is KMXF_DEVICE_EMBEDDED_CODEANDDATA_SIZE. The parameters server and deviceIndex can be used to identify the device. The parameters moduleIndex and channelIndex are not used.
The supported range is:
Range | Value (bytes) |
---|---|
Minimum | 0 (default) |
Maximum | 524288 |
This attribute reserves a shared memory area for an embedded application. In the handler, the attrib parameter to be changed is KMXF_DEVICE_EMBEDDED_SHARED_SIZE. The parameters server and deviceIndex can be used to identify the device. The parameters moduleIndex and channelIndex are not used.
The supported range is:
Range | Value (bytes) |
---|---|
Minimum | 0 (default) |
Maximum | 524288 |
This attribute defines the number of TX embedded queues allocated at initialization. In the handler, the attrib parameter to be changed is KMXF_DEVICE_EMBEDDED_TX_QUEUE_NUM. The parameters server and deviceIndex can be used to identify the device. The parameters moduleIndex and channelIndex are not used.
The supported range is:
Range | Value |
---|---|
Minimum | 0 (default) |
Maximum | 64 |
This attribute defines the number of RX embedded queues allocated at initialization. In the handler, the attrib parameter to be changed is KMXF_DEVICE_EMBEDDED_RX_QUEUE_NUM. The parameters server and deviceIndex can be used to identify the device. The parameters moduleIndex and channelIndex are not used.
The supported range is:
Range | Value |
---|---|
Minimum | 0 (default) |
Maximum | 64 |
This attribute defines the number of communication queues allocated at initialization. These queues are used for exchanging between a client application and an embedded application. In the handler, the attrib parameter to be changed is KMXF_DEVICE_EMBEDDED_COMM_QUEUE_NUM. The size of the queues are defined after the application is started with the mxfDeviceCommBufferAlloc() function. The parameters server and deviceIndex can be used to identify the device. The parameters moduleIndex and channelIndex are not used.
The supported range is:
Range | Value |
---|---|
Minimum | 0 (default) |
Maximum | 8 |
This attribute is used to change the default channel class when a device is reset. For instance, a device supporting the ASYNC channel class can select between ASYNC and CSDB. Set value to the desired channel class. server, deviceIndex, moduleIndex and channelIndex can be used to identify the channel.
This attribute is used to enable/disable the physical port of an ASYNC ENHANCED transmit channel. Set value to FALSE to disable the transmitter and to TRUE to enable it. When the transmitter is disabled, everything will work exactly the same as if it's enabled, but the data will not be sent. This attribute as no effect when internal loopback is enabled. server, deviceIndex, moduleIndex and channelIndex can be used to identify the channel.
The example below illustrates the handler basic structure:
uint32 mxfSystemInitAttributeUint64CallbackHandlerWithContext | ( | void * | context, |
HMXF_SERVER | server, | ||
MXF_SYSTEM_INIT_ATTRIBUTE_UINT64_HANDLER_WITH_CONTEXT | handler | ||
) |
Same as mxfSystemInitAttributeUint64CallbackHandler() but with an extra context parameter.
Allows the changing of some device initialization attribute values before MXF library initialization. This function must be called before MX-Foundation's library initialization (before the mxfSystemInit() or mxfSystemResourcesInit() function).
This handler is mandatory to change the value of the attributes below. The other attributes value must be changed after MX-Foundation library initialization using the mxfAttributeUint64Set() or mxfAttributeDoubleSet() functions.
The callback is called multiple times, once for each attribute that can be changed at initialization time for each channel/module/device combination.
[in] | context | pointer to context that will be passed in the callback |
[in] | server | server handle |
[in] | handler | attribute callback handler function to update the attribute value |
The callback handler function is defined as follow:
[in] context: pointer to context
[in] server: server handle
[in] deviceIndex: index of device on the server
[in] moduleIndex: index of module on the device
[in] channelIndex: index of channel on the module
[in] attrib: attribute to be changed.
The attributes that can be modified are listed here.
[in/out] value: Gives the current value. Can be overridden with the new value that must be set. If a new value needs to be set, the handler must return TRUE, otherwise the new value will be ignored and the attribute will keep the current value.
uint32 mxfSystemInit | ( | HMXF_SERVER | server | ) |
Resets the hardware device, initializes the library and allocates the base system resources. During the initialization, after the devices are detected, the firmware file is automatically loaded. When a device is configured to run in Ethernet mode, the firmware, library, server and configuration files are automatically loaded from the on-board flash, otherwise only the firmware is uploaded from the client system.
If an application needs to use the MXF library while another application is running, it must call mxfSystemResourcesInit() without the MXF_SYSTEM_OPTION_RESET_DEVICES option bit instead of mxfSystemInit().
Timebase is set to MXF_TIMEBASE_DEVICE_NSEC by this function.
If the function returns MAXT_ERROR_MANY_MASTER, the application can continue its execution, this error is a non-fatal error.
[in] | server | server handle |
uint32 mxfSystemsInit | ( | uint64 | count, |
HMXF_SERVER | servers[] | ||
) |
Resets the hardware devices, initializes the library, allocates the base system resources and synchronizes the devices. During the initialization, after the devices are detected, the firmware file is automatically loaded. When a device is configured to run in Ethernet mode, the firmware, library, server and configuration files are automatically loaded from the on-board flash, otherwise only the firmware is uploaded from the client system.
Timebase is set to MXF_TIMEBASE_DEVICE_NSEC by this function.
This function can't be called with user privileges.
[in] | count | number of server handle servers |
[in] | servers | array of server handle |
uint32 mxfSystemTerminate | ( | HMXF_SERVER | server | ) |
Resets the device and releases the system resources allocated by the library.
If you want to terminate the library without resetting the device (because some other applications are running) the mxfSystemResourcesRelease() function should be used instead.
[in] | server | server handle |
uint32 mxfSystemsTerminate | ( | uint64 | count, |
HMXF_SERVER | servers[] | ||
) |
Resets the devices and releases the system resources allocated by the library.
This function can't be called with user privileges.
[in] | count | number of server handle servers |
[in] | servers | array of server handle |