Skip to content

Commit 62170dd

Browse files
author
Kimmo Vaisanen
committed
Netsocket: Fix SocketAddress stub for new API
1 parent 4eda588 commit 62170dd

File tree

1 file changed

+2
-48
lines changed

1 file changed

+2
-48
lines changed

UNITTESTS/stubs/SocketAddress_stub.cpp

Lines changed: 2 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,9 @@
1616
*/
1717

1818
#include "SocketAddress.h"
19-
#include "NetworkInterface.h"
20-
#include "NetworkStack.h"
21-
#include <string.h>
22-
#include "mbed.h"
2319

2420

25-
static bool ipv6_is_valid(const char *addr)
26-
{
27-
return false;
28-
}
29-
30-
static int ipv6_scan_chunk(uint16_t *shorts, const char *chunk)
31-
{
32-
return 0;
33-
}
34-
35-
36-
SocketAddress::SocketAddress(nsapi_addr_t addr, uint16_t port)
21+
SocketAddress::SocketAddress(const nsapi_addr_t &addr, uint16_t port)
3722
{
3823
}
3924

@@ -49,10 +34,6 @@ SocketAddress::SocketAddress(const SocketAddress &addr)
4934
{
5035
}
5136

52-
SocketAddress::~SocketAddress()
53-
{
54-
}
55-
5637
bool SocketAddress::set_ip_address(const char *addr)
5738
{
5839
return false;
@@ -62,11 +43,7 @@ void SocketAddress::set_ip_bytes(const void *bytes, nsapi_version_t version)
6243
{
6344
}
6445

65-
void SocketAddress::set_addr(nsapi_addr_t addr)
66-
{
67-
}
68-
69-
void SocketAddress::set_port(uint16_t port)
46+
void SocketAddress::set_addr(const nsapi_addr_t &addr)
7047
{
7148
}
7249

@@ -75,29 +52,6 @@ const char *SocketAddress::get_ip_address() const
7552
return NULL;
7653
}
7754

78-
const void *SocketAddress::get_ip_bytes() const
79-
{
80-
return NULL;
81-
}
82-
83-
nsapi_version_t SocketAddress::get_ip_version() const
84-
{
85-
nsapi_version_t ver = NSAPI_IPv6;
86-
return ver;
87-
}
88-
89-
nsapi_addr_t SocketAddress::get_addr() const
90-
{
91-
nsapi_addr_t addr;
92-
addr.version = NSAPI_IPv6;
93-
return _addr;
94-
}
95-
96-
uint16_t SocketAddress::get_port() const
97-
{
98-
return 0;
99-
}
100-
10155
SocketAddress::operator bool() const
10256
{
10357
return false;

0 commit comments

Comments
 (0)