GNU Radio Manual and C++ API Reference  3.7.5.1
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
atsc_syminfo_impl.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  * 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 #ifndef INCLUDED_GR_DTV_ATSC_SYMINFO_H
23 #define INCLUDED_GR_DTV_ATSC_SYMINFO_H
24 
25 namespace gr {
26  namespace dtv {
27  namespace atsc {
28 
29  static const unsigned int SI_SEGMENT_NUM_MASK = 0x1ff;
30  static const unsigned int SI_FIELD_SYNC_SEGMENT_NUM = SI_SEGMENT_NUM_MASK; // conceptually -1
31 
32  struct syminfo {
33  unsigned int symbol_num : 10; // 0..831
34  unsigned int segment_num : 9; // 0..311 and SI_FIELD_SYNC_SEGMENT_NUM
35  unsigned int field_num : 1; // 0..1
36  unsigned int valid : 1; // contents are valid
37  };
38 
39 
40  static inline bool
42  {
43  return tag.symbol_num == 0 && tag.segment_num == SI_FIELD_SYNC_SEGMENT_NUM && tag.valid;
44  }
45 
46  static inline bool
48  {
49  return tag_is_start_field_sync (tag) && tag.field_num == 0;
50  }
51 
52  static inline bool
54  {
55  return tag_is_start_field_sync (tag) && tag.field_num == 1;
56  }
57 
58  } /* namespace atsc */
59  } /* namespace dtv */
60 } /* namespace gr */
61 
62 #endif /* INCLUDED_GR_DTV_ATSC_SYMINFO_H */
static const unsigned int SI_FIELD_SYNC_SEGMENT_NUM
Definition: atsc_syminfo_impl.h:30
static bool tag_is_start_field_sync(syminfo tag)
Definition: atsc_syminfo_impl.h:41
static bool tag_is_start_field_sync_1(syminfo tag)
Definition: atsc_syminfo_impl.h:47
Definition: atsc_syminfo_impl.h:32
static bool tag_is_start_field_sync_2(syminfo tag)
Definition: atsc_syminfo_impl.h:53
unsigned int field_num
Definition: atsc_syminfo_impl.h:35
static const unsigned int SI_SEGMENT_NUM_MASK
Definition: atsc_syminfo_impl.h:29
unsigned int segment_num
Definition: atsc_syminfo_impl.h:34
unsigned int valid
Definition: atsc_syminfo_impl.h:36
unsigned int symbol_num
Definition: atsc_syminfo_impl.h:33