Displaying data


#1

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


#2

On Wed, Jan 07, 2009 at 12:52:50PM +0800, Joreen T. 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