Asterisk - The Open Source Telephony Project  18.5.0
fskmodem_int.h
Go to the documentation of this file.
1 /*
2  * Asterisk -- An open source telephony toolkit.
3  *
4  * Copyright (C) 1999 - 2005, Digium, Inc.
5  *
6  * Mark Spencer <[email protected]>
7  *
8  * See http://www.asterisk.org for more information about
9  * the Asterisk project. Please do not directly contact
10  * any of the maintainers of this project for assistance;
11  * the project provides a web site, mailing lists and IRC
12  * channels for your use.
13  *
14  * This program is free software, distributed under the terms of
15  * the GNU General Public License Version 2. See the LICENSE file
16  * at the top of the source tree.
17  */
18 
19 /*! \file
20  * \brief FSK Modem Support
21  * \note Includes code and algorithms from the Zapata library.
22  */
23 
24 #ifndef _ASTERISK_FSKMODEM_H
25 #define _ASTERISK_FSKMODEM_H
26 
27 #define PARITY_NONE 0
28 #define PARITY_EVEN 1
29 #define PARITY_ODD 2
30 
31 
32 #define NCOLA 0x4000
33 
34 /* new filter structure */
35 struct filter_struct {
36 
37  int icoefs[8];
38  int ip;
39  int ixv[8];
40  int iyv[8];
41 };
42 
43 typedef struct {
44  int nbit; /*!< Number of Data Bits (5,7,8) */
45  int parity; /*!< Parity 0=none 1=even 2=odd */
46  int instop; /*!< Number of Stop Bits */
47  int hdlc; /*!< Modo Packet */
48  int xi0;
49  int xi1;
50  int xi2;
51 
52  int ispb;
53  int icont;
54  int bw; /*!< Band Selector*/
55  int f_mark_idx; /*!< Mark Frequency Index (f_M-500)/5 */
56  int f_space_idx; /*!< Space Frequency Index (f_S-500)/5 */
57  int state;
58 
59  int pllispb; /*!<Pll autosense */
60  int pllids;
61  int pllispb2;
62 
63  struct filter_struct mark_filter;
64  struct filter_struct space_filter;
65  struct filter_struct demod_filter;
66 
67 } fsk_data;
68 
69 /* \brief Retrieve a serial byte into outbyte.
70  Buffer is a pointer into a series of
71  shorts and len records the number of bytes in the buffer. len will be
72  overwritten with the number of bytes left that were not consumed.
73  \return return value is as follows:
74  \arg 0: Still looking for something...
75  \arg 1: An output byte was received and stored in outbyte
76  \arg -1: An error occured in the transmission
77  This must be called with at least 80 bytes of buffer. */
78 int fsk_serial(fsk_data *fskd, short *buffer, int *len, int *outbyte);
79 int fskmodem_init(fsk_data *fskd);
80 
81 #endif /* _ASTERISK_FSKMODEM_H */
enum sip_cc_notify_state state
Definition: chan_sip.c:959
int pllids
Definition: fskmodem_int.h:60
int fskmodem_init(fsk_data *fskd)
Definition: fskmodem_int.c:195
int fsk_serial(fsk_data *fskd, short *buffer, int *len, int *outbyte)
int instop
Definition: fskmodem_int.h:46
int pllispb
Definition: fskmodem_int.h:59
int pllispb2
Definition: fskmodem_int.h:61
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)