|
1 /* |
|
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Definition of geo WCDMA cell class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "lbtgeowcdmacell.h" |
|
20 |
|
21 EXPORT_C TLbtWcdmaCellInfo::~TLbtWcdmaCellInfo() |
|
22 { |
|
23 iMeasurementResult.Close(); |
|
24 } |
|
25 |
|
26 |
|
27 // ================= LOCAL FUNCTIONS ======================== |
|
28 |
|
29 // ================= MEMBER FUNCTIONS ======================= |
|
30 // --------------------------------------------------------------------------- |
|
31 // CLbtGeoWcdmaCell::NewLC() |
|
32 // |
|
33 // (other items were commented in a header). |
|
34 // --------------------------------------------------------------------------- |
|
35 // |
|
36 EXPORT_C CLbtGeoWcdmaCell* CLbtGeoWcdmaCell::NewLC() |
|
37 { |
|
38 CLbtGeoWcdmaCell* self = CLbtGeoWcdmaCell::NewL(); |
|
39 CleanupStack::Pop( self ); |
|
40 return self; |
|
41 } |
|
42 |
|
43 // --------------------------------------------------------------------------- |
|
44 // CLbtGeoWcdmaCell::NewL() |
|
45 // |
|
46 // (other items were commented in a header). |
|
47 // --------------------------------------------------------------------------- |
|
48 // |
|
49 EXPORT_C CLbtGeoWcdmaCell* CLbtGeoWcdmaCell::NewL() |
|
50 { |
|
51 CLbtGeoWcdmaCell* self = new( ELeave ) CLbtGeoWcdmaCell; |
|
52 CleanupStack::PushL( self ); |
|
53 self->ConstructL(); |
|
54 CleanupStack::Pop( self ); |
|
55 return self; |
|
56 } |
|
57 |
|
58 // --------------------------------------------------------------------------- |
|
59 // CLbtGeoWcdmaCell::NewL() |
|
60 // |
|
61 // (other items were commented in a header). |
|
62 // --------------------------------------------------------------------------- |
|
63 // |
|
64 EXPORT_C CLbtGeoWcdmaCell* CLbtGeoWcdmaCell::NewL(RMobilePhone::TMobilePhoneNetworkMode aNetworkType, |
|
65 RMobilePhone::TMobilePhoneNetworkCountryCode aCountryCode, |
|
66 RMobilePhone::TMobilePhoneNetworkIdentity aNetworkId, |
|
67 TUint aLocationAreaCode, |
|
68 TUint aCellId) |
|
69 { |
|
70 CLbtGeoWcdmaCell* self = CLbtGeoWcdmaCell::NewLC(aNetworkType,aCountryCode,aNetworkId,aLocationAreaCode, |
|
71 aCellId); |
|
72 CleanupStack::Pop( self ); |
|
73 return self; |
|
74 } |
|
75 |
|
76 // --------------------------------------------------------------------------- |
|
77 // CLbtGeoWcdmaCell::NewLC() |
|
78 // |
|
79 // (other items were commented in a header). |
|
80 // --------------------------------------------------------------------------- |
|
81 // |
|
82 EXPORT_C CLbtGeoWcdmaCell* CLbtGeoWcdmaCell::NewLC(RMobilePhone::TMobilePhoneNetworkMode aNetworkType, |
|
83 RMobilePhone::TMobilePhoneNetworkCountryCode aCountryCode, |
|
84 RMobilePhone::TMobilePhoneNetworkIdentity aNetworkId, |
|
85 TUint aLocationAreaCode, |
|
86 TUint aCellId) |
|
87 { |
|
88 CLbtGeoWcdmaCell* self = new( ELeave ) CLbtGeoWcdmaCell(); |
|
89 CleanupStack::PushL( self ); |
|
90 self->ConstructL( aNetworkType,aCountryCode,aNetworkId,aLocationAreaCode,aCellId); |
|
91 return self; |
|
92 } |
|
93 |
|
94 // --------------------------------------------------------------------------- |
|
95 // CLbtGeoWcdmaCell::CLbtGeoWcdmaCell() |
|
96 // |
|
97 // Default constructor |
|
98 // --------------------------------------------------------------------------- |
|
99 // |
|
100 CLbtGeoWcdmaCell::CLbtGeoWcdmaCell() |
|
101 { |
|
102 |
|
103 } |
|
104 |
|
105 // --------------------------------------------------------------------------- |
|
106 // CLbtGeoWcdmaCell::~CLbtGeoWcdmaCell() |
|
107 // |
|
108 // Destructor. |
|
109 // --------------------------------------------------------------------------- |
|
110 // |
|
111 EXPORT_C CLbtGeoWcdmaCell::~CLbtGeoWcdmaCell() |
|
112 { |
|
113 |
|
114 } |
|
115 |
|
116 // --------------------------------------------------------------------------- |
|
117 // CLbtGeoWcdmaCell::SetWcdmaCellInfo() |
|
118 // |
|
119 // (other items were commented in a header). |
|
120 // --------------------------------------------------------------------------- |
|
121 // |
|
122 EXPORT_C void CLbtGeoWcdmaCell::SetWcdmaCellInfo( const TLbtWcdmaCellInfo& aWcdmaCellInfo ) |
|
123 { |
|
124 iCellInfo.iCell = aWcdmaCellInfo.iCell; |
|
125 for(TInt i=0;i<aWcdmaCellInfo.iMeasurementResult.Count();++i) |
|
126 { |
|
127 TLbtWcdmaCellInfo::TLbtCellMeasuredResult nmr = aWcdmaCellInfo.iMeasurementResult[i]; |
|
128 iCellInfo.iMeasurementResult.Append(nmr); |
|
129 } |
|
130 } |
|
131 |
|
132 // --------------------------------------------------------------------------- |
|
133 // CLbtGeoWcdmaCell::WcdmaCellInfo() |
|
134 // |
|
135 // (other items were commented in a header). |
|
136 // --------------------------------------------------------------------------- |
|
137 // |
|
138 EXPORT_C const TLbtWcdmaCellInfo& CLbtGeoWcdmaCell::WcdmaCellInfo() |
|
139 { |
|
140 return iCellInfo; |
|
141 } |
|
142 |
|
143 // --------------------------------------------------------------------------- |
|
144 // CLbtGeoWcdmaCell::CGISpecifiedDuringCreation() |
|
145 // |
|
146 // (other items were commented in a header). |
|
147 // --------------------------------------------------------------------------- |
|
148 // |
|
149 EXPORT_C TBool CLbtGeoWcdmaCell::CGISpecifiedDuringCreation() const |
|
150 { |
|
151 return EFalse; |
|
152 } |
|
153 |
|
154 // --------------------------------------------------------------------------- |
|
155 // CLbtGeoWcdmaCell::DoExternalizeL() |
|
156 // |
|
157 // (other items were commented in a header). |
|
158 // --------------------------------------------------------------------------- |
|
159 // |
|
160 void CLbtGeoWcdmaCell::DoExternalizeL(RWriteStream& aStream) const |
|
161 { |
|
162 CLbtGeoCell::DoExternalizeL( aStream ); |
|
163 aStream.WriteInt8L(iCellInfo.iCell.iCarrierRssi); |
|
164 aStream.WriteInt8L(iCellInfo.iCell.iEcNo); |
|
165 aStream.WriteInt8L(iCellInfo.iCell.iRscp); |
|
166 aStream.WriteInt32L(iCellInfo.iCell.iPathLoss); |
|
167 TInt count = iCellInfo.iMeasurementResult.Count(); |
|
168 aStream.WriteInt32L( count ); |
|
169 for( TInt i=0;i<count;i++ ) |
|
170 { |
|
171 TLbtWcdmaCellInfo::TLbtCellMeasuredResult cellMeas = iCellInfo.iMeasurementResult[i]; |
|
172 aStream.WriteInt16L(cellMeas.iEcNo); |
|
173 aStream.WriteInt16L(cellMeas.iRscp); |
|
174 } |
|
175 } |
|
176 |
|
177 // --------------------------------------------------------------------------- |
|
178 // CLbtGeoWcdmaCell::DoInternalizeL() |
|
179 // |
|
180 // (other items were commented in a header). |
|
181 // --------------------------------------------------------------------------- |
|
182 // |
|
183 void CLbtGeoWcdmaCell::DoInternalizeL(RReadStream& aStream) |
|
184 { |
|
185 CLbtGeoCell::DoInternalizeL( aStream ); |
|
186 iCellInfo.iCell.iCarrierRssi = aStream.ReadInt8L(); |
|
187 iCellInfo.iCell.iEcNo = aStream.ReadInt8L(); |
|
188 iCellInfo.iCell.iRscp = aStream.ReadInt8L(); |
|
189 iCellInfo.iCell.iPathLoss = aStream.ReadInt32L(); |
|
190 TInt count = aStream.ReadInt32L(); |
|
191 for( TInt i=0;i<count;i++ ) |
|
192 { |
|
193 TLbtWcdmaCellInfo::TLbtCellMeasuredResult cellMeas; |
|
194 cellMeas.iEcNo = aStream.ReadInt16L(); |
|
195 cellMeas.iRscp = aStream.ReadInt16L(); |
|
196 iCellInfo.iMeasurementResult.Append(cellMeas); |
|
197 } |
|
198 } |