spandsp 0.0.6

private/bert.h
1/*
2 * SpanDSP - a series of DSP components for telephony
3 *
4 * private/bert.h - Bit error rate tests.
5 *
6 * Written by Steve Underwood <steveu@coppice.org>
7 *
8 * Copyright (C) 2004 Steve Underwood
9 *
10 * All rights reserved.
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 2.1,
14 * as published by the Free Software Foundation.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this program; if not, write to the Free Software
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 */
25
26#if !defined(_SPANDSP_PRIVATE_BERT_H_)
27#define _SPANDSP_PRIVATE_BERT_H_
28
29 typedef struct
30{
31 uint32_t reg;
32 int step;
33 int step_bit;
34 int bits;
35 int zeros;
36} bert_tx_state_t;
37
38 typedef struct
39{
40 uint32_t reg;
41 uint32_t ref_reg;
42 uint32_t master_reg;
43 int step;
44 int step_bit;
45 int resync;
46 int bits;
47 int zeros;
48 int resync_len;
49 int resync_percent;
50 int resync_bad_bits;
51 int resync_cnt;
52 int report_countdown;
53 int measurement_step;
54} bert_rx_state_t;
55
56/*!
57 Bit error rate tester (BERT) descriptor. This defines the working state for a
58 single instance of the BERT.
59*/
60 struct bert_state_s
61{
62 int pattern;
63 int pattern_class;
64 bert_report_func_t reporter;
65 void *user_data;
66 int report_frequency;
67 int limit;
68
69 uint32_t mask;
70 int shift;
71 int shift2;
72 int max_zeros;
73 int invert;
74 int resync_time;
75
76 int decade_ptr[9];
77 int decade_bad[9][10];
78 int error_rate;
79
80 bert_tx_state_t tx;
81 bert_rx_state_t rx;
82
83 bert_results_t results;
84
85 /*! \brief Error and flow logging control */
86 logging_state_t logging;
87};
88
89#endif
90/*- End of file ------------------------------------------------------------*/
logging_state_t
struct logging_state_s logging_state_t
Definition logging.h:75
bert_results_t
Definition bert.h:95
bert_rx_state_t
Definition private/bert.h:39
bert_state_s
Definition private/bert.h:61
bert_state_s::logging
logging_state_t logging
Error and flow logging control.
Definition private/bert.h:86
bert_tx_state_t
Definition private/bert.h:30