Skip to content

Commit

Permalink
add ota cluster on window-app
Browse files Browse the repository at this point in the history
  • Loading branch information
seb-fae committed Apr 5, 2022
1 parent e92157a commit 1017456
Show file tree
Hide file tree
Showing 9 changed files with 1,773 additions and 1,348 deletions.
136 changes: 136 additions & 0 deletions examples/window-app/common/window-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,140 @@ server cluster NetworkCommissioning = 49 {
command ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8;
}

client cluster OtaSoftwareUpdateProvider = 41 {
enum OTAApplyUpdateAction : ENUM8 {
kProceed = 0;
kAwaitNextAction = 1;
kDiscontinue = 2;
}

enum OTADownloadProtocol : ENUM8 {
kBDXSynchronous = 0;
kBDXAsynchronous = 1;
kHttps = 2;
kVendorSpecific = 3;
}

enum OTAQueryStatus : ENUM8 {
kUpdateAvailable = 0;
kBusy = 1;
kNotAvailable = 2;
kDownloadProtocolNotSupported = 3;
}

readonly global attribute int16u clusterRevision = 65533;

request struct QueryImageRequest {
vendor_id vendorId = 0;
INT16U productId = 1;
INT32U softwareVersion = 2;
OTADownloadProtocol protocolsSupported[] = 3;
optional INT16U hardwareVersion = 4;
optional CHAR_STRING location = 5;
optional BOOLEAN requestorCanConsent = 6;
optional OCTET_STRING metadataForProvider = 7;
}

request struct ApplyUpdateRequestRequest {
OCTET_STRING updateToken = 0;
INT32U newVersion = 1;
}

request struct NotifyUpdateAppliedRequest {
OCTET_STRING updateToken = 0;
INT32U softwareVersion = 1;
}

response struct QueryImageResponse {
OTAQueryStatus status = 0;
optional INT32U delayedActionTime = 1;
optional CHAR_STRING imageURI = 2;
optional INT32U softwareVersion = 3;
optional CHAR_STRING softwareVersionString = 4;
optional OCTET_STRING updateToken = 5;
optional BOOLEAN userConsentNeeded = 6;
optional OCTET_STRING metadataForRequestor = 7;
}

response struct ApplyUpdateResponse {
OTAApplyUpdateAction action = 0;
INT32U delayedActionTime = 1;
}

command QueryImage(QueryImageRequest): QueryImageResponse = 0;
command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2;
command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4;
}

server cluster OtaSoftwareUpdateRequestor = 42 {
enum OTAAnnouncementReason : ENUM8 {
kSimpleAnnouncement = 0;
kUpdateAvailable = 1;
kUrgentUpdateAvailable = 2;
}

enum OTAChangeReasonEnum : ENUM8 {
kUnknown = 0;
kSuccess = 1;
kFailure = 2;
kTimeOut = 3;
kDelayByProvider = 4;
}

enum OTAUpdateStateEnum : ENUM8 {
kUnknown = 0;
kIdle = 1;
kQuerying = 2;
kDelayedOnQuery = 3;
kDownloading = 4;
kApplying = 5;
kDelayedOnApply = 6;
kRollingBack = 7;
kDelayedOnUserConsent = 8;
}

struct ProviderLocation {
node_id providerNodeID = 1;
endpoint_no endpoint = 2;
fabric_idx fabricIndex = 254;
}

info event StateTransition = 0 {
OTAUpdateStateEnum previousState = 0;
OTAUpdateStateEnum newState = 1;
OTAChangeReasonEnum reason = 2;
nullable INT32U targetSoftwareVersion = 3;
}

critical event VersionApplied = 1 {
INT32U softwareVersion = 0;
INT16U productID = 1;
}

info event DownloadError = 2 {
INT32U softwareVersion = 0;
INT64U bytesDownloaded = 1;
nullable INT8U progressPercent = 2;
nullable INT64S platformCode = 3;
}

attribute ProviderLocation defaultOtaProviders[] = 0;
readonly attribute boolean updatePossible = 1;
readonly attribute OTAUpdateStateEnum updateState = 2;
readonly attribute nullable int8u updateStateProgress = 3;
readonly global attribute int16u clusterRevision = 65533;

request struct AnnounceOtaProviderRequest {
node_id providerNodeId = 0;
vendor_id vendorId = 1;
OTAAnnouncementReason announcementReason = 2;
optional OCTET_STRING metadataForNode = 3;
endpoint_no endpoint = 4;
}

command AnnounceOtaProvider(AnnounceOtaProviderRequest): DefaultSuccess = 0;
}

server cluster OperationalCredentials = 62 {
enum OperationalCertStatus : ENUM8 {
kSuccess = 0;
Expand Down Expand Up @@ -1191,6 +1325,8 @@ endpoint 0 {
server cluster GroupKeyManagement;
server cluster LocalizationConfiguration;
server cluster NetworkCommissioning;
binding cluster OtaSoftwareUpdateProvider;
server cluster OtaSoftwareUpdateRequestor;
server cluster OperationalCredentials;
server cluster PowerSource;
server cluster SoftwareDiagnostics;
Expand Down
Loading

0 comments on commit 1017456

Please sign in to comment.