1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // @file atgetbatteryinfo.h |
|
15 // This contains CATGetBattery which is defines the AT command for Getting Battery status |
|
16 // |
|
17 |
|
18 #ifndef __CBATTERY_H__ |
|
19 #define __CBATTERY_H__ |
|
20 |
|
21 //system include |
|
22 #include <etelmm.h> |
|
23 #include <cmmutility.h> |
|
24 //user include |
|
25 #include "atcommandbase.h" |
|
26 |
|
27 |
|
28 /** |
|
29 * class CATGetBattery |
|
30 * |
|
31 * CATGetBattery inherits from the CAtCommandBase class. |
|
32 * This class transmits the AT+COPS=? Command in order to get |
|
33 * Battery status in this phone |
|
34 */ |
|
35 class CATGetBattery : public CAtCommandBase |
|
36 { |
|
37 public: |
|
38 static CATGetBattery* NewL(CGlobalPhonemanager& aGloblePhone, |
|
39 CCtsyDispatcherCallback& aCtsyDispatcherCallback); |
|
40 /** |
|
41 * Destructor |
|
42 * |
|
43 */ |
|
44 ~CATGetBattery(); |
|
45 |
|
46 /** |
|
47 * Virtual function. Inherited from CAtCommandBase |
|
48 * Start Execute AT Command |
|
49 */ |
|
50 virtual void ExecuteCommand(); |
|
51 /** |
|
52 * Get the battery infomation returned by executing AT Command |
|
53 */ |
|
54 RMobilePhone::TMobilePhoneBatteryInfoV1 GetBatteryinfo(); |
|
55 /** |
|
56 * Get RF state information |
|
57 */ |
|
58 TRfStateInfo GetRfStateInfo(); |
|
59 /** |
|
60 * Will be called by AT Manager whenever a event was triggered |
|
61 * |
|
62 * @param aEventSource |
|
63 * @param aStatus |
|
64 */ |
|
65 virtual void EventSignal(TAtEventSource aEventSource, TInt aStatus); |
|
66 /** |
|
67 * Virtual function. Inherited from CAtCommandBase |
|
68 * @param aResponseBuf Line buf reading from baseband |
|
69 */ |
|
70 virtual void ParseResponseL(const TDesC8& aResponseBuf); |
|
71 /** |
|
72 * The return error value of AT command executed |
|
73 */ |
|
74 TInt GetErrorValue(); |
|
75 /** |
|
76 * Start the request |
|
77 */ |
|
78 virtual void StartRequest(); |
|
79 protected: |
|
80 /** |
|
81 * Constructor |
|
82 * |
|
83 * @param aGloblePhone |
|
84 * @param aCtsyDispatcherCallback |
|
85 */ |
|
86 CATGetBattery(CGlobalPhonemanager& aGloblePhone, |
|
87 CCtsyDispatcherCallback& aCtsyDispatcherCallback); |
|
88 /** |
|
89 * 2nd Constructor |
|
90 */ |
|
91 void ConstructL(); |
|
92 private: |
|
93 /* |
|
94 * The return battery infomation of AT command executed |
|
95 */ |
|
96 RMobilePhone::TMobilePhoneBatteryInfoV1 iBatteryInfo; |
|
97 /* |
|
98 * The return error value of AT command executed |
|
99 */ |
|
100 TInt iError; |
|
101 /** |
|
102 * The RF state information |
|
103 */ |
|
104 TRfStateInfo iRfStateInfo; |
|
105 |
|
106 }; |
|
107 #endif |
|