Hi,

I wrote a gnuRadio code that allows me to switch between a Tx_Path and
Rx_Path every 10 seconds.

The code is based on the tb.lock() , tb.unlock() functions and the
benchmarks provided with gnuradio.

I am able to do the switching fine, however after switching from
transmission to reception, the node receives some of the packets that were
sent during its own transmission period.

How can I overcome this echo like effect between the TX and RX periods ?

*
*
*In the main() function I have :
*

tb.start()
while True:
        time.sleep(10)
        tb.lock()
        tb.conf_transmit()
        tb.unlock()
        tb.transmit_packets()
        tb.lock()
        tb.conf_sense()
        tb.unlock()
    tb.wait()



*In the top_block class I have:*

def conf_transmit(self):
        self.disconnect(self.source, self.rxpath)
        self.connect(self.txpath, self.sink)

def conf_sense(self):
        self.disconnect(self.txpath, self.sink)
        self.connect(self.source, self.rxpath)

def transmit_packets(self):
        begin_time = time.time()
        pkt_size=1500
        pktno = 0
        while time.time() - begin_time < 10:   # Send for 10 minutes
            data = (pkt_size - 2) * chr(pktno & 0xff)
            payload = struct.pack('!H', pktno & 0xffff) + data
            self.send_pkt(payload)
            pktno += 1

def send_pkt(self, payload='', eof=False):
        ### Main Function to Send Packets.
        return self.txpath.send_pkt(payload, eof)


Best Regards,
--
Yahya Ezzeldin
 <http://www.ieee.org>
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to