Extract configurations to separate files
This commit is contained in:
parent
2a6db822ff
commit
be274132d6
31
include/configurations/EthernetConfiguration.h
Normal file
31
include/configurations/EthernetConfiguration.h
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
struct EthernetConfiguration {
|
||||||
|
|
||||||
|
// The MAC address of the ethernet connection
|
||||||
|
uint8_t macAddress[6];
|
||||||
|
|
||||||
|
// The master-in slave-out pin of the SPI connection for the Ethernet module
|
||||||
|
int8_t spiPinMiso;
|
||||||
|
|
||||||
|
// The master-out slave-in pin of the SPI connection for the Ethernet module
|
||||||
|
int8_t spiPinMosi;
|
||||||
|
|
||||||
|
// The slave clock pin of the SPI connection for the Ethernet module
|
||||||
|
int8_t spiPinSclk;
|
||||||
|
|
||||||
|
// The slave-select pin of the SPI connection for the Ethernet module
|
||||||
|
int8_t spiPinSS;
|
||||||
|
|
||||||
|
unsigned long dhcpLeaseTimeoutMs;
|
||||||
|
unsigned long dhcpLeaseResponseTimeoutMs;
|
||||||
|
|
||||||
|
// The static IP address to assign if DHCP fails
|
||||||
|
uint8_t manualIp[4];
|
||||||
|
|
||||||
|
// The IP address of the DNS server, if DHCP fails
|
||||||
|
uint8_t manualDnsAddress[4];
|
||||||
|
|
||||||
|
};
|
12
include/configurations/KeyConfiguration.h
Normal file
12
include/configurations/KeyConfiguration.h
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
struct KeyConfiguration {
|
||||||
|
|
||||||
|
const uint8_t* remoteKey;
|
||||||
|
|
||||||
|
const uint8_t* localKey;
|
||||||
|
|
||||||
|
uint32_t challengeExpiryMs;
|
||||||
|
};
|
@ -4,43 +4,8 @@
|
|||||||
#include "servo.h"
|
#include "servo.h"
|
||||||
#include "message.h"
|
#include "message.h"
|
||||||
#include <ESPAsyncWebServer.h>
|
#include <ESPAsyncWebServer.h>
|
||||||
|
#include "configurations/EthernetConfiguration.h"
|
||||||
struct EthernetConfiguration {
|
#include "configurations/KeyConfiguration.h"
|
||||||
|
|
||||||
// The MAC address of the ethernet connection
|
|
||||||
uint8_t macAddress[6];
|
|
||||||
|
|
||||||
// The master-in slave-out pin of the SPI connection for the Ethernet module
|
|
||||||
int8_t spiPinMiso;
|
|
||||||
|
|
||||||
// The master-out slave-in pin of the SPI connection for the Ethernet module
|
|
||||||
int8_t spiPinMosi;
|
|
||||||
|
|
||||||
// The slave clock pin of the SPI connection for the Ethernet module
|
|
||||||
int8_t spiPinSclk;
|
|
||||||
|
|
||||||
// The slave-select pin of the SPI connection for the Ethernet module
|
|
||||||
int8_t spiPinSS;
|
|
||||||
|
|
||||||
unsigned long dhcpLeaseTimeoutMs;
|
|
||||||
unsigned long dhcpLeaseResponseTimeoutMs;
|
|
||||||
|
|
||||||
// The static IP address to assign if DHCP fails
|
|
||||||
uint8_t manualIp[4];
|
|
||||||
|
|
||||||
// The IP address of the DNS server, if DHCP fails
|
|
||||||
uint8_t manualDnsAddress[4];
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
struct KeyConfiguration {
|
|
||||||
|
|
||||||
const uint8_t* remoteKey;
|
|
||||||
|
|
||||||
const uint8_t* localKey;
|
|
||||||
|
|
||||||
uint32_t challengeExpiryMs;
|
|
||||||
};
|
|
||||||
|
|
||||||
class SesameController: public ServerConnectionCallbacks {
|
class SesameController: public ServerConnectionCallbacks {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user