mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-12 01:53:07 +03:00
more lwIP physical interfaces (#6680)
This commit adds W5500 W5100 and ENC28j60 drivers from @njh with credits They are available in libraries/ An example is added in W5500 examples directory plus: * Extract dhcp server from lwip2 and add it to the core as a class. It must always be present, it is linked and can be called by fw on boot. So it cannot be stored in a library. * ethernet: static or dhcp works * PPPServer: example * bring WiFi.config() to the lwIP generic interface (argument reorder common function) * move hostname() from WiFI-STA to generic interface * remove non readable characters from dhcp-server comments * dhcp-server: magic_cookie is part of bootp rfc * fixes from https://github.com/d-a-v/W5500lwIP/issues/17 * enable lwip_hook_dhcp_parse_option() * +ethernet tcp client example in w5500 library examples
This commit is contained in:
@ -34,13 +34,17 @@
|
||||
// hence ipv4_addr/t is IPv4 version/copy of IPv4 ip_addr/_t
|
||||
// when IPv6 is enabled so we can deal with IPv4 use from firmware API.
|
||||
|
||||
// official lwIP's definitions
|
||||
#include "lwip/ip_addr.h"
|
||||
#include <lwip/ip4_addr.h>
|
||||
|
||||
#define ipv4_addr ip4_addr
|
||||
#define ipv4_addr_t ip4_addr_t
|
||||
|
||||
// official lwIP's definitions
|
||||
#include "lwip/ip_addr.h"
|
||||
#if LWIP_VERSION_MAJOR == 1
|
||||
struct ip4_addr { uint32_t addr; };
|
||||
typedef struct ip4_addr ip4_addr_t;
|
||||
#else
|
||||
#include <lwip/ip4_addr.h>
|
||||
|
||||
// defined in lwip-v1.4 sources only, used in fw
|
||||
struct ip_info {
|
||||
struct ipv4_addr ip;
|
||||
@ -48,4 +52,5 @@ struct ip_info {
|
||||
struct ipv4_addr gw;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif // __IPV4_ADDR_H__
|
||||
|
@ -382,13 +382,17 @@ void wifi_softap_free_station_info(void);
|
||||
bool wifi_softap_dhcps_start(void);
|
||||
bool wifi_softap_dhcps_stop(void);
|
||||
|
||||
#if 1 // dhcp server
|
||||
// these functions are open-source, in dhcp server,
|
||||
// which is now moved to lwIPDhcpServer.cpp (lwip2)
|
||||
// (but still there with lwip1)
|
||||
bool wifi_softap_set_dhcps_lease(struct dhcps_lease *please);
|
||||
bool wifi_softap_get_dhcps_lease(struct dhcps_lease *please);
|
||||
uint32 wifi_softap_get_dhcps_lease_time(void);
|
||||
bool wifi_softap_set_dhcps_lease_time(uint32 minute);
|
||||
bool wifi_softap_reset_dhcps_lease_time(void);
|
||||
|
||||
bool wifi_softap_add_dhcps_lease(uint8 *macaddr); // add static lease on the list, this will be the next available @
|
||||
#endif // dhcp server
|
||||
|
||||
enum dhcp_status wifi_softap_dhcps_status(void);
|
||||
bool wifi_softap_set_dhcps_offer_option(uint8 level, void* optarg);
|
||||
|
Reference in New Issue
Block a user