diff --git a/hdlc/hdlcsync.c b/hdlc/hdlcsync.c index ff236ea..f33f53f 100644 --- a/hdlc/hdlcsync.c +++ b/hdlc/hdlcsync.c @@ -102,13 +102,21 @@ static int process_raw_hdlc(struct hdlc_proc *hdlc, uint8_t *data, unsigned int { unsigned int i; int out; + static int last_out; for (i = 0; i < len; i ++) { out = process_hdlc_bit(hdlc, data[i]); - if (out == -123) - printf("F "); - else if (out >= 0) - printf("%02x ", out); + if (out == -123) { + /* suppress repeating Flag characters */ + if (last_out != out) + printf("\nF "); + last_out = out; + } else if (out >= 0) { + /* suppress 0xAA and 0x55 bit pattern */ + if (out != 0xaa && out != 0x55) + printf("%02x ", out); + last_out = out; + } } }