RFotaEngineSession Class Reference

class RFotaEngineSession : public RAknAppServiceBase
A client handle to a FOTA engine session. fotaengine.lib
Since
Series 60 3.1
Public Member Functions
RFotaEngineSession()
IMPORT_C voidClose()
IMPORT_C TIntCurrentVersion(TDes &)
IMPORT_C TIntDeleteUpdatePackage(const TInt)
IMPORT_C TIntDownload(const TInt, const TDesC8 &, const TSmlProfileId, const TDesC8 &, const TDesC8 &)
IMPORT_C TIntDownloadAndUpdate(const TInt, const TDesC8 &, const TSmlProfileId, const TDesC8 &, const TDesC8 &)
IMPORT_C voidGenericAlertSentL(const TInt)
IMPORT_C TIntGetDownloadUpdatePackageSize(const TInt, TInt &, TInt &)
IMPORT_C TIntGetResult(const TInt)
IMPORT_C TStateGetState(const TInt)
IMPORT_C TIntGetUpdatePackageIds(TDes16 &)
IMPORT_C TBoolIsPackageStoreSizeAvailable(const TInt)
IMPORT_C TIntLastUpdate(TTime &)
IMPORT_C voidOpenL()
IMPORT_C TIntOpenUpdatePackageStore(const TInt, RWriteStream *&)
IMPORT_C TIntScheduledUpdateL(TFotaScheduledUpdate)
IMPORT_C TIntTryResumeDownload()
IMPORT_C TIntUpdate(const TInt, const TSmlProfileId, const TDesC8 &, const TDesC8 &)
IMPORT_C voidUpdatePackageDownloadComplete(const TInt)
IMPORT_C TVersionVersion()
Private Member Functions
voidConnectToServerL(const TUid &, const TUid &)
IMPORT_C voidExtensionInterface(TUid, TAny *&)
TInt ReleaseChunkHandle()
voidSendChunkL(const TUint8 *, const TUint8 *)
TUid ServiceUid()
voidStartApplicationL(const TUid &, const TUid &)
Inherited Functions
RAknAppServiceBase::ConnectChainedAppL(TUid)
RApaAppServiceBase::CancelNotifyServerExit()const
RApaAppServiceBase::ConnectExistingAppL(const RApaAppServiceBase &)
RApaAppServiceBase::ConnectExistingAppL(const RApaAppServiceBase &,const TSecurityPolicy &)
RApaAppServiceBase::ConnectExistingByNameL(const TDesC &)
RApaAppServiceBase::ConnectExistingByNameL(const TDesC &,const TSecurityPolicy &)
RApaAppServiceBase::NotifyServerExit(TRequestStatus &)const
RApaAppServiceBase::RApaAppServiceBase()
RApaAppServiceBase::ServerName()const
RApaAppServiceBase::TransferExistingSessionL(RApaAppServiceBase &)
REikAppServiceBase::ConnectNewAppL(TUid)
REikAppServiceBase::ConnectNewAppL(TUid,const TSecurityPolicy &)
REikAppServiceBase::ConnectNewChildAppL(TUid,RWindowGroup &)
REikAppServiceBase::ConnectNewChildAppL(TUid,RWindowGroup &,const TSecurityPolicy &)
RHandleBase::Attributes()const
RHandleBase::BTraceId()const
RHandleBase::DoExtendedClose()
RHandleBase::Duplicate(const RThread &,TOwnerType)
RHandleBase::FullName()const
RHandleBase::FullName(TDes &)const
RHandleBase::Handle()const
RHandleBase::HandleInfo(THandleInfo *)
RHandleBase::Name()const
RHandleBase::NotifyDestruction(TRequestStatus &)
RHandleBase::Open(const TFindHandleBase &,TOwnerType)
RHandleBase::OpenByName(const TDesC &,TOwnerType,TInt)
RHandleBase::RHandleBase()
RHandleBase::RHandleBase(TInt)
RHandleBase::SetHandle(TInt)
RHandleBase::SetHandleNC(TInt)
RSessionBase::CreateSession(RServer2,const TVersion &)
RSessionBase::CreateSession(RServer2,const TVersion &,TInt)
RSessionBase::CreateSession(RServer2,const TVersion &,TInt,TIpcSessionType,const TSecurityPolicy *,TRequestStatus *)
RSessionBase::CreateSession(const TDesC &,const TVersion &)
RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt)
RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt,TIpcSessionType,const TSecurityPolicy *,TRequestStatus *)
RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt,TRequestStatus *)
RSessionBase::Open(RMessagePtr2,TInt,TOwnerType)
RSessionBase::Open(RMessagePtr2,TInt,const TSecurityPolicy &,TOwnerType)
RSessionBase::Open(TInt,TOwnerType)
RSessionBase::Open(TInt,const TSecurityPolicy &,TOwnerType)
RSessionBase::Send(TInt)const
RSessionBase::Send(TInt,const TIpcArgs &)const
RSessionBase::SendReceive(TInt)const
RSessionBase::SendReceive(TInt,TRequestStatus &)const
RSessionBase::SendReceive(TInt,const TIpcArgs &)const
RSessionBase::SendReceive(TInt,const TIpcArgs &,TRequestStatus &)const
RSessionBase::SetReturnedHandle(TInt)
RSessionBase::SetReturnedHandle(TInt,RHandleBase &)
RSessionBase::SetReturnedHandle(TInt,const TSecurityPolicy &)
RSessionBase::ShareAuto()
RSessionBase::ShareProtected()
Public Member Enumerations
enumTResult {
EResSuccessful = 200, EResUserCancelled = 401, EResCorruptedFWUPD = 402, EResPackageMismatch = 403, EResFailedSignatureAuthentication = 404, EResUndefinedError = 409, EResUpdateFailed = 410, EResMalformedOrBadURL = 411, EResAlternateDLServerUnavailable = 412, EResDLFailDueToDeviceOOM = 501, EResDLFailDueToNWIssues = 503
}
enumTState {
EIdle = 10, EClientRequest = 5, EStartingDownload = 15, EDownloadFailed = 20, EDownloadProgressingWithResume = 25, EDownloadProgressing = 30, EDownloadComplete = 40, EStartingUpdate = 50, EUpdateProgressing = 60, EUpdateFailed = 70, EUpdateFailedNoData = 80, EUpdateSuccessful = 90, EUpdateSuccessfulNoData = 100
}
Inherited Enumerations
RApaAppServiceBase:TApaAppServiceBaseCmdConstants
RHandleBase:TAttributes
RSessionBase:TAttachMode
Private Attributes
RChunk iChunk
TInt iGenericAlertSentPkgID
RFotaWriteStream *iStream
Inherited Attributes
RHandleBase::iHandle

