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!
_______________________________________________
Discuss-gnuradio mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to