|
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 // Description: |
|
16 // CATNotifyCellInfo |
|
17 |
|
18 //user include |
|
19 #include "atnotifycellinfo.h" |
|
20 |
|
21 _LIT8(KATNotifyCellInfo,"+CCED:*"); |
|
22 |
|
23 // --------------------------------------------------------------------------- |
|
24 // CATNotifyCellInfo::NewL |
|
25 // other items were commented in a header |
|
26 // --------------------------------------------------------------------------- |
|
27 CATNotifyCellInfo* CATNotifyCellInfo::NewL(CGlobalPhonemanager& aGloblePhone, |
|
28 CCtsyDispatcherCallback& aCtsyDispatcherCallback) |
|
29 { |
|
30 CATNotifyCellInfo* self = CATNotifyCellInfo::NewLC(aGloblePhone, aCtsyDispatcherCallback); |
|
31 CleanupStack::Pop(self); |
|
32 return self; |
|
33 } |
|
34 |
|
35 // --------------------------------------------------------------------------- |
|
36 // CATNotifyCellInfo::NewLC |
|
37 // other items were commented in a header |
|
38 // --------------------------------------------------------------------------- |
|
39 CATNotifyCellInfo* CATNotifyCellInfo::NewLC(CGlobalPhonemanager& aGloblePhone, |
|
40 CCtsyDispatcherCallback& aCtsyDispatcherCallback) |
|
41 { |
|
42 CATNotifyCellInfo* self = new (ELeave) CATNotifyCellInfo(aGloblePhone, aCtsyDispatcherCallback); |
|
43 CleanupStack::PushL(self); |
|
44 self->ConstructL(); |
|
45 return self; |
|
46 } |
|
47 |
|
48 // --------------------------------------------------------------------------- |
|
49 // CATNotifyCellInfo::~CATNotifyCellInfo |
|
50 // other items were commented in a header |
|
51 // --------------------------------------------------------------------------- |
|
52 CATNotifyCellInfo::~CATNotifyCellInfo() |
|
53 { |
|
54 |
|
55 } |
|
56 |
|
57 // --------------------------------------------------------------------------- |
|
58 // CATNotifyCellInfo::ConstructL |
|
59 // other items were commented in a header |
|
60 // --------------------------------------------------------------------------- |
|
61 void CATNotifyCellInfo::ConstructL() |
|
62 { |
|
63 CAtCommandBase::ConstructL(); |
|
64 RemoveAllExpectString(); |
|
65 AddExpectStringL(KATNotifyCellInfo); |
|
66 Enable(); |
|
67 } |
|
68 |
|
69 // --------------------------------------------------------------------------- |
|
70 // CATNotifyCellInfo::CATNotifyCellInfo |
|
71 // other items were commented in a header |
|
72 // --------------------------------------------------------------------------- |
|
73 CATNotifyCellInfo::CATNotifyCellInfo(CGlobalPhonemanager& aGloblePhone, |
|
74 CCtsyDispatcherCallback& aCtsyDispatcherCallback) |
|
75 :CAtCommandBase(aGloblePhone, aCtsyDispatcherCallback) |
|
76 { |
|
77 } |
|
78 // --------------------------------------------------------------------------- |
|
79 // CATNotifyCellInfo::CATNotifyCellInfo |
|
80 // other items were commented in a header |
|
81 // --------------------------------------------------------------------------- |
|
82 void CATNotifyCellInfo::Enable() |
|
83 { |
|
84 AddUnsolicitedAtCommand(); |
|
85 } |
|
86 // --------------------------------------------------------------------------- |
|
87 // CATNotifyCellInfo::CATNotifyCellInfo |
|
88 // other items were commented in a header |
|
89 // --------------------------------------------------------------------------- |
|
90 void CATNotifyCellInfo::Disable() |
|
91 { |
|
92 RemoveAtCommand(); |
|
93 } |
|
94 // --------------------------------------------------------------------------- |
|
95 // CATNotifyCellInfo::ParseResponseL |
|
96 // other items were commented in a header |
|
97 // --------------------------------------------------------------------------- |
|
98 void CATNotifyCellInfo::ParseResponseL(const TDesC8& /*aResponseBuf*/) |
|
99 { |
|
100 |
|
101 RArray<TPtrC8> array; |
|
102 CleanupClosePushL(array); |
|
103 iParser->ParseRespondedBuffer(array,CurrentLine()); |
|
104 ClearCurrentLine(); |
|
105 TInt Count = array.Count(); |
|
106 if (Count < 1) |
|
107 { |
|
108 CleanupStack::PopAndDestroy(); |
|
109 iError = KErrNotFound; |
|
110 return; |
|
111 } |
|
112 if( array[0].MatchF(KATNotifyCellInfo)==KErrNotFound) |
|
113 { |
|
114 CleanupStack::PopAndDestroy(); |
|
115 iError = KErrNotFound; |
|
116 return ; |
|
117 } |
|
118 TInt number = 0; |
|
119 TInt val = 0; |
|
120 TLex8 lexBasic(array[5]); |
|
121 lexBasic.Val(val); |
|
122 iCellInfo.iNmr[number].iBSIC = val; |
|
123 TLex8 lexArfcn(array[6]); |
|
124 lexArfcn.Val(val); |
|
125 iCellInfo.iNmr[number].iARFCN = val; |
|
126 TLex8 lexRxlev(array[7]); |
|
127 lexRxlev.Val(val); |
|
128 iCellInfo.iNmr[number].iRxLEV = val; |
|
129 |
|
130 |
|
131 for(TInt i = 14;i < Count-2;i++ ) |
|
132 { |
|
133 number++; |
|
134 i = i + 4; |
|
135 TInt val = 0; |
|
136 TLex8 lexBasic(array[i]); |
|
137 lexBasic.Val(val); |
|
138 i++; |
|
139 iCellInfo.iNmr[number].iBSIC = val; |
|
140 TLex8 lexArfcn(array[i]); |
|
141 lexArfcn.Val(val); |
|
142 iCellInfo.iNmr[number].iARFCN = val; |
|
143 i++; |
|
144 TLex8 lexRxlev(array[i]); |
|
145 lexRxlev.Val(val); |
|
146 iCellInfo.iNmr[number].iRxLEV = val; |
|
147 } |
|
148 TLex8 lexTa(array[Count-2]); |
|
149 lexTa.Val(val); |
|
150 iCellInfo.iTA = val; |
|
151 |
|
152 |
|
153 CleanupStack::PopAndDestroy(&array); |
|
154 iError = KErrNone; |
|
155 } |
|
156 // --------------------------------------------------------------------------- |
|
157 // CATNotifyCellInfo::ParseResponseL |
|
158 // other items were commented in a header |
|
159 // --------------------------------------------------------------------------- |
|
160 void CATNotifyCellInfo::EventSignal(TAtEventSource /*aEventSource*/, TInt /*aStatus*/) |
|
161 { |
|
162 iCtsyDispatcherCallback.CallbackPhoneNotifyCellInfoChangedInd(iError,iCellInfo); |
|
163 } |
|
164 //End of file |