Hi Everyone,

The "usrp_spectrum_sense.py" program is used to sense the defined spectrum
range. Now, I want to stop it for a period of five second time (e.g. from
55 to 59 seconds). For that purpose, I wrote the following lines in python.

================================================
import usrp_spectrum_sense_updated

import time



class main_class():


# calling the 'usrp_spectrum_sense.py' program


    def relay_func(self, tb):

while 1:


    curr_time = time.strftime('%S',time.localtime())


    if int(curr_time)>=55:

print 'Hello World"

    else:

t = usrp_spectrum_sense_updated.ThreadClass()

            t.start()


            tb = usrp_spectrum_sense_updated.my_top_block()

            try:

            tb.start()

            usrp_spectrum_sense_updated.main_loop(tb)


            except KeyboardInterrupt:

            pass

if __name__ == '__main__':

    tb = main_class()

    tb.relay_func(tb)

================================================


In the above program, I tried to stop sensing for the duration of 5 seconds
(i.e. 55 ---- 59 seconds). The program works fine whenever I execute it in
between of the mentioned time and it shift automatically to the sensing
mode at time=0 second; but once it start sensing then it never be returned
to the print message 'hello world' even when the condition is matched.

Earliest and kind response is highly appreciated. Thanks.

Regards,
Syed Aqeel Raza
_______________________________________________
Discuss-gnuradio mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to