GNU Radio 3.6.5.1 C++ API
stream_pdu_base.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2013 Free Software Foundation, Inc.
4  *
5  * This file is part of GNU Radio
6  *
7  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  *
12  * GNU Radio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with GNU Radio; see the file COPYING. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef INCLUDED_STREAM_PDU_BASE_H
24 #define INCLUDED_STREAM_PDU_BASE_H
25 
26 #include <gruel/thread.h>
27 #include <gruel/pmt.h>
28 
29 class gr_basic_block;
30 
31 namespace gr {
32  namespace blocks {
33 
35  {
36  public:
37  stream_pdu_base(int MTU=10000);
39 
40  protected:
41  int d_fd;
42  bool d_started;
43  bool d_finished;
44  std::vector<uint8_t> d_rxbuf;
46 
49 
50  void run();
51  void send(pmt::pmt_t msg);
52  bool wait_ready();
53  void start_rxthread(gr_basic_block *blk, pmt::pmt_t rxport);
54  void stop_rxthread();
55  };
56 
57  } /* namespace blocks */
58 } /* namespace gr */
59 
60 #endif /* INCLUDED_STREAM_PDU_BASE_H */