44
|
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 |
// CATGetFdnStatus
|
|
15 |
|
|
16 |
//user include
|
|
17 |
#include "atgetfdnstatus.h"
|
|
18 |
#include "mslogger.h"
|
|
19 |
|
|
20 |
|
|
21 |
_LIT8(KGetFdnStatusCommand,"AT+CPBS?\r");
|
|
22 |
_LIT8(KGetFdnStatusCmdRepondStr,"+CPBS:");
|
|
23 |
_LIT8(KFdnString,"FD");
|
|
24 |
// Class CATGetFdnStatus
|
|
25 |
// ---------------------------------------------------------------------------
|
|
26 |
// CATGetFdnStatus::NewL
|
|
27 |
// other items were commented in a header
|
|
28 |
// ---------------------------------------------------------------------------
|
|
29 |
CATGetFdnStatus* CATGetFdnStatus::NewL(CGlobalPhonemanager& aGloblePhone,
|
|
30 |
CCtsyDispatcherCallback& aCtsyDispatcherCallback)
|
|
31 |
{
|
|
32 |
CATGetFdnStatus* self = new(ELeave) CATGetFdnStatus(aGloblePhone,
|
|
33 |
aCtsyDispatcherCallback);
|
|
34 |
CleanupStack::PushL(self );
|
|
35 |
self->ConstructL();
|
|
36 |
CleanupStack::Pop(self );
|
|
37 |
return self ;
|
|
38 |
}
|
|
39 |
// ---------------------------------------------------------------------------
|
|
40 |
// CATGetFdnStatus::CATGetFdnStatus
|
|
41 |
// other items were commented in a header
|
|
42 |
// ---------------------------------------------------------------------------
|
|
43 |
CATGetFdnStatus::CATGetFdnStatus(CGlobalPhonemanager& aGloblePhone,
|
|
44 |
CCtsyDispatcherCallback& aCtsyDispatcherCallback)
|
|
45 |
:CAtCommandBase(aGloblePhone,aCtsyDispatcherCallback)
|
|
46 |
{
|
|
47 |
}
|
|
48 |
// ---------------------------------------------------------------------------
|
|
49 |
// CATGetFdnStatus::ConstructL
|
|
50 |
// other items were commented in a header
|
|
51 |
// ---------------------------------------------------------------------------
|
|
52 |
void CATGetFdnStatus::ConstructL()
|
|
53 |
{
|
|
54 |
CAtCommandBase::ConstructL();
|
|
55 |
iFdnStatus = EFalse;
|
|
56 |
iAtType = ELtsyAT_Phone_GetFdnStatus;
|
|
57 |
}
|
|
58 |
// ---------------------------------------------------------------------------
|
|
59 |
// CATGetFdnStatus::~CATGetFdnStatus
|
|
60 |
// other items were commented in a header
|
|
61 |
// ---------------------------------------------------------------------------
|
|
62 |
CATGetFdnStatus::~CATGetFdnStatus()
|
|
63 |
{
|
|
64 |
}
|
|
65 |
// ---------------------------------------------------------------------------
|
|
66 |
// CATGetFdnStatus::StartRequestL
|
|
67 |
// other items were commented in a header
|
|
68 |
// ---------------------------------------------------------------------------
|
|
69 |
void CATGetFdnStatus::StartRequest()
|
|
70 |
{
|
|
71 |
ExecuteCommand();
|
|
72 |
}
|
|
73 |
// ---------------------------------------------------------------------------
|
|
74 |
// CATGetFdnStatus::ExecuteCommand
|
|
75 |
// other items were commented in a header
|
|
76 |
// ---------------------------------------------------------------------------
|
|
77 |
void CATGetFdnStatus::ExecuteCommand()
|
|
78 |
{
|
|
79 |
iTxBuffer.Copy(KGetFdnStatusCommand);
|
|
80 |
Write();
|
|
81 |
}
|
|
82 |
// ---------------------------------------------------------------------------
|
|
83 |
// CATGetFdnStatus::CATGetFdnStatus
|
|
84 |
// other items were commented in a header
|
|
85 |
// ---------------------------------------------------------------------------
|
|
86 |
TBool CATGetFdnStatus::GetFdnStatus()
|
|
87 |
{
|
|
88 |
return iFdnStatus;
|
|
89 |
}
|
|
90 |
|
|
91 |
// ---------------------------------------------------------------------------
|
|
92 |
// CATGetFdnStatus::GetErrorValue
|
|
93 |
// other items were commented in a header
|
|
94 |
// ---------------------------------------------------------------------------
|
|
95 |
TInt CATGetFdnStatus::GetErrorValue()
|
|
96 |
{
|
|
97 |
return iError;
|
|
98 |
}
|
|
99 |
// ---------------------------------------------------------------------------
|
|
100 |
// CATGetFdnStatus::ParseResponseL
|
|
101 |
// other items were commented in a header
|
|
102 |
// ---------------------------------------------------------------------------
|
|
103 |
void CATGetFdnStatus::ParseResponseL(const TDesC8& /*aResponseBuf*/)
|
|
104 |
{
|
|
105 |
if (CurrentLine().Match(KLtsyOkString) != 0)
|
|
106 |
{
|
|
107 |
iError = KErrGeneral;
|
|
108 |
return ;
|
|
109 |
}
|
|
110 |
RArray<TPtrC8> array;
|
|
111 |
CleanupClosePushL(array);
|
|
112 |
iParser->ParseRespondedBuffer(array,PrecedingLine());
|
|
113 |
TInt Count = array.Count();
|
|
114 |
if (Count < 1)
|
|
115 |
{
|
|
116 |
CleanupStack::PopAndDestroy();
|
|
117 |
iError = KErrNotFound;
|
|
118 |
return;
|
|
119 |
}
|
|
120 |
if( array[0].MatchF(KGetFdnStatusCmdRepondStr)==KErrNotFound)
|
|
121 |
{
|
|
122 |
CleanupStack::PopAndDestroy();
|
|
123 |
iError = KErrNotFound;
|
|
124 |
return ;
|
|
125 |
}
|
|
126 |
if( array[1].MatchF(KFdnString)!=KErrNotFound)
|
|
127 |
{
|
|
128 |
iFdnStatus = ETrue;
|
|
129 |
}
|
|
130 |
|
|
131 |
CleanupStack::PopAndDestroy(&array);
|
|
132 |
iError = KErrNone;
|
|
133 |
}
|
|
134 |
|
|
135 |
//
|
|
136 |
// End of file
|