discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Packet Header Generator


From: Ed Criscuolo
Subject: Re: [Discuss-gnuradio] Packet Header Generator
Date: Sat, 15 Nov 2014 11:48:54 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130328 Thunderbird/17.0.5

On 11/14/14 4:49 PM, Tom Rondeau wrote:
On Fri, Nov 14, 2014 at 3:14 PM, Ed Criscuolo
<address@hidden <mailto:address@hidden>> wrote:

    I'm trying to use the Packet Header Generator block
    (not the Default one) from within GRC to generate a
    packet header formatted to my own specification in
    order to match an existing protocol.

    I assume that an appropriate "formatter object" can
    be submitted to this block to instruct it to build an
    arbitrary header, but I'm having difficulty finding
    any documentation or example of using a formatter object.
    All I found points to the packet_header_default::header___formatter
    method, which composes a fixed format that is of no use to me.

    Any help point me in the right direction?  Am I just missing
    it or is there no "generic" header formatter capability?

    @(^.^)@  Ed



Hey Ed,

Funny enough, I was just working on this today. I'm adding a similar
packet header generator for async (PDU-based) packets. The concept is
similar with a default base class that you'd overload for your own
purposes for packet formatting. I'll be documenting this behavior more
in the blocks themselves, and this should eventually become the basis
for another level of our tutorials.

I have it working here in simulation, but I know there's going to be
some trouble going over the air. I suspect I'll have something that's is
worth sharing and reasonably documented early next week.

Tom


OK.  Meanwhile, is there some clever Python hack I can use in the
interim?  I'm trying to get a timetag in a specific format
(64-bit integer, LSB=250 picoSeconds) into the header I'm generating.
It has to increment by 0x0000000000028000 for each packet.

For example, for my sequence number field, I needed a 16-bit unsigned
number that skipped over any value where the last 5 bits are '1',
and rolled over at 2**16.  I used a repeating short vector source
with the Python list comprehension

[s for s in range(0,32768)+range(-32768,0) if s%32 != 31]

as the vector entry in the GR block.  This got merged with the
other header fields via stream mux block. It worked great.

But for the timetag, I don't have the rollover which allowed
me to pregenerate a a fixed (large) vector.  Any ideas?

@(^.^)@  Ed




reply via email to

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