diff options
author | stevie <stevie@65a5c917-d112-43f1-993d-58c26a4786be> | 2011-05-29 10:24:15 +0000 |
---|---|---|
committer | stevie <stevie@65a5c917-d112-43f1-993d-58c26a4786be> | 2011-05-29 10:24:15 +0000 |
commit | da6ffc8343221ca66789c2e9c62506e5653301ea (patch) | |
tree | 56bff05ac3c506ff7906583660326c5c076017d9 /blocks/src/lib/op25_pcap_source_b.h | |
parent | f76f2bc712353a587782fe11a79b6447c9bbb88a (diff) |
Rename 'decoder' to 'blocks'.
git-svn-id: http://op25.osmocom.org/svn/trunk@283 65a5c917-d112-43f1-993d-58c26a4786be
Diffstat (limited to 'blocks/src/lib/op25_pcap_source_b.h')
-rw-r--r-- | blocks/src/lib/op25_pcap_source_b.h | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/blocks/src/lib/op25_pcap_source_b.h b/blocks/src/lib/op25_pcap_source_b.h new file mode 100644 index 0000000..0ab6618 --- /dev/null +++ b/blocks/src/lib/op25_pcap_source_b.h @@ -0,0 +1,89 @@ +/* -*- C++ -*- */ + +/* + * Copyright 2010-2011 Steve Glass + * + * This file is part of OP25. + * + * OP25 is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * OP25 is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + * License for more details. + * + * You should have received a copy of the GNU General Public License + * along with OP25; see the file COPYING. If not, write to the Free + * Software Foundation, Inc., 51 Franklin Street, Boston, MA + * 02110-1301, USA. + */ + +#ifndef INCLUDED_OP25_PCAP_SOURCE_B_H +#define INCLUDED_OP25_PCAP_SOURCE_B_H + +#include <boost/shared_ptr.hpp> +#include <gr_sync_block.h> +#include <stdint.h> +#include <string> +#include <vector> + +typedef boost::shared_ptr<class op25_pcap_source_b> op25_pcap_source_b_sptr; + +op25_pcap_source_b_sptr op25_make_pcap_source_b(const char *path, float delay); + +/** + * op25_pcap_source_b is a GNU Radio block for reading from a + * tcpdump-formatted capture file and producing a stream of octets. + */ +class op25_pcap_source_b : public gr_sync_block +{ +public: + + /** + * op25_pcap_source_b (virtual) destructor. + */ + virtual ~op25_pcap_source_b(); + + /** + * Process symbols into frames. + */ + virtual int work(int nof_output_items, gr_vector_const_void_star& input_items, gr_vector_void_star& output_items); + +private: + + /** + * Expose class to public ctor. Create a new instance of + * op25_pcap_source_b and wrap it in a shared_ptr. This is + * effectively the public constructor. + * + * \param path The path to the tcpdump-formatted input file. + * \param delay The number of seconds to delay before sending the first frame. + */ + friend op25_pcap_source_b_sptr op25_make_pcap_source_b(const char *path, float delay); + + /** + * op25_pcap_source_b protected constructor. + * + * \param path The path to the tcpdump-formatted input file. + * \param delay The number of seconds to delay before sending the first frame. + */ + op25_pcap_source_b(const char *path, float delay); + +private: + + /** + * The next octet to be read from the input file. + */ + size_t loc_; + + /** + * Symbols from the input file. + */ + std::vector<uint8_t> octets_; + +}; + +#endif /* INCLUDED_OP25_PCAP_SOURCE_B_H */ |