nl::Weave::DeviceLayer::SoftwareUpdateManager

Summary

Inheritance

Direct Known Subclasses:
  nl::Weave::DeviceLayer::SoftwareUpdateManagerImpl
  nl::Weave::DeviceLayer::SoftwareUpdateManagerImpl

Public types

ActionType{
  kAction_Ignore,
  kAction_DownloadNow,
  kAction_DownloadLater,
  kAction_ApplicationManaged
}
enum
When a software update is available, the application can chose one of the following actions as part of the SoftwareUpdateAvailable API event callback.
EventCallback)(void *apAppState, EventType aEvent, const InEventParam &aInParam, OutEventParam &aOutParam) typedef
void(*
EventType{
  kEvent_PrepareQuery,
  kEvent_PrepareQuery_Metadata,
  kEvent_QueryPrepareFailed,
  kEvent_QuerySent,
  kEvent_SoftwareUpdateAvailable,
  kEvent_FetchPartialImageInfo,
  kEvent_ClearImageFromStorage,
  kEvent_StartImageDownload,
  kEvent_StoreImageBlock,
  kEvent_ComputeImageIntegrity,
  kEvent_ReadyToInstall,
  kEvent_StartInstallImage,
  kEvent_Finished,
  kEvent_DefaultCheck = 100
}
enum
RetryPolicyCallback)(void *aAppState, RetryParam &aRetryParam, uint32_t &aOutIntervalMsec) typedef
void(*
State enum

Friend classes

Internal::GenericPlatformManagerImpl
friend class

Public functions

Abort(void)
CheckNow(void)
GetState(void)
State
ImageInstallComplete(WEAVE_ERROR aError)
IsInProgress(void)
bool
SetEventCallback(void *const aAppState, const EventCallback aEventCallback)
SetQueryIntervalWindow(uint32_t aMinWaitTimeMs, uint32_t aMaxWaitTimeMs)
SetRetryPolicyCallback(const RetryPolicyCallback aRetryPolicyCallback)
void

Public static functions

DefaultEventHandler(void *apAppState, EventType aEvent, const InEventParam & aInParam, OutEventParam & aOutParam)
void

Protected functions

SoftwareUpdateManager()=default
SoftwareUpdateManager(const SoftwareUpdateManager &)=delete
SoftwareUpdateManager(const SoftwareUpdateManager &&)=delete
operator=(const SoftwareUpdateManager &)=delete
~SoftwareUpdateManager()=default

Structs

nl::Weave::DeviceLayer::SoftwareUpdateManager::RetryParam

Unions

nl::Weave::DeviceLayer::SoftwareUpdateManager::InEventParam
nl::Weave::DeviceLayer::SoftwareUpdateManager::OutEventParam

Public types

ActionType

 ActionType

When a software update is available, the application can chose one of the following actions as part of the SoftwareUpdateAvailable API event callback.

The default action will be set to kAction_Now.

Properties
kAction_ApplicationManaged

Allows application to manage the rest of the phases of software update such as download, image integrity validation and install.

Software update manager state machine will move to the ApplicationManaged state. Scheduled software update checks (if enabled) will be suspended till application calls Abort or ImageInstallComplete API.

kAction_DownloadLater

Pause download on start.

Scheduled software update checks (if enabled) will be suspended. State machine will remain in Download state. When ready, application can call the resume download API to proceed with download or call Abort to cancel.

kAction_DownloadNow

Start the download right away.

A kEvent_FetchPartialImageInfo API event callback will be generated right after.

kAction_Ignore

Ignore the download completely.

A kEvent_Finished API event callback will be generated with error WEAVE_DEVICE_ERROR_SOFTWARE_UPDATE_CANCELLED if this option is selected and the retry logic will not be invoked.

EventCallback

void(* EventCallback)(void *apAppState, EventType aEvent, const InEventParam &aInParam, OutEventParam &aOutParam)

EventType

 EventType
Properties
kEvent_ClearImageFromStorage

Information event to signal the application to clear a previous partial image download from their storage since a new but different image is available for download.

kEvent_ComputeImageIntegrity

Event to request application to compute image integrity over the downloaded image.

Sent after download is complete.

kEvent_DefaultCheck

Used to verify correct default event handling in the application.

kEvent_FetchPartialImageInfo

Provides an opportunity for the application to disclose information of a partial image previously downloaded so that the download may be continued from the point where it last stopped.

URI of the available software update is provided as an input parameter that the application can use to compare if the image being downloaded is the same as the partial image. Application can set output parameter PartialImageLenInBytes to 0 to indicate non-existence of a partial image for the URI provided as a input parameter.

kEvent_Finished

Generated when a software update check has finished with or without errors.

Parameters included with this event provide the reason for failure if the attempt finished due to a failure.

kEvent_PrepareQuery

Generated when a software update check has been triggered.

Provides an opportunity for the application to supply product related information to the image query.

kEvent_PrepareQuery_Metadata

Provides an opportunity for the application to append additional meta-data to the software update query if needed.

Generated when implementation is ready to get meta-data from the application.

kEvent_QueryPrepareFailed

Generated when the implementation encounters an error while preparing to send out a software update query.

kEvent_QuerySent

Informational event to signal that a software update query has been sent.

kEvent_ReadyToInstall

Informational event to signal that image is ready to be installed.

Sent when image integrity check was successful.

kEvent_SoftwareUpdateAvailable

Generated when a ImageQueryResponse is received in response to a query containing information of the available update.

kEvent_StartImageDownload

Informational event to signal the start of an image download transaction.

kEvent_StartInstallImage

Informational event to signal the start of an image install to the application.

kEvent_StoreImageBlock

Generated whenever a data block is received from the file download server.

Parameters included with this event provide the data and the length of the data.

RetryPolicyCallback

void(* RetryPolicyCallback)(void *aAppState, RetryParam &aRetryParam, uint32_t &aOutIntervalMsec)

State

 State

Friend classes

Internal::GenericPlatformManagerImpl

friend class Internal::GenericPlatformManagerImpl

Public functions

Abort

WEAVE_ERROR Abort(
  void
)

CheckNow

WEAVE_ERROR CheckNow(
  void
)

GetState

State GetState(
  void
)

ImageInstallComplete

WEAVE_ERROR ImageInstallComplete(
  WEAVE_ERROR aError
)

IsInProgress

bool IsInProgress(
  void
)

SetEventCallback

WEAVE_ERROR SetEventCallback(
  void *const aAppState,
  const EventCallback aEventCallback
)

SetQueryIntervalWindow

WEAVE_ERROR SetQueryIntervalWindow(
  uint32_t aMinWaitTimeMs,
  uint32_t aMaxWaitTimeMs
)

SetRetryPolicyCallback

void SetRetryPolicyCallback(
  const RetryPolicyCallback aRetryPolicyCallback
)

Public static functions

DefaultEventHandler

void DefaultEventHandler(
  void *apAppState,
  EventType aEvent,
  const InEventParam & aInParam,
  OutEventParam & aOutParam
)

Protected functions

SoftwareUpdateManager

 SoftwareUpdateManager()=default

SoftwareUpdateManager

 SoftwareUpdateManager(
  const SoftwareUpdateManager &
)=delete

SoftwareUpdateManager

 SoftwareUpdateManager(
  const SoftwareUpdateManager &&
)=delete

operator=

SoftwareUpdateManager & operator=(
  const SoftwareUpdateManager &
)=delete

~SoftwareUpdateManager

 ~SoftwareUpdateManager()=default