MySensors Library & Examples
2.3.2-62-ge298769
|
A class to make it easier to handle and pass around IP addresses.
Definition at line 32 of file IPAddress.h.
#include <IPAddress.h>
Public Member Functions | |
IPAddress () | |
IPAddress constructor. | |
IPAddress (uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet) | |
IPAddress constructor. More... | |
IPAddress (uint32_t address) | |
IPAddress constructor. More... | |
IPAddress (const uint8_t *address) | |
IPAddress constructor. More... | |
bool | fromString (const char *address) |
Set the IP from a array of characters. More... | |
bool | fromString (const std::string &address) |
Set the IP from a string class type. More... | |
operator uint32_t () const | |
Overloaded cast operator. More... | |
bool | operator== (const IPAddress &addr) const |
Overloaded cast operator. More... | |
bool | operator== (uint32_t addr) const |
Overloaded cast operator. More... | |
bool | operator== (const uint8_t *addr) const |
Overloaded cast operator. More... | |
uint8_t | operator[] (int index) const |
Overloaded index operator. More... | |
uint8_t & | operator[] (int index) |
Overloaded index operator. More... | |
IPAddress & | operator= (const uint8_t *address) |
Overloaded copy operators. More... | |
IPAddress & | operator= (uint32_t address) |
Overloaded copy operator. More... | |
std::string | toString () |
Convert the IP address to a string. More... | |
Friends | |
class | Client |
IPAddress::IPAddress | ( | uint8_t | first_octet, |
uint8_t | second_octet, | ||
uint8_t | third_octet, | ||
uint8_t | fourth_octet | ||
) |
IPAddress constructor.
first_octet | first octet of the IPv4 address. |
second_octet | second octet of the IPv4 address. |
third_octet | third octet of the IPv4 address. |
fourth_octet | fourth octet of the IPv4 address. |
|
explicit |
IPAddress constructor.
address | to be set from a 32 bits integer. |
|
explicit |
IPAddress constructor.
address | to be set from a byte array. |
bool IPAddress::fromString | ( | const char * | address | ) |
Set the IP from a array of characters.
address | to be set. |
|
inline |
Set the IP from a string class type.
address | to be set. |
Definition at line 91 of file IPAddress.h.
|
inline |
Overloaded cast operator.
Allow IPAddress objects to be used where a pointer to a four-byte uint8_t array is expected
Definition at line 100 of file IPAddress.h.
IPAddress& IPAddress::operator= | ( | const uint8_t * | address | ) |
Overloaded copy operators.
Allow initialisation of IPAddress objects from byte array.
IPAddress& IPAddress::operator= | ( | uint32_t | address | ) |
Overloaded copy operator.
Allow initialisation of IPAddress objects from a 32 bits integer.
|
inline |
Overloaded cast operator.
Definition at line 108 of file IPAddress.h.
bool IPAddress::operator== | ( | const uint8_t * | addr | ) | const |
Overloaded cast operator.
|
inline |
Overloaded cast operator.
Definition at line 116 of file IPAddress.h.
|
inline |
Overloaded index operator.
Definition at line 139 of file IPAddress.h.
|
inline |
Overloaded index operator.
Allow getting and setting individual octets of the address.
Definition at line 131 of file IPAddress.h.
std::string IPAddress::toString | ( | ) |
Convert the IP address to a string.