Merge pull request #11149 from mirelachirica/remove_local_stack_types

Cellular: Remove unnecessary local variables
pull/11104/head
Seppo Takalo 2019-08-06 11:29:56 +03:00 committed by GitHub
commit dd2d585f30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 11 deletions

View File

@ -352,9 +352,6 @@ AT_CellularBase::CellularProperty AT_CellularContext::pdp_type_t_to_cellular_pro
bool AT_CellularContext::get_context()
{
bool modem_supports_ipv6 = get_property(PROPERTY_IPV6_PDP_TYPE);
bool modem_supports_ipv4 = get_property(PROPERTY_IPV4_PDP_TYPE);
_at.cmd_start_stop("+CGDCONT", "?");
_at.resp_start("+CGDCONT:");
_cid = -1;
@ -407,23 +404,19 @@ bool AT_CellularContext::get_context()
bool AT_CellularContext::set_new_context(int cid)
{
bool modem_supports_ipv6 = get_property(PROPERTY_IPV6_PDP_TYPE);
bool modem_supports_ipv4 = get_property(PROPERTY_IPV4_PDP_TYPE);
bool modem_supports_nonip = get_property(PROPERTY_NON_IP_PDP_TYPE);
char pdp_type_str[8 + 1] = {0};
pdp_type_t pdp_type = IPV4_PDP_TYPE;
if (_nonip_req && _cp_in_use && modem_supports_nonip) {
if (_nonip_req && _cp_in_use && get_property(PROPERTY_NON_IP_PDP_TYPE)) {
strncpy(pdp_type_str, "Non-IP", sizeof(pdp_type_str));
pdp_type = NON_IP_PDP_TYPE;
} else if (modem_supports_ipv6 && modem_supports_ipv4) {
} else if (get_property(PROPERTY_IPV4V6_PDP_TYPE)) {
strncpy(pdp_type_str, "IPV4V6", sizeof(pdp_type_str));
pdp_type = IPV4V6_PDP_TYPE;
} else if (modem_supports_ipv6) {
} else if (get_property(PROPERTY_IPV6_PDP_TYPE)) {
strncpy(pdp_type_str, "IPV6", sizeof(pdp_type_str));
pdp_type = IPV6_PDP_TYPE;
} else if (modem_supports_ipv4) {
} else if (get_property(PROPERTY_IPV4_PDP_TYPE)) {
strncpy(pdp_type_str, "IP", sizeof(pdp_type_str));
pdp_type = IPV4_PDP_TYPE;
} else {