On 11/07/2011 03:50 PM, Yan Nie wrote: > Really appreciate your answer, Josh. > > I am wondering how to control data streaming from devices to host in > Python, if the stream command issuing approaching cannot work in > Python? What I am trying to do is detecting pps pulse then 2ms later > start receiving data from USRP N200. The received data will feed in > next block of the flowgraph. >
Basically, the way python controls streaming is to call tb.start() or tb.stop(). I realize that isnt a lot of control. Option 1) Consider making a modification so that the user (you) can specify the time that the streaming will start. Basically an API call like uhd.set_stream_time(<time>). Where <time> will be used in the source block's start() method.... Or more simply, forget the API change, and hardcode the start-time that you want into the source block. Option 2) The USRP source already tags the samples with a timestamp. You dont need to control when streaming begins, because your donwnstream block can determine the time of any sample using tags (aka packet metadata). Option 3) Post messages into the source block to control streaming. This is a more advanced feature that isnt yet implemented either in the source block or from an API perspective. I mention it, because this is something I may add in the near future once my message passing work gets merged. Options 1 or 2 are probably most practical for you. -Josh > Thanks, Yan > > On 11/07/11, Josh Blum <[email protected]> wrote: >> I dont thing stream command has been "swigged" up into python. This >> is because starting and stopping is handled by the scheduler which >> is written in c++. So there was not a need to issue stream commands >> in python. > > _______________________________________________ Discuss-gnuradio > mailing list [email protected] > https://lists.gnu.org/mailman/listinfo/discuss-gnuradio _______________________________________________ Discuss-gnuradio mailing list [email protected] https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
