/usr/include/spandsp/at_interpreter.h is in libspandsp-dev 0.0.6~pre20-3.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | /*
* SpanDSP - a series of DSP components for telephony
*
* at_interpreter.h - AT command interpreter to V.251, V.252, V.253, T.31 and the 3GPP specs.
*
* Written by Steve Underwood <steveu@coppice.org>
*
* Copyright (C) 2004, 2005, 2006 Steve Underwood
*
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 2.1,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*! \file */
#if !defined(_SPANDSP_AT_INTERPRETER_H_)
#define _SPANDSP_AT_INTERPRETER_H_
/*! \page at_page AT command interpreter
\section at_page_sec_1 What does it do?
The AT interpreter module implements V.251, V.252, V.253, T.31 and various 3GPP
modem control commands.
\section at_page_sec_2 How does it work?
*/
typedef struct at_state_s at_state_t;
typedef int (at_modem_control_handler_t)(at_state_t *s, void *user_data, int op, const char *num);
typedef int (at_tx_handler_t)(at_state_t *s, void *user_data, const uint8_t *buf, size_t len);
typedef int (at_class1_handler_t)(at_state_t *s, void *user_data, int direction, int operation, int val);
enum at_rx_mode_e
{
AT_MODE_ONHOOK_COMMAND,
AT_MODE_OFFHOOK_COMMAND,
AT_MODE_CONNECTED,
AT_MODE_DELIVERY,
AT_MODE_HDLC,
AT_MODE_STUFFED
};
enum at_call_event_e
{
AT_CALL_EVENT_ALERTING = 1,
AT_CALL_EVENT_CONNECTED,
AT_CALL_EVENT_ANSWERED,
AT_CALL_EVENT_BUSY,
AT_CALL_EVENT_NO_DIALTONE,
AT_CALL_EVENT_NO_ANSWER,
AT_CALL_EVENT_HANGUP
};
enum at_modem_control_operation_e
{
/*! Start an outgoing call. */
AT_MODEM_CONTROL_CALL,
/*! Answer an incoming call. */
AT_MODEM_CONTROL_ANSWER,
/*! Hangup a call. */
AT_MODEM_CONTROL_HANGUP,
/*! Take the line off hook. */
AT_MODEM_CONTROL_OFFHOOK,
/*! Put the line on hook. */
AT_MODEM_CONTROL_ONHOOK,
/*! Control V.24 Circuit 108, "data terminal ready". */
AT_MODEM_CONTROL_DTR,
/*! Control V.24 Circuit 105, "request to send". */
AT_MODEM_CONTROL_RTS,
/*! Control V.24 Circuit 106, "clear to send". */
AT_MODEM_CONTROL_CTS,
/*! Control V.24 Circuit 109, "receive line signal detector" (i.e. carrier detect). */
AT_MODEM_CONTROL_CAR,
/*! Control V.24 Circuit 125, "ring indicator". */
AT_MODEM_CONTROL_RNG,
/*! Control V.24 Circuit 107, "data set ready". */
AT_MODEM_CONTROL_DSR,
/*! Set the caller ID for outgoing calls. */
AT_MODEM_CONTROL_SETID,
/* The remainder of the control functions should not get past the modem, to the
application. */
AT_MODEM_CONTROL_RESTART,
AT_MODEM_CONTROL_DTE_TIMEOUT
};
enum
{
AT_RESPONSE_CODE_OK = 0,
AT_RESPONSE_CODE_CONNECT,
AT_RESPONSE_CODE_RING,
AT_RESPONSE_CODE_NO_CARRIER,
AT_RESPONSE_CODE_ERROR,
AT_RESPONSE_CODE_XXX,
AT_RESPONSE_CODE_NO_DIALTONE,
AT_RESPONSE_CODE_BUSY,
AT_RESPONSE_CODE_NO_ANSWER,
AT_RESPONSE_CODE_FCERROR,
AT_RESPONSE_CODE_FRH3
};
/*!
AT profile.
*/
typedef struct
{
/*! TRUE if character echo is enabled */
int echo;
/*! TRUE if verbose reporting is enabled */
int verbose;
/*! TRUE if result codes are verbose */
int result_code_format;
/*! TRUE if pulse dialling is the default */
int pulse_dial;
/*! ??? */
int double_escape;
/*! ??? */
int adaptive_receive;
/*! The state of all possible S registers */
uint8_t s_regs[100];
} at_profile_t;
#if defined(__cplusplus)
extern "C"
{
#endif
SPAN_DECLARE(void) at_set_at_rx_mode(at_state_t *s, int new_mode);
SPAN_DECLARE(void) at_put_response(at_state_t *s, const char *t);
SPAN_DECLARE(void) at_put_numeric_response(at_state_t *s, int val);
SPAN_DECLARE(void) at_put_response_code(at_state_t *s, int code);
SPAN_DECLARE(void) at_reset_call_info(at_state_t *s);
/*! Set the call information for an AT interpreter.
\brief Set the call information for an AT interpreter.
\param s The AT interpreter context.
\param id .
\param value . */
SPAN_DECLARE(void) at_set_call_info(at_state_t *s, char const *id, char const *value);
SPAN_DECLARE(void) at_display_call_info(at_state_t *s);
SPAN_DECLARE(int) at_modem_control(at_state_t *s, int op, const char *num);
SPAN_DECLARE(void) at_call_event(at_state_t *s, int event);
SPAN_DECLARE(void) at_interpreter(at_state_t *s, const char *cmd, int len);
SPAN_DECLARE(void) at_set_class1_handler(at_state_t *s, at_class1_handler_t handler, void *user_data);
/*! Initialise an AT interpreter context.
\brief Initialise an AT interpreter context.
\param s The AT context.
\param at_tx_handler x.
\param at_tx_user_data x.
\param modem_control_handler x.
\param modem_control_user_data x.
\return A pointer to the AT context, or NULL if there was a problem. */
SPAN_DECLARE(at_state_t *) at_init(at_state_t *s,
at_tx_handler_t *at_tx_handler,
void *at_tx_user_data,
at_modem_control_handler_t *modem_control_handler,
void *modem_control_user_data);
/*! Release an AT interpreter context.
\brief Release an AT interpreter context.
\param s The AT context.
\return 0 for OK */
SPAN_DECLARE(int) at_release(at_state_t *s);
/*! Free an AT interpreter context.
\brief Free an AT interpreter context.
\param s The AT context.
\return 0 for OK */
SPAN_DECLARE(int) at_free(at_state_t *s);
#if defined(__cplusplus)
}
#endif
#endif
/*- End of file ------------------------------------------------------------*/
|