Skip to content

Commit 9a0a1c8

Browse files
committed
library:Net:code cleanup remove unsupported APIs
Signed-off-by: Ajay Bhargav <[email protected]>
1 parent 6d8e028 commit 9a0a1c8

File tree

6 files changed

+0
-51
lines changed

6 files changed

+0
-51
lines changed

libraries/Net/Net.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,6 @@ bool NetworkClass::isDataReady(void)
170170
return network_isready();
171171
}
172172

173-
IPAddress NetworkClass::localIP(void)
174-
{
175-
const uint8_t *ip = network_getlocalip();
176-
177-
return IPAddress(ip[0], ip[1], ip[2], ip[3]);
178-
}
179-
180173
IPAddress NetworkClass::resolve(const char *domain)
181174
{
182175
struct hostent *h = gethostbyname(domain);

libraries/Net/Net.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ class NetworkClass
3939
bool isGprsEnable(void);
4040
bool GprsWaitForActivation(int timeout = 60000);
4141
bool isGprsActive(void);
42-
IPAddress localIP(void);
4342
bool isDataEnable(void);
4443
int DataEnable(void);
4544
int DataDisable(void);

libraries/Net/NetClient.cpp

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -697,36 +697,6 @@ uint16_t NetClient::remotePort() const
697697
return remotePort(fd());
698698
}
699699

700-
#if 0 /* TODO */
701-
IPAddress NetClient::localIP(int fd) const
702-
{
703-
struct sockaddr_storage addr;
704-
socklen_t len = sizeof addr;
705-
getsockname(fd, (struct sockaddr *)&addr, &len);
706-
struct sockaddr_in *s = (struct sockaddr_in *)&addr;
707-
return IPAddress((uint32_t)(s->sin_addr.s_addr));
708-
}
709-
710-
uint16_t NetClient::localPort(int fd) const
711-
{
712-
struct sockaddr_storage addr;
713-
socklen_t len = sizeof addr;
714-
getsockname(fd, (struct sockaddr *)&addr, &len);
715-
struct sockaddr_in *s = (struct sockaddr_in *)&addr;
716-
return ntohs(s->sin_port);
717-
}
718-
719-
IPAddress NetClient::localIP() const
720-
{
721-
return localIP(fd());
722-
}
723-
724-
uint16_t NetClient::localPort() const
725-
{
726-
return localPort(fd());
727-
}
728-
#endif
729-
730700
bool NetClient::operator==(const NetClient &rhs)
731701
{
732702
return clientSocketHandle == rhs.clientSocketHandle && remotePort() == rhs.remotePort() && remoteIP() == rhs.remoteIP();

libraries/Net/NetClient.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,6 @@ class NetClient : public LogicromClient
103103
IPAddress remoteIP(int fd) const;
104104
uint16_t remotePort() const;
105105
uint16_t remotePort(int fd) const;
106-
#if 0 /* TODO */
107-
IPAddress localIP() const;
108-
IPAddress localIP(int fd) const;
109-
uint16_t localPort() const;
110-
uint16_t localPort(int fd) const;
111-
#endif
112106

113107
// friend class WiFiServer;
114108
using Print::write;

libraries/Net/examples/DomainResolve/DomainResolve.ino

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ void setup()
2222
/* Resolve if data connection ok */
2323
if (Net.isDataReady())
2424
{
25-
IPAddress devip = Net.localIP();
26-
printf("Device IP Address: %d.%d.%d.%d\n", devip[0], devip[1], devip[2], devip[3]);
27-
2825
/* Resolve google.com domain */
2926
IPAddress ip = Net.resolve("google.com");
3027
if (ip != IPADDR_NONE)

libraries/Net/keywords.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ DataDisable KEYWORD2
3030
isDataEnable KEYWORD2
3131
waitDataReady KEYWORD2
3232
isDataReady KEYWORD2
33-
localIP KEYWORD2
34-
getIMEI KEYWORD2
35-
getIMSI KEYWORD2
36-
getICCID KEYWORD2
3733

3834
#######################################
3935
# Constants (LITERAL1)

0 commit comments

Comments
 (0)