Constructor & Destructor Documentation

RFotaEngineSession()

IMPORT_CRFotaEngineSession()

Member Functions Documentation

Close()

IMPORT_C voidClose()

Closes session to Fota Engine

Since
Series 60 3.1

ConnectToServerL(const TUid &, const TUid &)

voidConnectToServerL(const TUid &aNameUid,
const TUid &aAppServerUid
)[private]

Connects to running fotaserver instance

Since
Series 60 3.1

Parameters

const TUid & aNameUidDifferentiator.
const TUid & aAppServerUidFotaServer app uid

CurrentVersion(TDes &)

IMPORT_C TIntCurrentVersion(TDes &aSWVersion)

Tells device FW version

Since
Series 60 3.1

Parameters

TDes & aSWVersionOn return, contains FW version of device.

DeleteUpdatePackage(const TInt)

IMPORT_C TIntDeleteUpdatePackage(const TIntaPkgId)

Called when DM server deletes firmware update management object from device's management tree. I.e. Delete to mgmt URI ./FUMO/<x>. If FOTA Engine has not yet deleted specified update package, then it should do so.

Since
Series 60 3.1

Parameters

const TInt aPkgIdUnique identifier of the update package.

Download(const TInt, const TDesC8 &, const TSmlProfileId, const TDesC8 &, const TDesC8 &)

IMPORT_C TIntDownload(const TIntaPkgId,
const TDesC8 &aPkgURL,
const TSmlProfileIdaProfileId,
const TDesC8 &aPkgName,
const TDesC8 &aPkgVersion
)

Called when DM server calls execute command to Firmware update object URI ./FUMO/<x>/Download Initiates a firmware download for the specified update package.

Since
Series 60 3.1

Parameters

const TInt aPkgIdUnique identifier of the update package. Mapped to Mgmt URI ./FUMO/<x> in DM Framework
const TDesC8 & aPkgURLContains the URL where the firmware update package or download descriptor is located. This URL is used for alternative download mechanism such as Descriptor Based Download. Mgmt URI ./FUMO/<x>/Download/PkgURL
const TSmlProfileId aProfileIdProfileId of the DM server that send the execute command
const TDesC8 & aPkgNameName associated with the firmware update package, may be empty Mgmt URI ./FUMO/<x>/PkgName
const TDesC8 & aPkgVersionVersion information for the firmware update package, may be empty. Mgmt URI./FUMO/<x>/PkgVersion

DownloadAndUpdate(const TInt, const TDesC8 &, const TSmlProfileId, const TDesC8 &, const TDesC8 &)

IMPORT_C TIntDownloadAndUpdate(const TIntaPkgId,
const TDesC8 &aPkgURL,
const TSmlProfileIdaProfileId,
const TDesC8 &aPkgName,
const TDesC8 &aPkgVersion
)

