annotate src/cs/drivers/drv_app/pwr/pwr_messages.c @ 636:57e67ca2e1cb

pcmdata.c: default +CGMI to "FreeCalypso" and +CGMM to model The present change has no effect whatsoever on Falconia-made and Openmoko-made devices on which /pcm/CGMI and /pcm/CGMM files have been programmed in FFS with sensible ID strings by the respective factories, but what should AT+CGMI and AT+CGMM queries return when the device is a Huawei GTM900 or Tango modem that has been converted to FreeCalypso with a firmware change? Before the present change they would return compiled-in defaults of "<manufacturer>" and "<model>", respectively; with the present change the firmware will self-identify as "FreeCalypso GTM900-FC" or "FreeCalypso Tango" on the two respective targets. This firmware identification will become important if someone incorporates an FC-converted GTM900 or Tango modem into a ZeroPhone-style smartphone where some high-level software like ofono will be talking to the modem and will need to properly identify this modem as FreeCalypso, as opposed to some other AT command modem flavor with different quirks. In technical terms, the compiled-in default for the AT+CGMI query (which will always be overridden by the /pcm/CGMI file in FFS if one is present) is now "FreeCalypso" in all configs on all targets; the compiled-in default for the AT+CGMM query (likewise always overridden by /pcm/CGMM if present) is "GTM900-FC" if CONFIG_TARGET_GTM900 or "Tango" if CONFIG_TARGET_TANGO or the original default of "<model>" otherwise.
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 19 Jan 2020 20:14:58 +0000
parents c93a236e0d50
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
145
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*******************************************************************************
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 *
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 * pwr_messages.c
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 *
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 * Purpose: Contains functions used by PWR to send events
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 * to the upper layer (MMI)
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 *
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 * Author Candice Bazanegue (c-brille@ti.com)
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 *
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 * (C) Texas Instruments 2001
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 *
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 ******************************************************************************/
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13
151
c93a236e0d50 PWR SWE compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 145
diff changeset
14 #include "rv/rv_defined_swe.h" // for RVM_PWR_SWE
145
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 #ifdef RVM_PWR_SWE
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17
151
c93a236e0d50 PWR SWE compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 145
diff changeset
18 #include "rvm/rvm_use_id_list.h"
c93a236e0d50 PWR SWE compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 145
diff changeset
19 #include "rvf/rvf_api.h"
c93a236e0d50 PWR SWE compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 145
diff changeset
20 #include "pwr/pwr_messages.h"
c93a236e0d50 PWR SWE compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 145
diff changeset
21 #include "rv/rv_general.h"
c93a236e0d50 PWR SWE compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 145
diff changeset
22 #include "spi/spi_env.h"
145
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 /*******************************************************************************
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 ** Function pwr_send_charger_plug_event
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 ** Description This function is used to send a 'POWER_CHARGER_PLUG_IND'
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 ** event to the upper layer.
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 *******************************************************************************/
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 T_RV_RET pwr_send_charger_plug_event(void)
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 {
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 T_RV_HDR *msg_p;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 if (pwr_env_ctrl_blk->power_info.info_enable == TRUE)
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 {
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 if (rvf_get_buf (pwr_env_ctrl_blk->prim_id, sizeof (T_RV_HDR),(void **) &msg_p) == RVF_RED)
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 {
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 rvf_send_trace ("PWR ERROR: Not enough memory",
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 28,
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 NULL_PARAM,
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 RV_TRACE_LEVEL_ERROR,
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 PWR_USE_ID);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 return (RV_MEMORY_ERR);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 }
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 msg_p->msg_id = POWER_CHARGER_PLUG_IND;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 msg_p->callback_func = NULL;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 PWR_SEND_MESSAGE(pwr_env_ctrl_blk->power_info.return_path, msg_p);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 }
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 return (RV_OK);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 }
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62 /*******************************************************************************
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 ** Function pwr_send_charger_unplug_event
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66 ** Description This function is used to send a 'POWER_CHARGER_UNPLUG_IND'
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67 ** event to the upper layer.
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
70 *******************************************************************************/
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71 T_RV_RET pwr_send_charger_unplug_event(void)
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72 {
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
73 T_RV_HDR *msg_p;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
74
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
75 if (pwr_env_ctrl_blk->power_info.info_enable == TRUE)
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
76 {
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77 if (rvf_get_buf (pwr_env_ctrl_blk->prim_id, sizeof (T_RV_HDR),(void **) &msg_p) == RVF_RED)
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78 {
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
79 rvf_send_trace ("PWR ERROR: Not enough memory",
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
80 28,
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
81 NULL_PARAM,
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
82 RV_TRACE_LEVEL_ERROR,
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
83 PWR_USE_ID);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
84
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
85 return (RV_MEMORY_ERR);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
86 }
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
87
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
88 msg_p->msg_id = POWER_CHARGER_UNPLUG_IND;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
89 msg_p->callback_func = NULL;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
90
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
91 PWR_SEND_MESSAGE(pwr_env_ctrl_blk->power_info.return_path, msg_p);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
92
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
93 }
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
94
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
95 return (RV_OK);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
96 }
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
97
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
98
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
99 /*******************************************************************************
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
100 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
101 ** Function pwr_send_CI_charge_start_event
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
102 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
103 ** Description This function is used to send a 'POWER_BAT_CI_CHARGE_START_IND'
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
104 ** event to the upper layer.
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
105 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
106 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
107 *******************************************************************************/
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
108 T_RV_RET pwr_send_CI_charge_start_event(void)
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
109 {
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
110 T_RV_HDR *msg_p;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
111
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
112 if (pwr_env_ctrl_blk->power_info.info_enable == TRUE)
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
113 {
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
114 if (rvf_get_buf (pwr_env_ctrl_blk->prim_id, sizeof (T_RV_HDR),(void **) &msg_p) == RVF_RED)
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
115 {
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
116 rvf_send_trace ("PWR ERROR: Not enough memory",
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
117 28,
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
118 NULL_PARAM,
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
119 RV_TRACE_LEVEL_ERROR,
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
120 PWR_USE_ID);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
121
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
122 return (RV_MEMORY_ERR);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
123 }
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
124
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
125 msg_p->msg_id = POWER_BAT_CI_CHARGE_START_IND;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
126 msg_p->callback_func = NULL;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
127
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
128 PWR_SEND_MESSAGE(pwr_env_ctrl_blk->power_info.return_path, msg_p);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
129
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
130 }
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
131
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
132 return (RV_OK);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
133 }
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
134
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
135
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
136 /*******************************************************************************
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
137 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
138 ** Function pwr_send_CV_charge_start_event
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
139 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
140 ** Description This function is used to send a 'POWER_BAT_CV_CHARGE_START_IND'
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
141 ** event to the upper layer.
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
142 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
143 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
144 *******************************************************************************/
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
145 T_RV_RET pwr_send_CV_charge_start_event(void)
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
146 {
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
147 T_RV_HDR *msg_p;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
148
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
149 if (pwr_env_ctrl_blk->power_info.info_enable == TRUE)
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
150 {
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
151 if (rvf_get_buf (pwr_env_ctrl_blk->prim_id, sizeof (T_RV_HDR),(void **) &msg_p) == RVF_RED)
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
152 {
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
153 rvf_send_trace ("PWR ERROR: Not enough memory",
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
154 28,
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
155 NULL_PARAM,
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
156 RV_TRACE_LEVEL_ERROR,
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
157 PWR_USE_ID);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
158
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
159 return (RV_MEMORY_ERR);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
160 }
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
161
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
162 msg_p->msg_id = POWER_BAT_CV_CHARGE_START_IND;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
163 msg_p->callback_func = NULL;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
164
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
165 PWR_SEND_MESSAGE(pwr_env_ctrl_blk->power_info.return_path, msg_p);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
166
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
167 }
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
168
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
169 return (RV_OK);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
170 }
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
171
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
172
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
173 /*******************************************************************************
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
174 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
175 ** Function pwr_send_charge_stop_event
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
176 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
177 ** Description This function is used to send a 'POWER_BAT_CHARGE_STOP_IND'
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
178 ** event to the upper layer.
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
179 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
180 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
181 *******************************************************************************/
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
182 T_RV_RET pwr_send_charge_stop_event(void)
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
183 {
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
184 T_RV_HDR *msg_p;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
185
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
186 if (pwr_env_ctrl_blk->power_info.info_enable == TRUE)
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
187 {
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
188 if (rvf_get_buf (pwr_env_ctrl_blk->prim_id, sizeof (T_RV_HDR),(void **) &msg_p) == RVF_RED)
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
189 {
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
190 rvf_send_trace ("PWR ERROR: Not enough memory",
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
191 28,
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
192 NULL_PARAM,
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
193 RV_TRACE_LEVEL_ERROR,
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
194 PWR_USE_ID);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
195
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
196 return (RV_MEMORY_ERR);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
197 }
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
198
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
199 msg_p->msg_id = POWER_BAT_CHARGE_STOP_IND;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
200 msg_p->callback_func = NULL;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
201
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
202 PWR_SEND_MESSAGE(pwr_env_ctrl_blk->power_info.return_path, msg_p);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
203
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
204 }
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
205
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
206 return (RV_OK);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
207 }
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
208
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
209
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
210 /*******************************************************************************
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
211 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
212 ** Function pwr_send_charge_not_possible_event
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
213 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
214 ** Description This function is used to send a 'POWER_BAT_CHARGE_NOT_POSSIBLE_IND'
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
215 ** event to the upper layer.
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
216 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
217 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
218 *******************************************************************************/
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
219 T_RV_RET pwr_send_charge_not_possible_event(T_BAT_PROBLEM charge_problem)
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
220 {
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
221 T_PWR_BAT_CHARGE_NOT_POSSIBLE *msg_p;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
222
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
223 if (pwr_env_ctrl_blk->power_info.info_enable == TRUE)
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
224 {
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
225 if (rvf_get_buf (pwr_env_ctrl_blk->prim_id, sizeof (T_PWR_BAT_CHARGE_NOT_POSSIBLE),(void **) &msg_p) == RVF_RED)
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
226 {
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
227 rvf_send_trace ("PWR ERROR: Not enough memory",
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
228 28,
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
229 NULL_PARAM,
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
230 RV_TRACE_LEVEL_ERROR,
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
231 PWR_USE_ID);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
232
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
233 return (RV_MEMORY_ERR);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
234 }
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
235
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
236 (msg_p->hdr).msg_id= POWER_BAT_CHARGE_NOT_POSSIBLE_IND;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
237 (msg_p->hdr).callback_func= NULL;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
238 msg_p->problem= charge_problem;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
239
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
240 PWR_SEND_MESSAGE(pwr_env_ctrl_blk->power_info.return_path, msg_p);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
241
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
242 }
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
243
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
244 return (RV_OK);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
245 }
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
246
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
247
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
248 /*******************************************************************************
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
249 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
250 ** Function pwr_send_bat_discharge_event
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
251 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
252 ** Description This function is used to send a 'POWER_BAT_DISCHARGE_LEVEL_IND'
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
253 ** event to the upper layer.
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
254 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
255 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
256 *******************************************************************************/
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
257 T_RV_RET pwr_send_bat_discharge_event(T_PWR_PERCENT remaining_capacity)
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
258 {
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
259 T_PWR_BAT_DISCHARGE_LEVEL *msg_p;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
260
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
261 if (pwr_env_ctrl_blk->power_info.info_enable == TRUE)
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
262 {
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
263 if (rvf_get_buf (pwr_env_ctrl_blk->prim_id, sizeof (T_PWR_BAT_DISCHARGE_LEVEL),(void **) &msg_p) == RVF_RED)
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
264 {
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
265 rvf_send_trace ("PWR ERROR: Not enough memory",
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
266 28,
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
267 NULL_PARAM,
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
268 RV_TRACE_LEVEL_ERROR,
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
269 PWR_USE_ID);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
270
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
271 return (RV_MEMORY_ERR);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
272 }
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
273
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
274 (msg_p->hdr).msg_id= POWER_BAT_DISCHARGE_LEVEL_IND;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
275 (msg_p->hdr).callback_func= NULL;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
276 msg_p->remaining_capacity= remaining_capacity;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
277
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
278 PWR_SEND_MESSAGE(pwr_env_ctrl_blk->power_info.return_path, msg_p);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
279
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
280 }
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
281
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
282 return (RV_OK);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
283 }
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
284
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
285
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
286 /*******************************************************************************
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
287 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
288 ** Function pwr_send_low_bat_event
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
289 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
290 ** Description This function is used to send a 'POWER_LOW_BAT_ALERT_IND'
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
291 ** event to the upper layer.
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
292 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
293 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
294 *******************************************************************************/
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
295 T_RV_RET pwr_send_low_bat_event(T_PWR_PERCENT remaining_capacity)
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
296 {
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
297 T_PWR_LOW_BAT_ALERT *msg_p;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
298
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
299 if (rvf_get_buf (pwr_env_ctrl_blk->prim_id, sizeof (T_PWR_LOW_BAT_ALERT),(void **) &msg_p) == RVF_RED)
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
300 {
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
301 rvf_send_trace ("PWR ERROR: Not enough memory",
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
302 28,
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
303 NULL_PARAM,
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
304 RV_TRACE_LEVEL_ERROR,
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
305 PWR_USE_ID);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
306
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
307 return (RV_MEMORY_ERR);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
308 }
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
309
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
310 (msg_p->hdr).msg_id= POWER_LOW_BAT_ALERT_IND;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
311 (msg_p->hdr).callback_func = NULL;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
312 msg_p->remaining_capacity= remaining_capacity;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
313
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
314 PWR_SEND_MESSAGE(pwr_env_ctrl_blk->power_alert.return_path, msg_p);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
315
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
316 return (RV_OK);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
317 }
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
318
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
319
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
320 /*******************************************************************************
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
321 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
322 ** Function pwr_send_battery_info
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
323 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
324 ** Description This function is used to send a 'POWER_BAT_INFO_STATUS'
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
325 ** event to the upper layer.
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
326 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
327 **
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
328 *******************************************************************************/
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
329 T_RV_RET pwr_send_battery_info(UINT16 battery_voltage, UINT16 battery_temperature,
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
330 UINT16 battery_charger_current,
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
331 BOOLEAN is_charger_plugged,
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
332 T_PWR_CHARGING_STATE is_charge_started,
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
333 T_PWR_PERCENT remaining_capacity)
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
334 {
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
335 T_PWR_BAT_INFO_STATUS *msg_p;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
336
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
337 if (rvf_get_buf (pwr_env_ctrl_blk->prim_id, sizeof (T_PWR_BAT_INFO_STATUS),(void **) &msg_p) == RVF_RED)
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
338 {
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
339 rvf_send_trace ("PWR ERROR: Not enough memory",
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
340 28,
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
341 NULL_PARAM,
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
342 RV_TRACE_LEVEL_ERROR,
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
343 PWR_USE_ID);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
344
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
345 return (RV_MEMORY_ERR);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
346 }
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
347
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
348 (msg_p->hdr).msg_id= POWER_BAT_INFO_STATUS;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
349 (msg_p->hdr).callback_func= NULL;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
350 msg_p->bat_info.battery_voltage= battery_voltage;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
351 msg_p->bat_info.battery_temperature= battery_temperature;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
352 msg_p->bat_info.battery_charger_current= battery_charger_current;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
353 msg_p->bat_info.charger_plugged= is_charger_plugged;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
354 msg_p->bat_info.charge_started= is_charge_started;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
355 msg_p->bat_info.remaining_capacity= remaining_capacity;
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
356
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
357
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
358
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
359 PWR_SEND_MESSAGE(pwr_env_ctrl_blk->power_info.return_path, msg_p);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
360
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
361 return (RV_OK);
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
362 }
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
363
246f4a7dd92b src/cs/drivers/drv_app/pwr: import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
364 #endif /* #ifdef RVM_PWR_SWE */