Skip to content

Commit

Permalink
Don't issue QoS commands if not a 3G module
Browse files Browse the repository at this point in the history
  • Loading branch information
brycekahle committed Sep 10, 2015
1 parent 19bd586 commit 750a024
Showing 1 changed file with 23 additions and 16 deletions.
39 changes: 23 additions & 16 deletions hal/src/electron/modem/mdm_hal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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");
Expand All @@ -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...");
Expand All @@ -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
Expand Down

0 comments on commit 750a024

Please sign in to comment.