~ubuntu-branches/ubuntu/karmic/asterisk/karmic

« back to all changes in this revision

Viewing changes to include/asterisk/fskmodem.h

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell
  • Date: 2002-04-27 21:19:32 UTC
  • Revision ID: james.westby@ubuntu.com-20020427211932-kqaertc4bg7ss5mc
Tags: upstream-0.1.11
ImportĀ upstreamĀ versionĀ 0.1.11

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Asterisk -- A telephony toolkit for Linux.
 
3
 *
 
4
 * FSK Modem Support 
 
5
 * 
 
6
 * Copyright (C) 1999, Mark Spencer
 
7
 *
 
8
 * Mark Spencer <markster@linux-support.net>
 
9
 *
 
10
 * This program is free software, distributed under the terms of
 
11
 * the GNU General Public License.
 
12
 *
 
13
 * Includes code and algorithms from the Zapata library.
 
14
 *
 
15
 */
 
16
 
 
17
#ifndef _FSKMODEM_H
 
18
#define _FSKMODEM_H
 
19
 
 
20
#define PARITY_NONE             0
 
21
#define PARITY_EVEN             1
 
22
#define PARITY_ODD              2
 
23
 
 
24
 
 
25
#define NCOLA 0x4000
 
26
 
 
27
typedef struct {
 
28
        float spb;      /* Samples / Bit */
 
29
        int nbit;       /* Number of Data Bits (5,7,8) */
 
30
        float nstop;    /* Number of Stop Bits 1,1.5,2  */
 
31
        int paridad;    /* Parity 0=none 1=even 2=odd */
 
32
        int hdlc;       /* Modo Packet */
 
33
        float x0;
 
34
        float x1;
 
35
        float x2;
 
36
        float cont;
 
37
        int bw;         /* Ancho de Banda */
 
38
        double fmxv[8],fmyv[8]; /* filter stuff for M filter */
 
39
        int     fmp;            /* pointer for M filter */
 
40
        double fsxv[8],fsyv[8]; /* filter stuff for S filter */
 
41
        int     fsp;            /* pointer for S filter */
 
42
        double flxv[8],flyv[8]; /* filter stuff for L filter */
 
43
        int     flp;            /* pointer for L filter */
 
44
        int f_mark_idx; /* Indice de frecuencia de marca (f_M-500)/5 */
 
45
        int f_space_idx;/* Indice de frecuencia de espacio (f_S-500)/5 */
 
46
        int state;
 
47
        int pcola;      /* Puntero de las colas de datos */
 
48
        float cola_in[NCOLA];           /* Cola de muestras de entrada */
 
49
        float cola_filtro[NCOLA];       /* Cola de muestras tras filtros */
 
50
        float cola_demod[NCOLA];        /* Cola de muestras demoduladas */
 
51
} fsk_data;
 
52
 
 
53
/* Retrieve a serial byte into outbyte.  Buffer is a pointer into a series of 
 
54
   shorts and len records the number of bytes in the buffer.  len will be 
 
55
   overwritten with the number of bytes left that were not consumed, and the
 
56
   return value is as follows:
 
57
     0: Still looking for something...  
 
58
         1: An output byte was received and stored in outbyte
 
59
         -1: An error occured in the transmission
 
60
   He must be called with at least 80 bytes of buffer. */
 
61
extern int fsk_serie(fsk_data *fskd, short *buffer, int *len, int *outbyte);
 
62
 
 
63
#endif