From c5064a8e3315f32770c729b6284fa132efb6e55a Mon Sep 17 00:00:00 2001 From: Seppo Takalo Date: Mon, 13 Aug 2018 18:25:16 +0300 Subject: [PATCH] Fix *MeshInterface::get_default_instance() This was returning object, instead of pointer. Also it was trying to call lowpan(reference), instad of lowpan(ptr). --- .../nanostack/mbed-mesh-api/source/LoWPANNDInterface.cpp | 4 ++-- features/nanostack/mbed-mesh-api/source/ThreadInterface.cpp | 4 ++-- features/netsocket/mbed_lib.json | 5 ++++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/features/nanostack/mbed-mesh-api/source/LoWPANNDInterface.cpp b/features/nanostack/mbed-mesh-api/source/LoWPANNDInterface.cpp index 0f674f8063..f9afe9ebf8 100644 --- a/features/nanostack/mbed-mesh-api/source/LoWPANNDInterface.cpp +++ b/features/nanostack/mbed-mesh-api/source/LoWPANNDInterface.cpp @@ -165,8 +165,8 @@ bool LoWPANNDInterface::getRouterIpAddress(char *address, int8_t len) #if MBED_CONF_NSAPI_DEFAULT_MESH_TYPE == LOWPAN && DEVICE_802_15_4_PHY MBED_WEAK MeshInterface *MeshInterface::get_default_instance() { - static LoWPANNDInterface lowpan(NanostackRfPhy::get_default_instance()); + static LoWPANNDInterface lowpan(&NanostackRfPhy::get_default_instance()); - return lowpan; + return &lowpan; } #endif diff --git a/features/nanostack/mbed-mesh-api/source/ThreadInterface.cpp b/features/nanostack/mbed-mesh-api/source/ThreadInterface.cpp index 14d7ab51f3..5b58cd4a03 100644 --- a/features/nanostack/mbed-mesh-api/source/ThreadInterface.cpp +++ b/features/nanostack/mbed-mesh-api/source/ThreadInterface.cpp @@ -255,8 +255,8 @@ mesh_error_t Nanostack::ThreadInterface::device_pskd_set(const char *pskd) #if MBED_CONF_NSAPI_DEFAULT_MESH_TYPE == THREAD && DEVICE_802_15_4_PHY MBED_WEAK MeshInterface *MeshInterface::get_target_default_instance() { - static ThreadInterface thread(NanostackRfPhy::get_default_instance()); + static ThreadInterface thread(&NanostackRfPhy::get_default_instance()); - return thread; + return &thread; } #endif diff --git a/features/netsocket/mbed_lib.json b/features/netsocket/mbed_lib.json index b93766c78d..179654b4e8 100644 --- a/features/netsocket/mbed_lib.json +++ b/features/netsocket/mbed_lib.json @@ -9,7 +9,10 @@ "default-cellular-apn": null, "default-cellular-username": null, "default-cellular-password": null, - "default-mesh-type": "THREAD", + "default-mesh-type": { + "help": "Configuration type for MeshInterface::get_default_instance(). [LOWPAN/THREAD]", + "value": "THREAD" + }, "dns-response-wait-time": { "help": "How long the DNS translator waits for a reply from a server in milliseconds", "value": 5000