Skip to content

Commit c5064a8

Browse files
author
Seppo Takalo
committed
Fix *MeshInterface::get_default_instance()
This was returning object, instead of pointer. Also it was trying to call lowpan(reference), instad of lowpan(ptr).
1 parent 9135418 commit c5064a8

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ bool LoWPANNDInterface::getRouterIpAddress(char *address, int8_t len)
165165
#if MBED_CONF_NSAPI_DEFAULT_MESH_TYPE == LOWPAN && DEVICE_802_15_4_PHY
166166
MBED_WEAK MeshInterface *MeshInterface::get_default_instance()
167167
{
168-
static LoWPANNDInterface lowpan(NanostackRfPhy::get_default_instance());
168+
static LoWPANNDInterface lowpan(&NanostackRfPhy::get_default_instance());
169169

170-
return lowpan;
170+
return &lowpan;
171171
}
172172
#endif

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,8 @@ mesh_error_t Nanostack::ThreadInterface::device_pskd_set(const char *pskd)
255255
#if MBED_CONF_NSAPI_DEFAULT_MESH_TYPE == THREAD && DEVICE_802_15_4_PHY
256256
MBED_WEAK MeshInterface *MeshInterface::get_target_default_instance()
257257
{
258-
static ThreadInterface thread(NanostackRfPhy::get_default_instance());
258+
static ThreadInterface thread(&NanostackRfPhy::get_default_instance());
259259

260-
return thread;
260+
return &thread;
261261
}
262262
#endif

features/netsocket/mbed_lib.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
"default-cellular-apn": null,
1010
"default-cellular-username": null,
1111
"default-cellular-password": null,
12-
"default-mesh-type": "THREAD",
12+
"default-mesh-type": {
13+
"help": "Configuration type for MeshInterface::get_default_instance(). [LOWPAN/THREAD]",
14+
"value": "THREAD"
15+
},
1316
"dns-response-wait-time": {
1417
"help": "How long the DNS translator waits for a reply from a server in milliseconds",
1518
"value": 5000

0 commit comments

Comments
 (0)