Procházet zdrojové kódy

[update] support receive more than 127 bytes of ppp frame.

liuxianliang před 4 roky
rodič
revize
098039bfde
2 změnil soubory, kde provedl 7 přidání a 13 odebrání
  1. 6 12
      src/cmux.c
  2. 1 1
      src/gsm/cmux_gsm.c

+ 6 - 12
src/cmux.c

@@ -430,20 +430,14 @@ static struct cmux_frame *cmux_frame_parse(struct cmux_buffer *buffer)
 
         frame->data_length = (*data & 254) >> 1;
         fcs = cmux_crctable[fcs ^ *data];
+        /* frame data length more than 127 bytes */
         if ((*data & 1) == 0)
         {
-            /* Current specify (version 7.1.0) states these kind of frames to be invalid
-            * Long lost of sync might be caused if we would expect a long
-            * frame because of an error in length field.
-                INC_BUF_POINTER(buf,data);
-                frame->data_length += (*data*128);
-                fcs = cmux_crctable[fcs^*data];
-                length_needed++;
-            */
-            cmux_frame_destroy(frame);
-            buffer->read_point = data;
-            buffer->flag_found = 0;
-            return cmux_frame_parse(buffer);
+            INC_BUF_POINTER(buffer,data);
+            frame->data_length += (*data*128);
+            fcs = cmux_crctable[fcs^*data];
+            length_needed++;
+            LOG_D("len_need: %d, frame_data_len: %d.", length_needed, frame->data_length);
         }
         length_needed += frame->data_length;
         if (!(cmux_buffer_length(buffer) >= length_needed))

+ 1 - 1
src/gsm/cmux_gsm.c

@@ -24,7 +24,7 @@
 #endif
 #include <rtdbg.h>
 
-#define CMUX_CMD "AT+CMUX=0,0,5,127,10,3,30,10,2"
+#define CMUX_CMD "AT+CMUX=0"
 
 struct cmux *gsm = RT_NULL;