[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] A little help with this please......urgent
From: |
Eric Blossom |
Subject: |
Re: [Discuss-gnuradio] A little help with this please......urgent |
Date: |
Fri, 2 Jan 2009 14:10:18 -0800 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
On Fri, Jan 02, 2009 at 03:56:43PM -0600, Mir Ali wrote:
> Hi,
> I am mailing this question again because, I didn't get enough help last
> time. :-)
Ali,
The easiest path is probably just to make a local copy of mod_pkts and
hack away. Once you have it working, you can clean it up and figure
out where it really ought to live.
Eric
> My intention here is very different from what gr.file_source() does, so
> please take a look at my explanation.
> I want to read a byte from a file and then put it on an input stream to a
> block. If you look at the following code below you will know that I do not
> want to open a stream from the file to the input of another block. I just
> want to read a byte of data and then put it on an input stream.
>
> tb.start()
> fil=open("/home/murtuza/t",'r') # I first open a file to read
> n=0
> while n<1:
> data = fil.read(gr.sizeof_char) # then read one byte only
> n=n+1
> send_pkt(data) # then send it over the stream to a block that
> processes that byte.
> # after this we read the next byte and then send the data to the
> input stream.
>
> tb.wait()
>
> If you look at benchmark_tx.py program data is read from a file and then
> send_pkt() is called. send_pkt() module in transmit_path.py calls
> "self.packet_transmitter.send_pkt(payload, eof)" which then calls send_pkt()
> in mod_pkts. Here, the payload is inserted into the message queue by the
> statement self._pkt_input.msgq().insert_tail(msg). I want to do something
> similar except for the fact that I want to put the unmodified byte in the
> queue unlike mod_pkts which first uses message_from_string and then inserts
> the msg on to the queue.
>
> If this can be done using file_source then can u tell how?
>
> I am working on something that requires me to do this. May be this is not an
> ideal way of doing it but still I want to know if it is possible.
>
> Thanks,
> Ali