GNU Radio's TPMS Package
fixed_length_frame_sink_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2014 Jared Boone <jared@sharebrained.com>.
4  *
5  * This is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3, or (at your option)
8  * any later version.
9  *
10  * This software is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this software; see the file COPYING. If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef INCLUDED_TPMS_FIXED_LENGTH_FRAME_SINK_IMPL_H
22 #define INCLUDED_TPMS_FIXED_LENGTH_FRAME_SINK_IMPL_H
23 
25 
26 namespace gr {
27  namespace tpms {
28 
30  {
31  private:
32  enum state_t { STATE_SYNC_SEARCH, STATE_HAVE_SYNC };
33 
34  static const int MAX_PKT_LEN = 4096;
35 
36  //msg_queue::sptr d_target_queue;
37  pmt::pmt_t d_message_port;
38  pmt::pmt_t d_attributes;
39  state_t d_state;
40  /*
41  unsigned char d_packet[MAX_PKT_LEN];
42  unsigned char d_packet_byte;
43  int d_packet_byte_index;
44  int d_packetlen;
45  int d_packetlen_cnt;
46  */
47  typedef std::vector<uint8_t> bits_t;
48  typedef std::list<bits_t> packets_t;
49 
50  packets_t d_packets;
51 
52  int d_frame_length;
53 
54  protected:
55  void enter_search();
56  void enter_have_sync();
57 
58  public:
59  //fixed_length_frame_sink_impl(int frame_length, msg_queue::sptr target_queue);
60  fixed_length_frame_sink_impl(int frame_length, pmt::pmt_t attributes);
62 
63  // Where all the action really happens
64  int work(int noutput_items,
65  gr_vector_const_void_star &input_items,
66  gr_vector_void_star &output_items);
67  };
68 
69  } // namespace tpms
70 } // namespace gr
71 
72 #endif /* INCLUDED_TPMS_FIXED_LENGTH_FRAME_SINK_IMPL_H */
73 
<+description of block+>
Definition: fixed_length_frame_sink.h:36
Definition: fixed_length_frame_sink_impl.h:29
Definition: ask_env.h:27
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
fixed_length_frame_sink_impl(int frame_length, pmt::pmt_t attributes)