Skip to content

Commit

Permalink
Align OTA cluster XML with the specification. (#29459)
Browse files Browse the repository at this point in the history
* Align OTA cluster XML with the specification.

This fixes the enum names to match.

The difference in the ProviderLocation name is being addressed in the spec in
https://github.com/CHIP-Specifications/connectedhomeip-spec/pull/7580

* Auto-update ZAP files.

* Regenerate generated code.

* Address review comment.
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Dec 4, 2023
1 parent 2ed0988 commit 2290520
Show file tree
Hide file tree
Showing 127 changed files with 1,459 additions and 1,233 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1416,7 +1416,7 @@
"<span style=\"color: #7fbf7f; text-decoration-color: #7fbf7f\">│ │ </span><span style=\"font-weight: bold\">&lt;</span><span style=\"color: #ff00ff; text-decoration-color: #ff00ff; font-weight: bold\">class</span><span style=\"color: #000000; text-decoration-color: #000000\"> </span><span style=\"color: #008000; text-decoration-color: #008000\">'chip.clusters.Objects.OtaSoftwareUpdateRequestor'</span><span style=\"font-weight: bold\">&gt;</span>: <span style=\"font-weight: bold\">{</span>\n",
"<span style=\"color: #7fbf7f; text-decoration-color: #7fbf7f\">│ │ │ </span><span style=\"font-weight: bold\">&lt;</span><span style=\"color: #ff00ff; text-decoration-color: #ff00ff; font-weight: bold\">class</span><span style=\"color: #000000; text-decoration-color: #000000\"> </span><span style=\"color: #008000; text-decoration-color: #008000\">'chip.clusters.Objects.OtaSoftwareUpdateRequestor.Attributes.DefaultOTAProviders'</span><span style=\"font-weight: bold\">&gt;</span>: <span style=\"font-weight: bold\">[]</span>,\n",
"<span style=\"color: #7fbf7f; text-decoration-color: #7fbf7f\">│ │ │ </span><span style=\"font-weight: bold\">&lt;</span><span style=\"color: #ff00ff; text-decoration-color: #ff00ff; font-weight: bold\">class</span><span style=\"color: #000000; text-decoration-color: #000000\"> </span><span style=\"color: #008000; text-decoration-color: #008000\">'chip.clusters.Objects.OtaSoftwareUpdateRequestor.Attributes.UpdatePossible'</span><span style=\"font-weight: bold\">&gt;</span>: <span style=\"color: #00ff00; text-decoration-color: #00ff00; font-style: italic\">True</span>,\n",
"<span style=\"color: #7fbf7f; text-decoration-color: #7fbf7f\">│ │ │ </span><span style=\"font-weight: bold\">&lt;</span><span style=\"color: #ff00ff; text-decoration-color: #ff00ff; font-weight: bold\">class</span><span style=\"color: #000000; text-decoration-color: #000000\"> </span><span style=\"color: #008000; text-decoration-color: #008000\">'chip.clusters.Objects.OtaSoftwareUpdateRequestor.Attributes.UpdateState'</span><span style=\"font-weight: bold\">&gt;</span>: <span style=\"font-weight: bold\">&lt;</span><span style=\"color: #ff00ff; text-decoration-color: #ff00ff; font-weight: bold\">OTAUpdateStateEnum.kUnknown:</span><span style=\"color: #000000; text-decoration-color: #000000\"> </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0</span><span style=\"font-weight: bold\">&gt;</span>,\n",
"<span style=\"color: #7fbf7f; text-decoration-color: #7fbf7f\">│ │ │ </span><span style=\"font-weight: bold\">&lt;</span><span style=\"color: #ff00ff; text-decoration-color: #ff00ff; font-weight: bold\">class</span><span style=\"color: #000000; text-decoration-color: #000000\"> </span><span style=\"color: #008000; text-decoration-color: #008000\">'chip.clusters.Objects.OtaSoftwareUpdateRequestor.Attributes.UpdateState'</span><span style=\"font-weight: bold\">&gt;</span>: <span style=\"font-weight: bold\">&lt;</span><span style=\"color: #ff00ff; text-decoration-color: #ff00ff; font-weight: bold\">UpdateStateEnum.kUnknown:</span><span style=\"color: #000000; text-decoration-color: #000000\"> </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0</span><span style=\"font-weight: bold\">&gt;</span>,\n",
"<span style=\"color: #7fbf7f; text-decoration-color: #7fbf7f\">│ │ │ </span><span style=\"font-weight: bold\">&lt;</span><span style=\"color: #ff00ff; text-decoration-color: #ff00ff; font-weight: bold\">class</span><span style=\"color: #000000; text-decoration-color: #000000\"> </span><span style=\"color: #008000; text-decoration-color: #008000\">'chip.clusters.Objects.OtaSoftwareUpdateRequestor.Attributes.UpdateStateProgress'</span><span style=\"font-weight: bold\">&gt;</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0</span>,\n",
"<span style=\"color: #7fbf7f; text-decoration-color: #7fbf7f\">│ │ │ </span><span style=\"font-weight: bold\">&lt;</span><span style=\"color: #ff00ff; text-decoration-color: #ff00ff; font-weight: bold\">class</span><span style=\"color: #000000; text-decoration-color: #000000\"> </span><span style=\"color: #008000; text-decoration-color: #008000\">'chip.clusters.Objects.OtaSoftwareUpdateRequestor.Attributes.ClusterRevision'</span><span style=\"font-weight: bold\">&gt;</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span>\n",
"<span style=\"color: #7fbf7f; text-decoration-color: #7fbf7f\">│ │ </span><span style=\"font-weight: bold\">}</span>,\n",
Expand Down Expand Up @@ -2432,7 +2432,7 @@
"\u001b[2;32m│ │ \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'chip.clusters.Objects.OtaSoftwareUpdateRequestor'\u001b[0m\u001b[1m>\u001b[0m: \u001b[1m{\u001b[0m\n",
"\u001b[2;32m│ │ │ \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'chip.clusters.Objects.OtaSoftwareUpdateRequestor.Attributes.DefaultOTAProviders'\u001b[0m\u001b[1m>\u001b[0m: \u001b[1m[\u001b[0m\u001b[1m]\u001b[0m,\n",
"\u001b[2;32m│ │ │ \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'chip.clusters.Objects.OtaSoftwareUpdateRequestor.Attributes.UpdatePossible'\u001b[0m\u001b[1m>\u001b[0m: \u001b[3;92mTrue\u001b[0m,\n",
"\u001b[2;32m│ │ │ \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'chip.clusters.Objects.OtaSoftwareUpdateRequestor.Attributes.UpdateState'\u001b[0m\u001b[1m>\u001b[0m: \u001b[1m<\u001b[0m\u001b[1;95mOTAUpdateStateEnum.kUnknown:\u001b[0m\u001b[39m \u001b[0m\u001b[1;36m0\u001b[0m\u001b[1m>\u001b[0m,\n",
"\u001b[2;32m│ │ │ \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'chip.clusters.Objects.OtaSoftwareUpdateRequestor.Attributes.UpdateState'\u001b[0m\u001b[1m>\u001b[0m: \u001b[1m<\u001b[0m\u001b[1;95mUpdateStateEnum.kUnknown:\u001b[0m\u001b[39m \u001b[0m\u001b[1;36m0\u001b[0m\u001b[1m>\u001b[0m,\n",
"\u001b[2;32m│ │ │ \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'chip.clusters.Objects.OtaSoftwareUpdateRequestor.Attributes.UpdateStateProgress'\u001b[0m\u001b[1m>\u001b[0m: \u001b[1;36m0\u001b[0m,\n",
"\u001b[2;32m│ │ │ \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'chip.clusters.Objects.OtaSoftwareUpdateRequestor.Attributes.ClusterRevision'\u001b[0m\u001b[1m>\u001b[0m: \u001b[1;36m1\u001b[0m\n",
"\u001b[2;32m│ │ \u001b[0m\u001b[1m}\u001b[0m,\n",
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/repl/Matter_Basic_Interactions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1409,7 +1409,7 @@
"<span style=\"color: #7fbf7f; text-decoration-color: #7fbf7f\">│ │ </span><span style=\"font-weight: bold\">&lt;</span><span style=\"color: #ff00ff; text-decoration-color: #ff00ff; font-weight: bold\">class</span><span style=\"color: #000000; text-decoration-color: #000000\"> </span><span style=\"color: #008000; text-decoration-color: #008000\">'chip.clusters.Objects.OtaSoftwareUpdateRequestor'</span><span style=\"font-weight: bold\">&gt;</span>: <span style=\"font-weight: bold\">{</span>\n",
"<span style=\"color: #7fbf7f; text-decoration-color: #7fbf7f\">│ │ │ </span><span style=\"font-weight: bold\">&lt;</span><span style=\"color: #ff00ff; text-decoration-color: #ff00ff; font-weight: bold\">class</span><span style=\"color: #000000; text-decoration-color: #000000\"> </span><span style=\"color: #008000; text-decoration-color: #008000\">'chip.clusters.Objects.OtaSoftwareUpdateRequestor.Attributes.DefaultOTAProviders'</span><span style=\"font-weight: bold\">&gt;</span>: <span style=\"font-weight: bold\">[]</span>,\n",
"<span style=\"color: #7fbf7f; text-decoration-color: #7fbf7f\">│ │ │ </span><span style=\"font-weight: bold\">&lt;</span><span style=\"color: #ff00ff; text-decoration-color: #ff00ff; font-weight: bold\">class</span><span style=\"color: #000000; text-decoration-color: #000000\"> </span><span style=\"color: #008000; text-decoration-color: #008000\">'chip.clusters.Objects.OtaSoftwareUpdateRequestor.Attributes.UpdatePossible'</span><span style=\"font-weight: bold\">&gt;</span>: <span style=\"color: #00ff00; text-decoration-color: #00ff00; font-style: italic\">True</span>,\n",
"<span style=\"color: #7fbf7f; text-decoration-color: #7fbf7f\">│ │ │ </span><span style=\"font-weight: bold\">&lt;</span><span style=\"color: #ff00ff; text-decoration-color: #ff00ff; font-weight: bold\">class</span><span style=\"color: #000000; text-decoration-color: #000000\"> </span><span style=\"color: #008000; text-decoration-color: #008000\">'chip.clusters.Objects.OtaSoftwareUpdateRequestor.Attributes.UpdateState'</span><span style=\"font-weight: bold\">&gt;</span>: <span style=\"font-weight: bold\">&lt;</span><span style=\"color: #ff00ff; text-decoration-color: #ff00ff; font-weight: bold\">OTAUpdateStateEnum.kUnknown:</span><span style=\"color: #000000; text-decoration-color: #000000\"> </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0</span><span style=\"font-weight: bold\">&gt;</span>,\n",
"<span style=\"color: #7fbf7f; text-decoration-color: #7fbf7f\">│ │ │ </span><span style=\"font-weight: bold\">&lt;</span><span style=\"color: #ff00ff; text-decoration-color: #ff00ff; font-weight: bold\">class</span><span style=\"color: #000000; text-decoration-color: #000000\"> </span><span style=\"color: #008000; text-decoration-color: #008000\">'chip.clusters.Objects.OtaSoftwareUpdateRequestor.Attributes.UpdateState'</span><span style=\"font-weight: bold\">&gt;</span>: <span style=\"font-weight: bold\">&lt;</span><span style=\"color: #ff00ff; text-decoration-color: #ff00ff; font-weight: bold\">UpdateStateEnum.kUnknown:</span><span style=\"color: #000000; text-decoration-color: #000000\"> </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0</span><span style=\"font-weight: bold\">&gt;</span>,\n",
"<span style=\"color: #7fbf7f; text-decoration-color: #7fbf7f\">│ │ │ </span><span style=\"font-weight: bold\">&lt;</span><span style=\"color: #ff00ff; text-decoration-color: #ff00ff; font-weight: bold\">class</span><span style=\"color: #000000; text-decoration-color: #000000\"> </span><span style=\"color: #008000; text-decoration-color: #008000\">'chip.clusters.Objects.OtaSoftwareUpdateRequestor.Attributes.UpdateStateProgress'</span><span style=\"font-weight: bold\">&gt;</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0</span>,\n",
"<span style=\"color: #7fbf7f; text-decoration-color: #7fbf7f\">│ │ │ </span><span style=\"font-weight: bold\">&lt;</span><span style=\"color: #ff00ff; text-decoration-color: #ff00ff; font-weight: bold\">class</span><span style=\"color: #000000; text-decoration-color: #000000\"> </span><span style=\"color: #008000; text-decoration-color: #008000\">'chip.clusters.Objects.OtaSoftwareUpdateRequestor.Attributes.ClusterRevision'</span><span style=\"font-weight: bold\">&gt;</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span>\n",
"<span style=\"color: #7fbf7f; text-decoration-color: #7fbf7f\">│ │ </span><span style=\"font-weight: bold\">}</span>,\n",
Expand Down Expand Up @@ -2425,7 +2425,7 @@
"\u001b[2;32m│ │ \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'chip.clusters.Objects.OtaSoftwareUpdateRequestor'\u001b[0m\u001b[1m>\u001b[0m: \u001b[1m{\u001b[0m\n",
"\u001b[2;32m│ │ │ \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'chip.clusters.Objects.OtaSoftwareUpdateRequestor.Attributes.DefaultOTAProviders'\u001b[0m\u001b[1m>\u001b[0m: \u001b[1m[\u001b[0m\u001b[1m]\u001b[0m,\n",
"\u001b[2;32m│ │ │ \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'chip.clusters.Objects.OtaSoftwareUpdateRequestor.Attributes.UpdatePossible'\u001b[0m\u001b[1m>\u001b[0m: \u001b[3;92mTrue\u001b[0m,\n",
"\u001b[2;32m│ │ │ \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'chip.clusters.Objects.OtaSoftwareUpdateRequestor.Attributes.UpdateState'\u001b[0m\u001b[1m>\u001b[0m: \u001b[1m<\u001b[0m\u001b[1;95mOTAUpdateStateEnum.kUnknown:\u001b[0m\u001b[39m \u001b[0m\u001b[1;36m0\u001b[0m\u001b[1m>\u001b[0m,\n",
"\u001b[2;32m│ │ │ \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'chip.clusters.Objects.OtaSoftwareUpdateRequestor.Attributes.UpdateState'\u001b[0m\u001b[1m>\u001b[0m: \u001b[1m<\u001b[0m\u001b[1;95mUpdateStateEnum.kUnknown:\u001b[0m\u001b[39m \u001b[0m\u001b[1;36m0\u001b[0m\u001b[1m>\u001b[0m,\n",
"\u001b[2;32m│ │ │ \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'chip.clusters.Objects.OtaSoftwareUpdateRequestor.Attributes.UpdateStateProgress'\u001b[0m\u001b[1m>\u001b[0m: \u001b[1;36m0\u001b[0m,\n",
"\u001b[2;32m│ │ │ \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'chip.clusters.Objects.OtaSoftwareUpdateRequestor.Attributes.ClusterRevision'\u001b[0m\u001b[1m>\u001b[0m: \u001b[1;36m1\u001b[0m\n",
"\u001b[2;32m│ │ \u001b[0m\u001b[1m}\u001b[0m,\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,20 +235,20 @@ server cluster BasicInformation = 40 {

/** Provides an interface for providing OTA software updates */
client cluster OtaSoftwareUpdateProvider = 41 {
enum OTAApplyUpdateAction : ENUM8 {
enum ApplyUpdateActionEnum : ENUM8 {
kProceed = 0;
kAwaitNextAction = 1;
kDiscontinue = 2;
}

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

enum OTAQueryStatus : ENUM8 {
enum StatusEnum : ENUM8 {
kUpdateAvailable = 0;
kBusy = 1;
kNotAvailable = 2;
Expand All @@ -266,15 +266,15 @@ client cluster OtaSoftwareUpdateProvider = 41 {
vendor_id vendorID = 0;
INT16U productID = 1;
INT32U softwareVersion = 2;
OTADownloadProtocol protocolsSupported[] = 3;
DownloadProtocolEnum protocolsSupported[] = 3;
optional INT16U hardwareVersion = 4;
optional CHAR_STRING<2> location = 5;
optional BOOLEAN requestorCanConsent = 6;
optional OCTET_STRING<512> metadataForProvider = 7;
}

response struct QueryImageResponse = 1 {
OTAQueryStatus status = 0;
StatusEnum status = 0;
optional INT32U delayedActionTime = 1;
optional CHAR_STRING<256> imageURI = 2;
optional INT32U softwareVersion = 3;
Expand All @@ -290,7 +290,7 @@ client cluster OtaSoftwareUpdateProvider = 41 {
}

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

Expand All @@ -309,21 +309,21 @@ client cluster OtaSoftwareUpdateProvider = 41 {

/** Provides an interface for downloading and applying OTA software updates */
server cluster OtaSoftwareUpdateRequestor = 42 {
enum OTAAnnouncementReason : ENUM8 {
enum AnnouncementReasonEnum : ENUM8 {
kSimpleAnnouncement = 0;
kUpdateAvailable = 1;
kUrgentUpdateAvailable = 2;
}

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

enum OTAUpdateStateEnum : ENUM8 {
enum UpdateStateEnum : ENUM8 {
kUnknown = 0;
kIdle = 1;
kQuerying = 2;
Expand All @@ -342,9 +342,9 @@ server cluster OtaSoftwareUpdateRequestor = 42 {
}

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

Expand All @@ -362,7 +362,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 {

attribute ProviderLocation defaultOTAProviders[] = 0;
readonly attribute boolean updatePossible = 1;
readonly attribute OTAUpdateStateEnum updateState = 2;
readonly attribute UpdateStateEnum updateState = 2;
readonly attribute nullable int8u updateStateProgress = 3;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand All @@ -374,7 +374,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 {
request struct AnnounceOTAProviderRequest {
node_id providerNodeID = 0;
vendor_id vendorID = 1;
OTAAnnouncementReason announcementReason = 2;
AnnouncementReasonEnum announcementReason = 2;
optional OCTET_STRING<512> metadataForNode = 3;
endpoint_no endpoint = 4;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@
"code": 2,
"mfgCode": null,
"side": "server",
"type": "OTAUpdateStateEnum",
"type": "UpdateStateEnum",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
Expand Down
Loading

0 comments on commit 2290520

Please sign in to comment.