GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
correlate_access_code_bb_ts.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2014 Free Software Foundation, Inc.
4  *
5  * This file is part of GNU Radio
6  *
7  * SPDX-License-Identifier: GPL-3.0-or-later
8  *
9  */
10 
11 #ifndef INCLUDED_DIGITAL_CORRELATE_ACCESS_CODE_BB_TS_H
12 #define INCLUDED_DIGITAL_CORRELATE_ACCESS_CODE_BB_TS_H
13 
14 #include <gnuradio/block.h>
15 #include <gnuradio/digital/api.h>
16 #include <string>
17 
18 namespace gr {
19 namespace digital {
20 
21 /*!
22  * \brief Examine input for specified access code, one bit at a time.
23  * \ingroup packet_operators_blk
24  *
25  * \details
26  * input: stream of bits (unpacked bytes)
27  * output: a tagged stream set of bits from the payload following
28  * the access code and header.
29  *
30  * This block searches for the given access code by reading in the
31  * input bits. Once found, it expects the following 32 samples to
32  * contain a header that includes the frame length (16 bits for
33  * the length, repeated). It decodes the header to get the frame
34  * length in order to set up the the tagged stream key
35  * information.
36  *
37  * The output of this block is appropriate for use with tagged
38  * stream blocks.
39  */
41 {
42 public:
43  // gr::digital::correlate_access_code_bb_ts::sptr
44  typedef std::shared_ptr<correlate_access_code_bb_ts> sptr;
45 
46  /*!
47  * \param access_code is represented with 1 byte per bit,
48  * e.g., "010101010111000100"
49  * \param threshold maximum number of bits that may be wrong
50  * \param tag_name key of the tag inserted into the tag stream
51  */
52  static sptr
53  make(const std::string& access_code, int threshold, const std::string& tag_name);
54 
55  /*!
56  * \param access_code is represented with 1 byte per bit,
57  * e.g., "010101010111000100"
58  */
59  virtual bool set_access_code(const std::string& access_code) = 0;
60  virtual unsigned long long access_code() const = 0;
61 };
62 
63 } /* namespace digital */
64 } /* namespace gr */
65 
66 #endif /* INCLUDED_DIGITAL_CORRELATE_ACCESS_CODE_BB_TS_H */
The abstract base class for all 'terminal' processing blocks.
Definition: gnuradio-runtime/include/gnuradio/block.h:63
Examine input for specified access code, one bit at a time.
Definition: correlate_access_code_bb_ts.h:41
std::shared_ptr< correlate_access_code_bb_ts > sptr
Definition: correlate_access_code_bb_ts.h:44
virtual unsigned long long access_code() const =0
virtual bool set_access_code(const std::string &access_code)=0
static sptr make(const std::string &access_code, int threshold, const std::string &tag_name)
#define DIGITAL_API
Definition: gr-digital/include/gnuradio/digital/api.h:18
GNU Radio logging wrapper.
Definition: basic_block.h:29