[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] carrier sensing, usrp2 & xcvr2450
From: |
Stefan Schmid |
Subject: |
Re: [Discuss-gnuradio] carrier sensing, usrp2 & xcvr2450 |
Date: |
Sat, 15 Jan 2011 09:45:47 +0100 |
unfortunately it doesn't.
I am using two hier_block2, one for the sensing part and one for the
transmitting part. (see code below)
What am I doing wrong? Thanks for your help!
Stefan.
class receive_path(gr.hier_block2):
def __init__(self, interface="", decim=4, gain=None, freq=None, mac=""):
gr.hier_block2.__init__(self, "receive_path",
gr.io_signature(0, 0,
0), gr.io_signature(0, 0, gr.sizeof_gr_complex))
self.u = usrp2.source_32fc(interface, mac)
...
alpha = 0.001
thresh = 30
self.probe = gr.probe_avg_mag_sqrd_c(thresh,alpha)
self.connect(self.u, self.probe)
def sense(self):
p = self.probe.level()
dbm = 10*math.log10(p) #dbm
return dbm
class transmit_path(gr.hier_block2):
def __init__(self, interface="", interp_rate=4, spb=4,
use_barker=False, mac_addr=None):
gr.hier_block2.__init__(self, "receive_path", gr.io_signature(0,
0, 0), gr.io_signature(0, 0, gr.sizeof_gr_complex))
self.u = usrp2.sink_32fc(interface, mac_addr)
....
self.packet_transmitter = bbn_80211b_mod_pkts(spb=spb,
alpha=0.5, gain=self.normal_gain, use_barker=use_barker)
self.connect(self.packet_transmitter, self.u)
def send_pkt(self, payload='', send_rate=0, eof=False):
return self.packet_transmitter.send_pkt(payload, send_rate, eof)
class flow_graph(gr.top_block):
def __init__(self):
gr.top_block.__init__(self)
....
self.rxpath = receive_path(interface, decim, gain, freq, mac)
self.txpath = transmit_path(interface, interp, spb, barker, mac)
self.connect(self.txpath)
self.connect(self.rxpath)
On Sat, Jan 15, 2011 at 12:25 AM, Matt Ettus <address@hidden> wrote:
> On 01/14/2011 02:09 PM, Stefan Schmid wrote:
>> Hi all
>>
>> I have an usrp2& Â xcvr2450 board and I wrote a simple python script
>> which I use to measure the signal strength and transmit a packet.
>> Since the xcvr2450 does not support full duplex it switches to
>> transmitting mode after sending the first packet. Is there a way to
>> switch back to receiving mode? Or is there another way to implement
>> such an application using the hardware I have?
>
>
> It switched back to receive as soon as it is done transmitting.
>
> Matt
>
>