discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Check The output of a block & input captured fram


From: Sara Chérif
Subject: Re: [Discuss-gnuradio] Check The output of a block & input captured frames to GNURadio
Date: Sat, 29 Mar 2014 01:51:45 +0200

I found that "tb.wait()" is written in the file so it takes too long time . Now after I erased tb.wait() .. the output on terminal is ---> ( ) .. I don't know why ?? Here is what is written in top_block.py


#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Top Block
# Generated: Sat Mar 29 01:47:01 2014
##################################################

from gnuradio import blocks
from gnuradio import eng_notation
from gnuradio import gr
from gnuradio.eng_option import eng_option
from gnuradio.filter import firdes
from grc_gnuradio import wxgui as grc_wxgui
from optparse import OptionParser
import wx

class top_block(grc_wxgui.top_block_gui):

    def __init__(self):
        grc_wxgui.top_block_gui.__init__(self, title="Top Block")
        _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png"
        self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY))

        ##################################################
        # Variables
        ##################################################
        self.samp_rate = samp_rate = 32000

        ##################################################
        # Blocks
        ##################################################
        self.blocks_vector_source_x_0 = blocks.vector_source_b((6, 6), True, 1, [])
        self.blocks_vector_sink_x_0 = blocks.vector_sink_b(1)
        self.blocks_throttle_0 = blocks.throttle(gr.sizeof_char*1, samp_rate,True)

        ##################################################
        # Connections
        ##################################################
        self.connect((self.blocks_vector_source_x_0, 0), (self.blocks_throttle_0, 0))
        self.connect((self.blocks_throttle_0, 0), (self.blocks_vector_sink_x_0, 0))
                                                                                                                              4,1           Top

# QT sink close method reimplementation

    def get_samp_rate(self):
        return self.samp_rate

    def set_samp_rate(self, samp_rate):
        self.samp_rate = samp_rate
        self.blocks_throttle_0.set_sample_rate(self.samp_rate)

if __name__ == '__main__':
    import ctypes
    import sys
    if sys.platform.startswith('linux'):
        try:
            x11 = ctypes.cdll.LoadLibrary('libX11.so')
            x11.XInitThreads()
        except:
            print "Warning: failed to XInitThreads()"
    parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
    (options, args) = parser.parse_args()
    tb = top_block()
    tb.Start(True)
    print tb.blocks_vector_sink_x_0.data()



2014-03-29 0:06 GMT+02:00 Sara Chérif <address@hidden>:
I want to make a test and see the output , I put 3 blocks , vector source , throttle and vector sink . I edited the "vector" parameter in vector source block to (6,6). All 3 blocks have a type "byte". I generated the flow graph.
I moved to the directory of grc file , I wrote in terminal
vim top_block.py
then I write to the end of file : " print tb.blocks_vector_sink_x_0.data()"
and saved the changes . Then I execute the python file by writing in terminal :
./top_block.py
But the output takes too long time and doesn't appear ! what is the problem ?
and is there any other method to see the output ???As I am a beginner and someone told me this method.
I tried this for example 10 times but every time it takes too long and doesn't appear , only one time it appears!

Another question :
If I have captured some frames using wireshark (from twinkle softphone), and  I saved them .I want to make them an input to ofdm transmitter . How to make them an input?

Thanks :)



reply via email to

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