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> 18 #include <arpa/inet.h> 21 #define ipaddr_aton(x, y) inet_aton((x), (y)) 24 #if USE_ESP32_FRAMEWORK_ARDUINO 25 #define arduino_ns Arduino_h 27 #define arduino_ns arduino 34 #include <esp_netif.h> 44 IPAddress(uint8_t first, uint8_t second, uint8_t third, uint8_t fourth) {
45 this->
ip_addr_.s_addr = htonl((first << 24) | (second << 16) | (third << 8) | fourth);
51 IPAddress(uint8_t first, uint8_t second, uint8_t third, uint8_t fourth) {
52 IP_ADDR4(&
ip_addr_, first, second, third, fourth);
58 #if USE_ESP32 && LWIP_IPV6 59 ip_addr_.type = IPADDR_TYPE_V4;
63 IPAddress(
const arduino_ns::IPAddress &other_ip) { ip_addr_set_ip4_u32(&
ip_addr_, other_ip); }
67 memcpy((
void *) &
ip_addr_, (
void *) other_ip,
sizeof(ip6_addr_t));
68 ip_addr_.type = IPADDR_TYPE_V6;
75 memcpy((
void *) &
ip_addr_.u_addr.ip6, (
void *) other_ip,
sizeof(esp_ip6_addr_t));
79 IPAddress(esp_ip4_addr_t *other_ip) { memcpy((
void *) &
ip_addr_, (
void *) other_ip,
sizeof(esp_ip4_addr_t)); }
82 memcpy((
void *) &
ip_addr_, (
void *) other_ip,
sizeof(ip_addr_));
84 memcpy((
void *) &ip_addr_, (
void *) &other_ip->u_addr.ip4,
sizeof(ip_addr_));
87 operator esp_ip_addr_t()
const {
90 memcpy((
void *) &tmp, (
void *) &
ip_addr_,
sizeof(ip_addr_));
92 memcpy((
void *) &tmp.u_addr.ip4, (
void *) &ip_addr_,
sizeof(ip_addr_));
96 operator esp_ip4_addr_t()
const {
99 memcpy((
void *) &tmp, (
void *) &
ip_addr_.u_addr.ip4,
sizeof(esp_ip4_addr_t));
101 memcpy((
void *) &tmp, (
void *) &
ip_addr_,
sizeof(ip_addr_));
113 operator arduino_ns::IPAddress()
const {
return ip_addr_get_ip4_u32(&
ip_addr_); }
125 (((u8_t *) (&
ip_addr_.u_addr.ip4))[3]) += increase;
127 (((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(esp_ip_addr_t *other_ip)
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)
std::array< IPAddress, 5 > IPAddresses
IPAddress(ip6_addr_t *other_ip)
This is a workaround until we can figure out a way to get the tflite-micro idf component code availab...
bool operator!=(const IPAddress &other) const