Forum: GNU Radio displaying data

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
0a2e71854bb218131012ec9764eb33dd?d=identicon&s=25 Joreen Tan (Guest)
on 2009-01-07 05:53
(Received via mailing list)
Hi,

How do i display the data received from benchmark_rx.py?

As in, after this line, "demods = modulation_utils.type_1_demods()"
which also means demodulating the received signal. how do i actually
make use of the signal received and then print it out on the
terminal?Regards,Joreen
745d8202ef5a58c1058d0e5395a78f9c?d=identicon&s=25 Eric Blossom (Guest)
on 2009-01-07 06:46
(Received via mailing list)
On Wed, Jan 07, 2009 at 12:52:50PM +0800, Joreen Tan wrote:
>
> Hi,
>
> How do i display the data received from benchmark_rx.py?
>
> As in, after this line, "demods = modulation_utils.type_1_demods()"
> which also means demodulating the received signal. how do i actually make use of the 
signal received and then print it out on the terminal?Regards,Joreen


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

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

        # do whatever you like with payload.  We just stuck a packet
  # number in the first two bytes for testing...


If this doesn't make sense, be sure to spend some time with the
excellent python tutorial http://www.python.org/doc

Eric
This topic is locked and can not be replied to.