Skip to content

Commit dd2d585

Browse files
author
Seppo Takalo
authored
Merge pull request #11149 from mirelachirica/remove_local_stack_types
Cellular: Remove unnecessary local variables
2 parents fae1504 + 341cc2b commit dd2d585

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

features/cellular/framework/AT/AT_CellularContext.cpp

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -352,9 +352,6 @@ AT_CellularBase::CellularProperty AT_CellularContext::pdp_type_t_to_cellular_pro
352352

353353
bool AT_CellularContext::get_context()
354354
{
355-
bool modem_supports_ipv6 = get_property(PROPERTY_IPV6_PDP_TYPE);
356-
bool modem_supports_ipv4 = get_property(PROPERTY_IPV4_PDP_TYPE);
357-
358355
_at.cmd_start_stop("+CGDCONT", "?");
359356
_at.resp_start("+CGDCONT:");
360357
_cid = -1;
@@ -407,23 +404,19 @@ bool AT_CellularContext::get_context()
407404

408405
bool AT_CellularContext::set_new_context(int cid)
409406
{
410-
bool modem_supports_ipv6 = get_property(PROPERTY_IPV6_PDP_TYPE);
411-
bool modem_supports_ipv4 = get_property(PROPERTY_IPV4_PDP_TYPE);
412-
bool modem_supports_nonip = get_property(PROPERTY_NON_IP_PDP_TYPE);
413-
414407
char pdp_type_str[8 + 1] = {0};
415408
pdp_type_t pdp_type = IPV4_PDP_TYPE;
416409

417-
if (_nonip_req && _cp_in_use && modem_supports_nonip) {
410+
if (_nonip_req && _cp_in_use && get_property(PROPERTY_NON_IP_PDP_TYPE)) {
418411
strncpy(pdp_type_str, "Non-IP", sizeof(pdp_type_str));
419412
pdp_type = NON_IP_PDP_TYPE;
420-
} else if (modem_supports_ipv6 && modem_supports_ipv4) {
413+
} else if (get_property(PROPERTY_IPV4V6_PDP_TYPE)) {
421414
strncpy(pdp_type_str, "IPV4V6", sizeof(pdp_type_str));
422415
pdp_type = IPV4V6_PDP_TYPE;
423-
} else if (modem_supports_ipv6) {
416+
} else if (get_property(PROPERTY_IPV6_PDP_TYPE)) {
424417
strncpy(pdp_type_str, "IPV6", sizeof(pdp_type_str));
425418
pdp_type = IPV6_PDP_TYPE;
426-
} else if (modem_supports_ipv4) {
419+
} else if (get_property(PROPERTY_IPV4_PDP_TYPE)) {
427420
strncpy(pdp_type_str, "IP", sizeof(pdp_type_str));
428421
pdp_type = IPV4_PDP_TYPE;
429422
} else {

0 commit comments

Comments
 (0)