1#ifndef __CONFIG_MQTT_OBJ_H
2#define __CONFIG_MQTT_OBJ_H
11 config_string topic{
"",
"Topic",
"Topic to publish Last Will & Testament message to"};
12 config_string message{
"",
"Message",
"LWT Message to publish on non-normal disconnect"};
13 config_uint sessExpIntvl{60,
"SessExpIntvl",
"Session Expirary delay (in seconds) between non-normal disconnect and broker invalidating session and publishing LWT"};
14 config_bool retain{
true,
"Retain",
"Whether the broker will retain LWT to publish to future subscribers."};
15 config_string connMessage{
"",
"Connect",
"LWT Message to publish on Connect"};
16 config_string normalDisconMessage{
"",
"NormalDisconnect",
"Message to publish on normal disconnect"};
19 config_MqttLWT(
config_obj &owner,
const char* name,
const char *desc = NULL)
23 config_MqttLWT(
const char* name,
const char *desc = NULL)
34 config_fs_bulkstore cert{
"/sys/mqtt/cert_",
false,
"ClientCert",
"Certificate content"};
35 config_fs_bulkstore privKey{
"/sys/mqtt/key_",
false,
"PrivateKey",
"Private Key associated with cert"};
38 config_x509Cert(
config_obj &owner,
const char* name,
const char *desc = NULL)
41 privKey.SetBulkstoreFlags(config_fs_bulkstore::FLAG_IS_SENSITIVE_HIDE_VALUE);
43 config_x509Cert(
const char* name,
const char *desc = NULL)
46 privKey.SetBulkstoreFlags(config_fs_bulkstore::FLAG_IS_SENSITIVE_HIDE_VALUE);
52 static int numConfigs;
54 static const char *createName();
57 config_uint brokerPort{MQTT_DEFAULT_PORT,
"Port",
""};
59 config_bool useTLS{
false,
"TLS_Enabled",
"Encrypt Connection using TLS"};
64 config_bool alwaysClean{
true,
"AlwayCleanStart",
"Always start session with a clean slate of subscriptions."};
65 config_bool enableLWT{
true,
"LWT_Enabled",
"Enable client use of LWT message"};
66 config_uint maxKeepAlive{
MQTT_DEFAULT_KEEP_ALIVE,
"KeepAlive",
"The number of seconds when, after multiple failed MQTT keepalive messages, the connection will be automatically restarted (Note: the server may impose a different maximum keepalive)"};
68 config_x509Cert clientCert{*
this,
"ClientCert",
"Client Cert to use to authenticate to the server"};
75 config_MqttClient(
config_obj &owner,
const char* name,
const char *desc = NULL)
79 config_MqttClient(
const char* name,
const char *desc = NULL)
Lightweight alternative to C++ CString class.
Definition nbstring.h:118
Boolean Configuration Variable.
Definition config_obj.h:997
Base class used to create configuration objects.
Definition config_obj.h:320
Password string Configuration Variable.
Definition config_obj.h:1343
String Configuration Variable.
Definition config_obj.h:1127
Unsigned 32-bit Integer Configuration Variable.
Definition config_obj.h:552
Configuration object header file.
#define MQTT_DEFAULT_KEEP_ALIVE
Definition mqtt.h:61