diff --git a/hal/src/electron/modem/mdm_hal.cpp b/hal/src/electron/modem/mdm_hal.cpp index 8752594074..101f3bbdfc 100644 --- a/hal/src/electron/modem/mdm_hal.cpp +++ b/hal/src/electron/modem/mdm_hal.cpp @@ -679,6 +679,7 @@ int MDMParser::_cbUACTIND(int type, const char* buf, int len, int* i) bool MDMParser::pdp(const char* apn) { bool ok = true; + bool is3G = _dev.dev == DEV_SARA_U260 || _dev.dev == DEV_SARA_U270; if (_init && _pwr) { LOCK(); MDM_INFO("Modem::pdp\r\n"); @@ -688,15 +689,17 @@ bool MDMParser::pdp(const char* apn) if (RESP_OK != waitFinalResp(NULL, NULL, 2000)) goto failure; - MDM_INFO("Define a QoS profile for PDP context 1"); - /* with Traffic Class 3 (background), - * maximum bit rate 64 kb/s both for UL and for DL, no Delivery Order requirements, - * a maximum SDU size of 320 octets, an SDU error ratio of 10-4, a residual bit error - * ratio of 10-5, delivery of erroneous SDUs allowed and Traffic Handling Priority 3. - */ - sendFormated("AT+CGEQREQ=1,3,64,64,,,0,320,\"1E4\",\"1E5\",1,,3\r\n"); - if (RESP_OK != waitFinalResp(NULL, NULL, 2000)) - goto failure; + if (is3G) { + MDM_INFO("Define a QoS profile for PDP context 1"); + /* with Traffic Class 3 (background), + * maximum bit rate 64 kb/s both for UL and for DL, no Delivery Order requirements, + * a maximum SDU size of 320 octets, an SDU error ratio of 10-4, a residual bit error + * ratio of 10-5, delivery of erroneous SDUs allowed and Traffic Handling Priority 3. + */ + sendFormated("AT+CGEQREQ=1,3,64,64,,,0,320,\"1E4\",\"1E5\",1,,3\r\n"); + if (RESP_OK != waitFinalResp(NULL, NULL, 2000)) + goto failure; + } MDM_INFO("Activate PDP context 1..."); sendFormated("AT+CGACT=1,1\r\n"); @@ -713,9 +716,11 @@ bool MDMParser::pdp(const char* apn) // +CGPADDR: 1, "99.88.111.88" if (RESP_OK != waitFinalResp(NULL, NULL, 2000)) - MDM_INFO("Read the negotiated QoS profile for PDP context 1..."); - sendFormated("AT+CGEQNEG=1\r\n"); - goto failure; + if (is3G) { + MDM_INFO("Read the negotiated QoS profile for PDP context 1..."); + sendFormated("AT+CGEQNEG=1\r\n"); + goto failure; + } } MDM_INFO("Test PDP context 1 for non-zero IP address..."); @@ -729,10 +734,12 @@ bool MDMParser::pdp(const char* apn) if (RESP_OK != waitFinalResp(NULL, NULL, 2000)) goto failure; - MDM_INFO("Read the negotiated QoS profile for PDP context 1..."); - sendFormated("AT+CGEQNEG=1\r\n"); - if (RESP_OK != waitFinalResp(NULL, NULL, 2000)) - goto failure; + if (is3G) { + MDM_INFO("Read the negotiated QoS profile for PDP context 1..."); + sendFormated("AT+CGEQNEG=1\r\n"); + if (RESP_OK != waitFinalResp(NULL, NULL, 2000)) + goto failure; + } UNLOCK(); _activated = true; // PDP