21 #ifndef SOCKET_ADDRESS_H 22 #define SOCKET_ADDRESS_H 24 #include "nsapi_types.h" 25 #include "mbed_toolchain.h" 54 "Constructors hide possible errors. Replaced by " 55 "NetworkInterface::gethostbyname.")
83 SocketAddress(
const void *bytes, nsapi_version_t version, uint16_t port = 0);
107 void set_ip_bytes(
const void *bytes, nsapi_version_t version);
158 operator bool()
const;
179 void _SocketAddress(
NetworkStack *iface,
const char *host, uint16_t port);
184 mutable char *_ip_address;
NetworkStack * nsapi_create_stack(nsapi_stack_t *stack)
Convert a raw nsapi_stack_t object into a C++ NetworkStack object.
friend bool operator==(const SocketAddress &a, const SocketAddress &b)
Compare two addresses for equality.
friend bool operator!=(const SocketAddress &a, const SocketAddress &b)
Compare two addresses for equality.
void set_addr(nsapi_addr_t addr)
Set the raw IP address.
bool set_ip_address(const char *addr)
Set the IP address.
~SocketAddress()
Destructor.
void set_ip_bytes(const void *bytes, nsapi_version_t version)
Set the raw IP bytes and IP version.
const char * get_ip_address() const
Get the human-readable IP address.
void set_port(uint16_t port)
Set the port.
struct nsapi_addr nsapi_addr_t
IP address structure for passing IP addresses by value.
SocketAddress & operator=(const SocketAddress &addr)
Copy address from another SocketAddress.
nsapi_version_t get_ip_version() const
Get the IP address version.
Common interface that is shared between network devices.
uint16_t get_port() const
Get the port.
IP address structure for passing IP addresses by value.
nsapi_addr_t get_addr() const
Get the raw IP address.
SocketAddress(S *stack, const char *host, uint16_t port=0)
Create a SocketAddress from a hostname and port.
const void * get_ip_bytes() const
Get the raw IP bytes.