mirror of
https://git.mirrors.martin98.com/https://github.com/luc-github/ESP3D.git
synced 2025-08-14 16:25:55 +08:00
Add new helper to convert IP to str
Add new helper to convert IP to str
This commit is contained in:
parent
3db280e18e
commit
b71cab9830
@ -69,6 +69,14 @@ char * WIFI_CONFIG::mac2str(uint8_t mac [WL_MAC_ADDR_LENGTH])
|
||||
return macstr;
|
||||
}
|
||||
|
||||
//just simple helper to convert IP address to string
|
||||
char * WIFI_CONFIG::ip2str(IPAddress Ip )
|
||||
{
|
||||
static char ipstr [16];
|
||||
if (0>sprintf(ipstr, "%i.%i.%i.%i",Ip[0],Ip[1],Ip[2],Ip[3])) strcpy (ipstr, "0.0.0.0");
|
||||
return ipstr;
|
||||
}
|
||||
|
||||
//Read configuration settings and apply them
|
||||
bool WIFI_CONFIG::Setup()
|
||||
{
|
||||
|
@ -29,6 +29,7 @@ class WIFI_CONFIG
|
||||
public:
|
||||
bool Setup();
|
||||
char * mac2str(uint8_t mac [WL_MAC_ADDR_LENGTH]);
|
||||
char * ip2str(IPAddress Ip );
|
||||
void configAP(IPAddress local_ip, IPAddress gateway, IPAddress subnet);
|
||||
private:
|
||||
byte split_ip (char * ptr,byte * part);
|
||||
|
Loading…
x
Reference in New Issue
Block a user