FreeCalypso > hg > fc-selenite
comparison src/g23m-aci/aci/ati_fcmisc.c @ 196:5f3544fc0308
AT@SPENH brought over from Magnetite
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 24 May 2020 19:46:18 +0000 |
parents | |
children | 07ece4691685 |
comparison
equal
deleted
inserted
replaced
195:2863e5e4af4f | 196:5f3544fc0308 |
---|---|
1 /* | |
2 * This module implements miscellaneous FreeCalypso-added AT commands. | |
3 */ | |
4 | |
5 #ifndef ATI_FCMISC_C | |
6 #define ATI_FCMISC_C | |
7 | |
8 #include "aci_all.h" | |
9 | |
10 #include <ctype.h> | |
11 #include <string.h> | |
12 | |
13 #include "aci_cmh.h" | |
14 #include "ati_cmd.h" | |
15 #include "aci_cmd.h" | |
16 #include "aci_io.h" | |
17 #include "aci_cmd.h" | |
18 #include "l4_tim.h" | |
19 #include "line_edit.h" | |
20 #include "aci_lst.h" | |
21 | |
22 #include "pcm.h" | |
23 #include "audio.h" | |
24 #include "aci.h" | |
25 #include "rx.h" | |
26 #include "pwr.h" | |
27 #include "l4_tim.h" | |
28 | |
29 #ifdef GPRS | |
30 #ifdef DTI | |
31 #include "dti.h" | |
32 #include "dti_conn_mng.h" | |
33 #include "dti_cntrl_mng.h" | |
34 #endif /* DTI */ | |
35 #include "gaci.h" | |
36 #include "gaci_cmh.h" | |
37 #include "gaci_cmd.h" | |
38 #endif /* GPRS */ | |
39 | |
40 #include "aci_mem.h" | |
41 #include "aci_prs.h" | |
42 | |
43 #include "ati_int.h" | |
44 | |
45 #ifndef _SIMULATION_ | |
46 #include "ffs/ffs.h" | |
47 #endif | |
48 | |
49 #ifdef FF_ATI_BAT | |
50 | |
51 #include "typedefs.h" | |
52 #include "gdd.h" | |
53 #include "bat.h" | |
54 | |
55 #include "ati_bat.h" | |
56 | |
57 #endif /*FF_ATI_BAT*/ | |
58 | |
59 #include "main/sys_types.h" | |
60 | |
61 extern SYS_UWORD8 SIM_allow_speed_enhancement; | |
62 | |
63 /* AT@SPENH - enable or disable SIM speed enhancement */ | |
64 GLOBAL T_ATI_RSLT atAtSPENH ( char *cl, UBYTE srcId ) | |
65 { | |
66 int state, nonvol = 0; | |
67 | |
68 TRACE_FUNCTION("atAtSPENH()"); | |
69 | |
70 cl = parse(cl, "Dd", &state, &nonvol); | |
71 if (!cl) | |
72 return (ATI_FAIL); | |
73 if (state != 0 && state != 1) | |
74 return (ATI_FAIL); | |
75 SIM_allow_speed_enhancement = state; | |
76 if (!nonvol) | |
77 return (ATI_CMPL); | |
78 ffs_mkdir("/etc"); | |
79 if (ffs_file_write("/etc/SIM_spenh", &SIM_allow_speed_enhancement, 1, | |
80 FFS_O_CREATE | FFS_O_TRUNC) == EFFS_OK) | |
81 return (ATI_CMPL); | |
82 else | |
83 return (ATI_FAIL); | |
84 } | |
85 | |
86 GLOBAL T_ATI_RSLT queatAtSPENH (char *cl, UBYTE srcId) | |
87 { | |
88 char *me="@SPENH: "; | |
89 | |
90 TRACE_FUNCTION("queatAtSPENH()"); | |
91 | |
92 sprintf(g_sa, "%s%u", me, SIM_allow_speed_enhancement); | |
93 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
94 return (ATI_CMPL); | |
95 } | |
96 | |
97 #endif /* ATI_FCMISC_C */ |