private/bert.h

00001 /*
00002  * SpanDSP - a series of DSP components for telephony
00003  *
00004  * private/bert.h - Bit error rate tests.
00005  *
00006  * Written by Steve Underwood <steveu@coppice.org>
00007  *
00008  * Copyright (C) 2004 Steve Underwood
00009  *
00010  * All rights reserved.
00011  *
00012  * This program is free software; you can redistribute it and/or modify
00013  * it under the terms of the GNU Lesser General Public License version 2.1,
00014  * as published by the Free Software Foundation.
00015  *
00016  * This program is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU Lesser General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU Lesser General Public
00022  * License along with this program; if not, write to the Free Software
00023  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00024  */
00025 
00026 #if !defined(_SPANDSP_PRIVATE_BERT_H_)
00027 #define _SPANDSP_PRIVATE_BERT_H_
00028 
00029 typedef struct
00030 {
00031     uint32_t reg;
00032     int step;
00033     int step_bit;
00034     int bits;
00035     int zeros;
00036 } bert_tx_state_t;
00037 
00038 typedef struct
00039 {
00040     uint32_t reg;
00041     uint32_t ref_reg;
00042     uint32_t master_reg;
00043     int step;
00044     int step_bit;
00045     int resync;
00046     int bits;
00047     int zeros;
00048     int resync_len;
00049     int resync_percent;
00050     int resync_bad_bits;
00051     int resync_cnt;
00052     int report_countdown;
00053     int measurement_step;
00054 } bert_rx_state_t;
00055 
00056 /*!
00057     Bit error rate tester (BERT) descriptor. This defines the working state for a
00058     single instance of the BERT.
00059 */
00060 struct bert_state_s
00061 {
00062     int pattern;
00063     int pattern_class;
00064     bert_report_func_t reporter;
00065     void *user_data;
00066     int report_frequency;
00067     int limit;
00068 
00069     uint32_t mask;
00070     int shift;
00071     int shift2;
00072     int max_zeros;
00073     int invert;
00074     int resync_time;
00075 
00076     int decade_ptr[9];
00077     int decade_bad[9][10];
00078     int error_rate;
00079 
00080     bert_tx_state_t tx;
00081     bert_rx_state_t rx;
00082 
00083     bert_results_t results;
00084 
00085     /*! \brief Error and flow logging control */
00086     logging_state_t logging;
00087 };
00088 
00089 #endif
00090 /*- End of file ------------------------------------------------------------*/

Generated on 9 Jul 2012 for spandsp by  doxygen 1.6.1