ESPixelStick Firmware
Firmware for the ESPixelStick
Loading...
Searching...
No Matches
c_InputMQTT Class Reference

#include <InputMQTT.h>

Inheritance diagram for c_InputMQTT:
Collaboration diagram for c_InputMQTT:

Public Member Functions

 c_InputMQTT (c_InputMgr::e_InputChannelIds NewInputChannelId, c_InputMgr::e_InputType NewChannelType, uint32_t BufferSize)
 
virtual ~c_InputMQTT ()
 
void Begin ()
 set up the operating environment based on the current config (or defaults)
 
bool SetConfig (JsonObject &jsonConfig)
 Set a new config in the driver.
 
void GetConfig (JsonObject &jsonConfig)
 Get the current config used by the driver.
 
void GetStatus (JsonObject &jsonStatus)
 
void Process ()
 Call from loop(), renders Input data.
 
void GetDriverName (String &sDriverName)
 get the name for the instantiated driver
 
void SetBufferInfo (uint32_t BufferSize)
 
void NetworkStateChanged (bool IsConnected)
 
- Public Member Functions inherited from c_InputCommon
 c_InputCommon (c_InputMgr::e_InputChannelIds NewInputChannelId, c_InputMgr::e_InputType NewChannelType, uint32_t BufferSize)
 < Start up the driver and put it into a safe mode
 
virtual ~c_InputCommon ()
 
virtual bool SetConfig (ArduinoJson::JsonObject &jsonConfig)=0
 Set a new config in the driver.
 
virtual void GetConfig (ArduinoJson::JsonObject &jsonConfig)=0
 Get the current config used by the driver.
 
virtual void SetOperationalState (bool ActiveFlag)
 
virtual bool isShutDownRebootNeeded ()
 
virtual void ProcessButtonActions (c_ExternalInput::InputValue_t value)
 
c_InputMgr::e_InputChannelIds GetInputChannelId ()
 
c_InputMgr::e_InputType GetInputType ()
 

Private Member Functions

void validateConfiguration ()
 
void setup ()
 Call from setup()
 
void onNetworkConnect ()
 Call from onWifiConnect()
 
void onNetworkDisconnect ()
 Call from onWiFiDisconnect()
 
void validate ()
 Call from validateConfig()
 
void NetworkStateChanged (bool IsConnected, bool RebootAllowed)
 
void PlayFseq (JsonObject &JsonConfig)
 
void PlayEffect (JsonObject &JsonConfig)
 
void GetEngineConfig (JsonObject &JsonConfig)
 
void GetEffectList (JsonObject &JsonConfig)
 
void StopPlayFileEngine ()
 
void UpdateEffectConfiguration (JsonObject &JsonConfig)
 
void load ()
 Load configuration from File System.
 
void save ()
 Save configuration to File System.
 
void disconnectFromMqtt ()
 
void connectToMqtt ()
 
void onMqttConnect (bool sessionPresent)
 
void onMqttDisconnect (AsyncMqttClientDisconnectReason reason)
 
void onMqttMessage (char *topic, char *payload, AsyncMqttClientMessageProperties properties, uint32_t len, uint32_t index, uint32_t total)
 
void publishHA ()
 
void publishState ()
 

Private Attributes

AsyncMqttClient mqtt
 
Ticker mqttTicker
 
c_InputCommonpEffectsEngine = nullptr
 
c_InputFPPRemotePlayItempPlayFileEngine = nullptr
 
c_InputEffectEngine::MQTTConfiguration_t effectConfig
 
String ip
 
uint16_t port = MQTT_PORT
 
String user
 
String password
 
String topic
 
bool CleanSessionRequired = false
 
String haprefix = "homeassistant"
 
bool hadisco = true
 
String lwtTopic
 
const char * ON = "ON"
 
const char * OFF = "OFF"
 
const char * LWT_ONLINE = "online"
 
const char * LWT_OFFLINE = "offline"
 
bool stateOn = false
 

Additional Inherited Members

- Protected Attributes inherited from c_InputCommon
bool HasBeenInitialized = false
 
uint32_t InputDataBufferSize = 0
 
bool IsInputChannelActive = true
 
c_InputMgr::e_InputChannelIds InputChannelId = c_InputMgr::e_InputChannelIds::InputChannelId_ALL
 
c_InputMgr::e_InputType ChannelType = c_InputMgr::e_InputType::InputType_Disabled
 

Constructor & Destructor Documentation

◆ c_InputMQTT()

c_InputMQTT::c_InputMQTT ( c_InputMgr::e_InputChannelIds NewInputChannelId,
c_InputMgr::e_InputType NewChannelType,
uint32_t BufferSize )
Here is the call graph for this function:

◆ ~c_InputMQTT()

c_InputMQTT::~c_InputMQTT ( )
virtual
Here is the call graph for this function:

Member Function Documentation

◆ Begin()

void c_InputMQTT::Begin ( )
virtual

set up the operating environment based on the current config (or defaults)

Implements c_InputCommon.

Here is the call graph for this function:

◆ connectToMqtt()

void c_InputMQTT::connectToMqtt ( )
private
Here is the caller graph for this function:

