-
Notifications
You must be signed in to change notification settings - Fork 511
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
Feature/cancel network connect on disconnect #863
Feature/cancel network connect on disconnect #863
Conversation
7f08bc8
to
da4d7ca
Compare
The latest commit ensures that the cancel operation only affects the call to
(EDIT: Why is Eclipse formatting so broken?) |
This is a risky change - I've seen my electron hang. @technobly Can you confirm the same? |
…ince this parameter cannot be reliably passed.
…e calling thread, which may be an ISR or the application thread.)
…and not all other operations.
… HAL `interrupt_hal.cpp`
6f970c5
to
a160447
Compare
Ok, this test app works as expected... however I've commented out SYSTEM_THREAD(ENABLE)
With theading enabled... the calls to the modem do not block the test app from proceeding to the next line, so that is why it behaves unexpectedly. |
But the threading is essential so we can cancel the connect attempt while it is happening. |
Some notes from testing this PR on an Electron U260
Todo
|
Some more data... Tinker that looks like this below, does seem to work ok and not lockup during connect with multi-threading enabled.
|
@m-mcgowan what do you think about my Soft Power Down comments and code fix above? We also need to figure out what it is about my code above that locks up the electron during connect with multithreading enabled. |
I don't think we should mix soft power down requiring an responsive application into this but address that separately. I wrote an app that blocked loop(), and soft power down doesn't work on 0.4.8-rc.6 either, so this is not a new issue. The reason is because system events should be posted and fired before shutting down, and these should happen on the application thread. A refinement might be to set a flag and force a system shutdown from systick after a timeout, but let's take that as a separate issue. |
👍 I'm ok with breaking out the Soft Power Down refinement. Edited the first post to reflect this. Would you please add the issue with your additional thoughts on a fix? |
…se a system hang when logging is enabled.
|
@m-mcgowan tested my test app above on a U260 [edit: with multi-threading enabled] and it does not lock up now during connect :) Also cancel works during connect just fine, and can exit and connect to the Cloud thereafter. Some of the Cellular API function operations lag behind the debugging output, but everything works. Also on device wiring/no_fixture tests all pass. |
Implementation for Issue #886
Todo
We should also look into what can be done to make Soft Power down function immediately with this PR while Connecting to the tower, i.e. It should cancel the connect. Some suggestions below.Doneness: