The MqttClient::publishConfigID() method has to be called the first time a successful connection to the MQTT broker has been established since the device startup.
Implementation Strategy:
add an attribute bool m_isConfigured to the Configuration class, initialized to false, add a get accessor method bool isConfigured()
the method Configuration::setConfig() sets the m_isConfigured = true
add a new bool isConfigured() method to interface MqttClientAdapter
add implementation for bool isConfigured() to class IoF_MqttClientAdapter, calling Configuration::isConfigured() (add new attribute Configuration* m_configuration to class IoF_MqttClientAdapter)
in MqttClient::reconnect() call publishConfigID(macAddress) if callout to m_adapter->isConfigured() returns false
The
MqttClient::publishConfigID()
method has to be called the first time a successful connection to the MQTT broker has been established since the device startup.Implementation Strategy:
bool m_isConfigured
to theConfiguration
class, initialized tofalse
, add a get accessor methodbool isConfigured()
Configuration::setConfig()
sets them_isConfigured = true
bool isConfigured()
method to interfaceMqttClientAdapter
bool isConfigured()
to classIoF_MqttClientAdapter
, callingConfiguration::isConfigured()
(add new attributeConfiguration* m_configuration
to classIoF_MqttClientAdapter
)MqttClient::reconnect()
callpublishConfigID(macAddress)
if callout tom_adapter->isConfigured()
returnsfalse