generate random mac address on first start

This commit is contained in:
technyon
2022-04-29 21:56:19 +02:00
parent 6bd6900198
commit 6fe1d70521
4 changed files with 60 additions and 8 deletions

View File

@@ -2,11 +2,12 @@
#include "NetworkDevice.h"
#include <Ethernet.h>
#include <Preferences.h>
class W5500Device : public NetworkDevice
{
public:
explicit W5500Device(const String& hostname);
explicit W5500Device(const String& hostname, Preferences* _preferences);
~W5500Device();
virtual void initialize();
@@ -18,7 +19,11 @@ public:
private:
void resetDevice();
void initializeMacAddress(byte* mac);
EthernetClient* _ethClient = nullptr;
PubSubClient* _mqttClient = nullptr;
Preferences* _preferences = nullptr;
byte _mac[6];
};