FreeCalypso > hg > fc-magnetite
changeset 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 | 85b38e37810b |
children | cd37d228dae0 |
files | components/aci-tcs3 src/g23m-aci/aci/ati_cmd.c src/g23m-aci/aci/ati_omcompat.c |
diffstat | 3 files changed, 143 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/components/aci-tcs3 Sat Sep 02 17:05:04 2017 +0000 +++ b/components/aci-tcs3 Sat Sep 02 17:37:06 2017 +0000 @@ -149,7 +149,7 @@ cfile_str2ind $SRCDIR/ati_dti.c cfile_str2ind $SRCDIR/ati_src_rvt.c -#cfile_str2ind $SRCDIR/ati_omcompat.c +cfile_str2ind $SRCDIR/ati_omcompat.c cfile_str2ind $SRCDIR/ati_audio.c # ACI stuff
--- a/src/g23m-aci/aci/ati_cmd.c Sat Sep 02 17:05:04 2017 +0000 +++ b/src/g23m-aci/aci/ati_cmd.c Sat Sep 02 17:37:06 2017 +0000 @@ -1192,10 +1192,10 @@ {"+CVHU", AT_CMD_CVHU, setatPlusCVHU, test_gen, queatPlusCVHU, "%s: (0-2)"}, /* Openmoko additions */ {"@AUL", AT_CMD_P_AUL, atAtAUL, test_gen, queatAtAUL, "%s: (0)"}, -#if 0 {"@ST", AT_CMD_P_ST, atAtST, test_gen, queatAtST, "%s: (-26,-23,-20,-17,-14,-11,-8,-5,-2,1)"}, {"@POFF", AT_CMD_P_POFF, atAtPOFF, 0, 0, 0}, {"@RST", AT_CMD_P_RST, atAtRST, 0, 0, 0}, +#if 0 {"@BAND", AT_CMD_P_BAND, atAtBAND, 0, 0, 0}, #endif /* FreeCalypso additions */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/g23m-aci/aci/ati_omcompat.c Sat Sep 02 17:37:06 2017 +0000 @@ -0,0 +1,141 @@ +/* + * This module implements those AT commands that were originally invented + * by Openmoko and have been retained in FreeCalypso. + */ + +#ifndef ATI_OMCOMPAT_C +#define ATI_OMCOMPAT_C + +#include "aci_all.h" + +#include <ctype.h> +#include <string.h> + +#include "aci_cmh.h" +#include "ati_cmd.h" +#include "aci_cmd.h" +#include "aci_io.h" +#include "aci_cmd.h" +#include "l4_tim.h" +#include "line_edit.h" +#include "aci_lst.h" + +#include "pcm.h" +#include "audio.h" +#include "aci.h" +#include "rx.h" +#include "pwr.h" +#include "l4_tim.h" + +#ifdef GPRS +#ifdef DTI +#include "dti.h" +#include "dti_conn_mng.h" +#include "dti_cntrl_mng.h" +#endif /* DTI */ +#include "gaci.h" +#include "gaci_cmh.h" +#include "gaci_cmd.h" +#endif /* GPRS */ + +#include "aci_mem.h" +#include "aci_prs.h" + +#include "ati_int.h" + +#ifndef _SIMULATION_ +#include "ffs/ffs.h" +#endif + +#ifdef FF_ATI_BAT + +#include "typedefs.h" +#include "gdd.h" +#include "bat.h" + +#include "ati_bat.h" + +#endif /*FF_ATI_BAT*/ + +#include "audio/audio_api.h" +#include "abb.h" +#include "dar/dar_api.h" + +/* + * PURPOSE : @ST command (Configure the sidetone level) + */ +GLOBAL T_ATI_RSLT atAtST (char *cl, UBYTE srcId) +{ + char tmp[8]={0}; + INT8 gain = -26; + TRACE_FUNCTION("atAtST()"); + + /* + * input functionality + */ + cl = parse(cl,"s", (LONG)8, tmp); + + gain = atoi(tmp); + + if ( cl ) + { + if ( gain == -23 || gain == -20 || gain == -17 || gain == -14 || gain == -11 || gain == -8 || gain == -5 || gain == -2 || gain == 1 || gain == -26 ) + { + Side_Tone_Write(gain); + return (ATI_CMPL); + } + else + { + cmdCmsError(CMS_ERR_OpNotAllowed); + return (ATI_FAIL); + } + } +} + +GLOBAL T_ATI_RSLT queatAtST (char *cl, UBYTE srcId) +{ + char *me="+ST: "; + INT8 ST1; + + TRACE_FUNCTION("queatAtST()"); + + ST1 = Side_Tone_Read(); + + sprintf(g_sa,"%s%d",me,ST1); + + io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); + + return (ATI_CMPL); +} + +/* + * PURPOSE : @POFF command (Power Off GSM Modem) + */ + +GLOBAL T_ATI_RSLT atAtPOFF (char *cl, UBYTE srcId) +{ + TRACE_FUNCTION("atAtPOFF"); + + sprintf(g_sa,"%s","OK"); + io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); + + ABB_Power_Off(); + + return (ATI_CMPL); +} + +/* + * PURPOSE : @RST command (Reset GSM Modem) + */ + +GLOBAL T_ATI_RSLT atAtRST (char *cl, UBYTE srcId) +{ + TRACE_FUNCTION("atAtRST"); + + dar_reset_system(); + + return (ATI_CMPL); +} + +#endif /* ATI_OMCOMPAT_C */ +