-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
modified Wi-SUN tasklet to return success when calling connect twice #11556
Conversation
@mikter, thank you for your changes. |
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 802_15_4_PHY is not requires for mesh anymore?
@@ -133,6 +133,7 @@ static void wisun_tasklet_main(arm_event_s *event) | |||
* The event is delivered when the NanoStack OS is running fine. | |||
* This event should be delivered ONLY ONCE. | |||
*/ | |||
tr_debug("event_Init"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
too detailed trace
@@ -434,7 +436,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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change needed also to other mesh tasklets?
If usage of |
My understanding was that this flag is only set if the board has 802 radio included. but mesh apis needs to be available if it is used with radio shield. So the && configuration was wrong |
started CI meanwhile |
True, but is there any use of the |
Test run: FAILEDSummary: 2 of 11 test jobs failed Failed test jobs:
|
|
I restarted both, all good now! |
features/netsocket/mbed_lib.json
Outdated
@@ -40,7 +40,7 @@ | |||
}, | |||
"default-mesh-type": { | |||
"help": "Configuration type for MeshInterface::get_default_instance(). [LOWPAN/THREAD/WISUN]", | |||
"value": "THREAD" | |||
"value": null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one question before integrating this: isn't this breaking change for apps - as the config value changes for default mesh type ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, these changes are potentially breaking, adding proper labels
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Questionable..
Is it a breaking change to return no default, instead of non-configured non-working default?
Or @mikter did the non-configured Thread work? My assumption is that it is a demo, with no real use cases.. should we optimise for testing and demo, or for real use cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think anyone should have Thread configured without any configuration in application
It would however work as a non-commissioned Thread device, but that should still be application configuration not a default.
I can remove this change if you like from this commit as it is not really related. although the Breaking change is not only because of this configuration, but it is because we are changing status code on public API.
CI restarted |
@AnttiKauppila Happy with changes and Release notes? |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Hold on here please, I'll start an email thread to confirm it. |
@mikter Are you sure that next sequence will work:
You demonstrate this and I see it was working earlier. I think double connect is now supported but not mine sequence. |
@juhhei01 Mika was supposed to just split the original PR into 2 separate ones, so presumably there should be another PR he has raised to cover your bug fix ? |
@adbridge I did not buy idea why you was blocking that fix which was reviewed and aproved by mesh stakeholders. I see that those blocked issues was even critical than current one. |
@@ -116,7 +116,7 @@ nsapi_error_t map_mesh_error(mesh_error_t err) | |||
case MESH_ERROR_PARAM: | |||
return NSAPI_ERROR_PARAMETER; | |||
case MESH_ERROR_STATE: | |||
return NSAPI_ERROR_DEVICE_ERROR; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like that now we are hiding something bigger issue? If we can return connected state at mesh error state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current return value make more sense if we are already connected
Ok the 5.15 is confirmed, I don't have further comments. |
@adbridge You are mixing commits and PRs.
One PR may contain more that one fix. Nothing wrong with that. You seem to enforse the last rule in the list:
However, pay attention to Having more merge commits just make history harder to read. |
@SeppoTakalo multiple commits for the same fix are acceptable. This PR had two very different changes and in that case it should go to two separate PRs. We are getting more strict on this because too many people are just dumping PRs with multiple unconnected fixes in them. |
yes |
CI started |
Test run: SUCCESSSummary: 12 of 12 test jobs passed |
Description
If connect to be called multiple times it will return NSAPI_ERROR_IS_CONNECTED status.
Pull request type
Reviewers
@JarkkoPaso @artokin @SeppoTakalo @AnttiKauppila @teetak01
Release Notes
Summary of changes
As stated in Mesh API documentation, we should return the status NSAPI_ERROR_IS_CONNECTED if connect is called twice. This PR (11556) fixes it.
Impact of changes
If connect method is called twice then different status code is returned.
Migration actions required
Implementations that rely on NSAPI_ERROR_DEVICE_ERROR status code when calling connect twice as their recovery method needs to change the handling to the correct status NSAPI_ERROR_IS_CONNECTED.