diff options
author | Harald Welte <laforge@gnumonks.org> | 2012-06-01 23:29:11 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2012-06-01 23:29:11 +0200 |
commit | 28e25ae42da7d65face9ad2472075f7c4fc87e92 (patch) | |
tree | da4b4d84c533d4bd6e254cca086eb29403f0acdf /src/gsmd/atcmd.c | |
parent | b0b7419a68adec35e473e0ce479b5356e838057a (diff) |
HACKS: Temporary hacks to make it work for wavecom / rf_lock
Diffstat (limited to 'src/gsmd/atcmd.c')
-rw-r--r-- | src/gsmd/atcmd.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gsmd/atcmd.c b/src/gsmd/atcmd.c index adf18e0..d8a01b6 100644 --- a/src/gsmd/atcmd.c +++ b/src/gsmd/atcmd.c @@ -101,6 +101,7 @@ static int llparse_byte(struct llparser *llp, char byte) llp->state = LLPARSE_STATE_PROMPT; else { #ifdef STRICT + DEBUGP("IDLE: no \\r or > following \\r\n"); llp->state = LLPARSE_STATE_ERROR; #else llp->state = LLPARSE_STATE_RESULT; @@ -115,8 +116,10 @@ static int llparse_byte(struct llparser *llp, char byte) case LLPARSE_STATE_IDLE_CR: if (byte == '\n') llp->state = LLPARSE_STATE_IDLE_LF; - else if (byte != '\r') + else if (byte != '\r') { + DEBUGP("IDLE_CR: no \\r following \\n\n"); llp->state = LLPARSE_STATE_ERROR; + } break; case LLPARSE_STATE_IDLE_LF: /* can we really go directly into result_cr ? */ @@ -156,9 +159,13 @@ static int llparse_byte(struct llparser *llp, char byte) } break; case LLPARSE_STATE_ERROR: + DEBUGP("already in state ERROR\n"); break; } + if (llp->state == LLPARSE_STATE_ERROR) + exit(5); + return ret; } |