GNU Radio 3.6.0 C++ API
uhd_amsg_source.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2011-2012 Free Software Foundation, Inc.
00003  * 
00004  * This file is part of GNU Radio
00005  * 
00006  * GNU Radio is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 3, or (at your option)
00009  * any later version.
00010  * 
00011  * GNU Radio is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  * 
00016  * You should have received a copy of the GNU General Public License
00017  * along with GNU Radio; see the file COPYING.  If not, write to
00018  * the Free Software Foundation, Inc., 51 Franklin Street,
00019  * Boston, MA 02110-1301, USA.
00020  */
00021 
00022 #ifndef INCLUDED_GR_EXTRAS_UHD_AMSG_SOURCE_H
00023 #define INCLUDED_GR_EXTRAS_UHD_AMSG_SOURCE_H
00024 
00025 #include <gnuradio/extras/api.h>
00026 #include <gr_sync_block.h>
00027 #include <uhd/usrp/multi_usrp.hpp>
00028 
00029 namespace gnuradio{ namespace extras{
00030 
00031 class GR_EXTRAS_API uhd_amsg_source : virtual public gr_sync_block{
00032 public:
00033     typedef boost::shared_ptr<uhd_amsg_source> sptr;
00034 
00035     /*!
00036      * \brief Make a new USRP asynchronous message-based source block.
00037      * \ingroup uhd_blk
00038      *
00039      * The async message source will post messages to the "async" subscriber group.
00040      * The key of each message will be the pmt symbol: "uhd_amsg"
00041      * The value of each message will be a pmt dictionary with the following keys/values:
00042      *  - symbol "timestamp" -> tuple(uint64 seconds, and double fractional seconds)
00043      *  - sybol "channel" -> uint64 channel number
00044      *  - sybol "event_code" -> uint64 event code
00045      */
00046     static sptr make(const uhd::device_addr_t &device_addr);
00047 };
00048 
00049 }}
00050 
00051 #endif /* INCLUDED_GR_EXTRAS_UHD_AMSG_SOURCE_H */