Skip to content

Commit 10251ab

Browse files
author
Teppo Järvelin
committed
Cellular: failure when deleting created context is not considered as an error
If delete fails there is nothing we or application can do. There is no point returning an error for this. This affects to AT_CellularContext::disconnect not returning an error if context delete fails.
1 parent 9bf85ef commit 10251ab

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

UNITTESTS/stubs/AT_CellularContext_stub.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,8 @@ pdp_type_t AT_CellularContext::string_to_pdp_type(const char *pdp_type)
172172
}
173173

174174
// PDP Context handling
175-
nsapi_error_t AT_CellularContext::delete_current_context()
175+
void AT_CellularContext::delete_current_context()
176176
{
177-
return NSAPI_ERROR_OK;
178177
}
179178

180179
nsapi_error_t AT_CellularContext::do_user_authentication()

features/cellular/framework/AT/AT_CellularContext.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ pdp_type_t AT_CellularContext::string_to_pdp_type(const char *pdp_type_str)
309309
}
310310

311311
// PDP Context handling
312-
nsapi_error_t AT_CellularContext::delete_current_context()
312+
void AT_CellularContext::delete_current_context()
313313
{
314314
tr_info("Delete context %d", _cid);
315315
_at.clear_error();
@@ -321,7 +321,8 @@ nsapi_error_t AT_CellularContext::delete_current_context()
321321
_new_context_set = false;
322322
}
323323

324-
return _at.get_last_error();
324+
// there is nothing we can do if deleting of context fails. No point reporting an error (for example disconnect).
325+
_at.clear_error();
325326
}
326327

327328
nsapi_error_t AT_CellularContext::do_user_authentication()

features/cellular/framework/AT/AT_CellularContext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class AT_CellularContext : public CellularContext, public AT_CellularBase {
115115
nsapi_error_t find_and_activate_context();
116116
nsapi_error_t activate_ip_context();
117117
void check_and_deactivate_context();
118-
nsapi_error_t delete_current_context();
118+
void delete_current_context();
119119
nsapi_error_t check_operation(nsapi_error_t err, ContextOperation op);
120120
void ciot_opt_cb(mbed::CellularNetwork::CIoT_Supported_Opt ciot_opt);
121121
virtual void do_connect_with_retry();

0 commit comments

Comments
 (0)