Doxygen with github
Loading...
Searching...
No Matches
ksf::comps::ksMqttConfigProvider Class Reference

A component that manages MQTT-related configuration. More...

#include <ksMqttConfigProvider.h>

+ Inheritance diagram for ksf::comps::ksMqttConfigProvider:

Public Member Functions

virtual const std::size_t getInstanceType () const
 Retrieves type ID of the object.
 
virtual bool isA (const std::size_t id) const
 Checks whether object is of given type.
 
void readParams () override
 Retrieves MQTT parameters.
 
void saveParams () override
 Saves MQTT aprameters into the configuration file.
 
void setupMqttConnector (ksMqttConnector &connector)
 Setup MQTT connector with captured parameters.
 
- Public Member Functions inherited from ksf::comps::ksConfigProvider
std::list< ksConfigParameter > & getParameters ()
 Provides const reference to the list of managed parameters.
 
- Public Member Functions inherited from ksf::ksComponent
virtual bool init (ksApplication *app)
 Initializes component.
 
virtual bool loop (ksApplication *app)
 Handles component loop logic, called from application loop.
 
virtual bool postInit (ksApplication *app)
 Method called after component initialization, used to setup references to other components.
 
- Public Member Functions inherited from ksf::ksRtti
virtual ~ksRtti ()=default
 Destructor.
 
template<typename TType >
TType * as ()
 Tries to cast object to the type provided as a template parameter.
 
template<typename TType >
const TType * as () const
 Tries to cast object to the type provided as a template parameter (const version).
 

Static Public Member Functions

static const std::size_t getClassType ()
 
- Static Public Member Functions inherited from ksf::comps::ksConfigProvider
static const std::size_t getClassType ()
 
- Static Public Member Functions inherited from ksf::ksComponent
static const std::size_t getClassType ()
 

Additional Inherited Members

- Protected Member Functions inherited from ksf::comps::ksConfigProvider
void addNewParam (std::string id, std::string label, std::string defaultValue, int maxLength=50, EConfigParamType::Type type={})
 Defines new configutation parameter.
 
void addNewParamWithConfigDefault (misc::ksConfig &config, std::string id, std::string label={}, int maxLength=50, EConfigParamType::Type type={})
 Defines new configuation parameter (with default value).
 
- Protected Attributes inherited from ksf::comps::ksConfigProvider
std::list< ksConfigParameterparams
 List of configuration parameters.
 
- Protected Attributes inherited from ksf::ksComponent
ksComponentState::TYPE componentState { ksComponentState::NotInitialized }
 Holds current state of the component.
 

Detailed Description

A component that manages MQTT-related configuration.

This configuration provider handles MQTT properties. Detailed documentation on its behavior can be found on the ksConfigProvider sub-page.

Member Function Documentation

◆ getInstanceType()

virtual const std::size_t ksf::comps::ksMqttConfigProvider::getInstanceType ( ) const
inlinevirtual

Retrieves type ID of the object.

Returns
Object type ID.

Reimplemented from ksf::comps::ksConfigProvider.

◆ isA()

virtual bool ksf::comps::ksMqttConfigProvider::isA ( const std::size_t id) const
inlinevirtual

Checks whether object is of given type.

Parameters
idType ID to check against.
Returns
True if object is of given type, otherwise false.

Reimplemented from ksf::comps::ksConfigProvider.

◆ readParams()

void ksf::comps::ksMqttConfigProvider::readParams ( )
overridevirtual

Retrieves MQTT parameters.

This method reads the configuation file to retrieve MQTT broker information from file. The config contains data like MQTT address, device prefix, optional: credentials and expected SSL fingerprint.

Implements ksf::comps::ksConfigProvider.

References ksf::comps::ksConfigProvider::addNewParamWithConfigDefault().

◆ saveParams()

void ksf::comps::ksMqttConfigProvider::saveParams ( )
overridevirtual

Saves MQTT aprameters into the configuration file.

This method saves current (in-memory) MQTT properties into the configuration file.

Implements ksf::comps::ksConfigProvider.

References ksf::comps::ksConfigProvider::params.

◆ setupMqttConnector()

void ksf::comps::ksMqttConfigProvider::setupMqttConnector ( ksMqttConnector & connector)

Setup MQTT connector with captured parameters.

Parameters
connectorMQTT connector reference

References ksf::comps::ksMqttConnector::setupConnection().

Referenced by ksf::comps::ksMqttConnector::init().


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