Skip to content

Commit 2af2b1b

Browse files
authored
Merge pull request #11190 from jarvte/fix_wise1570_netsocket_tests
Cellular: failure when deleting created context is not considered error
2 parents 575cffb + 10251ab commit 2af2b1b

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
@@ -167,9 +167,8 @@ AT_CellularBase::CellularProperty AT_CellularContext::pdp_type_t_to_cellular_pro
167167
}
168168

169169
// PDP Context handling
170-
nsapi_error_t AT_CellularContext::delete_current_context()
170+
void AT_CellularContext::delete_current_context()
171171
{
172-
return NSAPI_ERROR_OK;
173172
}
174173

175174
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
@@ -291,7 +291,7 @@ void AT_CellularContext::set_credentials(const char *apn, const char *uname, con
291291
}
292292

293293
// PDP Context handling
294-
nsapi_error_t AT_CellularContext::delete_current_context()
294+
void AT_CellularContext::delete_current_context()
295295
{
296296
tr_info("Delete context %d", _cid);
297297
_at.clear_error();
@@ -303,7 +303,8 @@ nsapi_error_t AT_CellularContext::delete_current_context()
303303
_new_context_set = false;
304304
}
305305

306-
return _at.get_last_error();
306+
// there is nothing we can do if deleting of context fails. No point reporting an error (for example disconnect).
307+
_at.clear_error();
307308
}
308309

309310
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
@@ -114,7 +114,7 @@ class AT_CellularContext : public CellularContext, public AT_CellularBase {
114114
nsapi_error_t find_and_activate_context();
115115
nsapi_error_t activate_ip_context();
116116
void check_and_deactivate_context();
117-
nsapi_error_t delete_current_context();
117+
void delete_current_context();
118118
nsapi_error_t check_operation(nsapi_error_t err, ContextOperation op);
119119
void ciot_opt_cb(mbed::CellularNetwork::CIoT_Supported_Opt ciot_opt);
120120
virtual void do_connect_with_retry();

0 commit comments

Comments
 (0)