Pktno!

Is pktno defined anywhere in python files(at transmitting end) other
than
benchmark_tx.py??Actually i want to print number of packets
transmitted.So,i
am looking for pktno.

Thanks…

On Fri, Mar 29, 2013 at 11:20 AM, manjusha
[email protected]wrote:

Is pktno defined anywhere in python files(at transmitting end) other than
benchmark_tx.py??Actually i want to print number of packets
transmitted.So,i
am looking for pktno.


Manjusha

Line 139 of benchmark_tx.py contains the payload. It’s the pktno packed
as
a short (2 bytes) followed by the pktno as a single byte repeated
pkt_size

Are you trying to print the number of packets transmitted using
benchmark_tx.py ? If so The packets are transmitted on line 140, so if
you
want to print pktno just print it there. The “while n < nbytes” loop
will
iterate once for every packet. You could replace line 142 to print pktno
instead of “.”.

-Nathan

Hi Nathan,

Thanks for your reply.I am not trying to find the pktno from
benchmark_tx.py
since i already tried doing that and it worked successfully.

I have a file that i transmit using file source.Everything goes fine but
i
want to see the number of packets that i have been used to transmit my
data.

Thanks…

is there no way to do it??!!any other ideas on how can it be
implemented?!

Sorry, I missed a line.

you should have a “data = file.read(pkt_size)” inside the while loop as
well.

Hi Manu,

Thanks for your reply

data = file.read(pkt_size) means that we asking it to read a file name
called pkt_size right??Is there any file with that name?

Please correct me if i am wrong in any sense.

I don’t see any pktno defined anywhere in gnuradio files apart from
benchmark_tx.py.

Thanks…

i get what you meant now…will give a try and let you know about it…

thanks.

I suppose you can do something similar to this

n = 0
data = file.read(pkt_size)
while data != “”:
make payload
send payload
n += 1

print n

Hi,

I put the following code in packet_utils.py

n=0
while len(pkt)!= “”:
print “make_packet: len(pkt) =”,len(payload)
# n=n+1
print “pktno”,n
n=n+1
what it did is ,it kept incrementing until i stop it.Although i connect
the
usrp to the computer or not,it keeps incrementing.
How can we know the correct number of packets tranmitted from this.The
packet numbers i get are in any way right??!!

Thanks…

Hi,

It’s not clear where in packet_utils.py you have introduced this bit of
code.
packet_utils.py contains definitions of certain functions.
Suppose you introduce this bit of code in the function make_packet
defined
inside packet_utils.py
make_packet() will be called by an instance of mod_pkts() defined inside
pkt.py, into which payload is passed.
So, when the send_pkt(payload) is called for the first time, it enters
the
while loop and it is executed indefinitely. The len(payload) will be
computed from the first payload that is passed into the make_packet().

To know the transmitted packet number you should have put the same code
in
benchmark_tx.py at a suitable location.

Hi Manu,

I understand what you said…Also,as you said i had that bit of code in
make_packet function under packet_utils.py…

I am unsure where that “suitable position” could be to place a bit of
code
which displays the packet number.

Also,i tried to run the GRC file and noticed that the control is not
going
to send_pkt in pkt.py.That means it is sending the packets from a
different
place.I need to find what function is being used to send the packet when
run
through GRC.

Please correct me if i am wrong.

Thanks.