comparison src/g23m-aci/aci/ati_omcompat.c @ 293:5b2ebc94cae4

aci3: integrated all Openmoko AT commands except AT@BAND
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 02 Sep 2017 17:37:06 +0000
parents
children 5e39123540e6
comparison
equal deleted inserted replaced
292:85b38e37810b 293:5b2ebc94cae4
1 /*
2 * This module implements those AT commands that were originally invented
3 * by Openmoko and have been retained in FreeCalypso.
4 */
5
6 #ifndef ATI_OMCOMPAT_C
7 #define ATI_OMCOMPAT_C
8
9 #include "aci_all.h"
10
11 #include <ctype.h>
12 #include <string.h>
13
14 #include "aci_cmh.h"
15 #include "ati_cmd.h"
16 #include "aci_cmd.h"
17 #include "aci_io.h"
18 #include "aci_cmd.h"
19 #include "l4_tim.h"
20 #include "line_edit.h"
21 #include "aci_lst.h"
22
23 #include "pcm.h"
24 #include "audio.h"
25 #include "aci.h"
26 #include "rx.h"
27 #include "pwr.h"
28 #include "l4_tim.h"
29
30 #ifdef GPRS
31 #ifdef DTI
32 #include "dti.h"
33 #include "dti_conn_mng.h"
34 #include "dti_cntrl_mng.h"
35 #endif /* DTI */
36 #include "gaci.h"
37 #include "gaci_cmh.h"
38 #include "gaci_cmd.h"
39 #endif /* GPRS */
40
41 #include "aci_mem.h"
42 #include "aci_prs.h"
43
44 #include "ati_int.h"
45
46 #ifndef _SIMULATION_
47 #include "ffs/ffs.h"
48 #endif
49
50 #ifdef FF_ATI_BAT
51
52 #include "typedefs.h"
53 #include "gdd.h"
54 #include "bat.h"
55
56 #include "ati_bat.h"
57
58 #endif /*FF_ATI_BAT*/
59
60 #include "audio/audio_api.h"
61 #include "abb.h"
62 #include "dar/dar_api.h"
63
64 /*
65 * PURPOSE : @ST command (Configure the sidetone level)
66 */
67 GLOBAL T_ATI_RSLT atAtST (char *cl, UBYTE srcId)
68 {
69 char tmp[8]={0};
70 INT8 gain = -26;
71 TRACE_FUNCTION("atAtST()");
72
73 /*
74 * input functionality
75 */
76 cl = parse(cl,"s", (LONG)8, tmp);
77
78 gain = atoi(tmp);
79
80 if ( cl )
81 {
82 if ( gain == -23 || gain == -20 || gain == -17 || gain == -14 || gain == -11 || gain == -8 || gain == -5 || gain == -2 || gain == 1 || gain == -26 )
83 {
84 Side_Tone_Write(gain);
85 return (ATI_CMPL);
86 }
87 else
88 {
89 cmdCmsError(CMS_ERR_OpNotAllowed);
90 return (ATI_FAIL);
91 }
92 }
93 }
94
95 GLOBAL T_ATI_RSLT queatAtST (char *cl, UBYTE srcId)
96 {
97 char *me="+ST: ";
98 INT8 ST1;
99
100 TRACE_FUNCTION("queatAtST()");
101
102 ST1 = Side_Tone_Read();
103
104 sprintf(g_sa,"%s%d",me,ST1);
105
106 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT);
107
108 return (ATI_CMPL);
109 }
110
111 /*
112 * PURPOSE : @POFF command (Power Off GSM Modem)
113 */
114
115 GLOBAL T_ATI_RSLT atAtPOFF (char *cl, UBYTE srcId)
116 {
117 TRACE_FUNCTION("atAtPOFF");
118
119 sprintf(g_sa,"%s","OK");
120 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT);
121
122 ABB_Power_Off();
123
124 return (ATI_CMPL);
125 }
126
127 /*
128 * PURPOSE : @RST command (Reset GSM Modem)
129 */
130
131 GLOBAL T_ATI_RSLT atAtRST (char *cl, UBYTE srcId)
132 {
133 TRACE_FUNCTION("atAtRST");
134
135 dar_reset_system();
136
137 return (ATI_CMPL);
138 }
139
140 #endif /* ATI_OMCOMPAT_C */
141