Forum: GNU Radio How to stor hexadecimal transmitted data in ./benchmark_tx

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.
B5af066fa3ac532ef8e67e72cdf57c66?d=identicon&s=25 Vaibhav Bhatnagar (vaibhav)
on 2008-11-26 15:06
I would like to capture all packets, when it generates in the file
benchmark_tx.py at 2.4Ghz like this:

# generate and send packets
    nbytes = int(1e6 * options.megabytes)
    n = 0
    pktno = 0
    pkt_size = int(options.size)

    while n < nbytes:
        if options.from_file is None:
            data = (pkt_size - 2) * chr(pktno & 0xff)


<<<< here I would like to write this data in file and  concatenate>>>>>>

        payload = struct.pack('!H', pktno & 0xffff) + data
        send_pkt(payload)
        n += len(payload)
        sys.stderr.write('.')


I tried to write it like:
f=open('a','w')
f.write(data), but it doesn't work because, data is not one value it's a
sequence of specific size. I dig a bit more in python got no idea.

can somebody give me an idea how I can store these value so that I can
compare these data after capturing on receiving end by usrp_rx_cfile.py
7eedcd6bf2792d8e1e81a07ce6cc09fa?d=identicon&s=25 Jérémy Skelton (Guest)
on 2008-11-27 13:28
(Received via mailing list)
Hi Vaibhav,

You may have a look at this :

f = open('file', 'a')
f.write('%X\t' % (data))

I didn't try but it should be the way to print in hexadecimal and
appending to the file.


Le 26-nov.-08 à 15:06, Vaibhav Bhatnagar a écrit :
This topic is locked and can not be replied to.