123
Diff: IpAddress.h
- Revision:
- 16:269f652b4d0b
- Parent:
- 11:647d53d146f1
diff -r 53715cc81c63 -r 269f652b4d0b IpAddress.h --- a/IpAddress.h Sat Sep 07 17:42:42 2019 +0000 +++ b/IpAddress.h Fri Jun 05 15:12:21 2020 +0000 @@ -22,6 +22,7 @@ #define IPADDRESS_h #include <stdio.h> +#include "SocketAddress.h" // A class to make it easier to handle and pass around IP addresses @@ -55,6 +56,8 @@ // Returns IP Address as string of char const char* toString(char* buf); + void toSocketAddress(SocketAddress* sockAddr) { sockAddr->set_ip_bytes((const void*)_address, NSAPI_IPv4); } + // Access the raw byte array containing the address. Because this returns a pointer // to the internal structure rather than a copy of the address this function should only // be used when you know that the usage of the returned uint8_t* will be transient and not