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) signal quality, using a standard (ETSI GSM 07.07 April 1997) AT command : AT+CSQ
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
/**
|
|
19 |
@file
|
|
20 |
@internalAll
|
|
21 |
*/
|
|
22 |
|
|
23 |
#ifndef __MMSIGNAL_H__
|
|
24 |
#define __MMSIGNAL_H__
|
|
25 |
|
|
26 |
#include "ATBASE.H"
|
|
27 |
|
|
28 |
class CATGetSignal : public CATCommands
|
|
29 |
{
|
|
30 |
public:
|
|
31 |
static CATGetSignal* NewL(CATIO* aIo, CTelObject* aTelObject, CATInit* aInit, CPhoneGlobals* aPhoneGlobals);
|
|
32 |
CATGetSignal(CATIO* aIo, CTelObject* aTelObject, CATInit* aInit, CPhoneGlobals* aPhoneGlobals);
|
|
33 |
~CATGetSignal();
|
|
34 |
void ConstructL();
|
|
35 |
virtual void Start(TTsyReqHandle aTsyReqHandle, TAny* aParams);
|
|
36 |
virtual void Stop(TTsyReqHandle aTsyReqHandle);
|
|
37 |
virtual void EventSignal(TEventSource aSource);
|
|
38 |
virtual void CompleteWithIOError(TEventSource aSource, TInt aStatus);
|
|
39 |
TInt8 NumberOfSignalBars(TInt32 aSignalStrength);
|
|
40 |
|
|
41 |
struct TTsySignalInfo
|
|
42 |
{
|
|
43 |
TInt32* iSignalStrength;
|
|
44 |
TInt8* iBar;
|
|
45 |
};
|
|
46 |
|
|
47 |
private:
|
|
48 |
void Complete(TInt aError, TEventSource aSource);
|
|
49 |
void ParseSignalResponseL();
|
|
50 |
|
|
51 |
enum {
|
|
52 |
EATNotInProgress,
|
|
53 |
EATSignalWaitForWriteComplete,
|
|
54 |
EATSignalReadComplete
|
|
55 |
} iState;
|
|
56 |
|
|
57 |
// Values of <rssi> parameter in AT+CSQ response
|
|
58 |
enum {
|
|
59 |
KSignalStrengthMinus113dBm = 0,
|
|
60 |
KSignalStrengthMinus101dBm = 6,
|
|
61 |
KSignalStrengthMinus89dBm = 12,
|
|
62 |
KSignalStrengthMinus77dBm = 18,
|
|
63 |
KSignalStrengthMinus53dBm = 30,
|
|
64 |
KSignalStrengthMinus51dBm = 31
|
|
65 |
};
|
|
66 |
|
|
67 |
TTsySignalInfo iSignalInfo;
|
|
68 |
};
|
|
69 |
#endif
|