-
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
Status callbacks #6032
Status callbacks #6032
Conversation
Looking at that, should we squash the entire original branch to 1 commit, as all the steps are review comments? |
Please review @kjbracey-arm @TeemuKultala @geky @AnttiKauppila @sg- @0xc0170 @mikaleppanen |
And we have a binary compatibility breakage with UBLOX_EVK_ODIN_W2 |
This targets master, not feature-status-callbacks ? |
Yes, the aim was to land the feature branch on master for 5.8. This is doing that in one step, incorporating implement fixes found during testing. Do you want to do a three-step process - you rebase the feature branch, then PR for fixes to it, then PR to merge feature to master? I guess now we know we have a compatibility break, going to feature branch first would give Ublox an opportunity to submit a PR for new binary to that feature-branch. |
Possible immediate workaround for ODIN_W2 - temporary hack to Will render the feature non-functional on that board for now. |
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.
Content looks fine to me - just that 1 query.
I'd be inclined to squash all the original feature branch work to 1 commit rather than including all the review changes on master. Not sure what others think.
return; | ||
} else { | ||
memcpy(thread_tasklet_data_ptr->ip, temp_ipv6, 16); | ||
if (memcmp(thread_tasklet_data_ptr->ip, thread_tasklet_data_ptr->link_config.mesh_local_ula_prefix, 8) == 0) { |
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.
Do you need to re-read the mesh_local_ula prefix too? Is that only set on the initial connect, or is it being updated?
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.
Yes, correct, that isn't updated, so need to read and update from the thread_management_configuration. I'll make a commit, I tested it already.
History clean up would be good (if its one commit or multiple but concise and clear) 👍
We should avoid this. @jarlamsa How to make it compatible with odin? cc @ARMmbed/team-ublox |
Ideal scenario would be that ublox would recompile their driver against this PR and push their recompiled binary to this PR |
Hi, we will update the driver and hopefully have something tomorrow if everything works as expected. |
Please rebase (mesh was updated recently) |
Hi, I have created a new driver release but could not create a PR/merge towards the jarlamsa:status-callbacks branch so maybe you can merge in the binaries instead? Driver release v2.4 rc1: The driver release is also dependent on this fix otherwise the TCP connection might hard fault: Note that the current wifi tests are not working for ODIN therefore they were not done. However internal u-blox tests have been run and the wifi example. This will be fixed in a later release. |
@andreaslarssonublox do you mean these commits?
What do you mean by this? What is breaking them? |
@jarlamsa Yes, those are the commits. Yes, the tests-network-wifi test cases were not run since we have not fixed some minor issues to get them to pass. However there is no change in behavior since the version 2.3 of the driver. |
This is the original content of feature-status-callbacks, reviewed in ARMmbed#5457
3c492c1
to
282f3c9
Compare
/morph build |
Build : SUCCESSBuild number : 1100 Triggering tests/morph test |
* | ||
* @param status_cb The callback for status changes | ||
*/ | ||
virtual void attach(mbed::Callback<void(nsapi_event_t, intptr_t)> status_cb); |
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.
Could you document what are the parameters of the callback in input ?
From the signature it looks like it may handle more than just status change otherwise why not just take in a nsapi_connection_status_t
as the callback parameter ?
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.
Some explanation is in nsapi_types.h, with nsapi_event_t. Is that clear enough that you understand it? (I know what it means but that may be because I was in the review meetings).
Agree it should be summarised here.
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 that clear enough that you understand it?
Looking at the documentation and signature; what is unclear for me is whether this status_cb will solely handle status change events or if it will receive other kind of events if nsapi_event_t is updated.
If the parameter of the attach function is not destined to handle events other than connection status change events then the interface is overly complex.
If the callback attached handles more than status events in the future then it is a breaking change: the contract with application code stated in comments would have been broken.
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.
Would this suffice for the documentation:
/** Register callback for status reporting
*
* The specified status callback function will be called on status changes
* on the network. The parameters on the callback are the event type and
* event-type dependent reason parameter.
*
* @param status_cb The callback for status changes
*/
virtual void attach(mbed::Callback<void(nsapi_event_t, intptr_t)> status_cb);
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.
The intent is that new events will be added to nsapi_event_t
, and users would be expected to ignore event types they didn't know about. That should be documented. There is one new event type already being plotted.
The use of an enum
for a set that may be extended is a little iffy; it seems to be a C++-ism to use them instead of #define
s, despite that. Precedent has already been set by nsapi_error
and nsapi_socket_option_t
, which are gradually being extended.
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.
@pan- Are you happy with the proposed change in my comment or does it need some refinement?
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 good (better than previous version) to me
Exporter Build : SUCCESSBuild number : 778 |
Test : SUCCESSBuild number : 908 |
/morph build |
@AnotherButler New API |
Build : SUCCESSBuild number : 1108 Triggering tests/morph test |
Test : SUCCESSBuild number : 916 |
Exporter Build : FAILUREBuild number : 787 |
/morph export-build |
Exporter Build : SUCCESSBuild number : 794 |
@jarlamsa Does this PR effectively replace the ARMmbed:feature-status-callbacks branch? Also, will this PR need to be squashed before merging in? |
@cmonr Yes, this contains all the original changes from ARMmbed:feature-status-callbacks branch. Not sure about squashing though, 2 cherry-picked commits are coming from ublox, and I would like those to be separate commits, 2 commits on top of that. And if you refer to the squashing discussion earlier, that has already been done. |
@VeijoPesonen is preparing handbook documentation - please link that PR to here when created. |
Description
Original PR to a feature branch: #5457
This PR adds cases when disconnect happens without user calling disconnect()
For lwip, if ethernet cable is disconnected
Nanostack 6LoWPAN - if connection to border router / outside is lost
Nanostack Thread - if connection to border router / outside is lost
Nanostack Ethernet - if ethernet cable is disconnected
Status
READY
Migrations
YES
These were discussed in the original PR: #5457
The new commits are not modifying these already discussed changes
In NetworkInterface new APIs:
-attach() for connection status callback registering
-get_connection_status()
-set_blocking()
In PPPCellularInterface:
-connection_status_cb() removed
Related PRs
feature-status-callbacks | #5457
Todos
Deploy notes
Steps to test or reproduce