24
|
1 |
// Copyright (c) 1997-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 |
// This queries the ME (Mobile Equipment) battery, using a standard (ETSI GSM 07.07 April 1997) AT command : AT+CBC
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
/**
|
|
19 |
@file
|
|
20 |
@internalAll
|
|
21 |
*/
|
|
22 |
|
|
23 |
#ifndef __MMBATTERY_H__
|
|
24 |
#define __MMBATTERY_H__
|
|
25 |
|
|
26 |
#include "ATBASE.H"
|
|
27 |
#include "etelmm.h"
|
|
28 |
|
|
29 |
class CATGetBattery : public CATCommands
|
|
30 |
{
|
|
31 |
public:
|
|
32 |
static CATGetBattery* NewL(CATIO* aIo, CTelObject* aTelObject, CATInit* aInit, CPhoneGlobals* aPhoneGlobals);
|
|
33 |
CATGetBattery(CATIO* aIo, CTelObject* aTelObject, CATInit* aInit, CPhoneGlobals* aPhoneGlobals);
|
|
34 |
~CATGetBattery();
|
|
35 |
void ConstructL();
|
|
36 |
virtual void Start(TTsyReqHandle aTsyReqHandle, TAny* aParams);
|
|
37 |
virtual void Stop(TTsyReqHandle aTsyReqHandle);
|
|
38 |
virtual void EventSignal(TEventSource aSource);
|
|
39 |
virtual void CompleteWithIOError(TEventSource aSource, TInt aStatus);
|
|
40 |
RMobilePhone::TMobilePhoneBatteryStatus ConvertBatteryStatus(TInt aBatteryStatus);
|
|
41 |
private:
|
|
42 |
virtual void Complete(TInt aError,TEventSource aSource);
|
|
43 |
void ParseBatteryResponseL();
|
|
44 |
|
|
45 |
enum {
|
|
46 |
EATNotInProgress,
|
|
47 |
EATBatteryWaitForWriteComplete,
|
|
48 |
EATBatteryReadComplete
|
|
49 |
} iState;
|
|
50 |
|
|
51 |
RMobilePhone::TMobilePhoneBatteryInfoV1* iBatteryInfo;
|
|
52 |
CPhoneGlobals* iPhoneGlobals;
|
|
53 |
};
|
|
54 |
#endif
|