Skip to main content

Class UpdateService

The default Meadow implementation of IUpdateService

Assembly: Meadow.dll
View Source
Declaration
public class UpdateService : IUpdateService, ICommandService

Implements:
Meadow.Update.IUpdateService

Properties

State

Gets the current state of the service

View Source
Declaration
public UpdateState State { get; }

Fields

NetworkRetryTimeoutSeconds

Retry period the service will use to attempt network reconnection

View Source
Declaration
public const int NetworkRetryTimeoutSeconds = 15

MaxDownloadRetries

Specifies the maximum number of download attempts before giving up.

View Source
Declaration
public const int MaxDownloadRetries = 10

RetryDelayMilliseconds

Period the service will wait between download attempts in case of failure.

View Source
Declaration
public const int RetryDelayMilliseconds = 1000

TokenExpirationPeriod

Auth token expiration period in minutes. TODO: Replace this hard-coded value with one retrieved from the Meadow Cloud.

View Source
Declaration
public const int TokenExpirationPeriod = 60

Methods

Shutdown()

Stops the service

View Source
Declaration
public void Shutdown()

Start()

Starts the service if it is not already running

View Source
Declaration
public void Start()

ClearUpdates()

Clears all locally stored update package information

View Source
Declaration
public void ClearUpdates()

RetrieveUpdate(UpdateInfo)

Retrieves an update package from the defined update server with the provided parameters

View Source
Declaration
public void RetrieveUpdate(UpdateInfo updateInfo)
Parameters
TypeNameDescription
Meadow.Update.UpdateInfoupdateInfoThe UpdateInfo describing the update to retrieve

ApplyUpdate(UpdateInfo)

Applies an already-retrieved update package with the provided parameters

View Source
Declaration
public void ApplyUpdate(UpdateInfo updateInfo)
Parameters
TypeNameDescription
Meadow.Update.UpdateInfoupdateInfoThe UpdateInfo describing the update to apply

Events

OnStateChanged

Event raised when an the state of the Update service changes

View Source
Declaration
public event EventHandler<UpdateState> OnStateChanged
Event Type

System.EventHandler<Meadow.Update.UpdateState>

OnUpdateAvailable

Event raised when an update is available on the defined Update server

View Source
Declaration
public event UpdateEventHandler OnUpdateAvailable
Event Type

Meadow.Update.UpdateEventHandler

OnUpdateProgress

Event raised with an update on download progress

View Source
Declaration
public event UpdateEventHandler OnUpdateProgress
Event Type

Meadow.Update.UpdateEventHandler

OnUpdateRetrieved

Event raised after an update package has been retrieved from the defined Update server

View Source
Declaration
public event UpdateEventHandler OnUpdateRetrieved
Event Type

Meadow.Update.UpdateEventHandler

OnUpdateSuccess

Event raised after an update package has been successfully applied

View Source
Declaration
public event UpdateEventHandler OnUpdateSuccess
Event Type

Meadow.Update.UpdateEventHandler

OnUpdateFailure

Event raised if a failure occurs in an attempt to apply an update package

View Source
Declaration
public event UpdateEventHandler OnUpdateFailure
Event Type

Meadow.Update.UpdateEventHandler

Implements