author | hgs |
Fri, 09 Jul 2010 13:13:20 +0100 | |
changeset 199 | 189ece41fa29 |
parent 90 | 947f0dc9f7a8 |
child 257 | 3e88ff8f41d5 |
permissions | -rw-r--r-- |
0 | 1 |
// Copyright (c) 2008-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 the License "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 |
// Hardware Configuration Respoitory Platform Independent Layer (PIL) |
|
15 |
// |
|
16 |
||
17 |
// -- INCLUDES ---------------------------------------------------------------- |
|
18 |
||
19 |
||
20 |
#include <nkern/nkern.h> |
|
21 |
#include <kernel/kernel.h> |
|
22 |
||
23 |
#ifdef HCRTEST_NO_EXPORT |
|
24 |
#undef EXPORT_C |
|
25 |
#undef IMPORT_C |
|
26 |
#define EXPORT_C |
|
27 |
#define IMPORT_C |
|
28 |
#endif // HCRTEST_NO_EXPORT |
|
29 |
||
30 |
#include <drivers/hcr.h> |
|
31 |
#include "hcr_debug.h" |
|
32 |
#include "hcr_pil.h" |
|
33 |
||
34 |
||
35 |
// -- FUNCTIONS --------------------------------------------------------------- |
|
36 |
||
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
37 |
|
0 | 38 |
#ifndef MAKE_DEF_FILE |
39 |
namespace HCR |
|
40 |
{ |
|
41 |
||
42 |
LOCAL_C TInt GetUValueWordSetting (const TSettingId& aId, |
|
43 |
TSettingType aType, UValueWord& aValue) |
|
44 |
{ |
|
45 |
HCR_FUNC("GetUValueWordSetting"); |
|
46 |
||
47 |
if (HCRNotReady) |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
48 |
HCR_TRACE_RETURN(KErrNotReady); |
0 | 49 |
|
39
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
50 |
__NK_ASSERT_DEBUG((aType & KMaskWordTypes) != 0); |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
51 |
|
0 | 52 |
TSettingRef sref(0,0); |
53 |
TInt err = 0; |
|
54 |
err = HCRSingleton->FindSetting(aId, aType, sref); |
|
55 |
if (err != KErrNone) |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
56 |
HCR_TRACE_RETURN(err); |
0 | 57 |
|
58 |
err = sref.iRep->GetValue(sref, aValue); |
|
39
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
59 |
__NK_ASSERT_DEBUG(err == KErrNone); |
0 | 60 |
|
61 |
return KErrNone; |
|
62 |
} |
|
63 |
||
64 |
LOCAL_C TInt GetUValueLargeSetting64 (const TSettingId& aId, |
|
65 |
TSettingType aType, UValueLarge& aValue) |
|
66 |
{ |
|
67 |
HCR_FUNC("GetUValueLargeSetting64"); |
|
68 |
||
69 |
if (HCRNotReady) |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
70 |
HCR_TRACE_RETURN(KErrNotReady); |
0 | 71 |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
72 |
__NK_ASSERT_DEBUG(aType == ETypeInt64 || aType == ETypeUInt64); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
73 |
|
0 | 74 |
TSettingRef sref(0,0); |
75 |
TInt err = 0; |
|
76 |
err = HCRSingleton->FindSetting(aId, aType, sref); |
|
77 |
if (err != KErrNone) |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
78 |
HCR_TRACE_RETURN(err); |
0 | 79 |
|
80 |
err = sref.iRep->GetLargeValue(sref, aValue); |
|
39
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
81 |
__NK_ASSERT_DEBUG(err == KErrNone); |
0 | 82 |
|
83 |
return KErrNone; |
|
84 |
} |
|
85 |
||
86 |
||
87 |
LOCAL_C TInt GetUValueLargeSettingTDes8 (const TSettingId& aId, |
|
88 |
TSettingType aType, TDes8& aValue) |
|
89 |
{ |
|
90 |
HCR_FUNC("GetUValueLargeSettingTDes8"); |
|
91 |
||
92 |
if (HCRNotReady) |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
93 |
HCR_TRACE_RETURN(KErrNotReady); |
0 | 94 |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
95 |
__NK_ASSERT_DEBUG(aType == ETypeBinData || aType == ETypeText8); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
96 |
|
0 | 97 |
TSettingRef sref(0,0); |
98 |
TInt err = 0; |
|
99 |
err = HCRSingleton->FindSetting(aId, aType, sref); |
|
100 |
if (err != KErrNone) |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
101 |
HCR_TRACE_RETURN(err); |
0 | 102 |
|
103 |
UValueLarge value; |
|
104 |
err = sref.iRep->GetLargeValue(sref, value); |
|
39
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
105 |
__NK_ASSERT_DEBUG(err == KErrNone); |
0 | 106 |
|
107 |
TInt len = sref.iRep->GetLength(sref); |
|
108 |
if (len > aValue.MaxSize()) |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
109 |
HCR_TRACE_RETURN(KErrTooBig); |
0 | 110 |
|
111 |
if (aType == ETypeBinData) |
|
112 |
aValue.Copy(value.iData, len); |
|
113 |
else |
|
114 |
aValue.Copy(value.iString8, len); |
|
115 |
||
116 |
return KErrNone; |
|
117 |
} |
|
118 |
||
119 |
LOCAL_C TInt GetUValueLargeSettingTUint8 (const TSettingId& aId, TSettingType aType, |
|
120 |
TUint16 aMaxLen, TUint8* aValue, TUint16& aLen) |
|
121 |
{ |
|
122 |
HCR_FUNC("GetUValueLargeSettingTUint8"); |
|
123 |
||
124 |
if (HCRNotReady) |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
125 |
HCR_TRACE_RETURN(KErrNotReady); |
0 | 126 |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
127 |
__NK_ASSERT_DEBUG(aType == ETypeBinData || aType == ETypeText8); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
128 |
|
0 | 129 |
TSettingRef sref(0,0); |
130 |
TInt err = 0; |
|
131 |
err = HCRSingleton->FindSetting(aId, aType, sref); |
|
132 |
if (err != KErrNone) |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
133 |
HCR_TRACE_RETURN(err); |
0 | 134 |
|
135 |
UValueLarge value; |
|
136 |
err = sref.iRep->GetLargeValue(sref, value); |
|
39
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
137 |
__NK_ASSERT_DEBUG(err == KErrNone); |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
138 |
|
0 | 139 |
aLen = sref.iRep->GetLength(sref); |
140 |
if (aLen > aMaxLen) |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
141 |
HCR_TRACE_RETURN(KErrTooBig); |
0 | 142 |
|
143 |
if (aType == ETypeBinData) |
|
144 |
memcpy (aValue, value.iData, aLen); |
|
145 |
else |
|
146 |
memcpy (aValue, value.iString8, aLen); |
|
147 |
||
148 |
return KErrNone; |
|
149 |
} |
|
150 |
||
151 |
LOCAL_C TInt GetUValueLargeSettingArray (const TSettingId& aId, TSettingType aType, |
|
152 |
TUint16 aMaxLen, TUint32* aValue, TUint16& aLen) |
|
153 |
{ |
|
154 |
HCR_FUNC("GetUValueLargeSettingArray"); |
|
155 |
||
156 |
if (HCRNotReady) |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
157 |
HCR_TRACE_RETURN(KErrNotReady); |
0 | 158 |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
159 |
__NK_ASSERT_DEBUG(aType == ETypeArrayInt32 || aType == ETypeArrayUInt32); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
160 |
|
0 | 161 |
TSettingRef sref(0,0); |
162 |
TInt err = 0; |
|
163 |
err = HCRSingleton->FindSetting(aId, aType, sref); |
|
164 |
if (err != KErrNone) |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
165 |
HCR_TRACE_RETURN(err); |
0 | 166 |
|
167 |
UValueLarge value; |
|
168 |
err = sref.iRep->GetLargeValue(sref, value); |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
169 |
__NK_ASSERT_DEBUG(err == KErrNone); |
0 | 170 |
|
171 |
aLen = sref.iRep->GetLength(sref); |
|
172 |
if (aLen > aMaxLen) |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
173 |
HCR_TRACE_RETURN(KErrTooBig); |
0 | 174 |
|
175 |
if (aType == ETypeArrayInt32) |
|
176 |
memcpy (aValue, value.iArrayInt32, aLen); |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
177 |
else |
0 | 178 |
memcpy (aValue, value.iArrayUInt32, aLen); |
179 |
||
180 |
return KErrNone; |
|
181 |
} |
|
182 |
||
183 |
} |
|
184 |
||
185 |
#endif // MAKE_DEF_FILE |
|
186 |
||
187 |
||
188 |
// -- SETTING GET ------------------------------------------------------------- |
|
189 |
||
190 |
||
191 |
EXPORT_C TInt HCR::GetInt(const TSettingId& aId, TInt8& aValue) |
|
192 |
{ |
|
193 |
#ifndef MAKE_DEF_FILE |
|
194 |
HCR_FUNC("HCR::GetInt8"); |
|
195 |
||
196 |
UValueWord value; |
|
197 |
TInt err = GetUValueWordSetting(aId, ETypeInt8, value); |
|
198 |
if (err != KErrNone) |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
199 |
HCR_TRACE_RETURN(err); |
0 | 200 |
|
201 |
aValue = value.iInt8; |
|
202 |
return KErrNone; |
|
203 |
#else |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
204 |
HCR_TRACE_RETURN(KErrGeneral); |
0 | 205 |
#endif // MAKE_DEF_FILE |
206 |
} |
|
207 |
||
208 |
||
209 |
EXPORT_C TInt HCR::GetInt(const TSettingId& aId, TInt16& aValue) |
|
210 |
{ |
|
211 |
#ifndef MAKE_DEF_FILE |
|
212 |
HCR_FUNC("HCR::GetInt16"); |
|
213 |
||
214 |
UValueWord value; |
|
215 |
TInt err = GetUValueWordSetting(aId, ETypeInt16, value); |
|
216 |
if (err != KErrNone) |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
217 |
HCR_TRACE_RETURN(err); |
0 | 218 |
|
219 |
aValue = value.iInt16; |
|
220 |
return KErrNone; |
|
221 |
#else |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
222 |
HCR_TRACE_RETURN(KErrGeneral); |
0 | 223 |
#endif // MAKE_DEF_FILE |
224 |
} |
|
225 |
||
226 |
||
227 |
EXPORT_C TInt HCR::GetInt(const TSettingId& aId, TInt32& aValue) |
|
228 |
{ |
|
229 |
#ifndef MAKE_DEF_FILE |
|
230 |
HCR_FUNC("HCR::GetInt32"); |
|
231 |
||
232 |
UValueWord value; |
|
233 |
TInt err = GetUValueWordSetting(aId, ETypeInt32, value); |
|
234 |
if (err != KErrNone) |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
235 |
HCR_TRACE_RETURN(err); |
0 | 236 |
|
237 |
aValue = value.iInt32; |
|
238 |
return KErrNone; |
|
239 |
#else |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
240 |
HCR_TRACE_RETURN(KErrGeneral); |
0 | 241 |
#endif // MAKE_DEF_FILE |
242 |
} |
|
243 |
||
244 |
||
245 |
EXPORT_C TInt HCR::GetInt(const TSettingId& aId, TInt64& aValue) |
|
246 |
{ |
|
247 |
#ifndef MAKE_DEF_FILE |
|
248 |
HCR_FUNC("HCR::GetInt64"); |
|
249 |
||
250 |
UValueLarge value; |
|
251 |
TInt err = GetUValueLargeSetting64(aId, ETypeInt64, value); |
|
252 |
if (err != KErrNone) |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
253 |
HCR_TRACE_RETURN(err); |
0 | 254 |
|
255 |
aValue = *(value.iInt64); |
|
256 |
return KErrNone; |
|
257 |
#else |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
258 |
HCR_TRACE_RETURN(KErrGeneral); |
0 | 259 |
#endif // MAKE_DEF_FILE |
260 |
} |
|
261 |
||
262 |
||
263 |
EXPORT_C TInt HCR::GetBool(const TSettingId& aId, TBool& aValue) |
|
264 |
{ |
|
265 |
#ifndef MAKE_DEF_FILE |
|
266 |
HCR_FUNC("HCR::GetBool"); |
|
267 |
||
268 |
UValueWord value; |
|
269 |
TInt err = GetUValueWordSetting(aId, ETypeBool, value); |
|
270 |
if (err != KErrNone) |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
271 |
HCR_TRACE_RETURN(err); |
0 | 272 |
|
273 |
aValue = value.iBool; |
|
274 |
return KErrNone; |
|
275 |
#else |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
276 |
HCR_TRACE_RETURN(KErrGeneral); |
0 | 277 |
#endif // MAKE_DEF_FILE |
278 |
} |
|
279 |
||
280 |
||
281 |
EXPORT_C TInt HCR::GetUInt(const TSettingId& aId, TUint8& aValue) |
|
282 |
{ |
|
283 |
#ifndef MAKE_DEF_FILE |
|
284 |
HCR_FUNC("HCR::GetUInt8"); |
|
285 |
||
286 |
UValueWord value; |
|
287 |
TInt err = GetUValueWordSetting(aId, ETypeUInt8, value); |
|
288 |
if (err != KErrNone) |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
289 |
HCR_TRACE_RETURN(err); |
0 | 290 |
|
291 |
aValue = value.iUInt8; |
|
292 |
return KErrNone; |
|
293 |
#else |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
294 |
HCR_TRACE_RETURN(KErrGeneral); |
0 | 295 |
#endif // MAKE_DEF_FILE |
296 |
} |
|
297 |
||
298 |
||
299 |
EXPORT_C TInt HCR::GetUInt(const TSettingId& aId, TUint16& aValue) |
|
300 |
{ |
|
301 |
#ifndef MAKE_DEF_FILE |
|
302 |
HCR_FUNC("HCR::GetUInt16"); |
|
303 |
||
304 |
UValueWord value; |
|
305 |
TInt err = GetUValueWordSetting(aId, ETypeUInt16,value); |
|
306 |
if (err != KErrNone) |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
307 |
HCR_TRACE_RETURN(err); |
0 | 308 |
|
309 |
aValue = value.iUInt16; |
|
310 |
return KErrNone; |
|
311 |
#else |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
312 |
HCR_TRACE_RETURN(KErrGeneral); |
0 | 313 |
#endif // MAKE_DEF_FILE |
314 |
} |
|
315 |
||
316 |
||
317 |
EXPORT_C TInt HCR::GetUInt(const TSettingId& aId, TUint32& aValue) |
|
318 |
{ |
|
319 |
#ifndef MAKE_DEF_FILE |
|
320 |
HCR_FUNC("HCR::GetUInt32"); |
|
321 |
||
322 |
UValueWord value; |
|
323 |
TInt err = GetUValueWordSetting(aId, ETypeUInt32, value); |
|
324 |
if (err != KErrNone) |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
325 |
HCR_TRACE_RETURN(err); |
0 | 326 |
|
327 |
aValue = value.iUInt32; |
|
328 |
return KErrNone; |
|
329 |
#else |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
330 |
HCR_TRACE_RETURN(KErrGeneral); |
0 | 331 |
#endif // MAKE_DEF_FILE |
332 |
} |
|
333 |
||
334 |
||
335 |
EXPORT_C TInt HCR::GetUInt(const TSettingId& aId, TUint64& aValue) |
|
336 |
{ |
|
337 |
#ifndef MAKE_DEF_FILE |
|
338 |
HCR_FUNC("HCR::GetUInt64"); |
|
339 |
||
340 |
UValueLarge value; |
|
341 |
TInt err = GetUValueLargeSetting64(aId, ETypeUInt64, value); |
|
342 |
if (err != KErrNone) |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
343 |
HCR_TRACE_RETURN(err); |
0 | 344 |
|
345 |
aValue = *(value.iUInt64); |
|
346 |
return KErrNone; |
|
347 |
#else |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
348 |
HCR_TRACE_RETURN(KErrGeneral); |
0 | 349 |
#endif // MAKE_DEF_FILE |
350 |
} |
|
351 |
||
352 |
||
353 |
EXPORT_C TInt HCR::GetLinAddr(const TSettingId& aId, TLinAddr& aValue) |
|
354 |
{ |
|
355 |
#ifndef MAKE_DEF_FILE |
|
356 |
HCR_FUNC("HCR::GetLinAddr"); |
|
357 |
||
358 |
UValueWord value; |
|
359 |
TInt err = GetUValueWordSetting(aId, ETypeLinAddr, value); |
|
360 |
if (err != KErrNone) |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
361 |
HCR_TRACE_RETURN(err); |
0 | 362 |
|
363 |
aValue = value.iAddress; |
|
364 |
return KErrNone; |
|
365 |
#else |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
366 |
HCR_TRACE_RETURN(KErrGeneral); |
0 | 367 |
#endif // MAKE_DEF_FILE |
368 |
} |
|
369 |
||
370 |
||
371 |
EXPORT_C TInt HCR::GetData(const TSettingId& aId, TUint16 aMaxLen, |
|
372 |
TUint8* aValue, TUint16& aLen) |
|
373 |
{ |
|
374 |
#ifndef MAKE_DEF_FILE |
|
375 |
HCR_FUNC("HCR::GetDataTUint8"); |
|
376 |
||
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
377 |
if(aValue == NULL || aMaxLen == 0) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
378 |
HCR_TRACE_RETURN(KErrArgument); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
379 |
|
0 | 380 |
TInt err = GetUValueLargeSettingTUint8(aId, ETypeBinData, aMaxLen, aValue, aLen); |
381 |
if (err != KErrNone) |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
382 |
HCR_TRACE_RETURN(err); |
0 | 383 |
|
384 |
return KErrNone; |
|
385 |
#else |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
386 |
HCR_TRACE_RETURN(KErrGeneral); |
0 | 387 |
#endif // MAKE_DEF_FILE |
388 |
} |
|
389 |
||
390 |
||
391 |
EXPORT_C TInt HCR::GetData(const TSettingId& aId, TDes8& aValue) |
|
392 |
{ |
|
393 |
#ifndef MAKE_DEF_FILE |
|
394 |
HCR_FUNC("HCR::GetDataTDes8"); |
|
395 |
||
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
396 |
if(aValue.MaxLength()==0) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
397 |
HCR_TRACE_RETURN(KErrArgument); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
398 |
|
0 | 399 |
TInt err = GetUValueLargeSettingTDes8(aId, ETypeBinData, aValue); |
400 |
if (err != KErrNone) |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
401 |
HCR_TRACE_RETURN(err); |
0 | 402 |
|
403 |
return KErrNone; |
|
404 |
#else |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
405 |
HCR_TRACE_RETURN(KErrGeneral); |
0 | 406 |
#endif // MAKE_DEF_FILE |
407 |
} |
|
408 |
||
409 |
||
410 |
EXPORT_C TInt HCR::GetString(const TSettingId& aId, TUint16 aMaxLen, |
|
411 |
TText8* aValue, TUint16& aLen) |
|
412 |
{ |
|
413 |
#ifndef MAKE_DEF_FILE |
|
414 |
HCR_FUNC("HCR::GetStringTUint8"); |
|
415 |
||
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
416 |
if(aValue == NULL || aMaxLen == 0) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
417 |
HCR_TRACE_RETURN(KErrArgument); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
418 |
|
0 | 419 |
TInt err = GetUValueLargeSettingTUint8(aId, ETypeText8, aMaxLen, aValue, aLen); |
420 |
if (err != KErrNone) |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
421 |
HCR_TRACE_RETURN(err); |
0 | 422 |
|
423 |
return KErrNone; |
|
424 |
#else |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
425 |
HCR_TRACE_RETURN(KErrGeneral); |
0 | 426 |
#endif // MAKE_DEF_FILE |
427 |
} |
|
428 |
||
429 |
||
430 |
EXPORT_C TInt HCR::GetString(const TSettingId& aId, TDes8& aValue) |
|
431 |
{ |
|
432 |
#ifndef MAKE_DEF_FILE |
|
433 |
HCR_FUNC("HCR::GetStringTUint8"); |
|
434 |
||
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
435 |
if(aValue.MaxLength() == 0) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
436 |
HCR_TRACE_RETURN(KErrArgument); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
437 |
|
0 | 438 |
TInt err = GetUValueLargeSettingTDes8(aId, ETypeText8, aValue); |
439 |
if (err != KErrNone) |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
440 |
HCR_TRACE_RETURN(err); |
0 | 441 |
|
442 |
return KErrNone; |
|
443 |
#else |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
444 |
HCR_TRACE_RETURN(KErrGeneral); |
0 | 445 |
#endif // MAKE_DEF_FILE |
446 |
} |
|
447 |
||
448 |
EXPORT_C TInt HCR::GetArray(const TSettingId& aId, TUint16 aMaxLen, |
|
449 |
TInt32* aValue, TUint16& aLen) |
|
450 |
{ |
|
451 |
#ifndef MAKE_DEF_FILE |
|
452 |
HCR_FUNC("HCR::GetArrayTInt32"); |
|
453 |
||
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
454 |
if(aValue == NULL || aMaxLen == 0) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
455 |
HCR_TRACE_RETURN(KErrArgument); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
456 |
|
0 | 457 |
TInt err = GetUValueLargeSettingArray(aId, ETypeArrayInt32, aMaxLen, (TUint32*)aValue, aLen); |
458 |
if (err != KErrNone) |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
459 |
HCR_TRACE_RETURN(err); |
0 | 460 |
|
461 |
return KErrNone; |
|
462 |
#else |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
463 |
HCR_TRACE_RETURN(KErrGeneral); |
0 | 464 |
#endif // MAKE_DEF_FILE |
465 |
} |
|
466 |
||
467 |
EXPORT_C TInt HCR::GetArray(const TSettingId& aId, TUint16 aMaxLen, |
|
468 |
TUint32* aValue, TUint16& aLen) |
|
469 |
{ |
|
470 |
#ifndef MAKE_DEF_FILE |
|
471 |
HCR_FUNC("HCR::GetArrayTUInt32"); |
|
472 |
||
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
473 |
if(aValue == NULL || aMaxLen == 0) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
474 |
HCR_TRACE_RETURN(KErrArgument); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
475 |
|
0 | 476 |
TInt err = GetUValueLargeSettingArray(aId, ETypeArrayUInt32, aMaxLen, aValue, aLen); |
477 |
if (err != KErrNone) |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
478 |
HCR_TRACE_RETURN(err); |
0 | 479 |
|
480 |
return KErrNone; |
|
481 |
#else |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
482 |
HCR_TRACE_RETURN(KErrGeneral); |
0 | 483 |
#endif // MAKE_DEF_FILE |
484 |
} |
|
485 |
||
486 |
||
487 |
// -- MULTIPLE GETS ----------------------------------------------------------- |
|
488 |
||
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
489 |
EXPORT_C TInt HCR::GetWordSettings(TInt aNum, const SSettingId aIds[], |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
490 |
TInt32 aValues[], TSettingType aTypes[], TInt aErrors[]) |
0 | 491 |
{ |
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
492 |
|
0 | 493 |
#ifndef MAKE_DEF_FILE |
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
494 |
HCR_FUNC("GetWordSettings"); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
495 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
496 |
if (HCRNotReady) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
497 |
HCR_TRACE_RETURN(KErrNotReady); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
498 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
499 |
if(aNum <= 0 || aIds == NULL || aErrors == NULL || aValues == NULL) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
500 |
HCR_TRACE_RETURN(KErrArgument); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
501 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
502 |
TInt err = KErrNone; |
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
503 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
504 |
//Only UDEB, check is the user provided array aIds ordered? |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
505 |
#ifdef _DEBUG |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
506 |
for(TInt cursor = 0; cursor < aNum - 1; cursor ++) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
507 |
{ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
508 |
//Check the element at cursor position and one above |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
509 |
err = CompareSSettingIds(aIds[cursor], aIds[cursor+1]); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
510 |
//if next element is less than previous one then array is not ordered. |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
511 |
//Critical error, report to user |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
512 |
if(err >= 0) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
513 |
HCR_TRACE_RETURN(KErrArgument); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
514 |
} |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
515 |
#endif |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
516 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
517 |
|
0 | 518 |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
519 |
//Don't leave while the resources are not fully allocated/deallocated |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
520 |
NKern::ThreadEnterCS(); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
521 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
522 |
err = HCRSingleton->GetWordSettings(aNum, aIds, aValues, aTypes, aErrors); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
523 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
524 |
//All de-allocations are done, leave a critical section |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
525 |
NKern::ThreadLeaveCS(); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
526 |
|
39
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
527 |
__NK_ASSERT_DEBUG(err >= KErrNone); |
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
528 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
529 |
return err; |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
530 |
|
0 | 531 |
#else |
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
532 |
HCR_TRACE_RETURN(KErrGeneral); |
0 | 533 |
#endif // MAKE_DEF_FILE |
534 |
} |
|
535 |
||
536 |
||
537 |
// -- SETTING PROPERTIES ------------------------------------------------------ |
|
538 |
||
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
539 |
EXPORT_C TInt HCR::GetTypeAndSize(const TSettingId& aId, TSettingType& aType, |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
540 |
TUint16& aLen) |
0 | 541 |
{ |
542 |
#ifndef MAKE_DEF_FILE |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
543 |
HCR_FUNC("GetTypeAndSize"); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
544 |
if (HCRNotReady) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
545 |
HCR_TRACE_RETURN(KErrNotReady); |
0 | 546 |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
547 |
TSettingRef sref(0,0); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
548 |
TInt err = HCRSingleton->FindSettingWithType(aId, aType, sref); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
549 |
|
39
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
550 |
__NK_ASSERT_DEBUG(err == KErrNone || err == KErrNotFound); |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
551 |
|
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
552 |
if(err == KErrNotFound) |
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
553 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
554 |
aLen = 0; |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
555 |
HCR_TRACE_RETURN(KErrNotFound); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
556 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
557 |
|
39
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
558 |
aLen = sref.iRep->GetLength(sref); |
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
559 |
return KErrNone; |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
560 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
561 |
#else |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
562 |
HCR_TRACE_RETURN(KErrGeneral); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
563 |
#endif //MAKE_DEF_FILE |
0 | 564 |
} |
565 |
||
566 |
||
567 |
// -- SETTING SEARCHES -------------------------------------------------------- |
|
568 |
||
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
569 |
EXPORT_C TInt HCR::FindNumSettingsInCategory (TCategoryUid aCatUid) |
0 | 570 |
{ |
571 |
#ifndef MAKE_DEF_FILE |
|
572 |
||
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
573 |
HCR_FUNC("FindNumSettingsInCategory"); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
574 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
575 |
if (HCRNotReady) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
576 |
HCR_TRACE_RETURN(KErrNotReady); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
577 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
578 |
TInt err = HCRSingleton->FindNumSettingsInCategory(aCatUid); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
579 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
580 |
if(err < 0) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
581 |
HCR_TRACE_RETURN(err); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
582 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
583 |
return err; |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
584 |
|
0 | 585 |
#else |
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
586 |
HCR_TRACE_RETURN(KErrGeneral); |
0 | 587 |
#endif // MAKE_DEF_FILE |
588 |
} |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
589 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
590 |
EXPORT_C TInt HCR::FindSettings(TCategoryUid aCat, TInt aMaxNum, |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
591 |
TElementId aElIds[], TSettingType aTypes[], TUint16 aLens[]) |
0 | 592 |
{ |
593 |
#ifndef MAKE_DEF_FILE |
|
594 |
||
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
595 |
HCR_FUNC("FindSettings without pattern/mask"); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
596 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
597 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
598 |
if (HCRNotReady) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
599 |
HCR_TRACE_RETURN(KErrNotReady); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
600 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
601 |
if(aMaxNum <= 0 || aElIds == NULL) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
602 |
HCR_TRACE_RETURN(KErrArgument); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
603 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
604 |
TInt err = HCRSingleton->FindSettings(aCat, aMaxNum, aElIds, |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
605 |
aTypes, aLens); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
606 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
607 |
if(err < 0) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
608 |
HCR_TRACE_RETURN(err); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
609 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
610 |
return err; |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
611 |
|
0 | 612 |
#else |
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
613 |
HCR_TRACE_RETURN(KErrGeneral); |
0 | 614 |
#endif // MAKE_DEF_FILE |
615 |
} |
|
616 |
||
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
617 |
EXPORT_C TInt HCR::FindSettings(TCategoryUid aCat, |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
618 |
TInt aMaxNum, TUint32 aMask, TUint32 aPattern, |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
619 |
TElementId aElIds[], TSettingType aTypes[], TUint16 aLens[]) |
0 | 620 |
{ |
621 |
#ifndef MAKE_DEF_FILE |
|
622 |
||
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
623 |
HCR_FUNC("FindSettings with pattern/mask"); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
624 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
625 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
626 |
if (HCRNotReady) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
627 |
HCR_TRACE_RETURN(KErrNotReady); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
628 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
629 |
if(aMaxNum <= 0 || aElIds == NULL) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
630 |
HCR_TRACE_RETURN(KErrArgument); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
631 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
632 |
TInt err = KErrNone; |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
633 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
634 |
//Don't leave while the resources are not fully allocated/deallocated |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
635 |
NKern::ThreadEnterCS(); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
636 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
637 |
err = HCRSingleton->FindSettings(aCat, aMaxNum, aMask, aPattern, |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
638 |
aElIds, aTypes, aLens); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
639 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
640 |
//All de-allocations are done, leave a critical section |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
641 |
NKern::ThreadLeaveCS(); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
642 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
643 |
if(err < 0) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
644 |
HCR_TRACE_RETURN(err); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
645 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
646 |
return err; |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
647 |
|
0 | 648 |
#else |
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
649 |
HCR_TRACE_RETURN(KErrGeneral); |
0 | 650 |
#endif // MAKE_DEF_FILE |
651 |
} |
|
652 |
||
653 |
||
654 |
// -- KERNEL ENTRY POINT ------------------------------------------------------ |
|
655 |
||
656 |
||
657 |
#ifdef MAKE_DEF_FILE |
|
658 |
||
659 |
DECLARE_STANDARD_EXTENSION() |
|
660 |
{ |
|
661 |
return KErrNone; |
|
662 |
} |
|
663 |
||
664 |
#endif // MAKE_DEF_FILE |
|
665 |