RtfwSetMonitorEventStates

RtfwSetMonitorEventStates enables and disables RTX64 Monitoring Framework events in the Persistent Event Set.

Syntax

bool RtfwSetMonitorEventStates(
    const bool * pEventStates,
    size_t countElements
);

Parameters

pEventStates

A pointer to an array containing exactly MF_EVENT_KIND_MAX elements, indexed by the enumerators from enumeration MF_EVENT_KIND. If an element is true, the corresponding monitoring event will be enabled, otherwise it will be disabled.

countElements

Specifies the number of elements in the array pointed to by parameter pEventStates. This value must be MF_EVENT_KIND_MAX.

Return Value

The function returns true if it succeeds. Otherwise, it returns false. Call GetLastError for additional error information.

Possible error codes:

Error Code Meaning
ERROR_INVALID_PARAMETER

The function was used to disable monitoring events MF_EVENT_KIND_MARKER or MF_EVENT_KIND_DATALOST, which can never be disabled

RT_ERROR_RESTART_SUBSYSTEM The RTX64 Subsystem needs to be restarted for a configuration change to take effect. This error only occurs when the Subsystem is running.

Remarks

If the number of monitoring events (i.e., MF_EVENT_KIND_MAX) in the RTX64 Runtime where the application executes differs from the number of monitoring events in the RTX64 SDK where the application was built, this parameter helps this function avoid overrunning the end of the array or reading array elements that do not correspond to valid monitoring events in the Runtime. Therefore, it is essential that client code always set this parameter.

This function only applies to the Persistent Event Set. It does not apply to the Transient Event Set.

Use API RtMonitorControl in RTAPI.DLL to change the enabled/disabled state of events in the Transient Event Set.

Requirements

Minimum Required Version RTX64 3.4
Header RtfwAPI.h
Library RtfwAPI.lib

See Also:

RtfwSetAllMonitorEventStates

MF_EVENT_KIND