Clarify framing errors

pull/7/merge
pabr 2017-07-05 16:56:06 +02:00
rodzic 0d1d3df558
commit 34cc137c5d
1 zmienionych plików z 16 dodań i 13 usunięć

Wyświetl plik

@ -52,10 +52,10 @@ namespace leansdr {
// Unstuff this 0
} else if ( shiftreg == 0x7e ) { // 01111110 HDLC flag
if ( nbits_out != 7 ) {
if ( debug ) fprintf(stderr, "?");
// Not at byte boundary
if ( debug ) fprintf(stderr, "^");
++*hdlc_errors;
}
nbits_out = 0;
} else {
// Checksum
crc16 ^= 0xffff;
if ( framesize<2 || framesize<minframesize ||
@ -66,8 +66,11 @@ namespace leansdr {
if ( framesize >= minframesize ) ++*fcs_errors;
} else {
if ( debug ) fprintf(stderr, "_");
// This will trigger output, but we finish the byte first.
*pdatasize = framesize-2;
}
}
nbits_out = 0;
begin_frame();
// Keep processing up to 7 remaining bits from byte_in.
// Special cases 0111111 and 1111111 cannot affect *pdatasize.