Skip to content

Commit f0a53d2

Browse files
author
Mika Tervonen
committed
modified Wi-SUN tasklet to return success when calling connet twice
Modified flagging of mesh APIs to not use internal RF chip flag changed default mesh interface to NULL instead of Thread Added some extra traces for Wi-SUN
1 parent f513bce commit f0a53d2

File tree

6 files changed

+8
-6
lines changed

6 files changed

+8
-6
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ bool LoWPANNDInterface::getRouterIpAddress(char *address, int8_t len)
171171
}
172172

173173
#define LOWPAN 0x2345
174-
#if MBED_CONF_NSAPI_DEFAULT_MESH_TYPE == LOWPAN && DEVICE_802_15_4_PHY
174+
#if MBED_CONF_NSAPI_DEFAULT_MESH_TYPE == LOWPAN
175175
MBED_WEAK MeshInterface *MeshInterface::get_target_default_instance()
176176
{
177177
static bool inited;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ nsapi_error_t InterfaceNanostack::set_file_system_root_path(const char *root_pat
230230
return MESH_ERROR_UNKNOWN;
231231
}
232232

233-
#if !DEVICE_802_15_4_PHY
233+
#ifndef MBED_CONF_NSAPI_DEFAULT_MESH_TYPE
234234
MBED_WEAK MeshInterface *MeshInterface::get_target_default_instance()
235235
{
236236
return NULL;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ mesh_error_t Nanostack::ThreadInterface::device_pskd_set(const char *pskd)
261261
}
262262

263263
#define THREAD 0x2345
264-
#if MBED_CONF_NSAPI_DEFAULT_MESH_TYPE == THREAD && DEVICE_802_15_4_PHY
264+
#if MBED_CONF_NSAPI_DEFAULT_MESH_TYPE == THREAD
265265

266266
MBED_WEAK MeshInterface *MeshInterface::get_target_default_instance()
267267
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ mesh_error_t WisunInterface::remove_trusted_certificates(void)
248248
}
249249

250250
#define WISUN 0x2345
251-
#if MBED_CONF_NSAPI_DEFAULT_MESH_TYPE == WISUN && DEVICE_802_15_4_PHY
251+
#if MBED_CONF_NSAPI_DEFAULT_MESH_TYPE == WISUN
252252
MBED_WEAK MeshInterface *MeshInterface::get_target_default_instance()
253253
{
254254
static bool inited;

features/nanostack/mbed-mesh-api/source/wisun_tasklet.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ static void wisun_tasklet_main(arm_event_s *event)
133133
* The event is delivered when the NanoStack OS is running fine.
134134
* This event should be delivered ONLY ONCE.
135135
*/
136+
tr_debug("event_Init");
136137
mesh_system_send_connect_event(wisun_tasklet_data_ptr->tasklet);
137138
break;
138139

@@ -147,6 +148,7 @@ static void wisun_tasklet_main(arm_event_s *event)
147148

148149
case APPLICATION_EVENT:
149150
if (event->event_id == APPL_EVENT_CONNECT) {
151+
tr_debug("event_connect");
150152
wisun_tasklet_configure_and_connect_to_network();
151153
}
152154
break;
@@ -434,7 +436,7 @@ int8_t wisun_tasklet_connect(mesh_interface_cb callback, int8_t nwk_interface_id
434436
int8_t tasklet_id = wisun_tasklet_data_ptr->tasklet;
435437

436438
if (wisun_tasklet_data_ptr->network_interface_id != INVALID_INTERFACE_ID) {
437-
return -3; // already connected to network
439+
return wisun_tasklet_data_ptr->tasklet; // already connected to network
438440
}
439441

440442
if (wisun_tasklet_data_ptr->tasklet_state == TASKLET_STATE_CREATED) {

features/netsocket/mbed_lib.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
},
4141
"default-mesh-type": {
4242
"help": "Configuration type for MeshInterface::get_default_instance(). [LOWPAN/THREAD/WISUN]",
43-
"value": "THREAD"
43+
"value": null
4444
},
4545
"dns-response-wait-time": {
4646
"help": "How long the DNS translator waits for a reply from a server in milliseconds",

0 commit comments

Comments
 (0)