discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] HDLC framer


From: Marcus Müller
Subject: Re: [Discuss-gnuradio] HDLC framer
Date: Thu, 04 Dec 2014 17:25:54 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0

Hi Daniel,
the HDLC framer can only deal with messages containing PMTs that are
"blobs", ie. u8vectors.
In fact, that's a missing feature:
        pmt::pmt_t len(pmt::car(msg)); //TODO for non-mult-8 nbits
        pmt::pmt_t blob(pmt::cdr(msg));
        if(!pmt::is_blob(blob))
            throw std::runtime_error("HDLC framer: PMT must be blob");

Instead of making a pmt.intern("String"), you will need to have a
u8vector. It's a bit ugly to generate that in single line:

pmt.pmt_to_python.numpy_to_uvector(numpy.array([ord(c) for c in "Hello
World"], numpy.uint8))

you might need to add an "import block" that does an "import numpy".

Greetings,
Marcus

On 12/04/2014 11:52 AM, Daniel Batista wrote:
> Thank you Marcus,
> I try the following:
> MessageStrobe("Hello World") ----> HDCL framer ---->HDLC deframer ----> 
> Message Debug
> and I get the following error message:thread[thread-per-block[2]: <block 
> hdlc_framer_pb (1)>]: pmt_car: wrong_type : Hello World!
> What did I do wrong?
> Daniel
>
>  
>
>      On Wednesday, December 3, 2014 10:55 AM, Marcus Müller <address@hidden> 
> wrote:
>    
>
>  Hi Daniel,
>
> PMT is short for "polymorphic type" [1].
> GNU Radio uses PMTs for stream tags and, more importantly here, for
> asynchronous message ports.
> So the idea is that you have a source of messages[2], sending your
> data to the HDLC framer, which frames it and generates output items.
> If you want some illustrated guide through these concept, I'd
> recommend the new guided tutorials on gnuradio.org[3] numbers 1 through 5.
>
> Greetings, and happy hacking,
> Marcus
>
> [1] http://gnuradio.org/doc/doxygen/page_pmt.html
> [2] http://gnuradio.org/doc/doxygen/page_msg_passing.html
> [3] http://gnuradio.org/redmine/projects/gnuradio/wiki/Guided_Tutorials
>
> On 12/02/2014 10:47 AM, Daniel Batista wrote:
>> Hi, I read in the documentation that HDLC framer takes in PMT
>> binary blobs and outputs HDLC frames as unpacked bits.I don't
>> undestand what are the PMT binary blobs.How can I put in an HDLC
>> frame a "Hello World" message? ThanksDaniel
>>
>>
>>
>>
>> _______________________________________________ Discuss-gnuradio
>> mailing list address@hidden 
>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>>
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
>
>    




reply via email to

[Prev in Thread] Current Thread [Next in Thread]