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.
pull/15403/head
Mingjie Shen 2023-04-19 01:24:19 -04:00
parent 975dfcf968
commit 3a466307d2
3 changed files with 3 additions and 3 deletions

View File

@ -28,7 +28,7 @@ class Nanostack::LoWPANNDInterface final : public Nanostack::MeshInterface {
public:
nsapi_error_t bringup(bool dhcp, const char *ip,
const char *netmask, const char *gw,
nsapi_ip_stack_t stack = IPV6_STACK,
nsapi_ip_stack_t stack = DEFAULT_STACK,
bool blocking = true) override;
nsapi_error_t bringdown() override;
nsapi_error_t get_gateway(SocketAddress *sockAddr) override;

View File

@ -27,7 +27,7 @@ class Nanostack::ThreadInterface : public Nanostack::MeshInterface {
public:
nsapi_error_t bringup(bool dhcp, const char *ip,
const char *netmask, const char *gw,
nsapi_ip_stack_t stack = IPV6_STACK,
nsapi_ip_stack_t stack = DEFAULT_STACK,
bool blocking = true) override;
nsapi_error_t bringdown() override;
friend class Nanostack;

View File

@ -34,7 +34,7 @@ class Nanostack::WisunInterface final : public Nanostack::MeshInterface {
public:
nsapi_error_t bringup(bool dhcp, const char *ip,
const char *netmask, const char *gw,
nsapi_ip_stack_t stack = IPV6_STACK,
nsapi_ip_stack_t stack = DEFAULT_STACK,
bool blocking = true) override;
nsapi_error_t bringdown() override;
nsapi_error_t get_gateway(SocketAddress *address) override;