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 // CATGetModemStatus |
|
15 |
|
16 #include "atgetmodemstatus.h" |
|
17 #include "mslogger.h" |
|
18 |
|
19 |
|
20 _LIT8(KATCommand, "AT\r"); |
|
21 // Class CATGetModemStatus |
|
22 // --------------------------------------------------------------------------- |
|
23 // CATGetModemStatus::NewL |
|
24 // other items were commented in a header |
|
25 // --------------------------------------------------------------------------- |
|
26 CATGetModemStatus* CATGetModemStatus::NewL(CGlobalPhonemanager& aGloblePhone, |
|
27 CCtsyDispatcherCallback& aCtsyDispatcherCallback) |
|
28 { |
|
29 CATGetModemStatus* self = new(ELeave) CATGetModemStatus(aGloblePhone, |
|
30 aCtsyDispatcherCallback); |
|
31 CleanupStack::PushL(self ); |
|
32 self->ConstructL(); |
|
33 CleanupStack::Pop(self ); |
|
34 return self ; |
|
35 } |
|
36 // --------------------------------------------------------------------------- |
|
37 // CATGetModemStatus::CATGetModemStatus |
|
38 // other items were commented in a header |
|
39 // --------------------------------------------------------------------------- |
|
40 CATGetModemStatus::CATGetModemStatus(CGlobalPhonemanager& aGloblePhone, |
|
41 CCtsyDispatcherCallback& aCtsyDispatcherCallback) |
|
42 :CAtCommandBase(aGloblePhone,aCtsyDispatcherCallback) |
|
43 { |
|
44 } |
|
45 // --------------------------------------------------------------------------- |
|
46 // CATGetModemStatus::ConstructL |
|
47 // other items were commented in a header |
|
48 // --------------------------------------------------------------------------- |
|
49 void CATGetModemStatus::ConstructL() |
|
50 { |
|
51 CAtCommandBase::ConstructL(); |
|
52 iAtType = ELtsyAT_Phone_ModemStatus; |
|
53 } |
|
54 // --------------------------------------------------------------------------- |
|
55 // CATGetModemStatus::~CATGetModemStatus |
|
56 // other items were commented in a header |
|
57 // --------------------------------------------------------------------------- |
|
58 CATGetModemStatus::~CATGetModemStatus() |
|
59 { |
|
60 } |
|
61 // --------------------------------------------------------------------------- |
|
62 // CATGetModemStatus::StartRequestL |
|
63 // other items were commented in a header |
|
64 // --------------------------------------------------------------------------- |
|
65 void CATGetModemStatus::StartRequest() |
|
66 { |
|
67 ExecuteCommand(); |
|
68 } |
|
69 // --------------------------------------------------------------------------- |
|
70 // CATGetModemStatus::ExecuteCommand |
|
71 // other items were commented in a header |
|
72 // --------------------------------------------------------------------------- |
|
73 void CATGetModemStatus::ExecuteCommand() |
|
74 { |
|
75 iTxBuffer.Copy(KATCommand); |
|
76 Write(); |
|
77 } |
|
78 // --------------------------------------------------------------------------- |
|
79 // CATGetModemStatus::ParseResponseL |
|
80 // other items were commented in a header |
|
81 // --------------------------------------------------------------------------- |
|
82 void CATGetModemStatus::ParseResponseL(const TDesC8& /*aResponseBuf*/) |
|
83 { |
|
84 if (CurrentLine().Match(KLtsyOkString) == 0) |
|
85 { |
|
86 iError = KErrNone; |
|
87 } |
|
88 else |
|
89 { |
|
90 iError = KErrGeneral; |
|
91 } |
|
92 } |
|
93 // --------------------------------------------------------------------------- |
|
94 // CATGetModemStatus::GetErrorValue |
|
95 // other items were commented in a header |
|
96 // --------------------------------------------------------------------------- |
|
97 TInt CATGetModemStatus::GetErrorValue() |
|
98 { |
|
99 return iError; |
|
100 } |
|
101 // --------------------------------------------------------------------------- |
|
102 // CATGetModemStatus::EventSignal |
|
103 // other items were commented in a header |
|
104 // --------------------------------------------------------------------------- |
|
105 void CATGetModemStatus::EventSignal(TAtEventSource aEventSource, TInt aStatus) |
|
106 { |
|
107 if(KErrNone !=aStatus) |
|
108 { |
|
109 iCtsyDispatcherCallback.CallbackPhoneBootNotifyModemStatusReadyComp(aStatus,ERfsStateInfoInactive); |
|
110 } |
|
111 else |
|
112 { |
|
113 if(aEventSource == EReadCompletion) |
|
114 { |
|
115 iCtsyDispatcherCallback.CallbackPhoneBootNotifyModemStatusReadyComp(iError,ERfsStateInfoNormal); |
|
116 } |
|
117 else |
|
118 { |
|
119 return; |
|
120 } |
|
121 } |
|
122 CAtCommandBase::Complete(); |
|
123 iPhoneGlobals.iEventSignalActive = EFalse; |
|
124 } |
|
125 // |
|
126 // End of file |
|