Mercurial > hg > audiostuff
comparison spandsp-0.0.3/spandsp-0.0.3/tests/at_interpreter_tests.c @ 5:f762bf195c4b
import spandsp-0.0.3
author | Peter Meerwald <pmeerw@cosy.sbg.ac.at> |
---|---|
date | Fri, 25 Jun 2010 16:00:21 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
4:26cd8f1ef0b1 | 5:f762bf195c4b |
---|---|
1 /* | |
2 * SpanDSP - a series of DSP components for telephony | |
3 * | |
4 * at_interpreter_tests.c - Tests for the AT interpreter. | |
5 * | |
6 * Written by Steve Underwood <steveu@coppice.org> | |
7 * | |
8 * Copyright (C) 2004, 2005, 2006 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 General Public License version 2, as | |
14 * 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 General Public License for more details. | |
20 * | |
21 * You should have received a copy of the GNU General Public License | |
22 * along with this program; if not, write to the Free Software | |
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
24 * | |
25 * $Id: at_interpreter_tests.c,v 1.9 2006/11/19 14:07:26 steveu Exp $ | |
26 */ | |
27 | |
28 /*! \file */ | |
29 | |
30 /*! \page at_interpreter_tests_page AT interpreter tests | |
31 \section at_interpreter_tests_page_sec_1 What does it do? | |
32 These tests exercise all the commands which should be understood by the AT interpreter. | |
33 */ | |
34 | |
35 #ifdef HAVE_CONFIG_H | |
36 #include "config.h" | |
37 #endif | |
38 | |
39 #define _GNU_SOURCE | |
40 | |
41 #include <inttypes.h> | |
42 #include <stdlib.h> | |
43 #include <unistd.h> | |
44 #include <stdio.h> | |
45 #include <fcntl.h> | |
46 #include <string.h> | |
47 #if defined(HAVE_TGMATH_H) | |
48 #include <tgmath.h> | |
49 #endif | |
50 #if defined(HAVE_MATH_H) | |
51 #include <math.h> | |
52 #endif | |
53 #include <assert.h> | |
54 #include <audiofile.h> | |
55 #include <tiffio.h> | |
56 | |
57 #include "spandsp.h" | |
58 | |
59 #define DLE 0x10 | |
60 #define ETX 0x03 | |
61 #define SUB 0x1A | |
62 | |
63 #define MANUFACTURER "www.soft-switch.org" | |
64 | |
65 struct command_response_s | |
66 { | |
67 const char *command; | |
68 const char *response; | |
69 }; | |
70 | |
71 static const struct command_response_s general_test_seq[] = | |
72 { | |
73 /* Try the various cases for "AT" */ | |
74 {"atE1\r", "atE1\r\r\nOK\r\n"}, | |
75 {"AtE1\r", "AtE1\r\r\nOK\r\n"}, | |
76 {"aTE1\r", "aTE1\r\r\nOK\r\n"}, | |
77 {"ATE1\r", "ATE1\r\r\nOK\r\n"}, | |
78 {"ATE0\r", "ATE0\r\r\nOK\r\n"}, | |
79 | |
80 /* Try the various command formats */ | |
81 {"ATS8?\r", "\r\n005\r\n\r\nOK\r\n"}, | |
82 {"ATS8=1\r", "\r\nOK\r\n"}, | |
83 {"ATS8.5?\r", "\r\n0\r\n\r\nOK\r\n"}, | |
84 {"ATS8.5=1\r", "\r\nOK\r\n"}, | |
85 {"ATS8.5?\r", "\r\n1\r\n\r\nOK\r\n"}, | |
86 {"ATS8?\r", "\r\n033\r\n\r\nOK\r\n"}, | |
87 {"AT+FCLASS=1\r", "\r\nOK\r\n"}, | |
88 {"AT+FCLASS?\r", "\r\n1\r\n\r\nOK\r\n"}, | |
89 {"AT+FCLASS=?\r", "\r\n0,1,1.0\r\n\r\nOK\r\n"}, | |
90 | |
91 /* Try all the commands */ | |
92 {"AT&C\r", "\r\nOK\r\n"}, /* V.250 6.2.8 - Circuit 109 (received line signal detector), behaviour */ | |
93 {"AT&D\r", "\r\nOK\r\n"}, /* V.250 6.2.9 - Circuit 108 (data terminal ready) behaviour */ | |
94 {"AT&F\r", "\r\nOK\r\n"}, /* V.250 6.1.2 - Set to factory-defined configuration */ | |
95 {"ATE0\r", "ATE0\r\r\nOK\r\n"}, /* Counteract the effects of the above */ | |
96 {"AT+A8E=?\r", "\r\n+A8E:(0-6),(0-5),(00-FF)\r\n\r\nOK\r\n"}, /* V.251 5.1 - V.8 and V.8bis operation controls */ | |
97 {"AT+A8M\r", "\r\nOK\r\n"}, /* V.251 5.2 - Send V.8 menu signals */ | |
98 {"AT+A8T=?\r", "\r\n+A8T:(0-10)\r\n\r\nOK\r\n"}, /* V.251 5.3 - Send V.8bis signal and/or message(s) */ | |
99 {"AT+ASTO=?\r", "\r\n+ASTO:\r\n\r\nOK\r\n"}, /* V.250 6.3.15 - Store telephone number */ | |
100 {"AT+CAAP=?\r", "\r\n+CAAP:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.25 - Automatic answer for eMLPP Service */ | |
101 {"AT+CACM=?\r", "\r\n+CACM:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.25 - Accumulated call meter */ | |
102 {"AT+CACSP=?\r", "\r\n+CACSP:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 11.1.7 - Voice Group or Voice Broadcast Call State Attribute Presentation */ | |
103 {"AT+CAEMLPP=?\r", "\r\n+CAEMLPP:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.22 - eMLPP Priority Registration and Interrogation */ | |
104 {"AT+CAHLD=?\r", "\r\n+CAHLD:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 11.1.3 - Leave an ongoing Voice Group or Voice Broadcast Call */ | |
105 {"AT+CAJOIN=?\r", "\r\n+CAJOIN:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 11.1.1 - Accept an incoming Voice Group or Voice Broadcast Call */ | |
106 {"AT+CALA=?\r", "\r\n+CALA:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.16 - Alarm */ | |
107 {"AT+CALCC=?\r", "\r\n+CALCC:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 11.1.6 - List current Voice Group and Voice Broadcast Calls */ | |
108 {"AT+CALD=?\r", "\r\n+CALD:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.38 - Delete alar m */ | |
109 {"AT+CALM=?\r", "\r\n+CALM:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.20 - Alert sound mode */ | |
110 {"AT+CAMM=?\r", "\r\n+CAMM:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.26 - Accumulated call meter maximum */ | |
111 {"AT+CANCHEV=?\r", "\r\n+CANCHEV:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 11.1.8 - NCH Support Indication */ | |
112 {"AT+CAOC=?\r", "\r\n+CAOC:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.16 - Advice of Charge */ | |
113 {"AT+CAPD=?\r", "\r\n+CAPD:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.39 - Postpone or dismiss an alarm */ | |
114 {"AT+CAPTT=?\r", "\r\n+CAPTT:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 11.1.4 - Talker Access for Voice Group Call */ | |
115 {"AT+CAREJ=?\r", "\r\n+CAREJ:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 11.1.2 - Reject an incoming Voice Group or Voice Broadcast Call */ | |
116 {"AT+CAULEV=?\r", "\r\n+CAULEV:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 11.1.5 - Voice Group Call Uplink Status Presentation */ | |
117 {"AT+CBC=?\r", "\r\n+CBC:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.4 - Battery charge */ | |
118 {"AT+CBCS=?\r", "\r\n+CBCS:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 11.3.2 - VBS subscriptions and GId status */ | |
119 {"AT+CBST=?\r", "\r\n+CBST:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.7 - Select bearer service type */ | |
120 {"AT+CCFC=?\r", "\r\n+CCFC:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.11 - Call forwarding number and conditions */ | |
121 {"AT+CCLK=?\r", "\r\n+CCLK:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.15 - Clock */ | |
122 {"AT+CCUG=?\r", "\r\n+CCUG:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.10 - Closed user group */ | |
123 {"AT+CCWA=?\r", "\r\n+CCWA:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.12 - Call waiting */ | |
124 {"AT+CCWE=?\r", "\r\n+CCWE:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.28 - Call Meter maximum event */ | |
125 {"AT+CDIP=?\r", "\r\n+CDIP:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.9 - Called line identification presentation */ | |
126 {"AT+CDIS=?\r", "\r\n+CDIS:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.8 - Display control */ | |
127 {"AT+CEER=?\r", "\r\n+CEER:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.10 - Extended error report */ | |
128 {"AT+CFCS=?\r", "\r\n+CFCS:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.24 - Fast call setup conditions */ | |
129 {"AT+CFUN=?\r", "\r\n+CFUN:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.2 - Set phone functionality */ | |
130 {"AT+CGACT=?\r", "\r\n+CGACT:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.10 - PDP context activate or deactivate */ | |
131 {"AT+CGANS=?\r", "\r\n+CGANS:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.16 - Manual response to a network request for PDP context activation */ | |
132 {"AT+CGATT=?\r", "\r\n+CGATT:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.9 - PS attach or detach */ | |
133 {"AT+CGAUTO=?\r", "\r\n+CGAUTO:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.15 - Automatic response to a network request for PDP context activation */ | |
134 {"AT+CGCLASS=?\r", "\r\n+CGCLASS:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.17 - GPRS mobile station class (GPRS only) */ | |
135 {"AT+CGCLOSP=?\r", "\r\n+CGCLOSP:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.13 - Configure local octet stream PAD parameters (Obsolete) */ | |
136 {"AT+CGCLPAD=?\r", "\r\n+CGCLPAD:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.12 - Configure local triple-X PAD parameters (GPRS only) (Obsolete) */ | |
137 {"AT+CGCMOD=?\r", "\r\n+CGCMOD:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.11 - PDP Context Modify */ | |
138 {"AT+CGCS=?\r", "\r\n+CGCS:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 11.3.1 - VGCS subscriptions and GId status */ | |
139 {"AT+CGDATA=?\r", "\r\n+CGDATA:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.12 - Enter data state */ | |
140 {"AT+CGDCONT=?\r", "\r\n+CGDCONT:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.1 - Define PDP Context */ | |
141 {"AT+CGDSCONT=?\r", "\r\n+CGDSCONT:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.2 - Define Secondary PDP Context */ | |
142 {"AT+CGEQMIN=?\r", "\r\n+CGEQMIN:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.7 - 3G Quality of Service Profile (Minimum acceptable) */ | |
143 {"AT+CGEQNEG=?\r", "\r\n+CGEQNEG:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.8 - 3G Quality of Service Profile (Negotiated) */ | |
144 {"AT+CGEQREQ=?\r", "\r\n+CGEQREQ:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.6 - 3G Quality of Service Profile (Requested) */ | |
145 {"AT+CGEREP=?\r", "\r\n+CGEREP:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.18 - Packet Domain event reporting */ | |
146 {"AT+CGMI=?\r", "\r\n+CGMI:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 5.1 - Request manufacturer identification */ | |
147 {"AT+CGMM=?\r", "\r\n+CGMM:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 5.2 - Request model identification */ | |
148 {"AT+CGMR=?\r", "\r\n+CGMR:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 5.3 - Request revision identification */ | |
149 {"AT+CGPADDR=?\r", "\r\n+CGPADDR:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.14 - Show PDP address */ | |
150 {"AT+CGQMIN=?\r", "\r\n+CGQMIN:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.5 - Quality of Service Profile (Minimum acceptable) */ | |
151 {"AT+CGQREQ=?\r", "\r\n+CGQREQ:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.4 - Quality of Service Profile (Requested) */ | |
152 {"AT+CGREG=?\r", "\r\n+CGREG:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.19 - GPRS network registration status */ | |
153 {"AT+CGSMS=?\r", "\r\n+CGSMS:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.20 - Select service for MO SMS messages */ | |
154 {"AT+CGSN=?\r", "\r\n+CGSN:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 5.4 - Request product serial number identification */ | |
155 {"AT+CGTFT=?\r", "\r\n+CGTFT:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.3 - Traffic Flow Template */ | |
156 {"AT+CHLD=?\r", "\r\n+CHLD:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.13 - Call related supplementary services */ | |
157 {"AT+CHSA=?\r", "\r\n+CHSA:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.18 - HSCSD non-transparent asymmetry configuration */ | |
158 {"AT+CHSC=?\r", "\r\n+CHSC:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.15 - HSCSD current call parameters */ | |
159 {"AT+CHSD=?\r", "\r\n+CHSD:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.12 - HSCSD device parameters */ | |
160 {"AT+CHSN=?\r", "\r\n+CHSN:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.14 - HSCSD non-transparent call configuration */ | |
161 {"AT+CHSR=?\r", "\r\n+CHSR:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.16 - HSCSD parameters report */ | |
162 {"AT+CHST=?\r", "\r\n+CHST:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.13 - HSCSD transparent call configuration */ | |
163 {"AT+CHSU=?\r", "\r\n+CHSU:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.17 - HSCSD automatic user initiated upgrading */ | |
164 {"AT+CHUP=?\r", "\r\n+CHUP:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.5 - Hangup call */ | |
165 {"AT+CIMI=?\r", "\r\n+CIMI:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 5.6 - Request international mobile subscriber identity */ | |
166 {"AT+CIND=?\r", "\r\n+CIND:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.9 - Indicator control */ | |
167 {"AT+CKPD=?\r", "\r\n+CKPD:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.7 - Keypad control */ | |
168 {"AT+CLAC=?\r", "\r\n+CLAC:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.37 - List all available AT commands */ | |
169 {"AT+CLAE=?\r", "\r\n+CLAE:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.31 - Language Event */ | |
170 {"AT+CLAN=?\r", "\r\n+CLAN:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.30 - Set Language */ | |
171 {"AT+CLCC=?\r", "\r\n+CLCC:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.18 - List current calls */ | |
172 {"AT+CLCK=?\r", "\r\n+CLCK:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.4 - Facility lock */ | |
173 {"AT+CLIP=?\r", "\r\n+CLIP:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.6 - Calling line identification presentation */ | |
174 {"AT+CLIR=?\r", "\r\n+CLIR:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.7 - Calling line identification restriction */ | |
175 {"AT+CLVL=?\r", "\r\n+CLVL:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.23 - Loudspeaker volume level */ | |
176 {"AT+CMAR=?\r", "\r\n+CMAR:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.36 - Master Reset */ | |
177 {"AT+CMEC=?\r", "\r\n+CMEC:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.6 - Mobile Termination control mode */ | |
178 {"AT+CMER=?\r", "\r\n+CMER:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.10 - Mobile Termination event reporting */ | |
179 {"AT+CMOD=?\r", "\r\n+CMOD:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.4 - Call mode */ | |
180 {"AT+CMUT=?\r", "\r\n+CMUT:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.24 - Mute control */ | |
181 {"AT+CMUX=?\r", "\r\n+CMUX:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 5.7 - Multiplexing mode */ | |
182 {"AT+CNUM=?\r", "\r\n+CNUM:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.1 - Subscriber number */ | |
183 {"AT+COLP=?\r", "\r\n+COLP:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.8 - Connected line identification presentation */ | |
184 {"AT+COPN=?\r", "\r\n+COPN:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.21 - Read operator names */ | |
185 {"AT+COPS=?\r", "\r\n+COPS:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.3 - PLMN selection */ | |
186 {"AT+COTDI=?\r", "\r\n+COTDI:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 11.1.9 - Originator to Dispatcher Information */ | |
187 {"AT+CPAS=?\r", "\r\n+CPAS:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.1 - Phone activity status */ | |
188 {"AT+CPBF=?\r", "\r\n+CPBF:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.13 - Find phonebook entries */ | |
189 {"AT+CPBR=?\r", "\r\n+CPBR:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.12 - Read phonebook entries */ | |
190 {"AT+CPBS=?\r", "\r\n+CPBS:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.11 - Select phonebook memory storage */ | |
191 {"AT+CPBW=?\r", "\r\n+CPBW:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.14 - Write phonebook entry */ | |
192 {"AT+CPIN=?\r", "\r\n+CPIN:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.3 - Enter PIN */ | |
193 {"AT+CPLS=?\r", "\r\n+CPLS:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.20 - Selection of preferred PLMN list */ | |
194 {"AT+CPOL=?\r", "\r\n+CPOL:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.19 - Preferred PLMN list */ | |
195 {"AT+CPPS=?\r", "\r\n+CPPS:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.23 - eMLPP subscriptions */ | |
196 {"AT+CPROT=?\r", "\r\n+CPROT:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.42 - Enter protocol mode */ | |
197 {"AT+CPUC=?\r", "\r\n+CPUC:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.27 - Price per unit and currency table */ | |
198 {"AT+CPWC=?\r", "\r\n+CPWC:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.29 - Power class */ | |
199 {"AT+CPWD=?\r", "\r\n+CPWD:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.5 - Change password */ | |
200 {"AT+CR=?\r", "\r\n+CR:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.9 - Service reporting control */ | |
201 {"AT+CRC=?\r", "\r\n+CRC:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.11 - Cellular result codes */ | |
202 {"AT+CREG=?\r", "\r\n+CREG:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.2 - Network registration */ | |
203 {"AT+CRLP=?\r", "\r\n+CRLP:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.8 - Radio link protocol */ | |
204 {"AT+CRMC=?\r", "\r\n+CRMC:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.34 - Ring Melody Control */ | |
205 {"AT+CRMP=?\r", "\r\n+CRMP:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.35 - Ring Melody Playback */ | |
206 {"AT+CRSL=?\r", "\r\n+CRSL:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.21 - Ringer sound level */ | |
207 {"AT+CRSM=?\r", "\r\n+CRSM:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.18 - Restricted SIM access */ | |
208 {"AT+CSCC=?\r", "\r\n+CSCC:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.19 - Secure control command */ | |
209 {"AT+CSCS=?\r", "\r\n+CSCS:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 5.5 - Select TE character set */ | |
210 {"AT+CSDF=?\r", "\r\n+CSDF:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.22 - Settings date format */ | |
211 {"AT+CSGT=?\r", "\r\n+CSGT:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.32 - Set Greeting Text */ | |
212 {"AT+CSIL=?\r", "\r\n+CSIL:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.23 - Silence Command */ | |
213 {"AT+CSIM=?\r", "\r\n+CSIM:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.17 - Generic SIM access */ | |
214 {"AT+CSNS=?\r", "\r\n+CSNS:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.19 - Single numbering scheme */ | |
215 {"AT+CSQ=?\r", "\r\n+CSQ:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.5 - Signal quality */ | |
216 {"AT+CSSN=?\r", "\r\n+CSSN:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.17 - Supplementary service notifications */ | |
217 {"AT+CSTA=?\r", "\r\n+CSTA:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.1 - Select type of address */ | |
218 {"AT+CSTF=?\r", "\r\n+CSTF:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.24 - Settings time format */ | |
219 {"AT+CSVM=?\r", "\r\n+CSVM:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.33 - Set Voice Mail Number */ | |
220 {"AT+CTFR=?\r", "\r\n+CTFR:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.14 - Call deflection */ | |
221 {"AT+CTZR=?\r", "\r\n+CTZR:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.41 - Time Zone Reporting */ | |
222 {"AT+CTZU=?\r", "\r\n+CTZU:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.40 - Automatic Time Zone Update */ | |
223 {"AT+CUSD=?\r", "\r\n+CUSD:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.15 - Unstructured supplementary service data */ | |
224 {"AT+CUUS1=?\r", "\r\n+CUUS1:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.26 - User to User Signalling Service 1 */ | |
225 {"AT+CV120=?\r", "\r\n+CV120:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.21 - V.120 rate adaption protocol */ | |
226 {"AT+CVHU=?\r", "\r\n+CVHU:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.20 - Voice Hangup Control */ | |
227 {"AT+CVIB=?\r", "\r\n+CVIB:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.22 - Vibrator mode */ | |
228 {"AT+DR=?\r", "\r\n+DR:\r\n\r\nOK\r\n"}, /* V.250 6.6.2 - Data compression reporting */ | |
229 {"AT+DS=?\r", "\r\n+DS:\r\n\r\nOK\r\n"}, /* V.250 6.6.1 - Data compression */ | |
230 {"AT+EB=?\r", "\r\n+EB:\r\n\r\nOK\r\n"}, /* V.250 6.5.2 - Break handling in error control operation */ | |
231 {"AT+EFCS=?\r", "\r\n+EFCS:(0-2)\r\n\r\nOK\r\n"}, /* V.250 6.5.4 - 32-bit frame check sequence */ | |
232 {"AT+EFCS?\r", "\r\n+EFCS:0\r\n\r\nOK\r\n"}, | |
233 {"AT+EFRAM=?\r", "\r\n+EFRAM:(1-65535),(1-65535)\r\n\r\nOK\r\n"}, /* V.250 6.5.8 - Frame length */ | |
234 {"AT+ER=?\r", "\r\n+ER:(0,1)\r\n\r\nOK\r\n"}, /* V.250 6.5.5 - Error control reporting */ | |
235 {"AT+ES\r", "\r\nOK\r\n"}, /* V.250 6.5.1 - Error control selection */ | |
236 {"AT+ESR\r", "\r\nOK\r\n"}, /* V.250 6.5.3 - Selective repeat */ | |
237 {"AT+ETBM=?\r", "\r\n+ETBM:(0-2),(0-2),(0-30)\r\n\r\nOK\r\n"}, /* T.31 8.5.1 - Adaptive reception control */ | |
238 {"AT+ETBM?\r", "\r\n+ETBM:0,0\r\n\r\nOK\r\n"}, | |
239 {"AT+EWIND=?\r", "\r\n+EWIND:(1-127),(1-127)\r\n\r\nOK\r\n"}, /* V.250 6.5.7 - Window size */ | |
240 {"AT+EWIND?\r", "\r\n+EWIND:0,0\r\n\r\nOK\r\n"}, | |
241 {"AT+FAR=?\r", "\r\n0,1\r\n\r\nOK\r\n"}, /* T.31 8.5.1 - Adaptive reception control */ | |
242 {"AT+FAR?\r", "\r\n0\r\n\r\nOK\r\n"}, | |
243 {"AT+FCL=?\r", "\r\n(0-255)\r\n\r\nOK\r\n"}, /* T.31 8.5.2 - Carrier loss timeout */ | |
244 {"AT+FCLASS=?\r", "\r\n0,1,1.0\r\n\r\nOK\r\n"}, /* T.31 8.2 - Capabilities identification and control */ | |
245 {"AT+FCLASS?\r", "\r\n1\r\n\r\nOK\r\n"}, | |
246 {"AT+FDD=?\r", "\r\n(0,1)\r\n\r\nOK\r\n"}, /* T.31 8.5.3 - Double escape character replacement */ | |
247 {"AT+FDD?\r", "\r\n0\r\n\r\nOK\r\n"}, | |
248 {"AT+FIT=?\r", "\r\n+FIT:(0-255),(0-1)\r\n\r\nOK\r\n"}, /* T.31 8.5.4 - DTE inactivity timeout */ | |
249 {"AT+FIT?\r", "\r\n+FIT:0,0\r\n\r\nOK\r\n"}, | |
250 {"AT+FLO\r", "\r\nOK\r\n"}, /* T.31 says to implement something similar to +IFC */ | |
251 {"AT+FMI?\r", "\r\n" MANUFACTURER "\r\n\r\nOK\r\n"}, /* T.31 says to duplicate +GMI */ | |
252 {"AT+FMM?\r", "\r\n" PACKAGE "\r\n\r\nOK\r\n"}, /* T.31 says to duplicate +GMM */ | |
253 {"AT+FMR?\r", "\r\n" VERSION "\r\n\r\nOK\r\n"}, /* T.31 says to duplicate +GMR */ | |
254 {"AT+FPR=?\r", "\r\n115200\r\n\r\nOK\r\n"}, /* T.31 says to implement something similar to +IPR */ | |
255 {"AT+FPR?\r", "\r\n0\r\n\r\nOK\r\n"}, | |
256 {"AT+FRH=?\r", "\r\n3\r\n\r\nOK\r\n"}, /* T.31 8.3.6 - HDLC receive */ | |
257 {"AT+FRH?\r", "\r\n-1\r\n\r\nOK\r\n"}, | |
258 #if defined(ENABLE_V17) | |
259 {"AT+FRM=?\r", "\r\n24,48,72,73,74,96,97,98,121,122,145,146\r\n\r\nOK\r\n"}, /* T.31 8.3.4 - Facsimile receive */ | |
260 #else | |
261 {"AT+FRM=?\r", "\r\n24,48,72,96\r\n\r\nOK\r\n"}, /* T.31 8.3.4 - Facsimile receive */ | |
262 #endif | |
263 {"AT+FRM?\r", "\r\n-1\r\n\r\nOK\r\n"}, | |
264 {"AT+FRS=?\r", "\r\n0-255\r\n\r\nOK\r\n"}, /* T.31 8.3.2 - Receive silence */ | |
265 {"AT+FRS?\r", "\r\n-1\r\n\r\nOK\r\n"}, | |
266 {"AT+FTH=?\r", "\r\n3\r\n\r\nOK\r\n"}, /* T.31 8.3.5 - HDLC transmit */ | |
267 {"AT+FTH?\r", "\r\n-1\r\n\r\nOK\r\n"}, | |
268 #if defined(ENABLE_V17) | |
269 {"AT+FTM=?\r", "\r\n24,48,72,73,74,96,97,98,121,122,145,146\r\n\r\nOK\r\n"}, /* T.31 8.3.3 - Facsimile transmit */ | |
270 #else | |
271 {"AT+FTM=?\r", "\r\n24,48,72,96\r\n\r\nOK\r\n"}, /* T.31 8.3.3 - Facsimile transmit */ | |
272 #endif | |
273 {"AT+FTM?\r", "\r\n-1\r\n\r\nOK\r\n"}, | |
274 {"AT+FTS=?\r", "\r\n0-255\r\n\r\nOK\r\n"}, /* T.31 8.3.1 - Transmit silence */ | |
275 {"AT+FTS?\r", "\r\n-1\r\n\r\nOK\r\n"}, | |
276 {"AT+GCAP\r", "\r\nOK\r\n"}, /* V.250 6.1.9 - Request complete capabilities list */ | |
277 {"AT+GCI=?\r", "\r\n+GCI:(00-FF)\r\n\r\nOK\r\n"}, /* V.250 6.1.10 - Country of installation, */ | |
278 {"AT+GCI?\r", "\r\n+GCI:00\r\n\r\nOK\r\n"}, | |
279 {"AT+GMI?\r", "\r\n" MANUFACTURER "\r\n\r\nOK\r\n"}, /* V.250 6.1.4 - Request manufacturer identification */ | |
280 {"AT+GMM?\r", "\r\n" PACKAGE "\r\n\r\nOK\r\n"}, /* V.250 6.1.5 - Request model identification */ | |
281 {"AT+GMR?\r", "\r\n" VERSION "\r\n\r\nOK\r\n"}, /* V.250 6.1.6 - Request revision identification */ | |
282 {"AT+GOI\r", "\r\nOK\r\n"}, /* V.250 6.1.8 - Request global object identification */ | |
283 {"AT+GSN?\r", "\r\n42\r\n\r\nOK\r\n"}, /* V.250 6.1.7 - Request product serial number identification */ | |
284 {"AT+ICF?\r", "\r\n+ICF:0,0\r\n\r\nOK\r\n"}, /* V.250 6.2.11 - DTE-DCE character framing */ | |
285 {"AT+ICLOK?\r", "\r\n+ICLOK:0\r\n\r\nOK\r\n"}, /* V.250 6.2.14 - Select sync transmit clock source */ | |
286 {"AT+IDSR?\r", "\r\n+IDSR:0\r\n\r\nOK\r\n"}, /* V.250 6.2.16 - Select data set ready option */ | |
287 {"AT+IFC\r", "\r\nOK\r\n"}, /* V.250 6.2.12 - DTE-DCE local flow control */ | |
288 {"AT+ILRR\r", "\r\nOK\r\n"}, /* V.250 6.2.13 - DTE-DCE local rate reporting */ | |
289 {"AT+ILSD=?\r", "\r\n+ILSD:(0,1)\r\n\r\nOK\r\n"}, /* V.250 6.2.15 - Select long space disconnect option */ | |
290 {"AT+ILSD?\r", "\r\n+ILSD:0\r\n\r\nOK\r\n"}, | |
291 {"AT+IPR=?\r", "\r\n+IPR:(115200),(115200)\r\n\r\nOK\r\n"}, /* V.250 6.2.10 - Fixed DTE rate */ | |
292 {"AT+IPR?\r", "\r\n+IPR:0\r\n\r\nOK\r\n"}, | |
293 {"AT+IRTS=?\r", "\r\n+IRTS:(0,1)\r\n\r\nOK\r\n"}, /* V.250 6.2.17 - Select synchronous mode RTS option */ | |
294 {"AT+IRTS?\r", "\r\n+IRTS:0\r\n\r\nOK\r\n"}, | |
295 {"AT+MA\r", "\r\nOK\r\n"}, /* V.250 6.4.2 - Modulation automode control */ | |
296 {"AT+MR=?\r", "\r\n+MR:(0,1)\r\n\r\nOK\r\n"}, /* V.250 6.4.3 - Modulation reporting control */ | |
297 {"AT+MR?\r", "\r\n+MR:0\r\n\r\nOK\r\n"}, | |
298 {"AT+MS\r", "\r\nOK\r\n"}, /* V.250 6.4.1 - Modulation selection */ | |
299 {"AT+MSC=?\r", "\r\n+MSC:(0,1)\r\n\r\nOK\r\n"}, /* V.250 6.4.8 - Seamless rate change enable */ | |
300 {"AT+MSC?\r", "\r\n+MSC:0\r\n\r\nOK\r\n"}, | |
301 {"AT+MV18AM\r", "\r\nOK\r\n"}, /* V.250 6.4.6 - V.18 answering message editing */ | |
302 {"AT+MV18P=?\r", "\r\n+MV18P:(2-7)\r\n\r\nOK\r\n"}, /* V.250 6.4.7 - Order of probes */ | |
303 {"AT+MV18P?\r", "\r\n+MV18P:0\r\n\r\nOK\r\n"}, | |
304 {"AT+MV18R=?\r", "\r\n+MV18R:(0,1)\r\n\r\nOK\r\n"}, /* V.250 6.4.5 - V.18 reporting control */ | |
305 {"AT+MV18R?\r", "\r\n+MV18R:0\r\n\r\nOK\r\n"}, | |
306 {"AT+MV18S\r", "\r\nOK\r\n"}, /* V.250 6.4.4 - V.18 selection */ | |
307 {"AT+TADR\r", "\r\nOK\r\n"}, /* V.250 6.7.2.9 - Local V.54 address */ | |
308 {"AT+TAL=?\r", "\r\n+TAL:(0,1),(0,1)\r\n\r\nOK\r\n"}, /* V.250 6.7.2.15 - Local analogue loop */ | |
309 {"AT+TAL?\r", "\r\n+TAL:0,0\r\n\r\nOK\r\n"}, | |
310 {"AT+TALS=?\r", "\r\n+TALS:(0-3)\r\n\r\nOK\r\n"}, /* V.250 6.7.2.6 - Analogue loop status */ | |
311 {"AT+TALS?\r", "\r\n+TALS:0\r\n\r\nOK\r\n"}, | |
312 {"AT+TDLS=?\r", "\r\n+TDLS:(0-4)\r\n\r\nOK\r\n"}, /* V.250 6.7.2.7 - Local digital loop status */ | |
313 {"AT+TDLS?\r", "\r\n+TDLS:0\r\n\r\nOK\r\n"}, | |
314 {"AT+TE140=?\r", "\r\n+TE140:(0,1)\r\n\r\nOK\r\n"}, /* V.250 6.7.2.1 - Enable ckt 140 */ | |
315 {"AT+TE140?\r", "\r\n+TE140:0\r\n\r\nOK\r\n"}, | |
316 {"AT+TE141=?\r", "\r\n+TE141:(0,1)\r\n\r\nOK\r\n"}, /* V.250 6.7.2.2 - Enable ckt 141 */ | |
317 {"AT+TE141?\r", "\r\n+TE141:0\r\n\r\nOK\r\n"}, | |
318 {"AT+TEPAL=?\r", "\r\n+TEPAL:(0,1)\r\n\r\nOK\r\n"}, /* V.250 6.7.2.5 - Enable front panel analogue loop */ | |
319 {"AT+TEPAL?\r", "\r\n+TEPAL:0\r\n\r\nOK\r\n"}, | |
320 {"AT+TEPDL=?\r", "\r\n+TEPDL:(0,1)\r\n\r\nOK\r\n"}, /* V.250 6.7.2.4 - Enable front panel RDL */ | |
321 {"AT+TEPDL?\r", "\r\n+TEPDL:0\r\n\r\nOK\r\n"}, | |
322 {"AT+TERDL=?\r", "\r\n+TERDL:(0,1)\r\n\r\nOK\r\n"}, /* V.250 6.7.2.3 - Enable RDL from remote */ | |
323 {"AT+TERDL?\r", "\r\n+TERDL:0\r\n\r\nOK\r\n"}, | |
324 {"AT+TLDL=?\r", "\r\n+TLDL:(0,1)\r\n\r\nOK\r\n"}, /* V.250 6.7.2.13 - Local digital loop */ | |
325 {"AT+TLDL?\r", "\r\n+TLDL:0\r\n\r\nOK\r\n"}, | |
326 {"AT+TMODE=?\r", "\r\n+TMODE:(0,1)\r\n\r\nOK\r\n"}, /* V.250 6.7.2.10 - Set V.54 mode */ | |
327 {"AT+TMODE?\r", "\r\n+TMODE:0\r\n\r\nOK\r\n"}, | |
328 {"AT+TNUM\r", "\r\nOK\r\n"}, /* V.250 6.7.2.12 - Errored bit and block counts */ | |
329 {"AT+TRDL=?\r", "\r\n+TRDL:(0,1)\r\n\r\nOK\r\n"}, /* V.250 6.7.2.14 - Request remote digital loop */ | |
330 {"AT+TRDL?\r", "\r\n+TRDL:0\r\n\r\nOK\r\n"}, | |
331 {"AT+TRDLS\r", "\r\nOK\r\n"}, /* V.250 6.7.2.8 - Remote digital loop status */ | |
332 {"AT+TRES=?\r", "\r\n+TRES:(0-2)\r\n\r\nOK\r\n"}, /* V.250 6.7.2.17 - Self test result */ | |
333 {"AT+TRES?\r", "\r\n+TRES:0\r\n\r\nOK\r\n"}, | |
334 {"AT+TSELF=?\r", "\r\n+TSELF:(0,1)\r\n\r\nOK\r\n"}, /* V.250 6.7.2.16 - Self test */ | |
335 {"AT+TSELF?\r", "\r\n+TSELF:0\r\n\r\nOK\r\n"}, | |
336 {"AT+TTER=?\r", "\r\n+TTER:(0-65535),(0-65535)\r\n\r\nOK\r\n"}, /* V.250 6.7.2.11 - Test error rate */ | |
337 {"AT+TTER?\r", "\r\n+TTER:0,0\r\n\r\nOK\r\n"}, | |
338 {"AT+VBT\r", "\r\nOK\r\n"}, /* 3GPP TS 27.007 C.2.2 - Buffer threshold setting */ | |
339 {"AT+VCID=?\r", "\r\n0,1\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 C.2.3 - Calling number ID presentation */ | |
340 {"AT+VCID?\r", "\r\n0\r\n\r\nOK\r\n"}, | |
341 {"AT+VDR\r", "\r\nOK\r\n"}, /* V.253 10.3.1 - Distinctive ring (ring cadence reporting) */ | |
342 {"AT+VDT\r", "\r\nOK\r\n"}, /* V.253 10.3.2 - Control tone cadence reporting */ | |
343 {"AT+VDX\r", "\r\nOK\r\n"}, /* V.253 10.5.6 - Speakerphone duplex mode */ | |
344 {"AT+VEM\r", "\r\nOK\r\n"}, /* V.253 10.5.7 - Deliver event reports */ | |
345 {"AT+VGM\r", "\r\nOK\r\n"}, /* V.253 10.5.2 - Microphone gain */ | |
346 {"AT+VGR\r", "\r\nOK\r\n"}, /* V.253 10.2.1 - Receive gain selection */ | |
347 {"AT+VGS\r", "\r\nOK\r\n"}, /* V.253 10.5.3 - Speaker gain */ | |
348 {"AT+VGT\r", "\r\nOK\r\n"}, /* V.253 10.2.2 - Volume selection */ | |
349 {"AT+VIP\r", "\r\nOK\r\n"}, /* V.253 10.1.1 - Initialize voice parameters */ | |
350 {"AT+VIT\r", "\r\nOK\r\n"}, /* V.253 10.2.3 - DTE/DCE inactivity timer */ | |
351 {"AT+VLS\r", "\r\nOK\r\n"}, /* V.253 10.2.4 - Analogue source/destination selection */ | |
352 {"AT+VPP\r", "\r\nOK\r\n"}, /* V.253 10.4.2 - Voice packet protocol */ | |
353 {"AT+VRA\r", "\r\nOK\r\n"}, /* V.253 10.2.5 - Ringing tone goes away timer */ | |
354 {"AT+VRID?\r", "\r\n0\r\n\r\nOK\r\n"}, /* Extension - Find the originating and destination numbers */ | |
355 {"AT+VRL\r", "\r\nOK\r\n"}, /* V.253 10.1.2 - Ring local phone */ | |
356 {"AT+VRN\r", "\r\nOK\r\n"}, /* V.253 10.2.6 - Ringing tone never appeared timer */ | |
357 {"AT+VRX\r", "\r\nOK\r\n"}, /* V.253 10.1.3 - Voice receive state */ | |
358 {"AT+VSD\r", "\r\nOK\r\n"}, /* V.253 10.2.7 - Silence detection (QUIET and SILENCE) */ | |
359 {"AT+VSID=12345\r", "\r\nOK\r\n"}, /* Extension - Set the originating number */ | |
360 {"AT+vsid?\r", "\r\n12345\r\n\r\nOK\r\n"}, /* Extension - Set the originating number */ | |
361 {"AT+VSM\r", "\r\nOK\r\n"}, /* V.253 10.2.8 - Compression method selection */ | |
362 {"AT+VSP\r", "\r\nOK\r\n"}, /* V.253 10.5.1 - Voice speakerphone state */ | |
363 {"AT+VTA\r", "\r\nOK\r\n"}, /* V.253 10.5.4 - Train acoustic echo-canceller */ | |
364 {"AT+VTD\r", "\r\nOK\r\n"}, /* V.253 10.2.9 - Beep tone duration timer */ | |
365 {"AT+VTH\r", "\r\nOK\r\n"}, /* V.253 10.5.5 - Train line echo-canceller */ | |
366 {"AT+VTR\r", "\r\nOK\r\n"}, /* V.253 10.1.4 - Voice duplex state */ | |
367 {"AT+VTS\r", "\r\nOK\r\n"}, /* V.253 10.1.5 - DTMF and tone generation in voice */ | |
368 {"AT+VTX\r", "\r\nOK\r\n"}, /* V.253 10.1.6 - Transmit data state */ | |
369 {"AT+WS46\r", "\r\nOK\r\n"}, /* 3GPP TS 27.007 5.9 - PCCA STD-101 [17] select wireless network */ | |
370 {"ATA\r", "\r\nERROR\r\n"}, /* V.250 6.3.5 - Answer */ | |
371 {"ATDT1234567890ABCDPSTW*#+,!@\r", ""}, /* V.250 6.3.1 - Dial */ | |
372 {"ATE1\r", "\r\nOK\r\n"}, /* V.250 6.2.4 - Command echo */ | |
373 {"ATE0\r", "ATE0\r\r\nOK\r\n"}, /* V.250 6.2.4 - Command echo */ | |
374 {"ATH\r", "\r\nOK\r\n"}, /* V.250 6.3.6 - Hook control */ | |
375 {"ATI\r", "\r\n" PACKAGE "\r\n\r\nOK\r\n"}, /* V.250 6.1.3 - Request identification information */ | |
376 {"ATL\r", "\r\nOK\r\n"}, /* V.250 6.3.13 - Monitor speaker loudness */ | |
377 {"ATM\r", "\r\nOK\r\n"}, /* V.250 6.3.14 - Monitor speaker mode */ | |
378 {"ATO\r", "\r\nCONNECT\r\n\r\nOK\r\n"}, /* V.250 6.3.7 - Return to online data state */ | |
379 {"ATP\r", "\r\nOK\r\n"}, /* V.250 6.3.3 - Select pulse dialling (command) */ | |
380 {"ATQ\r", "\r\nOK\r\n"}, /* V.250 6.2.5 - Result code suppression */ | |
381 {"ATS0=?\r", "\r\n000\r\n\r\nOK\r\n"}, /* V.250 6.3.8 - Automatic answer */ | |
382 {"ATS0?\r", "\r\n000\r\n\r\nOK\r\n"}, | |
383 {"ATS10=?\r", "\r\n000\r\n\r\nOK\r\n"}, /* V.250 6.3.12 - Automatic disconnect delay */ | |
384 {"ATS10?\r", "\r\n000\r\n\r\nOK\r\n"}, | |
385 {"ATS3=?\r", "\r\n000\r\n\r\nOK\r\n"}, /* V.250 6.2.1 - Command line termination character */ | |
386 {"ATS3?\r", "\r\n013\r\n\r\nOK\r\n"}, | |
387 {"ATS4=?\r", "\r\n000\r\n\r\nOK\r\n"}, /* V.250 6.2.2 - Response formatting character */ | |
388 {"ATS4?\r", "\r\n010\r\n\r\nOK\r\n"}, | |
389 {"ATS5=?\r", "\r\n000\r\n\r\nOK\r\n"}, /* V.250 6.2.3 - Command line editing character */ | |
390 {"ATS5?\r", "\r\n008\r\n\r\nOK\r\n"}, | |
391 {"ATS6=?\r", "\r\n000\r\n\r\nOK\r\n"}, /* V.250 6.3.9 - Pause before blind dialling */ | |
392 {"ATS6?\r", "\r\n001\r\n\r\nOK\r\n"}, | |
393 {"ATS7=?\r", "\r\n000\r\n\r\nOK\r\n"}, /* V.250 6.3.10 - Connection completion timeout */ | |
394 {"ATS7?\r", "\r\n060\r\n\r\nOK\r\n"}, | |
395 {"ATS8=?\r", "\r\n000\r\n\r\nOK\r\n"}, /* V.250 6.3.11 - Comma dial modifier time */ | |
396 {"ATS8?\r", "\r\n005\r\n\r\nOK\r\n"}, | |
397 {"ATT\r", "\r\nOK\r\n"}, /* V.250 6.3.2 - Select tone dialling (command) */ | |
398 {"ATV0\r", "0\r"}, /* V.250 6.2.6 - DCE response format */ | |
399 {"ATV1\r", "\r\nOK\r\n"}, | |
400 {"ATX4\r", "\r\nOK\r\n"}, /* V.250 6.2.7 - Result code selection and call progress monitoring control */ | |
401 {"ATZ\r", "\r\nOK\r\n"}, /* V.250 6.1.1 - Reset to default configuration */ | |
402 {"", ""} | |
403 }; | |
404 | |
405 char *decode_test_file = NULL; | |
406 int countdown = 0; | |
407 int command_response_test_step = -1; | |
408 char response_buf[1000]; | |
409 int response_buf_ptr = 0; | |
410 | |
411 static int at_rx(at_state_t *s, const char *t, int len) | |
412 { | |
413 at_interpreter(s, t, len); | |
414 return 0; | |
415 } | |
416 /*- End of function --------------------------------------------------------*/ | |
417 | |
418 static int at_send(at_state_t *s, const char *t) | |
419 { | |
420 printf("%s", t); | |
421 at_rx(s, t, strlen(t)); | |
422 return 0; | |
423 } | |
424 /*- End of function --------------------------------------------------------*/ | |
425 | |
426 static int at_send_at(at_state_t *s, const char *t) | |
427 { | |
428 uint8_t buf[500]; | |
429 | |
430 sprintf((char *) buf, "AT%s\r", t); | |
431 printf("%s", t); | |
432 at_rx(s, t, strlen(t)); | |
433 return 0; | |
434 } | |
435 /*- End of function --------------------------------------------------------*/ | |
436 | |
437 static int at_expect(at_state_t *s, const char *t) | |
438 { | |
439 return 0; | |
440 } | |
441 /*- End of function --------------------------------------------------------*/ | |
442 | |
443 static int at_send_hdlc(at_state_t *s, uint8_t *t, int len) | |
444 { | |
445 uint8_t buf[100]; | |
446 int i; | |
447 int j; | |
448 | |
449 for (i = 0, j = 0; i < len; i++) | |
450 { | |
451 if (*t == DLE) | |
452 buf[j++] = DLE; | |
453 buf[j++] = *t++; | |
454 } | |
455 buf[j++] = DLE; | |
456 buf[j++] = ETX; | |
457 at_rx(s, (char *) buf, j); | |
458 return 0; | |
459 } | |
460 /*- End of function --------------------------------------------------------*/ | |
461 | |
462 static int general_test(at_state_t *s) | |
463 { | |
464 int i; | |
465 | |
466 for (i = 0; general_test_seq[i].command[0]; i++) | |
467 { | |
468 response_buf_ptr = 0; | |
469 response_buf[0] = '\0'; | |
470 command_response_test_step = i; | |
471 at_send(s, general_test_seq[i].command); | |
472 if (strcmp(general_test_seq[command_response_test_step].response, response_buf) != 0) | |
473 { | |
474 printf("Incorrect response\n"); | |
475 printf("Expected: '%s'\n", general_test_seq[command_response_test_step].response); | |
476 printf("Received: '%s'\n", response_buf); | |
477 return -1; | |
478 } | |
479 } | |
480 return 0; | |
481 } | |
482 /*- End of function --------------------------------------------------------*/ | |
483 | |
484 static int modem_call_control(at_state_t *s, void *user_data, int op, const char *num) | |
485 { | |
486 switch (op) | |
487 { | |
488 case AT_MODEM_CONTROL_CALL: | |
489 printf("\nModem control - Dialing '%s'\n", num); | |
490 break; | |
491 case AT_MODEM_CONTROL_ANSWER: | |
492 printf("\nModem control - Answering\n"); | |
493 /* Force an error response, so we get something well defined for the test. */ | |
494 return -1; | |
495 case AT_MODEM_CONTROL_HANGUP: | |
496 printf("\nModem control - Hanging up\n"); | |
497 break; | |
498 case AT_MODEM_CONTROL_OFFHOOK: | |
499 printf("\nModem control - Going off hook\n"); | |
500 break; | |
501 case AT_MODEM_CONTROL_ONHOOK: | |
502 printf("\nModem control - Going on hook\n"); | |
503 break; | |
504 case AT_MODEM_CONTROL_DTR: | |
505 printf("\nModem control - DTR %d\n", (int) (intptr_t) num); | |
506 break; | |
507 case AT_MODEM_CONTROL_RTS: | |
508 printf("\nModem control - RTS %d\n", (int) (intptr_t) num); | |
509 break; | |
510 case AT_MODEM_CONTROL_CTS: | |
511 printf("\nModem control - CTS %d\n", (int) (intptr_t) num); | |
512 break; | |
513 case AT_MODEM_CONTROL_CAR: | |
514 printf("\nModem control - CAR %d\n", (int) (intptr_t) num); | |
515 break; | |
516 case AT_MODEM_CONTROL_RNG: | |
517 printf("\nModem control - RNG %d\n", (int) (intptr_t) num); | |
518 break; | |
519 case AT_MODEM_CONTROL_DSR: | |
520 printf("\nModem control - DSR %d\n", (int) (intptr_t) num); | |
521 break; | |
522 case AT_MODEM_CONTROL_SETID: | |
523 printf("\nModem control - Set ID '%s'\n", num); | |
524 break; | |
525 case AT_MODEM_CONTROL_RESTART: | |
526 printf("\nModem control - Restart %d\n", (int) (intptr_t) num); | |
527 break; | |
528 case AT_MODEM_CONTROL_DTE_TIMEOUT: | |
529 printf("\nModem control - Set DTE timeout %d\n", (int) (intptr_t) num); | |
530 break; | |
531 default: | |
532 printf("\nModem control - operation %d\n", op); | |
533 break; | |
534 } | |
535 /*endswitch*/ | |
536 return 0; | |
537 } | |
538 /*- End of function --------------------------------------------------------*/ | |
539 | |
540 static int at_tx_handler(at_state_t *s, void *user_data, const uint8_t *buf, size_t len) | |
541 { | |
542 int i; | |
543 | |
544 for (i = 0; i < len; i++) | |
545 { | |
546 response_buf[response_buf_ptr++] = buf[i]; | |
547 putchar(buf[i]); | |
548 } | |
549 response_buf[response_buf_ptr] = '\0'; | |
550 | |
551 return 0; | |
552 } | |
553 /*- End of function --------------------------------------------------------*/ | |
554 | |
555 int main(int argc, char *argv[]) | |
556 { | |
557 at_state_t at_state; | |
558 | |
559 if (at_init(&at_state, at_tx_handler, NULL, modem_call_control, NULL) == NULL) | |
560 { | |
561 fprintf(stderr, "Cannot start the AT interpreter\n"); | |
562 exit(2); | |
563 } | |
564 if (general_test(&at_state)) | |
565 { | |
566 printf("Tests failed.\n"); | |
567 exit(2); | |
568 } | |
569 printf("Tests passed.\n"); | |
570 return 0; | |
571 } | |
572 /*- End of function --------------------------------------------------------*/ | |
573 /*- End of file ------------------------------------------------------------*/ |