MQTT Device refractor

This commit is contained in:
iranl
2024-11-05 21:25:07 +01:00
parent 1e7cefa770
commit 67bf20eaa5
6 changed files with 72 additions and 192 deletions

View File

@@ -10,8 +10,9 @@
class NetworkDevice
{
public:
explicit NetworkDevice(const String& hostname, const IPConfiguration* ipConfiguration)
explicit NetworkDevice(const String& hostname, Preferences* preferences, const IPConfiguration* ipConfiguration)
: _hostname(hostname),
_preferences(preferences),
_ipConfiguration(ipConfiguration)
{}
@@ -19,7 +20,6 @@ public:
virtual void initialize() = 0;
virtual void reconfigure() = 0;
virtual void printError();
virtual void update();
virtual void scan(bool passive = false, bool async = true) = 0;
@@ -57,8 +57,14 @@ protected:
bool _useEncryption = false;
bool _mqttEnabled = true;
void init();
MqttClient *getMqttClient() const;
char _ca[TLS_CA_MAX_SIZE] = {0};
char _cert[TLS_CERT_MAX_SIZE] = {0};
char _key[TLS_KEY_MAX_SIZE] = {0};
#endif
const String _hostname;