Diffstat (limited to 'gammu/emb/common/protocol/at') (more/less context) (ignore whitespace changes)
-rw-r--r-- | gammu/emb/common/protocol/at/at.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gammu/emb/common/protocol/at/at.c b/gammu/emb/common/protocol/at/at.c index f4a75b7..f8ddc06 100644 --- a/gammu/emb/common/protocol/at/at.c +++ b/gammu/emb/common/protocol/at/at.c @@ -45,56 +45,60 @@ typedef struct { static GSM_Error AT_StateMachine(GSM_StateMachine *s, unsigned char rx_char) { GSM_Protocol_Message Msg2; GSM_Protocol_ATData *d = &s->Protocol.Data.AT; int i; /* These are lines with end of "normal" answers */ static char *StartStrings[] = { "OK" , "ERROR" , "+CME ERROR:" , "+CMS ERROR:" , "+CPIN: " , /*A2D issue*/ NULL}; /* Some info from phone can be inside "normal" answers * It starts with strings written here */ static SpecialAnswersStruct SpecialAnswers[] = { {"_OSIGQ:" ,1}, {"_OBS:" ,1}, {"^SCN:" ,1}, {"+CGREG:" ,1}, {"+CBM:" ,1}, {"+CMT:" ,2}, {"+CMTI:" ,1}, {"+CDS:" ,2}, - {"+CREG:" ,1}, + {"+CREG:" ,1}, {"+CUSD" ,1}, {"RING" ,1}, {"NO CARRIER" ,1}, {"NO ANSWER" ,1}, {"+COLP" ,1}, {"+CLIP" ,1}, + {"SDNDCRC =" ,1}, /* Samsung binary transfer end */ + {NULL ,1}}; +//printf("%c",rx_char); + /* Ignore leading CR, LF and ESC */ if (d->Msg.Length == 0) { if (rx_char == 10 || rx_char == 13 || rx_char == 27) return ERR_NONE; d->LineStart = d->Msg.Length; } if (d->Msg.BufferUsed < d->Msg.Length + 2) { d->Msg.BufferUsed = d->Msg.Length + 2; d->Msg.Buffer = (unsigned char *)realloc(d->Msg.Buffer,d->Msg.BufferUsed); } d->Msg.Buffer[d->Msg.Length++] = rx_char; d->Msg.Buffer[d->Msg.Length ] = 0; switch (rx_char) { case 0: break; case 10: case 13: if (!d->wascrlf) d->LineEnd = d->Msg.Length-1; d->wascrlf = true; if (d->Msg.Length > 0 && rx_char == 10 && d->Msg.Buffer[d->Msg.Length-2]==13) { i = 0; while (StartStrings[i] != NULL) { if (strncmp(StartStrings[i],d->Msg.Buffer+d->LineStart,strlen(StartStrings[i])) == 0) { |