diff options
Diffstat (limited to 'gr-zeromq/include')
-rw-r--r-- | gr-zeromq/include/gnuradio/zeromq/pub_sink.h | 18 | ||||
-rw-r--r-- | gr-zeromq/include/gnuradio/zeromq/sub_source.h | 4 |
2 files changed, 16 insertions, 6 deletions
diff --git a/gr-zeromq/include/gnuradio/zeromq/pub_sink.h b/gr-zeromq/include/gnuradio/zeromq/pub_sink.h index cef6a82a54..d9410c48cf 100644 --- a/gr-zeromq/include/gnuradio/zeromq/pub_sink.h +++ b/gr-zeromq/include/gnuradio/zeromq/pub_sink.h @@ -22,11 +22,17 @@ namespace zeromq { * \ingroup zeromq * * \details - * This block acts a a streaming sink for a GNU Radio flowgraph - * and writes its contents to a ZMQ PUB socket. A PUB socket may + * This block acts as a streaming sink for a GNU Radio flowgraph + * and writes its contents to a ZMQ PUB socket. A PUB socket may * have subscribers and will pass all incoming stream data to each - * subscriber. Subscribers can be either another gr-zeromq source - * block or a non-GNU Radio ZMQ socket. + * subscriber with a matching key. If the publisher's key is set to + * "GNURadio", the following example subscriber keys will match: "G", + * "GN", .., "GNURadio". In other words, the subscriber must contain + * the first set of characters from the publisher's key. If the subscriber + * sets an empty key "", it will accept all input messages from the + * publisher (including the key itself if one is set). Subscribers + * can either be another gr-zeromq source block or a non-GNU Radio + * ZMQ socket. */ class ZEROMQ_API pub_sink : virtual public gr::sync_block { @@ -42,13 +48,15 @@ public: * \param timeout Receive timeout in milliseconds, default is 100ms, 1us increments. * \param pass_tags Whether sink will serialize and pass tags over the link. * \param hwm High Watermark to configure the socket to (-1 => zmq's default) + * \param key Prepend a key/topic to the start of each message (default is none) */ static sptr make(size_t itemsize, size_t vlen, char* address, int timeout = 100, bool pass_tags = false, - int hwm = -1); + int hwm = -1, + const std::string& key = ""); /*! * \brief Return a std::string of ZMQ_LAST_ENDPOINT from the underlying ZMQ socket. diff --git a/gr-zeromq/include/gnuradio/zeromq/sub_source.h b/gr-zeromq/include/gnuradio/zeromq/sub_source.h index 88d286b3b8..c2be39e615 100644 --- a/gr-zeromq/include/gnuradio/zeromq/sub_source.h +++ b/gr-zeromq/include/gnuradio/zeromq/sub_source.h @@ -39,13 +39,15 @@ public: * \param timeout Receive timeout in milliseconds, default is 100ms, 1us increments. * \param pass_tags Whether source will look for and deserialize tags. * \param hwm High Watermark to configure the socket to (-1 => zmq's default) + * \param key Subscriber filter key. Leave empty to pass all messages. */ static sptr make(size_t itemsize, size_t vlen, char* address, int timeout = 100, bool pass_tags = false, - int hwm = -1); + int hwm = -1, + const std::string& key = ""); /*! * \brief Return a std::string of ZMQ_LAST_ENDPOINT from the underlying ZMQ socket. |