# HDLC Deframer example

**URL:** <https://www.ruby-forum.com/t/hdlc-deframer-example/234021>\
**Category:** GNU Radio\
**Created:** [January 30, 2015, 10:22pm UTC](https://www.ruby-forum.com/t/hdlc-deframer-example/234021 "2015-01-30T22:22:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [January 30, 2015, 10:22pm UTC](https://www.ruby-forum.com/t/hdlc-deframer-example/234021/1 "2015-01-30T22:22:52Z")

</div>

Hi,  
I want to run a simple frame-deframe hdlc example.  
In the attached flow-graph the framed packet is printed through the  
“message debug” block. Why I do not receive any message in the output of  
the deframer?

Thank you  
Thanasis

---

<div class="post-metadata">

**Author:** ![Thanasis\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7ea924/32.png) [@Thanasis\_B](https://www.ruby-forum.com/u/Thanasis_B)\
**Post date:** [January 30, 2015, 10:40pm UTC](https://www.ruby-forum.com/t/hdlc-deframer-example/234021/2 "2015-01-30T22:40:09Z")

</div>

Two reasons. First, that random generator is only ever going to generate  
one PDU, and it’s not going all the way through the deframer for some  
reason. I think the deframer is asking for more samples than the framer  
ever ends up generating. Try a Message Strobe - Random Delay block, with  
the message set to:

pmt.cons(pmt.PMT\_NIL, pmt.init\_u8vector(4, [0xAA]\*4))

Second, the deframer length fields include the HDLC CRC. They probably  
shouldn’t, in hindsight, but increase the max length to 6 and it’ll  
work.

–n

On Fri, Jan 30, 2015 at 1:21 PM, Thanasis B.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![Thanasis\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7ea924/32.png) [@Thanasis\_B](https://www.ruby-forum.com/u/Thanasis_B)\
**Post date:** [January 30, 2015, 10:53pm UTC](https://www.ruby-forum.com/t/hdlc-deframer-example/234021/3 "2015-01-30T22:53:56Z")

</div>

Thank you Nick!

It worked like a charm!

2015-01-30 23:38 GMT+02:00 Nick F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
