8 #if defined(USE_ESP_IDF) || defined(USE_LIBRETINY) || USE_ARDUINO_VERSION_CODE > VERSION_CODE(3, 0, 0) 9 #include <lwip/ip_addr.h> 14 #include <IPAddress.h> 17 #if USE_ESP32_FRAMEWORK_ARDUINO 18 #define arduino_ns Arduino_h 20 #define arduino_ns arduino 27 #include <esp_netif.h> 36 IPAddress(uint8_t first, uint8_t second, uint8_t third, uint8_t fourth) {
37 IP_ADDR4(&
ip_addr_, first, second, third, fourth);
42 memcpy((
void *) &
ip_addr_, (
void *) other_ip,
sizeof(ip4_addr_t));
43 #if USE_ESP32 && LWIP_IPV6 44 ip_addr_.type = IPADDR_TYPE_V4;
48 IPAddress(
const arduino_ns::IPAddress &other_ip) { ip_addr_set_ip4_u32(&
ip_addr_, other_ip); }
52 memcpy((
void *) &
ip_addr_, (
void *) other_ip,
sizeof(ip6_addr_t));
53 ip_addr_.type = IPADDR_TYPE_V6;
60 memcpy((
void *) &
ip_addr_.u_addr.ip6, (
void *) other_ip,
sizeof(esp_ip6_addr_t));
64 IPAddress(esp_ip4_addr_t *other_ip) { memcpy((
void *) &
ip_addr_, (
void *) other_ip,
sizeof(esp_ip4_addr_t)); }
65 operator esp_ip_addr_t()
const {
68 memcpy((
void *) &tmp, (
void *) &
ip_addr_,
sizeof(ip_addr_));
70 memcpy((
void *) &tmp.u_addr.ip4, (
void *) &ip_addr_,
sizeof(ip_addr_));
74 operator esp_ip4_addr_t()
const {
77 memcpy((
void *) &tmp, (
void *) &
ip_addr_.u_addr.ip4,
sizeof(esp_ip4_addr_t));
79 memcpy((
void *) &tmp, (
void *) &
ip_addr_,
sizeof(ip_addr_));
85 operator ip_addr_t()
const {
return ip_addr_; }
87 operator ip4_addr_t()
const {
return *ip_2_ip4(&
ip_addr_); }
91 operator arduino_ns::IPAddress()
const {
return ip_addr_get_ip4_u32(&
ip_addr_); }
103 (((u8_t *) (&
ip_addr_.u_addr.ip4))[3]) += increase;
105 (((u8_t *) (&
ip_addr_.addr))[3]) += increase;
IPAddress(esp_ip6_addr_t *other_ip)
IPAddress(esp_ip4_addr_t *other_ip)
IPAddress & operator+=(uint8_t increase)
bool operator==(const IPAddress &other) const
IPAddress(const ip_addr_t *other_ip)
IPAddress(const arduino_ns::IPAddress &other_ip)
IPAddress(ip4_addr_t *other_ip)
IPAddress(const std::string &in_address)
IPAddress(uint8_t first, uint8_t second, uint8_t third, uint8_t fourth)
IPAddress(ip6_addr_t *other_ip)
Implementation of SPI Controller mode.
bool operator!=(const IPAddress &other) const