Skip to content

Commit

Permalink
modified Wi-SUN tasklet to return success when calling connet twice
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Mika Tervonen committed Sep 24, 2019
1 parent f513bce commit bd2c122
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ bool LoWPANNDInterface::getRouterIpAddress(char *address, int8_t len)
}

#define LOWPAN 0x2345
#if MBED_CONF_NSAPI_DEFAULT_MESH_TYPE == LOWPAN && DEVICE_802_15_4_PHY
#if MBED_CONF_NSAPI_DEFAULT_MESH_TYPE == LOWPAN
MBED_WEAK MeshInterface *MeshInterface::get_target_default_instance()
{
static bool inited;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ nsapi_error_t InterfaceNanostack::set_file_system_root_path(const char *root_pat
return MESH_ERROR_UNKNOWN;
}

#if !DEVICE_802_15_4_PHY
#ifndef MBED_CONF_NSAPI_DEFAULT_MESH_TYPE
MBED_WEAK MeshInterface *MeshInterface::get_target_default_instance()
{
return NULL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ mesh_error_t Nanostack::ThreadInterface::device_pskd_set(const char *pskd)
}

#define THREAD 0x2345
#if MBED_CONF_NSAPI_DEFAULT_MESH_TYPE == THREAD && DEVICE_802_15_4_PHY
#if MBED_CONF_NSAPI_DEFAULT_MESH_TYPE == THREAD

MBED_WEAK MeshInterface *MeshInterface::get_target_default_instance()
{
Expand Down
2 changes: 1 addition & 1 deletion features/nanostack/mbed-mesh-api/source/WisunInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ mesh_error_t WisunInterface::remove_trusted_certificates(void)
}

#define WISUN 0x2345
#if MBED_CONF_NSAPI_DEFAULT_MESH_TYPE == WISUN && DEVICE_802_15_4_PHY
#if MBED_CONF_NSAPI_DEFAULT_MESH_TYPE == WISUN
MBED_WEAK MeshInterface *MeshInterface::get_target_default_instance()
{
static bool inited;
Expand Down
2 changes: 1 addition & 1 deletion features/nanostack/mbed-mesh-api/source/nd_tasklet.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ int8_t nd_tasklet_connect(mesh_interface_cb callback, int8_t nwk_interface_id)
int8_t tasklet_id = tasklet_data_ptr->tasklet;

if (tasklet_data_ptr->network_interface_id != INVALID_INTERFACE_ID) {
return -3; // already connected to network
return tasklet_data_ptr->tasklet; // already connected to network
}

if (tasklet_data_ptr->tasklet_state == TASKLET_STATE_CREATED) {
Expand Down
2 changes: 1 addition & 1 deletion features/nanostack/mbed-mesh-api/source/thread_tasklet.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ int8_t thread_tasklet_connect(mesh_interface_cb callback, int8_t nwk_interface_i
int8_t tasklet = thread_tasklet_data_ptr->tasklet;

if (thread_tasklet_data_ptr->nwk_if_id != INVALID_INTERFACE_ID) {
return -3; // already connected to network
return thread_tasklet_data_ptr->tasklet; // already connected to network
}

if (thread_tasklet_data_ptr->tasklet_state == TASKLET_STATE_CREATED) {
Expand Down
2 changes: 1 addition & 1 deletion features/nanostack/mbed-mesh-api/source/wisun_tasklet.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ int8_t wisun_tasklet_connect(mesh_interface_cb callback, int8_t nwk_interface_id
int8_t tasklet_id = wisun_tasklet_data_ptr->tasklet;

if (wisun_tasklet_data_ptr->network_interface_id != INVALID_INTERFACE_ID) {
return -3; // already connected to network
return wisun_tasklet_data_ptr->tasklet; // already connected to network
}

if (wisun_tasklet_data_ptr->tasklet_state == TASKLET_STATE_CREATED) {
Expand Down
2 changes: 1 addition & 1 deletion features/netsocket/mbed_lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
},
"default-mesh-type": {
"help": "Configuration type for MeshInterface::get_default_instance(). [LOWPAN/THREAD/WISUN]",
"value": "THREAD"
"value": null
},
"dns-response-wait-time": {
"help": "How long the DNS translator waits for a reply from a server in milliseconds",
Expand Down

0 comments on commit bd2c122

Please sign in to comment.