|
arduino-audio-tools
|
Arduino-compatible IPAddress class implemented in pure C++. More...
#include <IPAddress.h>
Public Member Functions | |
| IPAddress () | |
| 0.0.0.0 | |
| IPAddress (const char *str) | |
| From a dotted-decimal string; leaves address as 0.0.0.0 on parse failure. | |
| IPAddress (const uint8_t octets[4]) | |
| From a 4-byte array. | |
| IPAddress (uint32_t dword) | |
| From a raw uint32 in host byte order (same as Arduino) | |
| IPAddress (uint8_t a, uint8_t b, uint8_t c, uint8_t d) | |
| From four octets. | |
| bool | fromString (const char *str) |
| operator bool () const | |
| True if address is non-zero. | |
| operator uint32_t () const | |
| Raw uint32 (host byte order, same layout as Arduino) | |
| bool | operator!= (const IPAddress &other) const |
| bool | operator!= (uint32_t dword) const |
| IPAddress & | operator= (const char *str) |
| IPAddress & | operator= (const uint8_t octets[4]) |
| IPAddress & | operator= (uint32_t dword) |
| bool | operator== (const IPAddress &other) const |
| bool | operator== (const uint8_t octets[4]) const |
| bool | operator== (uint32_t dword) const |
| uint8_t & | operator[] (int i) |
| Octet access (read/write) | |
| uint8_t | operator[] (int i) const |
| uint8_t * | raw () |
| const uint8_t * | raw () const |
| Raw byte pointer (read-only) | |
| std::string | toString () const |
| Returns dotted-decimal string e.g. "192.168.1.1". | |
Static Public Member Functions | |
| static IPAddress | any () |
| static IPAddress | broadcast () |
| static IPAddress | loopback () |
Arduino-compatible IPAddress class implemented in pure C++.
Supports IPv4 only. Drop-in replacement for Arduino's IPAddress for use on platforms without the Arduino core (e.g. Zephyr, Linux).
Usage: IPAddress ip(192, 168, 1, 1); IPAddress ip(0xC0A80101); // same, from uint32_t IPAddress ip("192.168.1.1"); // from string IPAddress ip; // 0.0.0.0
ip[0] // 192 (uint32_t)ip // raw big-endian uint32 ip.toString() // "192.168.1.1" if (ip) { ... } // false if 0.0.0.0 ip == other // comparison
|
inline |
0.0.0.0
From a dotted-decimal string; leaves address as 0.0.0.0 on parse failure.
Parses a dotted-decimal string into this address.
|
inline |
|
inline |
Returns dotted-decimal string e.g. "192.168.1.1".
| uint8_t bytes[4] |
| uint32_t dword |