Called when DM server calls execute command to Firmware update object URI ./FUMO/<x>/DownloadAndUpdate Initiates a firmware download and an immediate update for the specified update package.

Since
Series 60 3.1

Parameters

const TInt aPkgIdUnique identifier of the update package. Mapped to Mgmt URI ./FUMO/<x> in DM Framework
const TDesC8 & aPkgURLContains the URL where the firmware update package or download descriptor is located. This URL is used for alternative download mechanism such as Descriptor Based Download. Mgmt URI ./FUMO/<x>/DownloadAndUpdate/PkgURL
const TSmlProfileId aProfileIdProfileId of the DM server that send the execute command
const TDesC8 & aPkgNameName associated with the firmware update package, may be empty. Mgmt URI ./FUMO/<x>/PkgName
const TDesC8 & aPkgVersionVersion information for the firmware update package, may be empty. Mgmt URI./FUMO/<x>/PkgVersion

ExtensionInterface(TUid, TAny *&)

IMPORT_C voidExtensionInterface(TUidaInterfaceId,
TAny *&aImplementation
)[private, virtual]

Parameters

TUid aInterfaceId
TAny *& aImplementation

GenericAlertSentL(const TInt)

IMPORT_C voidGenericAlertSentL(const TIntaPackageID)

Tells fotaserver that generic alert for package is sent. When fotaengine session is closed, cleanup for package is done.

Since
Series 60 3.1

Parameters

const TInt aPackageID

GetDownloadUpdatePackageSize(const TInt, TInt &, TInt &)

IMPORT_C TIntGetDownloadUpdatePackageSize(const TIntaPkgId,
TInt &aDownloadedSize,
TInt &aTotalSize
)
Gets the downloaded and full size of the update package. Called by Download Manager during resume operation to know the size of partially downloaded package.
Since
Series 60 3.2.2

Parameters

const TInt aPkgIdUnique identifier of the update package.
TInt & aDownloadedSizeOn return, size of the downloaded package in bytes
TInt & aTotalSizeOn return, full size of the download package in bytes

GetResult(const TInt)

IMPORT_C TIntGetResult(const TIntaPkgId)

Called when caller wants to enquire Final Result Code of specified firmware update operation. If the update operation is not yet reached final stage, then -1 should be returned to the caller. Possible Final Result Codes are specified in OMA FUMO Specification. Note that Download operation also ends to final result code e.g. 202 - Successful Download.

Since
Series 60 3.1

Parameters

const TInt aPkgIdUnique identifier of the update package.

GetState(const TInt)

IMPORT_C TStateGetState(const TIntaPkgId)

Called when caller wants to enquire State of specified firmware update. If the State is unknown to FOTA Engine, then it should return EIdle.

Since
Series 60 3.1

Parameters

const TInt aPkgIdUnique identifier of the update package.

GetUpdatePackageIds(TDes16 &)

IMPORT_C TIntGetUpdatePackageIds(TDes16 &aPackageIdList)

Gets IDs of the present update packages.

Since
Series 60 3.1

Parameters

TDes16 & aPackageIdListOn return, contains array of pkg ids

IsPackageStoreSizeAvailable(const TInt)

IMPORT_C TBoolIsPackageStoreSizeAvailable(const TIntaSize)

Called when DM server is about to start sending new firmware update package using DM Large Object download. This function is used to enquire if there is enough space available for the firmware update package. e.g when DM server is about to start sending new firmware update package using DM Large Object download.

Since
Series 60 3.1

Parameters

const TInt aSizeSize of the firmware update package. Since continuation of interrupted downloads is not supported , this means new update package.

LastUpdate(TTime &)

IMPORT_C TIntLastUpdate(TTime &aUpdate)

Retrieves the timestamp of last succesful update.

Since
Series 60 3.1

Parameters

TTime & aUpdateOn return, contains time of last succesfull update

OpenL()

IMPORT_C voidOpenL()

Opens session to Fota Engine

Since
Series 60 3.1

OpenUpdatePackageStore(const TInt, RWriteStream *&)

IMPORT_C TIntOpenUpdatePackageStore(const TIntaPkgId,
RWriteStream *&aPkgStore
)

Opens stream to update package storage. Call UpdatePackageDownloadComplete when package is completely written.

Since
Series 60 3.1

Parameters

const TInt aPkgIdUnique identifier of the update package. Download mgr may use value -1.
RWriteStream *& aPkgStoreOn return, open stream in which file may be written to.

ReleaseChunkHandle()

TInt ReleaseChunkHandle()[private]

Signals the server to release chunk handle

Since
Series 60 3.1

ScheduledUpdateL(TFotaScheduledUpdate)

