Changeset 2736
- Timestamp:
- 08/17/07 12:02:26 (6 years ago)
- Location:
- trunk/src/target/gsm
- Files:
-
- 3 edited
-
include/gsmd/gsmd.h (modified) (2 diffs)
-
src/gsmd/atcmd.c (modified) (2 diffs)
-
src/gsmd/vendor_bcm.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/target/gsm/include/gsmd/gsmd.h
r2732 r2736 18 18 #define LGSM_ATCMD_F_EXTENDED 0x01 /* as opposed to basic */ 19 19 #define LGSM_ATCMD_F_PARAM 0x02 /* as opposed to action */ 20 #define LGSM_ATCMD_F_LFCR 0x04 /* accept LFCR as a line terminator */ 20 21 21 22 struct gsmd_atcmd { … … 38 39 LLPARSE_STATE_RESULT, /* within result payload */ 39 40 LLPARSE_STATE_RESULT_CR, /* CR after result */ 41 LLPARSE_STATE_RESULT_LF, /* LF after result */ 40 42 LLPARSE_STATE_PROMPT, /* within a "> " prompt */ 41 43 LLPARSE_STATE_PROMPT_SPC, /* a complete "> " prompt */ -
trunk/src/target/gsm/src/gsmd/atcmd.c
r2732 r2736 77 77 } 78 78 79 static inline void llparse_endline(struct llparser *llp) 80 { 81 /* re-set cursor to start of buffer */ 82 llp->cur = llp->buf; 83 llp->state = LLPARSE_STATE_IDLE; 84 memset(llp->buf, 0, LLPARSE_BUF_SIZE); 85 } 86 79 87 static int llparse_byte(struct llparser *llp, char byte) 80 88 { … … 122 130 if (byte == '\r') 123 131 llp->state = LLPARSE_STATE_RESULT_CR; 132 else if ((llp->flags & LGSM_ATCMD_F_LFCR) && byte == '\n') 133 llp->state = LLPARSE_STATE_RESULT_LF; 124 134 else 125 135 ret = llparse_append(llp, byte); 126 136 break; 127 137 case LLPARSE_STATE_RESULT_CR: 128 if (byte == '\n') {129 /* re-set cursor to start of buffer */130 llp->cur = llp->buf;131 llp->state = LLPARSE_STATE_IDLE;132 memset(llp->buf, 0, LLPARSE_BUF_SIZE);133 }138 if (byte == '\n') 139 llparse_endline(llp); 140 break; 141 case LLPARSE_STATE_RESULT_LF: 142 if (byte == '\r') 143 llparse_endline(llp); 134 144 break; 135 145 case LLPARSE_STATE_PROMPT: -
trunk/src/target/gsm/src/gsmd/vendor_bcm.c
r2734 r2736 99 99 struct gsmd_atcmd *cmd; 100 100 101 /* bcm sometimes sends LFCR instead of CRLF (eg *MTSMENU message) */ 102 g->llp.flags |= LGSM_ATCMD_F_LFCR; 103 101 104 /* TODO */ 102 105 return rc;
Note: See TracChangeset
for help on using the changeset viewer.
