This commit is contained in:
cfif 2024-12-04 14:13:29 +03:00
parent 9fcacfb273
commit 08c825a2ed
1 changed files with 14 additions and 1 deletions

View File

@ -62,7 +62,20 @@ AtCommandResult AtGsmTelitLe910_PdpActivate(tAtCmd *env, uint8_t cid) {
AtCmdTxSendLn(env); AtCmdTxSendLn(env);
return AtCmdOkErrAnswer(env, env->stdRxTimeout*10); uint32_t leftMs;
uint32_t endMs = SystemGetMs() + env->stdRxTimeout * 2;
while (endMs > SystemGetMs()) {
leftMs = endMs - SystemGetMs();
if ((AtCmdReceiveNextLine(env, leftMs) == AT_OK) && (SystemGetMs() < endMs)) {
if (AtCmdRxBeginWithStatic(env, "OK"))return AT_OK;
if (AtCmdRxBeginWithStatic(env, "ERROR"))return AT_ERROR;
if (AtCmdRxBeginWithStatic(env, "+CME ERROR"))return AT_ERROR;
AtCmdProcessUnresolvedLine(env);
}
}
return AT_TIMEOUT;
} }
AtCommandResult AtGsmTelitLe910_PdpDeactivate(tAtCmd *env, uint8_t cid) { AtCommandResult AtGsmTelitLe910_PdpDeactivate(tAtCmd *env, uint8_t cid) {