FreeCalypso > hg > fc-magnetite
comparison src/aci2/aci/ati_omcompat.c @ 245:3b8d291ed45a
aci2: AT@AUL reimplemented in the new FreeCalypso way
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 24 Jul 2017 04:41:53 +0000 |
parents | b16d79c550a2 |
children | 1badec9097de |
comparison
equal
deleted
inserted
replaced
244:bec9198fc306 | 245:3b8d291ed45a |
---|---|
46 #include "aci_prs.h" | 46 #include "aci_prs.h" |
47 | 47 |
48 #include "ati_int.h" | 48 #include "ati_int.h" |
49 | 49 |
50 #ifndef _SIMULATION_ | 50 #ifndef _SIMULATION_ |
51 #include "ffs\ffs.h" | 51 #include "ffs/ffs.h" |
52 #endif | 52 #endif |
53 | 53 |
54 #ifdef FF_ATI_BAT | 54 #ifdef FF_ATI_BAT |
55 | 55 |
56 #include "typedefs.h" | 56 #include "typedefs.h" |
59 | 59 |
60 #include "ati_bat.h" | 60 #include "ati_bat.h" |
61 | 61 |
62 #endif /*FF_ATI_BAT*/ | 62 #endif /*FF_ATI_BAT*/ |
63 | 63 |
64 #include "audio\audio_api.h" | 64 #include "audio/audio_api.h" |
65 #include "abb.h" | 65 #include "abb.h" |
66 #include "..\drivers\drv_app\power\power.h" | 66 #include "../drivers/drv_app/power/power.h" |
67 | 67 |
68 #ifdef GPRS | 68 #ifdef GPRS |
69 #include "p_mph.h" | 69 #include "p_mph.h" |
70 #include "p_mphc.h" | 70 #include "p_mphc.h" |
71 #include "..\alr\alr_gprs.h" | 71 #include "../alr/alr_gprs.h" |
72 #endif | 72 #endif |
73 #include "p_tb.h" | 73 #include "p_tb.h" |
74 #include "..\alr\alr.h" | 74 #include "../alr/alr.h" |
75 | 75 |
76 /* | 76 /* |
77 * PURPOSE : @ST command (Configure the sidetone level) | 77 * PURPOSE : @ST command (Configure the sidetone level) |
78 */ | 78 */ |
79 GLOBAL T_ATI_RSLT atAtST (char *cl, UBYTE srcId) | 79 GLOBAL T_ATI_RSLT atAtST (char *cl, UBYTE srcId) |
80 { | 80 { |
81 T_ACI_RETURN ret = AT_FAIL; | |
82 char tmp[8]={0}; | 81 char tmp[8]={0}; |
83 INT8 gain = -26; | 82 INT8 gain = -26; |
84 TRACE_FUNCTION("atAtST()"); | 83 TRACE_FUNCTION("atAtST()"); |
85 | 84 |
86 /* | 85 /* |
96 { | 95 { |
97 Side_Tone_Write(gain); | 96 Side_Tone_Write(gain); |
98 return (ATI_CMPL); | 97 return (ATI_CMPL); |
99 } | 98 } |
100 else | 99 else |
101 { | 100 { |
102 cmdCmsError(CMS_ERR_OpNotAllowed); | 101 cmdCmsError(CMS_ERR_OpNotAllowed); |
103 return (ATI_FAIL); | 102 return (ATI_FAIL); |
104 } | 103 } |
105 } | 104 } |
106 } | 105 } |
107 | 106 |
108 GLOBAL T_ATI_RSLT queatAtST (char *cl, UBYTE srcId) | 107 GLOBAL T_ATI_RSLT queatAtST (char *cl, UBYTE srcId) |
109 { | 108 { |
110 char *me="+ST: "; | 109 char *me="+ST: "; |
111 INT8 ST1; | 110 INT8 ST1; |
112 T_ACI_RETURN ret = AT_FAIL; | |
113 | 111 |
114 TRACE_FUNCTION("queatAtST()"); | 112 TRACE_FUNCTION("queatAtST()"); |
115 | 113 |
116 ST1 = Side_Tone_Read(); | 114 ST1 = Side_Tone_Read(); |
117 | 115 |
118 sprintf(g_sa,"%s%d",me,ST1); | 116 sprintf(g_sa,"%s%d",me,ST1); |
119 | 117 |
120 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | 118 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); |
121 | 119 |
122 return (ATI_CMPL); | 120 return (ATI_CMPL); |
123 | |
124 } | |
125 | |
126 /* | |
127 * PURPOSE : @AUL command (Audio table load) | |
128 */ | |
129 | |
130 static char tmp[8]={0}; | |
131 | |
132 GLOBAL T_ATI_RSLT atAtAUL (char *cl, UBYTE srcId) | |
133 { | |
134 T_ACI_RETURN ret = AT_FAIL; | |
135 T_AUDIO_MODE_LOAD audio_mode_load_parameter; | |
136 T_RV_RETURN return_path; | |
137 | |
138 /* initalize the return path, for this test the return path is an message */ | |
139 return_path.callback_func = NULL; | |
140 return_path.addr_id = rvf_get_taskid(); | |
141 | |
142 TRACE_FUNCTION("atAtAUL()"); | |
143 | |
144 /* | |
145 * input functionality | |
146 */ | |
147 cl = parse(cl,"s", (LONG)8, tmp); | |
148 | |
149 sprintf(audio_mode_load_parameter.audio_mode_filename, "para%s", tmp); | |
150 | |
151 if ( audio_mode_load(&audio_mode_load_parameter, return_path) == AUDIO_ERROR ) | |
152 return (ATI_FAIL); | |
153 else | |
154 return (ATI_CMPL); | |
155 | |
156 } | |
157 | |
158 GLOBAL T_ATI_RSLT queatAtAUL (char *cl, UBYTE srcId) | |
159 { | |
160 char *me="@AUL: "; | |
161 T_ACI_RETURN ret = AT_FAIL; | |
162 | |
163 TRACE_FUNCTION("queatAtAUL()"); | |
164 | |
165 if (strlen(tmp)) | |
166 sprintf(g_sa,"%s/aud/para%s.cfg",me, tmp); | |
167 else | |
168 sprintf(g_sa,"%s",me); | |
169 | |
170 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
171 | |
172 return (ATI_CMPL); | |
173 | |
174 } | 121 } |
175 | 122 |
176 /* | 123 /* |
177 * PURPOSE : @POFF command (Power Off GSM Modem) | 124 * PURPOSE : @POFF command (Power Off GSM Modem) |
178 */ | 125 */ |
179 | 126 |
180 GLOBAL T_ATI_RSLT atAtPOFF (char *cl, UBYTE srcId) | 127 GLOBAL T_ATI_RSLT atAtPOFF (char *cl, UBYTE srcId) |
181 { | 128 { |
182 TRACE_FUNCTION("atAtPOFF"); | 129 TRACE_FUNCTION("atAtPOFF"); |
183 | 130 |
184 sprintf(g_sa,"%s","OK"); | 131 sprintf(g_sa,"%s","OK"); |
185 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | 132 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); |
186 | 133 |
187 ABB_Power_Off(); | 134 ABB_Power_Off(); |
188 | 135 |
189 return (ATI_CMPL); | 136 return (ATI_CMPL); |
190 } | 137 } |
191 | 138 |
192 /* | 139 /* |
193 * PURPOSE : @RST command (Reset GSM Modem) | 140 * PURPOSE : @RST command (Reset GSM Modem) |
194 */ | 141 */ |
195 | 142 |
196 GLOBAL T_ATI_RSLT atAtRST (char *cl, UBYTE srcId) | 143 GLOBAL T_ATI_RSLT atAtRST (char *cl, UBYTE srcId) |
197 { | 144 { |
198 TRACE_FUNCTION("atAtRST"); | 145 TRACE_FUNCTION("atAtRST"); |
199 | 146 |
200 Power_OFF_Button(); | 147 Power_OFF_Button(); |
201 | 148 |
202 return (ATI_CMPL); | 149 return (ATI_CMPL); |
203 } | 150 } |
204 | 151 |
205 /* | 152 /* |
206 * Openmoko's firmware contains an undocumented AT@SC command that | 153 * Openmoko's firmware contains an undocumented AT@SC command that |
207 * sets/changes the IMEI of the modem. However, it takes the IMEI | 154 * sets/changes the IMEI of the modem. However, it takes the IMEI |