private/v8.h

00001 /*
00002  * SpanDSP - a series of DSP components for telephony
00003  *
00004  * private/v8.h - V.8 modem negotiation processing.
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: v8.h,v 1.1 2008/10/13 13:14:01 steveu Exp $
00026  */
00027  
00028 #if !defined(_SPANDSP_PRIVATE_V8_H_)
00029 #define _SPANDSP_PRIVATE_V8_H_
00030 
00031 struct v8_state_s
00032 {
00033     /*! \brief TRUE if we are the calling modem */
00034     int caller;
00035     /*! \brief The current state of the V8 protocol */
00036     int state;
00037     int negotiation_timer;
00038     int ci_timer;
00039     int ci_count;
00040     fsk_tx_state_t v21tx;
00041     fsk_rx_state_t v21rx;
00042     queue_state_t *tx_queue;
00043     modem_connect_tones_tx_state_t ansam_tx;
00044     modem_connect_tones_rx_state_t ansam_rx;
00045 
00046     v8_result_handler_t *result_handler;
00047     void *result_handler_user_data;
00048 
00049     /*! \brief Modulation schemes available at this end. */
00050     int available_modulations;
00051     int common_modulations;
00052     int negotiated_modulation;
00053     int far_end_modulations;
00054     
00055     int call_function;
00056     int protocol;
00057     int pstn_access;
00058     int nsf_seen;
00059     int pcm_modem_availability;
00060     int t66_seen;
00061 
00062     /* V8 data parsing */
00063     unsigned int bit_stream;
00064     int bit_cnt;
00065     /* Indicates the type of message coming up */
00066     int preamble_type;
00067     uint8_t rx_data[64];
00068     int rx_data_ptr;
00069     
00070     /*! \brief a reference copy of the last CM or JM message, used when
00071                testing for matches. */
00072     uint8_t cm_jm_data[64];
00073     int cm_jm_count;
00074     int got_cm_jm;
00075     int got_cj;
00076     int zero_byte_count;
00077     /*! \brief Error and flow logging control */
00078     logging_state_t logging;
00079 };
00080 
00081 #endif
00082 /*- End of file ------------------------------------------------------------*/

Generated by  doxygen 1.6.2