Skip to content

Commit 3a46630

Browse files
committed
Define default parameters of functions of derived class the same as the base class
The member function bringup() of class ThreadInterface redefines parameter stack's default value to IPV6_STACK from the inherited default value DEFAULT_STACK (in Interface). The default value will be resolved statically, not by dispatch, so this can cause confusion. Similar arguments apply to LoWPANNDInterface and WisunInterface.
1 parent 975dfcf commit 3a46630

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

connectivity/nanostack/mbed-mesh-api/source/LoWPANNDInterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Nanostack::LoWPANNDInterface final : public Nanostack::MeshInterface {
2828
public:
2929
nsapi_error_t bringup(bool dhcp, const char *ip,
3030
const char *netmask, const char *gw,
31-
nsapi_ip_stack_t stack = IPV6_STACK,
31+
nsapi_ip_stack_t stack = DEFAULT_STACK,
3232
bool blocking = true) override;
3333
nsapi_error_t bringdown() override;
3434
nsapi_error_t get_gateway(SocketAddress *sockAddr) override;

connectivity/nanostack/mbed-mesh-api/source/ThreadInterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Nanostack::ThreadInterface : public Nanostack::MeshInterface {
2727
public:
2828
nsapi_error_t bringup(bool dhcp, const char *ip,
2929
const char *netmask, const char *gw,
30-
nsapi_ip_stack_t stack = IPV6_STACK,
30+
nsapi_ip_stack_t stack = DEFAULT_STACK,
3131
bool blocking = true) override;
3232
nsapi_error_t bringdown() override;
3333
friend class Nanostack;

connectivity/nanostack/mbed-mesh-api/source/WisunInterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Nanostack::WisunInterface final : public Nanostack::MeshInterface {
3434
public:
3535
nsapi_error_t bringup(bool dhcp, const char *ip,
3636
const char *netmask, const char *gw,
37-
nsapi_ip_stack_t stack = IPV6_STACK,
37+
nsapi_ip_stack_t stack = DEFAULT_STACK,
3838
bool blocking = true) override;
3939
nsapi_error_t bringdown() override;
4040
nsapi_error_t get_gateway(SocketAddress *address) override;

0 commit comments

Comments
 (0)