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