Accessing packet payload in reception

Hello!

I’m trying to implement a scheme in which I have a receiving node
accept a frequency to tune to from a sending node, and I would
appreciate any advice how to code this.
I’m using the /digital/benchmark_xx.py scripts, so in Tx i’ve used the
defined send_pkt function that packs a message to send like this:

def send_pkt(payload=’’, eof=False):
return fun_graph.txpath.send_pkt(payload, eof)


fun_graph = transmit_graph(mods[options.modulation], options)

send_pkt("%s.%s.%s" % (destname, sourcename, str(frequency) )

send_pkt(eof=True)

Is this a good way to send such a payload? Next I’d like to get the
values destname, sourcename, and frequency out of the received packet
at the receiving node, but I’m not sure which blocks/functions to call
on to access these. What i’ll do with the received message is
something along the lines of:

(message = *access to the depths of the demodulation blocks and packet
queues, giving me the string “desname.sourcename.str(frequency)” *)

parsed = message.split(’.’, 3) # to tokenize the message between the ‘.’

now tune to parsed[2]…

I’d appreciate any help very much!

Thanks,

Ben Olsen

Following up:

(message = *access to the depths of the demodulation blocks and packet
queues, giving me the string “desname.sourcename.str(frequency)” *)

would this be something along the lines of:

message = fun_graph.rxpath.packet_receiver._watcher.(_rcvd_pktq…)?

I get a bit lost this deep into it…

Again, thanks for any assistance
-Ben Olsen

On Mon, Apr 16, 2007 at 12:35:29PM -0500, Ben Olsen wrote:

Again, thanks for any assistance
-Ben Olsen

Hi Ben,

You shouldn’t have to grovel around in the bottom of the code.
The “rx_callback” method in benchmark_rx is called with the received
packet.

FWIW, I’d probably pick a different separator than ‘.’ since it’s quite
likely to show up in a frequency. If you’re going to send your
parameters as ASCII, I’d consider using chr(0) as the delimiter.

Eric