◆ disconnectFromMqtt()

void c_InputMQTT::disconnectFromMqtt ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetConfig()

void c_InputMQTT::GetConfig ( JsonObject & jsonConfig)

Get the current config used by the driver.

Here is the caller graph for this function:

◆ GetDriverName()

void c_InputMQTT::GetDriverName ( String & sDriverName)
inlinevirtual

get the name for the instantiated driver

Implements c_InputCommon.

◆ GetEffectList()

void c_InputMQTT::GetEffectList ( JsonObject & JsonConfig)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetEngineConfig()

void c_InputMQTT::GetEngineConfig ( JsonObject & JsonConfig)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetStatus()

void c_InputMQTT::GetStatus ( JsonObject & jsonStatus)
virtual

Implements c_InputCommon.

◆ load()

void c_InputMQTT::load ( )
private

Load configuration from File System.

◆ NetworkStateChanged() [1/2]

void c_InputMQTT::NetworkStateChanged ( bool IsConnected)
virtual

Reimplemented from c_InputCommon.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ NetworkStateChanged() [2/2]

void c_InputMQTT::NetworkStateChanged ( bool IsConnected,
bool RebootAllowed )
private
Here is the call graph for this function:

◆ onMqttConnect()

void c_InputMQTT::onMqttConnect ( bool sessionPresent)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onMqttDisconnect()

void c_InputMQTT::onMqttDisconnect ( AsyncMqttClientDisconnectReason reason)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onMqttMessage()

void c_InputMQTT::onMqttMessage ( char * topic,
char * payload,
AsyncMqttClientMessageProperties properties,
uint32_t len,
uint32_t index,
uint32_t total )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onNetworkConnect()

void c_InputMQTT::onNetworkConnect ( )
private

Call from onWifiConnect()

Here is the call graph for this function:
Here is the caller graph for this function:

◆ onNetworkDisconnect()

void c_InputMQTT::onNetworkDisconnect ( )
private

Call from onWiFiDisconnect()

Here is the call graph for this function:

◆ PlayEffect()

void c_InputMQTT::PlayEffect ( JsonObject & JsonConfig)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PlayFseq()

void c_InputMQTT::PlayFseq ( JsonObject & JsonConfig)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Process()

void c_InputMQTT::Process ( )
virtual

Call from loop(), renders Input data.

Implements c_InputCommon.

Here is the call graph for this function:

◆ publishHA()

void c_InputMQTT::publishHA ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ publishState()

void c_InputMQTT::publishState ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ save()

void c_InputMQTT::save ( )
private

Save configuration to File System.

◆ SetBufferInfo()

void c_InputMQTT::SetBufferInfo ( uint32_t BufferSize)
virtual

Implements c_InputCommon.

Here is the call graph for this function:

◆ SetConfig()

bool c_InputMQTT::SetConfig ( JsonObject & jsonConfig)

Set a new config in the driver.

Here is the call graph for this function:

◆ setup()

void c_InputMQTT::setup ( )
private

Call from setup()

◆ StopPlayFileEngine()

void c_InputMQTT::StopPlayFileEngine ( )
private
Here is the caller graph for this function:

◆ UpdateEffectConfiguration()

void c_InputMQTT::UpdateEffectConfiguration ( JsonObject & JsonConfig)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ validate()

void c_InputMQTT::validate ( )
private

Call from validateConfig()

◆ validateConfiguration()

void c_InputMQTT::validateConfiguration ( )
private
Here is the caller graph for this function:

Member Data Documentation

◆ CleanSessionRequired

bool c_InputMQTT::CleanSessionRequired = false
private

◆ effectConfig

c_InputEffectEngine::MQTTConfiguration_t c_InputMQTT::effectConfig
private

◆ hadisco

bool c_InputMQTT::hadisco = true
private

◆ haprefix

String c_InputMQTT::haprefix = "homeassistant"
private

◆ ip

String c_InputMQTT::ip
private

◆ LWT_OFFLINE

const char* c_InputMQTT::LWT_OFFLINE = "offline"
private

◆ LWT_ONLINE

const char* c_InputMQTT::LWT_ONLINE = "online"
private

◆ lwtTopic

String c_InputMQTT::lwtTopic
private

◆ mqtt

AsyncMqttClient c_InputMQTT::mqtt
private

◆ mqttTicker

Ticker c_InputMQTT::mqttTicker
private

◆ OFF

const char* c_InputMQTT::OFF = "OFF"
private

◆ ON

const char* c_InputMQTT::ON = "ON"
private

◆ password

String c_InputMQTT::password
private

◆ pEffectsEngine

c_InputCommon* c_InputMQTT::pEffectsEngine = nullptr
private

◆ port

uint16_t c_InputMQTT::port = MQTT_PORT
private

◆ pPlayFileEngine

c_InputFPPRemotePlayItem* c_InputMQTT::pPlayFileEngine = nullptr
private

◆ stateOn

bool c_InputMQTT::stateOn = false
private

◆ topic

String c_InputMQTT::topic
private

◆ user

String c_InputMQTT::user
private

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