-
Notifications
You must be signed in to change notification settings - Fork 3k
Cellular: Provide API to restart cellular device #11159
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
Conversation
This API will restart the cellular device and its state machine and will try to reconnect again. It can be used from error recovery which an error happened in the cellular device
@Reda-RM, thank you for your changes. |
|
||
AT_CellularContext *curr = _context_list; | ||
while (curr) { | ||
nsapi_error_t error = curr->connect(); |
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.
Should check if a context has called connect and re-connection is really required.
In async mode should wait for DISCONNECTED
events before calling connect()
.
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.
@AriParkkila How can we know if connect()
was called before? Should I use is_connected()
before shutting down the device?
Regarding the async mode I thought it will be handled through the connect()
itself through the event queue. Can we change the mode temporary to synchronous mode here and then return it back after connecting? is there a better way for both points?
Why does this need to be a new API method? Is it not just a series of calls to existing APIs? Having an API like this seems like it just raises too many questions about what exactly it does - you'd have to end up specifying the exact sequence of sub-calls it makes, which then makes it feel like it may as well just be an example code snippet, or external library helper. And then you'd find yourself adding all the blocking/non-blocking variations, and events... Generically, I would expect the generic "disconnect" followed by "connect" on a |
@kjbracey-arm I agree with you that using disconnect then connect is better to reset the network interface. However this is not the case in cellular device so I introduced this new API. If you are going to consider restarting the cellular device and its state machine in disconnect API then no need at all for the new one. |
It was merged. @ARMmbed/mbed-os-wan please review |
Mbed OS API description for |
@Reda-RM Any comments for above questions? |
If we would like to do not add special API for cellular interfaces then I think " |
@trowbridgec Make sure you put your 2 cents in. |
I don't think disconnect should power down. When I disconnect I only want to disconnect from the network, either cellular or packet (as it's now). That way I can leave the modem powered on and save some time in the next connect. |
We may make |
@Reda-RM That would work too. The point I wanted to make is that IMHO there still should be a way to just disconnect from the network and what you've described above would achieve that too. |
My two cents is that PSM applications should be taken into account when considering the functionality of Should I be able to call Related issues: |
Continuing what @trowbridgec typed above; Additional consideration in documentation should also be given for how to manage Pelion client when an api like this is called as well as in PSM scenario's. |
Note, we are close to the 5.14 code freeze. This needs update asap to be in 5.14 otherwise will move to the next minor version |
Hi alls, I do not want this in connect/disconnect even with a bool parameter. Cellular device can have multiple connections, and being able to just disconnect is one way to use it as stated. Similarly, there is actually 2 stages in cellular devices, attach and connect. I do not think any of the current intefaces reset when disconnect is called -- if the reset here means any sort of HW level reset. If the justification is general operation on any interface, this would need to be implemented on all interfaces and drivers. This is a big change. Disconnect will invalidate PSM -- PSM maintains the network addressing, and disconnect changes that when the PDP context is closed. So PSM will be affected, network signalling is caused. So in summary I propose no changes to NetworkInterface. And it should not be specific for cellular device -- the separate calls should be used because they do provide the flexibility needed. |
If we do not like to modify the disconnect, should we at least make |
I removed 5.14 label, as this is not ready yet |
@Reda-RM CellularDevice API has In general, |
I will close this PR and individual APIs should be used instead to reset the network interface. May be a documentation is needed for the reset sequence. |
This API will restart the cellular device and its state machine and will try to reconnect again.
It can be used from error recovery which an error happened in the cellular device
This pull request depends on PR #11154 and should be merged after it.
Description
Pull request type
Reviewers
@AriParkkila
Release Notes