Remove old and modified libs, switch to ESPAsyncWebserver, add support for ESP32-H2 and multiple Ethernet modules (#455)

* Asyncwebserver

* Squashed commit of the following:

commit 575ef02f593918ec6654c87407a4d11fc17071b8
Author: technyon <j.o.schuemann@gmx.de>
Date:   Mon Aug 12 17:56:11 2024 +0200

    merge master

commit 35e5adf4ecd80f9829e8801181f35dd2c1d94759
Merge: a2cc7be2 21adca01
Author: technyon <j.o.schuemann@gmx.de>
Date:   Mon Aug 12 17:41:04 2024 +0200

    Merge branch 'master' of github.com:technyon/nuki_hub into DM9051

commit a2cc7be2954cbd8767ab8186296c0b14134d1d0b
Author: technyon <j.o.schuemann@gmx.de>
Date:   Mon Aug 12 10:51:50 2024 +0200

    update nuki ble

commit 20c809f3dca28b29b219d1ff3a183f1981316de5
Author: technyon <j.o.schuemann@gmx.de>
Date:   Mon Aug 12 10:44:46 2024 +0200

    backup

commit dd41c218efb5270f5efeb734e64dff695920db16
Merge: 153000b5 e84b944a
Author: technyon <j.o.schuemann@gmx.de>
Date:   Mon Aug 12 10:40:03 2024 +0200

    Merge branch 'master' of github.com:technyon/nuki_hub into DM9051

commit 153000b5b1af7df1fbeb5263df94eb26f689cc0a
Author: technyon <j.o.schuemann@gmx.de>
Date:   Mon Aug 12 10:23:07 2024 +0200

    fix linker error

commit a93bbfbfc4301e46ff3696a763dd13c6c89efefb
Author: technyon <j.o.schuemann@gmx.de>
Date:   Sun Aug 11 11:27:07 2024 +0200

    backup

commit f611c75ce8c35f829bcad6cf7e86188f4b3ec331
Merge: f1964917 063fbab6
Author: technyon <j.o.schuemann@gmx.de>
Date:   Sun Aug 11 11:24:47 2024 +0200

    merge master

commit f1964917b4dade3920f1ecdb699c58630199e6da
Author: technyon <j.o.schuemann@gmx.de>
Date:   Sat Aug 10 15:17:45 2024 +0200

    update platformio.ini

commit f448e5e8a7e93be38e09e2ab0b622199a3721af6
Author: technyon <j.o.schuemann@gmx.de>
Date:   Sat Aug 10 11:28:09 2024 +0200

    add SPIClass instance for DM9051

commit 1f190e9aa08033535a2eb442a92e6e20409bbda1
Author: technyon <j.o.schuemann@gmx.de>
Date:   Sat Aug 10 11:22:26 2024 +0200

    add definitions and constructor for DM9051

commit 726b3602ae91594ee1210ad5b6714f75cc5e42a7
Merge: 50a2eb13 4af90cbc
Author: technyon <j.o.schuemann@gmx.de>
Date:   Sat Aug 10 10:19:34 2024 +0200

    merge master

commit 50a2eb136d75d90921f1c6974f18bc107bddc123
Author: technyon <j.o.schuemann@gmx.de>
Date:   Fri Aug 9 11:52:09 2024 +0200

    add comment

commit 9437e485cae169efdf8e5a7bf188a1c7e792d1e5
Author: technyon <j.o.schuemann@gmx.de>
Date:   Sun Aug 4 08:29:21 2024 +0200

    move LAN8720 definitions to seperate file

* Remove Core 2 Ethernet library

* Custom Ethernet

* GPIO and Preferences

* H2
This commit is contained in:
iranl
2024-08-16 13:02:37 +02:00
committed by GitHub
parent 346c5c65d1
commit 9a896a7ab1
206 changed files with 4055 additions and 20829 deletions

View File

@@ -0,0 +1,102 @@
#pragma once
#include <ETH.h>
#include <cstdint>
#include <hal/spi_types.h>
#include <SPI.h>
#include "LAN8720Definitions.h"
#include "DM9051Definitions.h"
#include "W5500Definitions.h"
#include <NetworkClient.h>
#include <NetworkClientSecure.h>
#include <Preferences.h>
#include "NetworkDevice.h"
#ifndef NUKI_HUB_UPDATER
#include "espMqttClient.h"
#endif
class EthernetDevice : public NetworkDevice
{
public:
EthernetDevice(const String& hostname,
Preferences* preferences,
const IPConfiguration* ipConfiguration,
const std::string& deviceName,
uint8_t phy_addr = ETH_PHY_ADDR_LAN8720,
int power = ETH_PHY_POWER_LAN8720,
int mdc = ETH_PHY_MDC_LAN8720,
int mdio = ETH_PHY_MDIO_LAN8720,
eth_phy_type_t ethtype = ETH_PHY_TYPE_LAN8720,
eth_clock_mode_t clock_mode = ETH_CLK_MODE_LAN8720,
bool use_mac_from_efuse = false);
EthernetDevice(const String& hostname,
Preferences* preferences,
const IPConfiguration* ipConfiguration,
const std::string& deviceName,
uint8_t phy_addr,
int cs,
int irq,
int rst,
int spi_sck,
int spi_miso,
int spi_mosi,
uint8_t spi_freq_mhz,
eth_phy_type_t ethtype);
const String deviceName() const override;
virtual void initialize();
virtual void reconfigure();
virtual ReconnectStatus reconnect(bool force = false);
bool supportsEncryption() override;
virtual bool isConnected();
int8_t signalStrength() override;
String localIP() override;
String BSSIDstr() override;
private:
Preferences* _preferences;
void init();
void onDisconnected();
void waitForIpAddressWithTimeout();
bool _connected = false;
bool _restartOnDisconnect = false;
bool _startAp = false;
char* _path;
bool _hardwareInitialized = false;
const std::string _deviceName;
uint8_t _phy_addr;
// LAN8720
int _power;
int _mdc;
int _mdio;
// W55000 and DM9051
int _cs;
int _irq;
int _rst;
int _spi_sck;
int _spi_miso;
int _spi_mosi;
uint8_t _spi_freq_mhz;
eth_phy_type_t _type;
eth_clock_mode_t _clock_mode;
bool _use_mac_from_efuse;
bool _useSpi = false;
#ifndef NUKI_HUB_UPDATER
char _ca[TLS_CA_MAX_SIZE] = {0};
char _cert[TLS_CERT_MAX_SIZE] = {0};
char _key[TLS_KEY_MAX_SIZE] = {0};
#endif
};