GNU Radio Manual and C++ API Reference 3.7.14.0
The Free & Open Software Radio Ecosystem
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
25namespace atsc {
26
27static const unsigned int SI_SEGMENT_NUM_MASK = 0x1ff;
28static const unsigned int SI_FIELD_SYNC_SEGMENT_NUM =
29 SI_SEGMENT_NUM_MASK; // conceptually -1
30
31struct syminfo {
32 unsigned int symbol_num : 10; // 0..831
33 unsigned int segment_num : 9; // 0..311 and SI_FIELD_SYNC_SEGMENT_NUM
34 unsigned int field_num : 1; // 0..1
35 unsigned int valid : 1; // contents are valid
36};
37
38
39static inline bool tag_is_start_field_sync(syminfo tag)
40{
41 return tag.symbol_num == 0 && tag.segment_num == SI_FIELD_SYNC_SEGMENT_NUM &&
42 tag.valid;
43}
44
45static inline bool tag_is_start_field_sync_1(syminfo tag)
46{
47 return tag_is_start_field_sync(tag) && tag.field_num == 0;
48}
49
50static inline bool tag_is_start_field_sync_2(syminfo tag)
51{
52 return tag_is_start_field_sync(tag) && tag.field_num == 1;
53}
54
55} // namespace atsc
56
57#endif /* _ATSC_SYMINFO_H_ */
Definition: syminfo_impl.h:25
static const unsigned int SI_SEGMENT_NUM_MASK
Definition: syminfo_impl.h:27
static bool tag_is_start_field_sync_2(syminfo tag)
Definition: syminfo_impl.h:50
static bool tag_is_start_field_sync(syminfo tag)
Definition: syminfo_impl.h:39
static bool tag_is_start_field_sync_1(syminfo tag)
Definition: syminfo_impl.h:45
static const unsigned int SI_FIELD_SYNC_SEGMENT_NUM
Definition: syminfo_impl.h:28
Definition: syminfo_impl.h:31
unsigned int symbol_num
Definition: syminfo_impl.h:32
unsigned int valid
Definition: syminfo_impl.h:35
unsigned int segment_num
Definition: syminfo_impl.h:33
unsigned int field_num
Definition: syminfo_impl.h:34