discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Message passing to UHD: USRP source/sink


From: Aravind Deshikh
Subject: Re: [Discuss-gnuradio] Message passing to UHD: USRP source/sink
Date: Fri, 5 Apr 2019 02:38:07 -0500

In the above-explained case scenario, I'm thinking of appending the csv to a dictionary and based on a loop, can I code (IN PYTHON) the work function of the block according to when there is 1, the corresponding channel frequency is sent as a message when it reads a change: 
So, firstly, Is it possible to use "import csv" in the block code? IF YES, the work function goes something like:

PSEUDO-CODE:
1) iterate through the .csv file saved in a dictionary and compare it with the expected forms of row (0001 or 0010 or 0100 or 1000).
2) Using 4 counters, one for each form; when there is a change in the row format, all counters are set to zero and that particular counter sets to 1.
3) As soon as the counter is 1 it should send its corresponding "tune_request message". NOW, HOW SHOULD I DO THIS?
4) And after each iteration over 1 row the code sleeps for 1 second and moves to the next row using sleep(1).

If NO, how do I create access to the .csv file to this block?

If there is any other way I need to look at this please let me know!

Aravind Deshikh. V

On Thu, Apr 4, 2019 at 11:32 PM Aravind Deshikh <address@hidden> wrote:
Hello everyone,
I'm working on frequency hopping using GNU Radio and USRP N210 as a function of Cognitive radio. Here, I have a .csv file which has the availability of channel to use among 4 frequency channels in a binary format like:
CH0    CH1     CH2     CH3              
(900)   (910)    (920)   (930)   (Mhz) 
    1         0          0           0           (for 10 rows) 
    0         1          0           0           (for the next 10 rows)
    0         0          1           0           (for the next 10 rows)      
    0         0          0           1           (for the next 10 rows)                                            
and each row is the spectrum occupancy for 1 second interval.
I have to create a GNU Radio custom block to send timed PMT messages to the command input of USRP source to HOP THE FREQUENCY.
I'm unable to understand how to use the "Message Passing API" to create this block using "GR-MODTOOL" that needs to send a "tune_request" as a message to change the "freq" at the UHD: USRP SOURCE. Please let me know if I'm missing something here that will help me do this or what I need to do, to code such a bloc function.

I have read through the message passing API (msg_handler function) and the formats for the tune request, but it is hard to figure this out.
SOMEBODY, PLEASE HELP ME TO DO THIS. 
Any kind of help with this would be of great value to me and is wholeheartedly appreciated.

Thank you very much in advance.

Sincerely,
Aravind Deshikh. V

reply via email to

[Prev in Thread] Current Thread [Next in Thread]