Skip to content

Cellular API shutdown to stop state machine #11154

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

Merged
merged 1 commit into from
Aug 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions features/cellular/framework/AT/AT_CellularContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -984,14 +984,14 @@ void AT_CellularContext::cellular_callback(nsapi_event_t ev, intptr_t ptr)
} else if (ev == NSAPI_EVENT_CONNECTION_STATUS_CHANGE && ptr == NSAPI_STATUS_DISCONNECTED) {
tr_info("cellular_callback: PPP mode and NSAPI_STATUS_DISCONNECTED");
_cb_data.error = NSAPI_ERROR_NO_CONNECTION;
_is_connected = false;
}
}
#else
#if MBED_CONF_MBED_TRACE_ENABLE
if (ev == NSAPI_EVENT_CONNECTION_STATUS_CHANGE && ptr == NSAPI_STATUS_DISCONNECTED) {
tr_info("cb: CellularContext disconnected");
_is_connected = false;
}
#endif // MBED_CONF_MBED_TRACE_ENABLE
#endif // NSAPI_PPP_AVAILABLE
// forward status change events to application, call_network_cb will make sure that only changed event are forwarded
call_network_cb((nsapi_connection_status_t)ptr);
Expand Down
3 changes: 0 additions & 3 deletions features/cellular/framework/AT/AT_CellularDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,6 @@ nsapi_error_t AT_CellularDevice::init()

nsapi_error_t AT_CellularDevice::shutdown()
{
if (_state_machine) {
_state_machine->reset();
}
CellularDevice::shutdown();

return _at->at_cmd_discard("+CFUN", "=0");
Expand Down
3 changes: 3 additions & 0 deletions features/cellular/framework/device/CellularDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ void CellularDevice::cellular_callback(nsapi_event_t ev, intptr_t ptr, CellularC

nsapi_error_t CellularDevice::shutdown()
{
if (_state_machine) {
_state_machine->stop();
}
CellularContext *curr = get_context_list();
while (curr) {
curr->cellular_callback(NSAPI_EVENT_CONNECTION_STATUS_CHANGE, NSAPI_STATUS_DISCONNECTED);
Expand Down