comparison gsm-fw/g23m-aci/aci/aci_bat_em.c @ 775:eedbf248bac0

gsm-fw/g23m-aci subtree: initial import from LoCosto source
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sun, 12 Oct 2014 01:45:14 +0000
parents
children
comparison
equal deleted inserted replaced
774:40a721fd9854 775:eedbf248bac0
1 /*
2 +-----------------------------------------------------------------------------
3 | Project : GSM-F&D (8411)
4 | Modul : ACI_BAT
5 +-----------------------------------------------------------------------------
6 | Copyright 2002 Texas Instruments Berlin, AG
7 | All rights reserved.
8 |
9 | This file is confidential and a trade secret of Texas
10 | Instruments Berlin, AG
11 | The receipt of or possession of this file does not convey
12 | any rights to reproduce or disclose its contents or to
13 | manufacture, use, or sell anything it may describe, in
14 | whole, or in part, without the specific written consent of
15 | Texas Instruments Berlin, AG.
16 +-----------------------------------------------------------------------------
17 | Purpose : This BAT wrapper modul is ...
18 |
19 +-----------------------------------------------------------------------------
20 */
21
22 #include "aci_all.h" /* includes prim.h, which includes p_bat.h */
23 #include "aci_cmh.h" /* prototypes of sAT_,qAT_,tAT_ */
24 #include "aci_bat_cmh.h" /* prototypes of sBAT_,qBAT_,tBAT_ */
25
26
27 /*
28 +--------------------------------------------------------------------+
29 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
30 | STATE : code ROUTINE : sBAT_PercentEM |
31 +--------------------------------------------------------------------+
32
33 PURPOSE :
34 */
35 GLOBAL T_ACI_BAT_RSLT sBAT_PercentEM (T_ACI_DTI_PRC_PSI *src_infos_psi,
36 T_BAT_cmd_send *cmd)
37 {
38 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
39 T_BAT_percent_em_mode mode;
40 T_BAT_percent_em_sin_type type = BAT_P_EM_TYPE_NOT_PRESENT;
41
42 TRACE_FUNCTION ("sBAT_PercentEM()");
43
44 mode = cmd->params.ptr_set_percent_em->mode;
45 type = cmd->params.ptr_set_percent_em->sin_type;
46
47 if ( (mode NEQ BAT_P_EM_MODE_SIN ) AND (mode NEQ BAT_P_EM_MODE_SIN ) )
48 {
49 return ACI_BAT_FAIL;
50 }
51
52 if ( (mode EQ BAT_P_EM_MODE_SIN ) AND ((type EQ BAT_P_EM_TYPE_NOT_PRESENT) OR ((type < BAT_P_EM_TYPE_SC) AND (type > BAT_P_EM_TYPE_GRLC ))) )
53 {
54 return ACI_BAT_FAIL;
55 }
56
57 if ( (mode EQ BAT_P_EM_MODE_PCO ) AND (type EQ BAT_P_EM_TYPE_NOT_PRESENT) )
58 {
59 return ACI_BAT_FAIL;
60 }
61
62 if (type EQ BAT_P_EM_TYPE_NOT_PRESENT)
63 {
64 type = BAT_P_EM_TYPE_SC;
65 }
66
67 ret = (T_ACI_BAT_RSLT)sAT_PercentEM((T_ACI_CMD_SRC)src_infos_psi->srcId,
68 (T_EM_AT_MODE)mode,(T_EM_AT_TYPE)type);
69 return(ret);
70 }
71