[Top][All Lists]

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

[Discuss-gnuradio] Parsing extra metadata

From: Daniel Marlow
Subject: [Discuss-gnuradio] Parsing extra metadata
Date: Tue, 19 Aug 2014 16:13:19 -0400


   I am trying to add some extra information to the standard metadata file header.    

   Following the information posted on http://gnuradio.org/doc/doxygen/page_metadata.html , I am able to write and read the standard metadata.    I have attempted to add extra metadata with the following lines in my flowgraph:

                # add some extra meta data
key = pmt.pmt_intern("dummy")
val = pmt.pmt_from_long(77) 
extras = pmt.pmt_make_dict()
extras = pmt.pmt_dict_add(extras, key, val)
extras_str = pmt.pmt_serialize_str(extras)

                nItems = 1024*size
self.blocks_file_meta_sink_0 =  blocks.file_meta_sink(gr.sizeof_float*1,"./meta_test.dat",
  samp_rate, 1, blocks.GR_FILE_FLOAT, False, nItems, extras_str, True)

  I think that the writing is going OK, since the length of the header increases by a reasonable amount and a Unix hexdump indicates that the "dummy" data is present.   However, I am stuck when it comes to getting at the extra data using the parse_file_metadata functions.  In particular, when I try to read the data using:

        cHeader = c[0:185]   # character array read from file 
    pmt_dict = pmt.pmt_deserialize_str(cHeader) 
    p = parse_file_metadata.parse_header(pmt_dict,False)
    p_extra = parse_file_metadata.parse_extra_dict(pmt_dict,info,True)
The first parse_file_metadata line successfully provides the standard metadata, but the second parse_file_metadata does not provide the extra "dummy" data.   I suspect that it has to do with my poor understanding of what should go in the info argument.

Any help would be greatly appreciated.

Dan Marlow

reply via email to

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