chore: housekeeping

This commit is contained in:
2024-11-12 00:55:52 +06:00
parent 5f9c966602
commit 48943ba71f
32 changed files with 715 additions and 854 deletions

27
include/network.h Normal file
View File

@@ -0,0 +1,27 @@
#ifndef NETWORK_H
#define NETWORK_H
#include <MQTT/MQTTClient.h>
#include <stdint.h>
// Definitions for socket indexes
#define DHCP_SOCKET 0
#define DNS_SOCKET 1
#define TCP_SOCKET 2
typedef enum {
DHCP_STATE_INIT,
DHCP_STATE_DISCOVER,
DHCP_STATE_REQUEST,
DHCP_STATE_LEASED,
DHCP_STATE_RENEW,
DHCP_STATE_RELEASE
} dhcp_state_t;
// Initializes the W5500 chip
void configure_network(void);
void network_init(void);
void dhcp_process(void);
uint8_t dhcp_get_state(void);
#endif // NETWORK_H