spandsp 0.0.6
|
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 * $Id: bert.h,v 1.2 2009/04/14 16:04:54 steveu Exp $ 00026 */ 00027 00028 #if !defined(_SPANDSP_PRIVATE_BERT_H_) 00029 #define _SPANDSP_PRIVATE_BERT_H_ 00030 00031 typedef struct 00032 { 00033 uint32_t reg; 00034 int step; 00035 int step_bit; 00036 int bits; 00037 int zeros; 00038 } bert_tx_state_t; 00039 00040 typedef struct 00041 { 00042 uint32_t reg; 00043 uint32_t ref_reg; 00044 uint32_t master_reg; 00045 int step; 00046 int step_bit; 00047 int resync; 00048 int bits; 00049 int zeros; 00050 int resync_len; 00051 int resync_percent; 00052 int resync_bad_bits; 00053 int resync_cnt; 00054 int report_countdown; 00055 int measurement_step; 00056 } bert_rx_state_t; 00057 00058 /*! 00059 Bit error rate tester (BERT) descriptor. This defines the working state for a 00060 single instance of the BERT. 00061 */ 00062 struct bert_state_s 00063 { 00064 int pattern; 00065 int pattern_class; 00066 bert_report_func_t reporter; 00067 void *user_data; 00068 int report_frequency; 00069 int limit; 00070 00071 uint32_t mask; 00072 int shift; 00073 int shift2; 00074 int max_zeros; 00075 int invert; 00076 int resync_time; 00077 00078 int decade_ptr[9]; 00079 int decade_bad[9][10]; 00080 int error_rate; 00081 00082 bert_tx_state_t tx; 00083 bert_rx_state_t rx; 00084 00085 bert_results_t results; 00086 00087 /*! \brief Error and flow logging control */ 00088 logging_state_t logging; 00089 }; 00090 00091 #endif 00092 /*- End of file ------------------------------------------------------------*/