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)
20 : config_obj(owner, name, desc)
23 config_MqttLWT(
const char* name,
const char *desc = NULL)
24 : config_obj(name, desc)
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)
39 : config_obj(owner, name, desc)
41 privKey.SetBulkstoreFlags(config_fs_bulkstore::FLAG_IS_SENSITIVE_HIDE_VALUE);
43 config_x509Cert(
const char* name,
const char *desc = NULL)
44 : config_obj(name, desc)
46 privKey.SetBulkstoreFlags(config_fs_bulkstore::FLAG_IS_SENSITIVE_HIDE_VALUE);
52 static int numConfigs;
54 static const char *createName();
56 config_string brokerFqdn{
"",
"Hostname",
""};
57 config_uint brokerPort{MQTT_DEFAULT_PORT,
"Port",
""};
59 config_bool useTLS{
false,
"TLS_Enabled",
"Encrypt Connection using TLS"};
61 config_string cfgClientId{
"",
"ClientId",
""};
62 config_string cfgUsername{
"",
"Username",
""};
63 config_pass cfgPassword{
"",
"Password",
""};
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"};
73 NBString interpBroker;
75 config_MqttClient(config_obj &owner,
const char* name,
const char *desc = NULL)
76 : config_obj(owner, name, desc)
79 config_MqttClient(
const char* name,
const char *desc = NULL)
80 : config_obj(name, desc)
Base class used to create configuration objects.
Definition config_obj.h:323
#define MQTT_DEFAULT_KEEP_ALIVE
Definition mqtt.h:61