|
47
|
1 |
/*
|
|
|
2 |
* Copyright (c) 2004 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: DM Fota Adapter
|
|
|
15 |
*
|
|
|
16 |
*/
|
|
|
17 |
|
|
|
18 |
|
|
|
19 |
|
|
|
20 |
|
|
|
21 |
#ifndef __NSMLDMFOTAADAPTER_H__
|
|
|
22 |
#define __NSMLDMFOTAADAPTER_H__
|
|
|
23 |
|
|
|
24 |
// INCLUDES
|
|
|
25 |
#include <e32base.h>
|
|
|
26 |
#include <smldmadapter.h>
|
|
|
27 |
#include <fotaengine.h>
|
|
|
28 |
#include <fotaConst.h>
|
|
|
29 |
|
|
|
30 |
#include "nsmldmfotaadapterdb.h"
|
|
|
31 |
|
|
|
32 |
|
|
|
33 |
// CONSTANTS
|
|
|
34 |
|
|
|
35 |
const TInt KNSmlDMFotaResultBufferExpandSize = 64;
|
|
|
36 |
const TInt KNSmlDMFotaStreamingTreshold = 4096;
|
|
|
37 |
const TInt KNSmlDMFotaNullPkgId = -1;
|
|
|
38 |
|
|
|
39 |
// final result values
|
|
|
40 |
const TInt KNSmlDMFotaUndefinedError = 410;
|
|
|
41 |
const TInt KNSmlDMFotaSuccessfullDownload = 202;
|
|
|
42 |
const TInt KNSmlDMFotaBadUrl = 502;
|
|
|
43 |
|
|
|
44 |
// P&S keys defined & owned by FotaServer for OMA DM large object
|
|
|
45 |
// sets the OMA DM large object download status
|
|
|
46 |
const TUint32 KFotaLrgObjDl = 0x00000005;
|
|
|
47 |
// sets the profile id used for OMA DM large object download
|
|
|
48 |
const TUint32 KFotaLrgObjProfileId = 0x00000006;
|
|
|
49 |
// literals for DDF structure
|
|
|
50 |
_LIT8( KNSmlDMFotaNode, "FUMO" );
|
|
|
51 |
_LIT8( KNSmlDMFotaNodeName, "PkgName" );
|
|
|
52 |
_LIT8( KNSmlDMFotaNodeVersion, "PkgVersion" );
|
|
|
53 |
_LIT8( KNSmlDMFotaNodeDownload, "Download" );
|
|
|
54 |
_LIT8( KNSmlDMFotaNodeDownloadUrl, "PkgURL" );
|
|
|
55 |
_LIT8( KNSmlDMFotaNodeDownloadAndUpdate, "DownloadAndUpdate" );
|
|
|
56 |
_LIT8( KNSmlDMFotaNodeDownloadAndUpdateUrl, "PkgURL" );
|
|
|
57 |
_LIT8( KNSmlDMFotaNodeState, "State" );
|
|
|
58 |
|
|
|
59 |
// descriptions for DDF nodes
|
|
|
60 |
_LIT8( KNSmlDMFotaNodeDescription,
|
|
|
61 |
"Placeholder for all firmware management objects" );
|
|
|
62 |
|
|
|
63 |
_LIT8( KNSmlDMFotaRunTimeNodeDescription,
|
|
|
64 |
"Placeholder for a single firmware management object" );
|
|
|
65 |
|
|
|
66 |
_LIT8( KNSmlDMFotaNodeNameDescription,
|
|
|
67 |
"Name of a firmware update package" );
|
|
|
68 |
|
|
|
69 |
_LIT8( KNSmlDMFotaNodeVersionDescription,
|
|
|
70 |
"Version of a firmware update package" );
|
|
|
71 |
|
|
|
72 |
_LIT8( KNSmlDMFotaNodeDownloadDescription,
|
|
|
73 |
"Execution target for firmware update package download" );
|
|
|
74 |
|
|
|
75 |
_LIT8( KNSmlDMFotaNodeDownloadUrlDescription,
|
|
|
76 |
"Url to a location containing binary firmare update package" );
|
|
|
77 |
|
|
|
78 |
_LIT8( KNSmlDMFotaNodeUpdateDescription,
|
|
|
79 |
"Execution target for installing update package to device" );
|
|
|
80 |
|
|
|
81 |
_LIT8( KNSmlDMFotaNodeUpdateDataDescription,
|
|
|
82 |
"Binary data used in installation" );
|
|
|
83 |
|
|
|
84 |
_LIT8( KNSmlDMFotaNodeDownloadAndUpdateDescription,
|
|
|
85 |
"Execution target for downloading firmware update package and installing it" );
|
|
|
86 |
|
|
|
87 |
_LIT8( KNSmlDMFotaNodeDownloadAndUpdateUrlDescription,
|
|
|
88 |
"Url to a location containing binary firmare update package" );
|
|
|
89 |
|
|
|
90 |
_LIT8( KNSmlDMFotaNodeStateDescription,
|
|
|
91 |
"Current state of firmware update" );
|
|
|
92 |
|
|
|
93 |
// mime types etc
|
|
|
94 |
_LIT8( KNSmlDMFotaRunTimeMimeType,
|
|
|
95 |
"org.openmobilealliance/1.0/FirmwareUpdateManagementObject" );
|
|
|
96 |
|
|
|
97 |
_LIT8( KNSmlDMFotaTextPlain, "text/plain" );
|
|
|
98 |
_LIT8( KNSmlDMFotaDDFVersion, "1.0" );
|
|
|
99 |
|
|
|
100 |
_LIT8( KNSmlDMFotaUpdateMetaType,
|
|
|
101 |
"org.openmobilealliance.dm.firmwareupdate.update" );
|
|
|
102 |
|
|
|
103 |
_LIT8( KNSmlDMFotaDownloadMetaType,
|
|
|
104 |
"org.openmobilealliance.dm.firmwareupdate.download" );
|
|
|
105 |
|
|
|
106 |
_LIT8( KNSmlDMFotaDownloadAndUpdateMetaType,
|
|
|
107 |
"org.openmobilealliance.dm.firmwareupdate.downloadandupdate" );
|
|
|
108 |
|
|
|
109 |
_LIT8( KNSmlDMFotaMetaFormat, "text/plain" );
|
|
|
110 |
|
|
|
111 |
_LIT8( KNSmlDMFotaRunTimeChildren,
|
|
|
112 |
"PkgName/PkgVersion/Download/DownloadAndUpdate/State" );
|
|
|
113 |
|
|
|
114 |
// uri related
|
|
|
115 |
_LIT8( KNSmlDMFotaSeparatorDes, "/" );
|
|
|
116 |
_LIT8( KNSmlDMFotaRuntimeMatch, "*FUMO/*" );
|
|
|
117 |
_LIT8( KNSmlDMFotaRootMatch, "*FUMO" );
|
|
|
118 |
|
|
|
119 |
|
|
|
120 |
/**
|
|
|
121 |
* CNSmlDmFotaAdapter, the main adapter class of Fota. Provides methods
|
|
|
122 |
* to access and modify FUMO objects.
|
|
|
123 |
*
|
|
|
124 |
* @lib nsmldmfotaadapter.lib
|
|
|
125 |
*
|
|
|
126 |
*/
|
|
|
127 |
class CNSmlDmFotaAdapter : public CSmlDmAdapter
|
|
|
128 |
{
|
|
|
129 |
|
|
|
130 |
public:
|
|
|
131 |
|
|
|
132 |
/**
|
|
|
133 |
* Two-phased constructor.
|
|
|
134 |
* @param aDmCallback A pointer to DM Callback, which is used to
|
|
|
135 |
* set statuses and results of commands.
|
|
|
136 |
* @return A pointer to the newly created adapter.
|
|
|
137 |
*/
|
|
|
138 |
static CNSmlDmFotaAdapter* NewL( MSmlDmCallback* aDmCallback );
|
|
|
139 |
|
|
|
140 |
/**
|
|
|
141 |
* Two-phased constructor. Pushes the pointer onto the CleanupStack.
|
|
|
142 |
* @param aDmCallback A pointer to DM Callback, which is used to
|
|
|
143 |
* set statuses and results of commands.
|
|
|
144 |
* @return A pointer to the newly created adapter.
|
|
|
145 |
*/
|
|
|
146 |
static CNSmlDmFotaAdapter* NewLC( MSmlDmCallback* aDmCallback );
|
|
|
147 |
|
|
|
148 |
/**
|
|
|
149 |
* Destructor.
|
|
|
150 |
*/
|
|
|
151 |
virtual ~CNSmlDmFotaAdapter();
|
|
|
152 |
|
|
|
153 |
public:
|
|
|
154 |
|
|
|
155 |
// from CSmlDmAdapter
|
|
|
156 |
|
|
|
157 |
/**
|
|
|
158 |
* Sets current version of Fota adapter's DDF structure to aDDFVersion.
|
|
|
159 |
* @param aVersion Buffer which on return contains the version.
|
|
|
160 |
*/
|
|
|
161 |
void DDFVersionL( CBufBase& aDDFVersion );
|
|
|
162 |
|
|
|
163 |
/**
|
|
|
164 |
* Fills the DDF structure of firmware management object using the given
|
|
|
165 |
* reference as the root of DDF. Also checks if there are any Generic
|
|
|
166 |
* Alerts to be sent to current remote DM server. If there are, delegates
|
|
|
167 |
* the alerts to SOS Server using Private API.
|
|
|
168 |
* @param aDDFObject Reference to root DDF node.
|
|
|
169 |
*/
|
|
|
170 |
void DDFStructureL( MSmlDmDDFObject& aDDF );
|
|
|
171 |
|
|
|
172 |
/**
|
|
|
173 |
* Updates a leaf object in FUMO. Sets ENotFound as status to DM Framework,
|
|
|
174 |
* if aURI and/or aLUID is not valid.
|
|
|
175 |
* @param aURI Uri which spesifies the leaf to be updated in a firmware
|
|
|
176 |
* object.
|
|
|
177 |
* @param aLUID Identifier used to identify in which firmware object
|
|
|
178 |
* the leaf should be updated.
|
|
|
179 |
* @param aObject Data used in the update.
|
|
|
180 |
* @param aType Mime type of the data. Ignored in Fota adapter.
|
|
|
181 |
* @param aStatusRef Identifier that is used when setting the completion
|
|
|
182 |
* status to DM Framework.
|
|
|
183 |
*/
|
|
|
184 |
void UpdateLeafObjectL( const TDesC8& aURI,
|
|
|
185 |
const TDesC8& aLUID,
|
|
|
186 |
const TDesC8& aObject,
|
|
|
187 |
const TDesC8& aType,
|
|
|
188 |
TInt aStatusRef );
|
|
|
189 |
|
|
|
190 |
/**
|
|
|
191 |
* Deletes a firmware object from Fota DB. If aURI does not point to a
|
|
|
192 |
* runtime node and/or aLUIDis invalid, ENotFound is set as status for
|
|
|
193 |
* this command.
|
|
|
194 |
* @param aURI Uri which spesifies a firmware object.
|
|
|
195 |
* @param aLUID Identifier used to identify in which firmware object
|
|
|
196 |
* should be deleted.
|
|
|
197 |
* @param aStatusRef Identifier that is used when setting the completion
|
|
|
198 |
* status to DM Framework.
|
|
|
199 |
*/
|
|
|
200 |
void DeleteObjectL( const TDesC8& aURI,
|
|
|
201 |
const TDesC8& aLUID,
|
|
|
202 |
const TInt aStatusRef );
|
|
|
203 |
|
|
|
204 |
/**
|
|
|
205 |
* Fetches a leaf object in FUMO. Sets ENotFound as status to DM Framework,
|
|
|
206 |
* if aURI and/or aLUID is not valid.
|
|
|
207 |
* @param aURI Uri which spesifies the leaf to be fetched.
|
|
|
208 |
* @param aLUID Identifier used to identify from which firmware object the
|
|
|
209 |
* leaf should be fetched.
|
|
|
210 |
* @param aType Mime type that server wishes to be used in the returned data.
|
|
|
211 |
* Ignored in Fota adapter (but used when setting the result).
|
|
|
212 |
* @param aResultRef Identifier that is used when setting the result
|
|
|
213 |
* (fetched data) to DM Framework.
|
|
|
214 |
* @param aStatusRef Identifier that is used when setting the completion
|
|
|
215 |
* status to DM Framework.
|
|
|
216 |
*/
|
|
|
217 |
void FetchLeafObjectL( const TDesC8& aURI,
|
|
|
218 |
const TDesC8& aLUID,
|
|
|
219 |
const TDesC8& aType,
|
|
|
220 |
const TInt aResultsRef,
|
|
|
221 |
const TInt aStatusRef );
|
|
|
222 |
|
|
|
223 |
/**
|
|
|
224 |
* Forms a list of children of given node (aURI) and sets the list to
|
|
|
225 |
* DM Framework as result.
|
|
|
226 |
* @param aURI Uri which spesifies the node whose children should be
|
|
|
227 |
* listed. In Fota this should point to either to the ./FUMO or ./FUMO/<x>.
|
|
|
228 |
* In the first case aPreviousURISegmentList is trusted and the list is
|
|
|
229 |
* formed entirely based on it. In the latter case, a hard coded list of
|
|
|
230 |
* run time node's children is returned.
|
|
|
231 |
* @param aLUID Identifier of aURI. Ignored in Fota adapter.
|
|
|
232 |
* @param aPreviousURISegmentList A List of aURI's children formed by
|
|
|
233 |
* DM Framework.
|
|
|
234 |
* @param aResultRef Identifier that is used when setting the result
|
|
|
235 |
* (fetched data) to DM Framework.
|
|
|
236 |
* @param aStatusRef Identifier that is used when setting the completion
|
|
|
237 |
* status to DM Framework.
|
|
|
238 |
*/
|
|
|
239 |
void ChildURIListL( const TDesC8& aURI,
|
|
|
240 |
const TDesC8& aLUID,
|
|
|
241 |
const CArrayFix<TSmlDmMappingInfo>& aPreviousURISegmentList,
|
|
|
242 |
const TInt aResultsRef,
|
|
|
243 |
const TInt aStatusRef );
|
|
|
244 |
|
|
|
245 |
/**
|
|
|
246 |
* Adds a firmware object to Fota DB. If aURI does not point to a runtime
|
|
|
247 |
* node and/or aLUID is invalid, ENotFound is set as status for this
|
|
|
248 |
* command.
|
|
|
249 |
* @param aURI Uri which spesifies the firmware object.
|
|
|
250 |
* @param aParentLUID Identifier of aURI. If this is a valid ID, then
|
|
|
251 |
* the object has already been added and EAlreadyExists is set as status
|
|
|
252 |
* for this command.
|
|
|
253 |
* @param aStatusRef Identifier that is used when setting the completion
|
|
|
254 |
* status to DM Framework.
|
|
|
255 |
*/
|
|
|
256 |
void AddNodeObjectL( const TDesC8& aURI,
|
|
|
257 |
const TDesC8& aParentLUID,
|
|
|
258 |
const TInt aStatusRef );
|
|
|
259 |
|
|
|
260 |
/**
|
|
|
261 |
* This method is used to update PkgData, which is the only large object
|
|
|
262 |
* data in FUMO. Adapter opens a stream to a data (using Fota Engine)
|
|
|
263 |
* and sets this stream to aStream after which this method returns. DM Host
|
|
|
264 |
* Server then writes the data to the stream piece by piece and finally
|
|
|
265 |
* calls StreamCommittedL() when all data is written.
|
|
|
266 |
* @param aURI Uri which spesifies the leaf to be updated in a firmware
|
|
|
267 |
* object. If this does not point to ./FUMO/<x>/Update/PkgData, ENotFound
|
|
|
268 |
* is set as status for this command.
|
|
|
269 |
* @param aLUID Identifier used to identify in which firmware object the
|
|
|
270 |
* data should be updated.
|
|
|
271 |
* @param aStream Pointer to a stream, where the opened stream is set.
|
|
|
272 |
* @param aType Mime type of the data. Ignored in Fota adapter.
|
|
|
273 |
* @param aStatusRef Identifier that is used when setting the completion
|
|
|
274 |
* status to DM Framework.
|
|
|
275 |
*/
|
|
|
276 |
void UpdateLeafObjectL( const TDesC8& aURI,
|
|
|
277 |
const TDesC8& aLUID,
|
|
|
278 |
RWriteStream*& aStream,
|
|
|
279 |
const TDesC8& aType,
|
|
|
280 |
const TInt aStatusRef );
|
|
|
281 |
|
|
|
282 |
/**
|
|
|
283 |
* Fetches the size of leaf object's data in bytes. Sets ENotFound as
|
|
|
284 |
* status to DM Framework, if aURI and/or aLUID is not valid.
|
|
|
285 |
* @param aURI Uri which spesifies the leaf whose data is measured.
|
|
|
286 |
* @param aLUID Identifier used to identify from which firmware object
|
|
|
287 |
* the leaf size should be counted.
|
|
|
288 |
* @param aType Mime type that server wishes to be used in the returned
|
|
|
289 |
* data. Ignored in Fota adapter (but used when setting the result)
|
|
|
290 |
* @param aResultRef Identifier that is used when setting the result
|
|
|
291 |
* (fetched data) to DM Framework.
|
|
|
292 |
* @param aStatusRef Identifier that is used when setting the completion
|
|
|
293 |
* status to DM Framework.
|
|
|
294 |
*/
|
|
|
295 |
void FetchLeafObjectSizeL( const TDesC8& aURI,
|
|
|
296 |
const TDesC8& aLUID,
|
|
|
297 |
const TDesC8& aType,
|
|
|
298 |
const TInt aResultsRef,
|
|
|
299 |
const TInt aStatusRef );
|
|
|
300 |
|
|
|
301 |
/**
|
|
|
302 |
* Executes command targeting Download, DownloadAndUpdate or Update. In any
|
|
|
303 |
* other case, ENotFound is set as status for this command. Saves all
|
|
|
304 |
* the data needed when reporting the final result of this command in
|
|
|
305 |
* the beginning of next DM session, fetches needed data for the command
|
|
|
306 |
* and delegates the command to Fota Engine.
|
|
|
307 |
* @param aURI Uri which spesifies the target node for the exec command.
|
|
|
308 |
* @param aLUID Identifier used to identify the firmware object where the
|
|
|
309 |
* target node lies.
|
|
|
310 |
* @param aArgument The argument data of the exec command. In Fota this is
|
|
|
311 |
* an overloaded feature, and this parameter contains the Correlator of
|
|
|
312 |
* the exec command.
|
|
|
313 |
* @param aType Mime type of aArgument. Ignored in Fota adapter.
|
|
|
314 |
* @param aStatusRef Identifier that is used when setting the completion
|
|
|
315 |
* status to DM Framework.
|
|
|
316 |
*/
|
|
|
317 |
void ExecuteCommandL( const TDesC8& aURI,
|
|
|
318 |
const TDesC8& aLUID,
|
|
|
319 |
const TDesC8& aArgument,
|
|
|
320 |
const TDesC8& aType,
|
|
|
321 |
const TInt aStatusRef );
|
|
|
322 |
|
|
|
323 |
/**
|
|
|
324 |
* Not supported.
|
|
|
325 |
*/
|
|
|
326 |
void ExecuteCommandL( const TDesC8& aURI,
|
|
|
327 |
const TDesC8& aLUID,
|
|
|
328 |
RWriteStream*& aStream,
|
|
|
329 |
const TDesC8& aType,
|
|
|
330 |
const TInt aStatusRef );
|
|
|
331 |
|
|
|
332 |
/**
|
|
|
333 |
* Not supported.
|
|
|
334 |
*/
|
|
|
335 |
void CopyCommandL( const TDesC8& aTargetURI,
|
|
|
336 |
const TDesC8& aTargetLUID,
|
|
|
337 |
const TDesC8& aSourceURI,
|
|
|
338 |
const TDesC8& aSourceLUID,
|
|
|
339 |
const TDesC8& aType,
|
|
|
340 |
TInt aStatusRef );
|
|
|
341 |
|
|
|
342 |
/**
|
|
|
343 |
* Not supported.
|
|
|
344 |
*/
|
|
|
345 |
void StartAtomicL();
|
|
|
346 |
|
|
|
347 |
/**
|
|
|
348 |
* Not supported.
|
|
|
349 |
*/
|
|
|
350 |
void CommitAtomicL();
|
|
|
351 |
|
|
|
352 |
/**
|
|
|
353 |
* Not supported.
|
|
|
354 |
*/
|
|
|
355 |
void RollbackAtomicL();
|
|
|
356 |
|
|
|
357 |
/**
|
|
|
358 |
* Returns whether or not streaming is supported in this adapter. In Fota
|
|
|
359 |
* this method is also used to enquire whether or not a large object
|
|
|
360 |
* whose size is given in aItemSize fits to disk (OOD check using Fota
|
|
|
361 |
* Engine), and to acknowledge that Generic Alerts have been successfully
|
|
|
362 |
* sent. If aItemSize is larger that 0, OOD check feature is executed. If
|
|
|
363 |
* aItemSize equals KNSmlDMResetGenAlerts, Generic Alerts are marked sent.
|
|
|
364 |
* Otherwise aItemSize is set to a treshold value, which is used by DM
|
|
|
365 |
* Host Server to determine if streaming should be used (large object)
|
|
|
366 |
* or not.
|
|
|
367 |
* @param aItemSize If this parameter is larger than zero in the beginning,
|
|
|
368 |
* on return it equals KErrNone if the data fits to disk, and KErrNoMemory
|
|
|
369 |
* if not. If in the beginning this param equals KNSmlDMResetGenAlerts,
|
|
|
370 |
* Generic Alerts are marked sent. Otherwise if in the beginning this param
|
|
|
371 |
* is less or equal to zero, on return it equals to the treshold value
|
|
|
372 |
* mentioned above.
|
|
|
373 |
* @return Whether or not streaming is supported in this adapter
|
|
|
374 |
* (ETrue always).
|
|
|
375 |
*/
|
|
|
376 |
TBool StreamingSupport( TInt& aItemSize );
|
|
|
377 |
|
|
|
378 |
/**
|
|
|
379 |
* DM Host Server notifies Fota adapter using this method, when all data
|
|
|
380 |
* has been written to the stream opened for streaming in UpdateLeafObjectL
|
|
|
381 |
* targeting PkgData. Fota adapter forwards this notification to Fota
|
|
|
382 |
* Engine.
|
|
|
383 |
*/
|
|
|
384 |
void StreamCommittedL();
|
|
|
385 |
|
|
|
386 |
/**
|
|
|
387 |
* Not supported.
|
|
|
388 |
*/
|
|
|
389 |
void CompleteOutstandingCmdsL();
|
|
|
390 |
|
|
|
391 |
private:
|
|
|
392 |
|
|
|
393 |
/**
|
|
|
394 |
* Check if fota table exists
|
|
|
395 |
* @param aLUID ID of the node
|
|
|
396 |
* @return whether table exists
|
|
|
397 |
*/
|
|
|
398 |
TBool TableExistsL(const TDesC8& aLUID) const;
|
|
|
399 |
|
|
|
400 |
/**
|
|
|
401 |
* Default constructor.
|
|
|
402 |
* @param aEcomArguments A pointer to MSmlDmCallback which is received
|
|
|
403 |
* through ECom. The pointer is passed on to base class.
|
|
|
404 |
*/
|
|
|
405 |
CNSmlDmFotaAdapter( TAny* aEcomArguments );
|
|
|
406 |
|
|
|
407 |
/**
|
|
|
408 |
* Second phase construction.
|
|
|
409 |
*/
|
|
|
410 |
void ConstructL();
|
|
|
411 |
|
|
|
412 |
/**
|
|
|
413 |
* Fetches the data in firmware object identified by aLUID (object) and
|
|
|
414 |
* aURI (leaf).
|
|
|
415 |
* @param aURI Identifies the leaf whose data should be fetched.
|
|
|
416 |
* @param aLUID Identifies the FW object in which the leaf object is.
|
|
|
417 |
* @param aObject Reference to CBufBase to which the fetched data is
|
|
|
418 |
* written.
|
|
|
419 |
* @return Status code according to the success of the fetch.
|
|
|
420 |
*/
|
|
|
421 |
CSmlDmAdapter::TError DoFetchObjectL( const TDesC8& aURI,
|
|
|
422 |
const TDesC8& aLUID,
|
|
|
423 |
CBufBase& aObject );
|
|
|
424 |
|
|
|
425 |
/**
|
|
|
426 |
* Gets data needed for Update execution from Fota DB and notifies
|
|
|
427 |
* Fota Engine. Note: this method does not wait for Fota Engine to
|
|
|
428 |
* execute the command, but immediately returns when Fota Engine has been
|
|
|
429 |
* notified.
|
|
|
430 |
* @param aLUID The id of the firmware object to which this exec is
|
|
|
431 |
* targeted.
|
|
|
432 |
* @param aProfile The profile id of the currently running DM session.
|
|
|
433 |
* @return Status code according to the success of the method.
|
|
|
434 |
*/
|
|
|
435 |
CSmlDmAdapter::TError DoExecUpdateL( const TNSmlDmFwObjectId aLUID,
|
|
|
436 |
const TSmlProfileId aProfile );
|
|
|
437 |
|
|
|
438 |
/**
|
|
|
439 |
* Gets data needed for Download or DownloadAndUpdate execution from
|
|
|
440 |
* Fota DB and notifies Fota Engine. Note: this method does not wait
|
|
|
441 |
* for Fota Engine to execute the command, but immediately returns when
|
|
|
442 |
* Fota Engine has been notified.
|
|
|
443 |
* @param aLUID The id of the firmware object to which this exec is
|
|
|
444 |
* targeted.
|
|
|
445 |
* @param aProfile The profile id of the currently running DM session.
|
|
|
446 |
* @param aUpdate If set ETrue, executes DownloadAndUpdate. Otherwise
|
|
|
447 |
* executes Download.
|
|
|
448 |
* @return Status code according to the success of the method.
|
|
|
449 |
*/
|
|
|
450 |
CSmlDmAdapter::TError DoExecDownloadL( const TNSmlDmFwObjectId aLUID,
|
|
|
451 |
const TSmlProfileId aProfile,
|
|
|
452 |
TBool aUpdate );
|
|
|
453 |
|
|
|
454 |
/**
|
|
|
455 |
* Saves all the data needed to save before any exec command and returns
|
|
|
456 |
* the id of the profile of currently running DM session.
|
|
|
457 |
* @param aURI Management uri, which is the target of the exec command.
|
|
|
458 |
* @param aLUID Identifies the firm3ware object that is the target of the
|
|
|
459 |
* exec command.
|
|
|
460 |
* @param aCorrelator Correlator received as an argument in the exec
|
|
|
461 |
* command.
|
|
|
462 |
* @return Profile id of the currently running DM session.
|
|
|
463 |
*/
|
|
|
464 |
TSmlProfileId SaveExecInfoL( const TDesC8& aURI,
|
|
|
465 |
const TNSmlDmFwObjectId aLUID,
|
|
|
466 |
const TDesC8& aCorrelator );
|
|
|
467 |
|
|
|
468 |
/**
|
|
|
469 |
* Fetches profile id and server id of the currently running DM session
|
|
|
470 |
* using Client API.
|
|
|
471 |
* @param aProfId Reference which on succesful return contains the
|
|
|
472 |
* profile id.
|
|
|
473 |
* @param aServerId Reference which on successful return contains
|
|
|
474 |
* the server id.
|
|
|
475 |
*/
|
|
|
476 |
void GetServerInfoL( TSmlProfileId& aProfId, HBufC8*& aServerId ) const;
|
|
|
477 |
|
|
|
478 |
/**
|
|
|
479 |
* Checks if there are any firmware objects that have empty final results.
|
|
|
480 |
* If there are, checks if any their final result should be reported to
|
|
|
481 |
* currently running DM session's remote server using Generic Alert.
|
|
|
482 |
* I.e. if the remote server is the same as with any of those firmware
|
|
|
483 |
* object's whose execution's final result has not been reported yet,
|
|
|
484 |
* uses Private API to generate Generic Alert about them.
|
|
|
485 |
*/
|
|
|
486 |
void MakeGenericAlertsL();
|
|
|
487 |
|
|
|
488 |
/***
|
|
|
489 |
* Checks existance of predefined node under FUMO and adds it to
|
|
|
490 |
* DM Tree
|
|
|
491 |
**/
|
|
|
492 |
|
|
|
493 |
void CheckAndAddPredefinedNodeL();
|
|
|
494 |
/***
|
|
|
495 |
* Gets predefined node name to be created under FUMO from cenrep
|
|
|
496 |
*
|
|
|
497 |
**/
|
|
|
498 |
|
|
|
499 |
void GetPredefinedNodeL(TDes8& aNode);
|
|
|
500 |
/**
|
|
|
501 |
* Sets final result to all those FW objects that are associated with
|
|
|
502 |
* current DM session's remote server, have been a target to an exec
|
|
|
503 |
* command and that exec command has been finished. I.e. Generic Alert
|
|
|
504 |
* has been successfully sent reporting these final results, and is not
|
|
|
505 |
* needed to be sent anymore in next DM session.
|
|
|
506 |
*/
|
|
|
507 |
void MarkGenericAlertsSentL();
|
|
|
508 |
|
|
|
509 |
/**
|
|
|
510 |
* Returns correct meta/type acoording to the execution target aURI.
|
|
|
511 |
* @param aURI The target for exec command, e.g. ./FUMO/<X>/Update
|
|
|
512 |
* @return The meta/type
|
|
|
513 |
*/
|
|
|
514 |
TPtrC8 GetMetaType( const TDesC8& aURI ) const;
|
|
|
515 |
|
|
|
516 |
/**
|
|
|
517 |
* Maps a system wide error code to a TError.
|
|
|
518 |
* @param aError A system wide error code.
|
|
|
519 |
* @return A TError value depending on aError.
|
|
|
520 |
*/
|
|
|
521 |
CSmlDmAdapter::TError MapErrorToStatus( TInt aError ) const;
|
|
|
522 |
|
|
|
523 |
/**
|
|
|
524 |
* Parses a numeric value from aLUID.
|
|
|
525 |
* @param aLUID A string representation of a signed integer.
|
|
|
526 |
* @return TInt value.
|
|
|
527 |
*/
|
|
|
528 |
TInt DesToInt( const TDesC8& aLUID ) const;
|
|
|
529 |
|
|
|
530 |
/**
|
|
|
531 |
* Return the last uri segment of the given uri. E.g. in
|
|
|
532 |
* ./FUMO/<x>/Download last uri segment is "Download"
|
|
|
533 |
* @param aURI the uri to be parsed.
|
|
|
534 |
* @return The last segment.
|
|
|
535 |
*/
|
|
|
536 |
TPtrC8 LastURISeg( const TDesC8& aURI ) const;
|
|
|
537 |
|
|
|
538 |
/**
|
|
|
539 |
* Fills the given information to a DDF Object node.
|
|
|
540 |
* @param aNode The node whose data is filled.
|
|
|
541 |
* @param aAccTypes The access types of the node.
|
|
|
542 |
* @param aOccurance Occurance of the node.
|
|
|
543 |
* @param aScope The scope of the node.
|
|
|
544 |
* @param aFormat The format of the node's data, i.e. node/chr/bin/...
|
|
|
545 |
* @param aDescription Informal description of the node.
|
|
|
546 |
*/
|
|
|
547 |
void FillNodeInfoL( MSmlDmDDFObject& aNode,
|
|
|
548 |
const TSmlDmAccessTypes& aAccTypes,
|
|
|
549 |
MSmlDmDDFObject::TOccurence aOccurrence,
|
|
|
550 |
MSmlDmDDFObject::TScope aScope,
|
|
|
551 |
MSmlDmDDFObject::TDFFormat aFormat,
|
|
|
552 |
const TDesC8& aDescription ) const;
|
|
|
553 |
|
|
|
554 |
RFotaEngineSession& FotaEngineL();
|
|
|
555 |
|
|
|
556 |
private:
|
|
|
557 |
|
|
|
558 |
CNSmlDmFotaAdapterDb* iFotaDb;
|
|
|
559 |
RFotaEngineSession iFotaEngine;
|
|
|
560 |
|
|
|
561 |
TInt iPkgId;
|
|
|
562 |
|
|
|
563 |
};
|
|
|
564 |
|
|
|
565 |
#endif // __NSMLDMFOTAADAPTER_H__
|