RtfwSetMonitorEventStates
RtfwSetMonitorEventStates enables and disables wRTOS Monitoring events in the Persistent Event Set.
Syntax
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.
- The Persistent Event Set is the enabled/disabled state of all monitoring events that are used to configure the state of monitor events on Subsystem start.
- The Transient Event Set is the current enabled/disabled states of all monitoring events in use by the wRTOS Subsystem. At Subsystem start, the Transient Event Set is initialized to be a copy of the Persistent Event Set. The Transient Event Set can then be modified by the wRTOS Monitor or RTAPI calls. At Subsystem stop, the Transient Event Set is destroyed.
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: