# HG changeset patch # User Mychaela Falconia # Date 1514831682 0 # Node ID 9a237d51c226d2907ca24c1a9b88af24f2771a72 # Parent 0da72ce64c86ecb59cb6dc5d85b13f362cd434b5 aci3: ati_fchg.c module brought over from aci2 diff -r 0da72ce64c86 -r 9a237d51c226 components/aci-tcs3 --- a/components/aci-tcs3 Mon Jan 01 18:23:11 2018 +0000 +++ b/components/aci-tcs3 Mon Jan 01 18:34:42 2018 +0000 @@ -151,6 +151,7 @@ cfile_str2ind $SRCDIR/ati_src_rvt.c cfile_str2ind $SRCDIR/ati_omcompat.c cfile_str2ind $SRCDIR/ati_audio.c +cfile_str2ind $SRCDIR/ati_fchg.c # ACI stuff cfile_str2ind $SRCDIR/aci_aci.c diff -r 0da72ce64c86 -r 9a237d51c226 src/g23m-aci/aci/ati_fchg.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/g23m-aci/aci/ati_fchg.c Mon Jan 01 18:34:42 2018 +0000 @@ -0,0 +1,96 @@ +/* + * The non-standard FreeCalypso-added AT commands implemented in this module + * expose the API of FreeCalypso battery charging driver FCHG. + */ + +#ifndef ATI_FCHG_C +#define ATI_FCHG_C + +#include "aci_all.h" + +#include +#include + +#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 "rv/rv_defined_swe.h" // for RVM_FCHG_SWE + +#ifdef RVM_FCHG_SWE +#include "fchg/fchg_api.h" + +/* AT%CBC - customized alternative to standard AT+CBC */ +GLOBAL T_ATI_RSLT atPercentCBC ( char *cl, UBYTE srcId ) +{ + struct fchg_user_state fchg; + + TRACE_FUNCTION("atPercentCBC()"); + if (fchg_get_current_state(&fchg) != RV_OK) + return ATI_FAIL; + sprintf(g_sa, "%%CBC: %d,%d,%d", fchg.chg_state, fchg.batt_mv, + fchg.batt_percent); + io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); + return ATI_CMPL; +} + +/* AT@CHG - manual control of battery charging */ +GLOBAL T_ATI_RSLT atAtCHG ( char *cl, UBYTE srcId ) +{ + enum fchg_user_charge_ctrl ctrl; + + TRACE_FUNCTION("atAtCHG()"); + cl = parse(cl, "D", &ctrl); + if (!cl) + return ATI_FAIL; + if (fchg_user_charge_control(ctrl) == RV_OK) + return ATI_CMPL; + else + return ATI_FAIL; +} + +#endif /* RVM_FCHG_SWE */ + +#endif /* ATI_FCHG_C */