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