RMM API 2.0.0
Loading...
Searching...
No Matches
RMMSideChannels Class Reference

Class to manage the configuration and data handling of side channels. More...

#include <RMMSideChannels.h>

Collaboration diagram for RMMSideChannels:

Public Member Functions

 RMMSideChannels (RMMRegisterAccess &RMMRegs)
 Constructor for the RMMSideChannels class.
 
rmmStatus fillSideChannelsfromJson (json &settings)
 Populates side channel configurations from a JSON object.
 
rmmStatus configSideChannels ()
 Configures all side channels based on stored settings.
 
rmmStatus getSideChannelStats (SideChannelStatsData &stats)
 Retrieves statistics for the side channels.
 
rmmStatus fetchSideChannelData (uint8_t sideChIdx, SideChannelsData &data)
 Fetches and populates the data for a specific side channel.
 

Public Attributes

RMMLog rmmLog
 Log handler for RMMSideChannel messages.
 

Detailed Description

Class to manage the configuration and data handling of side channels.

The RMMSideChannels class provides methods to configure, manage, and retrieve statistics for side channels. It supports reading configurations from JSON, enabling/disabling side channels, and fetching real-time side channel data.

Constructor & Destructor Documentation

◆ RMMSideChannels()

RMMSideChannels::RMMSideChannels ( RMMRegisterAccess & RMMRegs)

Constructor for the RMMSideChannels class.

Parameters
[in]RMMRegsReference to an RMMRegisterAccess object for register access.

Member Function Documentation

◆ configSideChannels()

rmmStatus RMMSideChannels::configSideChannels ( )

Configures all side channels based on stored settings.

This method disables both side channels before applying configurations to ensure synchronization with the JSON configuration file. It then iterates through all side channels and applies their respective settings.

Returns
rmmStatus Returns rmmSuccess on successful configuration, or rmmError if any side channel fails to configure.

◆ fetchSideChannelData()

rmmStatus RMMSideChannels::fetchSideChannelData ( uint8_t sideChIdx,
SideChannelsData & data )

Fetches and populates the data for a specific side channel.

Parameters
[in]sideChIdxThe index of the side channel to fetch data for (0-based). Valid range is 0 to NUMBER_SIDE_CHANNELS - 1.
[out]dataA reference to a SideChannelsData structure where the fetched data will be stored.
Returns
rmmSuccess if the operation was successful.
rmmError if the sideChIdx is out of the valid range or any other error occurs.

◆ fillSideChannelsfromJson()

rmmStatus RMMSideChannels::fillSideChannelsfromJson ( json & settings)

Populates side channel configurations from a JSON object.

This method parses a JSON object containing side channel settings and initializes the sideChannels structure with the extracted values. It validates the number of configured side channels and ensures that side channel IDs are within the allowed range.

Parameters
[in]settingsA reference to a JSON object containing the side channel configuration.
Returns
rmmStatus Returns rmmSuccess upon successful configuration.
Exceptions
std::invalid_argumentif no side channel configurations are found or if the number of defined side channels exceeds NUMBER_SIDE_CHANNELS.
std::runtime_errorif a side channel ID is invalid or out of range.

◆ getSideChannelStats()

rmmStatus RMMSideChannels::getSideChannelStats ( SideChannelStatsData & stats)

Retrieves statistics for the side channels.

This method reads the frequency and overflow status for each side channel.

Parameters
[out]statsA reference to a SideChannelStatsData structure where the retrieved statistics will be stored.
Returns
rmmStatus Returns rmmSuccess upon successful retrieval of statistics.

The documentation for this class was generated from the following files: