summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2010-04-06 17:24:04 -0500
committerDenis Kenzior <denkenz@gmail.com>2010-04-06 22:49:44 -0500
commitf6d23e153eba65167e8a7c3732fec50ff1d69ea2 (patch)
tree97d669caecacb2aa211c0f409160bde13b31cc4b
parent8bff9b65411d5ff1dfb9fbc5f03a28ffdc88d596 (diff)
downloadofono-f6d23e153eba65167e8a7c3732fec50ff1d69ea2.tar.bz2
ppp: Implement receive ACCM
-rw-r--r--gatchat/gatppp.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gatchat/gatppp.c b/gatchat/gatppp.c
index c1abbec3..ebba0ca2 100644
--- a/gatchat/gatppp.c
+++ b/gatchat/gatppp.c
@@ -288,8 +288,14 @@ static struct frame_buffer *ppp_decode(GAtPPP *ppp, guint8 *frame)
fcs = PPPINITFCS16;
i = 0;
- /* TBD - how to deal with recv_accm */
while (frame[pos] != PPP_FLAG_SEQ) {
+ /* Skip the characters in receive ACCM */
+ if (frame[pos] < 0x20 &&
+ (ppp->recv_accm & (1 << frame[pos])) != 0) {
+ pos++;
+ continue;
+ }
+
/* scan for escape character */
if (frame[pos] == PPP_ESC) {
/* skip that char */
@@ -640,7 +646,7 @@ GAtPPP *g_at_ppp_new(GIOChannel *modem)
/* set options to defaults */
ppp->mru = DEFAULT_MRU;
- ppp->recv_accm = DEFAULT_ACCM;
+ ppp->recv_accm = ~0U;
ppp->xmit_accm[0] = DEFAULT_ACCM;
ppp->xmit_accm[3] = 0x60000000; /* 0x7d, 0x7e */
ppp->pfc = FALSE;