spandsp  0.0.6
private/ademco_contactid.h
Go to the documentation of this file.
1 /*
2  * SpanDSP - a series of DSP components for telephony
3  *
4  * private/ademco_contactid.h - Ademco ContactID alarm protocol
5  *
6  * Written by Steve Underwood <steveu@coppice.org>
7  *
8  * Copyright (C) 2012 Steve Underwood
9  *
10  * All rights reserved.
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU Lesser General Public License version 2.1,
14  * as published by the Free Software Foundation.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with this program; if not, write to the Free Software
23  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24  */
25 
26 /*! \file */
27 
28 #if !defined(_SPANDSP_PRIVATE_ADEMCO_CONTACTID_H_)
29 #define _SPANDSP_PRIVATE_ADEMCO_CONTACTID_H_
30 
32 {
33  ademco_contactid_report_func_t callback;
34  void *callback_user_data;
35 
36  int step;
37  int remaining_samples;
38  uint32_t tone_phase;
39  int32_t tone_phase_rate;
40  int16_t tone_level;
41  dtmf_rx_state_t dtmf;
42 
43  char rx_digits[16 + 1];
44  int rx_digits_len;
45 
46  /*! \brief Error and flow logging control */
48 };
49 
51 {
52  tone_report_func_t callback;
53  void *callback_user_data;
54 
55  int step;
56  int remaining_samples;
57 
58  dtmf_tx_state_t dtmf;
59 #if defined(SPANDSP_USE_FIXED_POINT)
60  /*! Minimum acceptable tone level for detection. */
61  int32_t threshold;
62  /*! The accumlating total energy on the same period over which the Goertzels work. */
63  int32_t energy;
64 #else
65  /*! Minimum acceptable tone level for detection. */
66  float threshold;
67  /*! The accumlating total energy on the same period over which the Goertzels work. */
68  float energy;
69 #endif
70  goertzel_state_t tone_1400;
71  goertzel_state_t tone_2300;
72  /*! The current sample number within a processing block. */
74 
75  /*! \brief A buffer to save the sent message, in case we need to retry. */
76  char tx_digits[16 + 1];
77  int tx_digits_len;
78  /*! \brief The number of consecutive retries. */
79  int tries;
80 
81  int tone_state;
82  int duration;
83  int last_hit;
84  int in_tone;
85  int clear_to_send;
86  int timer;
87 
88  int busy;
89 
90  /*! \brief Error and flow logging control */
92 };
93 
94 #endif
95 /*- End of file ------------------------------------------------------------*/
Definition: private/ademco_contactid.h:31
int current_sample
Definition: private/ademco_contactid.h:73
Definition: private/dtmf.h:50
Definition: private/ademco_contactid.h:50
Definition: private/dtmf.h:33
float energy
Definition: private/ademco_contactid.h:68
logging_state_t logging
Error and flow logging control.
Definition: private/ademco_contactid.h:47
logging_state_t logging
Error and flow logging control.
Definition: private/ademco_contactid.h:91
char tx_digits[16+1]
A buffer to save the sent message, in case we need to retry.
Definition: private/ademco_contactid.h:76
int tries
The number of consecutive retries.
Definition: private/ademco_contactid.h:79
Definition: private/logging.h:33
Definition: tone_detect.h:45
float threshold
Definition: private/ademco_contactid.h:66