discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] Passing the payload to the application level (to GUI


From: Yu-Hua Yang
Subject: [Discuss-gnuradio] Passing the payload to the application level (to GUI display)
Date: Mon, 15 Jun 2009 16:06:15 +0800

Hi,

I found a similar thread here http://lists.gnu.org/archive/html/discuss-gnuradio/2006-09/msg00205.html

but the suggested solution doesnt seem to work well with what I am trying to do.

All i am trying to do is take the received packet information

print "ok = %5s  pktno = %4d  n_rcvd = %4d  n_right = %4d" % (
                    ok, pktno, n_rcvd, n_right)

and display this on my GUI. But the rx_callback function cannot take 'self' as a parameter so there is no way for me display the pktno, n_rcvd, n_right on my GUI.

I tried the following without success, because the same problem persists: i simply cannot pass the callback information back up to the GUI level.

def rx_callback(ok, payload):
               
                global n_rcvd, n_right, message
                (pktno,) = struct.unpack('!H', payload[0:2])
                n_rcvd += 1
                if ok:
                    n_right += 1

                message = "ok = %5s  pktno = %4d  n_rcvd = %4d  n_right = %4d" % (
                    ok, pktno, n_rcvd, n_right)

def wrapped_callback(self, callback):
          def test_wrap(ok, payload):
                    callback(ok, payload)
          return test_wrap
          self.output.AppendText(message)

tb = my_top_block(demods[options.modulation], wrapped_callback(self,rx_callback), options)

I am very lost as to what to do. Do I have to modify pkt.py and rebuild?? Is there anyway to pass the payload stuff up to the GUI??

Please help!

reply via email to

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