IMPORT_C TIntScheduledUpdateL(TFotaScheduledUpdateaSchedule)

Like Update, but called by scheduler mechanism. Needed package details (profile id etc are already known)

Since
Series 60 3.2

Parameters

TFotaScheduledUpdate aScheduleSchedule data

SendChunkL(const TUint8 *, const TUint8 *)

voidSendChunkL(const TUint8 *aP1,
const TUint8 *aP2
)[private]

Signals the server to read chunk contents

Since
Series 60 3.1

Parameters

const TUint8 * aP1Pointer to beginning of content
const TUint8 * aP2Pointer to end of content

ServiceUid()

TUid ServiceUid()const [private, virtual]

Returns the UID of the service that this session provides an interface for. Client side service implementations must implement this function to return the UID for the service that they implement.

Since
Series 60 3.1

StartApplicationL(const TUid &, const TUid &)

voidStartApplicationL(const TUid &aNameUid,
const TUid &aAppServerUid
)[private]

Starts fotaserver server application.

Since
Series 60 3.1

Parameters

const TUid & aNameUidDifferentiator.
const TUid & aAppServerUidFotaServer app uid

TryResumeDownload()

IMPORT_C TIntTryResumeDownload()
Requests to resume the suspended download of the update package. Called by Fota Monitory Service. for ex, when network is available again.
Since
Series 60 3.2.2

Update(const TInt, const TSmlProfileId, const TDesC8 &, const TDesC8 &)

IMPORT_C TIntUpdate(const TIntaPkgId,
const TSmlProfileIdaProfileId,
const TDesC8 &aPkgName,
const TDesC8 &aPkgVersion
)

Called when DM server calls execute command to Firmware update object URI ./FUMO/<x>/Update Initiates a firmware update for the specified update package. Firmware Update Package should be already downloaded to the device either using DM Large Object or OMA OTA download mechanisms.

Since
Series 60 3.1

Parameters

const TInt aPkgIdUnique identifier of the update package.
const TSmlProfileId aProfileIdProfileId of the DM server that send the execute command
const TDesC8 & aPkgNameName associated with the firmware update package, may be empty. Mgmt URI ./FUMO/<x>/PkgName
const TDesC8 & aPkgVersionVersion information for the firmware update package, may be empty. Mgmt URI./FUMO/<x>/PkgVersion

UpdatePackageDownloadComplete(const TInt)

IMPORT_C voidUpdatePackageDownloadComplete(const TIntaPkgId)

Call this when download of update package is completed. In case of software error or network interruption, this is not called and package store is left empty. When this is called, fotaengine closes the stream and associated storage.

Since
Series 60 3.1

Parameters

const TInt aPkgIdUnique identifier of the update package. Download mgr may use value -1.

Version()

IMPORT_C TVersionVersion()const

Member Enumerations Documentation

Enum TResult

An enumeration of the firmware update result codes as specified in the OMA Firmware Update Management Oobject specification.

Enumerators

EResSuccessful = 200
EResUserCancelled = 401
EResCorruptedFWUPD = 402
EResPackageMismatch = 403
EResFailedSignatureAuthentication = 404
EResUndefinedError = 409
EResUpdateFailed = 410
EResMalformedOrBadURL = 411
EResAlternateDLServerUnavailable = 412
EResDLFailDueToDeviceOOM = 501
EResDLFailDueToNWIssues = 503

Enum TState

An enumeration of the firmware update progress state codes as specified in FUMO spec.

Enumerators

EIdle = 10

No firmware update has been started

EClientRequest = 5

Client has sent a client initiated request

EStartingDownload = 15

There is no data available and download is about to start

EDownloadFailed = 20

Download failed and there is no data received

EDownloadProgressingWithResume = 25

Download is progressing with resume support. This is an internal state and is not a valid FUMO state. Only DM UI and Fota Server can get this state; others get state 30 instead.

EDownloadProgressing = 30

Download is progressing without resume support.

EDownloadComplete = 40

Have data and download has been completed successfully

EStartingUpdate = 50

Have data and about to start update

EUpdateProgressing = 60

Denotes that the update is currently running, but has not yet completed

EUpdateFailed = 70

Have data but update failed

EUpdateFailedNoData = 80

Update failed and data deleted or removed

EUpdateSuccessful = 90

Update complete and data still available

EUpdateSuccessfulNoData = 100

Data deleted or removed after a successful update

Member Data Documentation

RChunk iChunk

RChunk iChunk[private]

Chunk for sending swupd contents to fotaserver

TInt iGenericAlertSentPkgID

TInt iGenericAlertSentPkgID[private]

If not -1 , indicates that generic alert has been sent for this package

RFotaWriteStream * iStream

RFotaWriteStream *iStream[private]

Stream for writing swupd file to chunk