|
@@ -24,8 +24,10 @@ public:
|
|
|
constexpr IP4(uint8_t b0, uint8_t b1, uint8_t b2, uint8_t b3) :
|
|
|
b{b0,b1,b2,b3} { }
|
|
|
IP4(const IPAddress & ip) : l{ip} { }
|
|
|
- constexpr IP4(const ip_addr_t & ip) : l{ip.u_addr.ip4.addr} { }
|
|
|
- constexpr IP4(const esp_ip_addr_t & ip) : l{ip.u_addr.ip4.addr} { }
|
|
|
+ constexpr IP4(const ip_addr_t & ip) :
|
|
|
+ l{ip.type == IPADDR_TYPE_V4 ? ip.u_addr.ip4.addr : 0} { }
|
|
|
+ constexpr IP4(const esp_ip_addr_t & ip) :
|
|
|
+ l{ip.type == IPADDR_TYPE_V4 ? ip.u_addr.ip4.addr : 0} { }
|
|
|
IP4(const char *str);
|
|
|
|
|
|
operator uint32_t () { return l; }
|