@@ -52,12 +52,12 @@ Result openGPRSContext(SIM800 *sim800, const char *apn)
5252
5353 sim800->sendATTest ();
5454
55- while ((sim800->sendCmdAndWaitForResp_P (REGISTRATION_STATUS, CONNECTED, 2000 ) != TRUE &&
56- sim800->sendCmdAndWaitForResp_P (REGISTRATION_STATUS, ROAMING, 2000 ) != TRUE ) &&
55+ while ((sim800->sendCmdAndWaitForResp_P (REGISTRATION_STATUS, CONNECTED, 12000 ) != TRUE &&
56+ sim800->sendCmdAndWaitForResp_P (REGISTRATION_STATUS, ROAMING, 12000 ) != TRUE ) &&
5757 attempts < MAX_ATTEMPTS)
5858 {
59- sim800->sendCmdAndWaitForResp_P (READ_VOLTAGE, AT_OK, 1000 );
60- sim800->sendCmdAndWaitForResp_P (SIGNAL_QUALITY, AT_OK, 1000 );
59+ sim800->sendCmdAndWaitForResp_P (READ_VOLTAGE, AT_OK, 2000 );
60+ sim800->sendCmdAndWaitForResp_P (SIGNAL_QUALITY, AT_OK, 2000 );
6161 attempts++;
6262 delay (1000 * attempts);
6363 if (attempts == MAX_ATTEMPTS)
@@ -67,20 +67,20 @@ Result openGPRSContext(SIM800 *sim800, const char *apn)
6767 }
6868 }
6969
70- if (sim800->sendCmdAndWaitForResp_P (BEARER_PROFILE_GPRS, AT_OK, 2000 ) == FALSE )
70+ if (sim800->sendCmdAndWaitForResp_P (BEARER_PROFILE_GPRS, AT_OK, 14000 ) == FALSE )
7171 result = ERROR_BEARER_PROFILE_GPRS;
7272
7373 char httpApn[64 ];
7474 char tmp[24 ];
7575 strcpy_P (tmp, apn);
7676 sprintf_P (httpApn, BEARER_PROFILE_APN, tmp);
77- if (sim800->sendCmdAndWaitForResp (httpApn, AT_OK_, 2000 ) == FALSE )
77+ if (sim800->sendCmdAndWaitForResp (httpApn, AT_OK_, 10000 ) == FALSE )
7878 result = ERROR_BEARER_PROFILE_APN;
7979
80- while (sim800->sendCmdAndWaitForResp_P (QUERY_BEARER, BEARER_OPEN, 2000 ) == FALSE && attempts < MAX_ATTEMPTS)
80+ while (sim800->sendCmdAndWaitForResp_P (QUERY_BEARER, BEARER_OPEN, 10000 ) == FALSE && attempts < MAX_ATTEMPTS)
8181 {
8282 attempts++;
83- if (sim800->sendCmdAndWaitForResp_P (OPEN_GPRS_CONTEXT, AT_OK, 2000 ) == FALSE )
83+ if (sim800->sendCmdAndWaitForResp_P (OPEN_GPRS_CONTEXT, AT_OK, 10000 ) == FALSE )
8484 {
8585 result = ERROR_OPEN_GPRS_CONTEXT;
8686 }
@@ -97,7 +97,7 @@ Result closeGPRSContext(SIM800 *sim800)
9797{
9898 Result result = SUCCESS;
9999
100- if (sim800->sendCmdAndWaitForResp_P (CLOSE_GPRS_CONTEXT, AT_OK, 2000 ) == FALSE )
100+ if (sim800->sendCmdAndWaitForResp_P (CLOSE_GPRS_CONTEXT, AT_OK, 4000 ) == FALSE )
101101 result = ERROR_CLOSE_GPRS_CONTEXT;
102102
103103 return result;
0 commit comments