Fix *MeshInterface::get_default_instance()

This was returning object, instead of pointer.
Also it was trying to call lowpan(reference), instad of lowpan(ptr).
pull/7778/head
Seppo Takalo 2018-08-13 18:25:16 +03:00
parent 91354184dc
commit c5064a8e33
3 changed files with 8 additions and 5 deletions

View File

@ -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 #if MBED_CONF_NSAPI_DEFAULT_MESH_TYPE == LOWPAN && DEVICE_802_15_4_PHY
MBED_WEAK MeshInterface *MeshInterface::get_default_instance() 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 #endif

View File

@ -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 #if MBED_CONF_NSAPI_DEFAULT_MESH_TYPE == THREAD && DEVICE_802_15_4_PHY
MBED_WEAK MeshInterface *MeshInterface::get_target_default_instance() 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 #endif

View File

@ -9,7 +9,10 @@
"default-cellular-apn": null, "default-cellular-apn": null,
"default-cellular-username": null, "default-cellular-username": null,
"default-cellular-password": 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": { "dns-response-wait-time": {
"help": "How long the DNS translator waits for a reply from a server in milliseconds", "help": "How long the DNS translator waits for a reply from a server in milliseconds",
"value": 5000 "value": 5000