[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 03/05: digital: Fix error in HDLC framer re
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 03/05: digital: Fix error in HDLC framer rejecting packets when falsely determined to be "out of frame". |
Date: |
Sun, 27 Jul 2014 18:06:21 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
trondeau pushed a commit to branch maint
in repository gnuradio.
commit 488f24f0771cd6876b212e43d80f858936563f98
Author: Nick Foster <address@hidden>
Date: Tue Jul 22 15:18:41 2014 -0700
digital: Fix error in HDLC framer rejecting packets when falsely determined
to be
"out of frame".
---
gr-digital/lib/hdlc_deframer_bp_impl.cc | 24 +++++++++---------------
gr-digital/lib/hdlc_deframer_bp_impl.h | 1 -
2 files changed, 9 insertions(+), 16 deletions(-)
diff --git a/gr-digital/lib/hdlc_deframer_bp_impl.cc
b/gr-digital/lib/hdlc_deframer_bp_impl.cc
index 0723ad4..976d147 100644
--- a/gr-digital/lib/hdlc_deframer_bp_impl.cc
+++ b/gr-digital/lib/hdlc_deframer_bp_impl.cc
@@ -56,7 +56,6 @@ namespace gr {
d_bitctr=0;
d_ones=0;
d_pktbuf = new unsigned char[length_max+2];
- d_in_frame=false;
}
/*
@@ -106,28 +105,23 @@ namespace gr {
}
else {
}
- d_in_frame=false;
} else {
- d_in_frame=true;
}
d_bitctr=0;
d_bytectr=0;
} else { //unstuff
}
} else { //not 5+ continuous ones
- if(d_in_frame) {
- if(d_bytectr > d_length_max) {
- d_bytectr=0;
+ if(d_bytectr > d_length_max) {
+ d_bytectr=0;
+ d_bitctr=0;
+ } else {
+ d_pktbuf[d_bytectr]>>=1;
+ if (bit) d_pktbuf[d_bytectr] |= 0x80;
+ d_bitctr++;
+ if (d_bitctr==8) {
d_bitctr=0;
- d_in_frame=false;
- } else {
- d_pktbuf[d_bytectr]>>=1;
- if (bit) d_pktbuf[d_bytectr] |= 0x80;
- d_bitctr++;
- if (d_bitctr==8) {
- d_bitctr=0;
- d_bytectr++;
- }
+ d_bytectr++;
}
}
}
diff --git a/gr-digital/lib/hdlc_deframer_bp_impl.h
b/gr-digital/lib/hdlc_deframer_bp_impl.h
index f7c4253..d29d9fc 100644
--- a/gr-digital/lib/hdlc_deframer_bp_impl.h
+++ b/gr-digital/lib/hdlc_deframer_bp_impl.h
@@ -36,7 +36,6 @@ namespace gr {
size_t d_ones;
size_t d_bytectr;
size_t d_bitctr;
- bool d_in_frame;
unsigned char *d_pktbuf;
unsigned int crc_ccitt(unsigned char *data, size_t len);