RtfwSetMonitorEventStates

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

Syntax

Copy
bool RtfwSetMonitorEventStates(
    [in]    const bool * pEventStates,
    [in]    size_t countElements
);

Parameters

[in] 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.

[in] countElements

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

Return Value

If the function succeeds, it returns TRUE. If the function fails, it returns FALSE. Call GetLastError to obtain an error code.

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 wRTOS 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 wRTOS Runtime where the application executes differs from the number of monitoring events in the wRTOS 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 sets 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 supported version Header Library

wRTOS 1.0 SDK

RtfwApi.h

RtfwApi.lib

See Also: