Skip to content

Commit

Permalink
Revert "Removed the OTA update provider from the zap file"
Browse files Browse the repository at this point in the history
This reverts commit 0f15c24.
  • Loading branch information
shgutte committed Nov 15, 2024
1 parent b29b45a commit 289a2be
Show file tree
Hide file tree
Showing 4 changed files with 495 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,82 @@ cluster BasicInformation = 40 {
command MfgSpecificPing(): DefaultSuccess = 0;
}

/** Provides an interface for providing OTA software updates */
cluster OtaSoftwareUpdateProvider = 41 {
revision 1; // NOTE: Default/not specifically set

enum ApplyUpdateActionEnum : enum8 {
kProceed = 0;
kAwaitNextAction = 1;
kDiscontinue = 2;
}

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

enum StatusEnum : enum8 {
kUpdateAvailable = 0;
kBusy = 1;
kNotAvailable = 2;
kDownloadProtocolNotSupported = 3;
}

readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
readonly attribute attrib_id attributeList[] = 65531;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;

request struct QueryImageRequest {
vendor_id vendorID = 0;
int16u productID = 1;
int32u softwareVersion = 2;
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 {
StatusEnum status = 0;
optional int32u delayedActionTime = 1;
optional char_string<256> imageURI = 2;
optional int32u softwareVersion = 3;
optional char_string<64> softwareVersionString = 4;
optional octet_string<32> updateToken = 5;
optional boolean userConsentNeeded = 6;
optional octet_string<512> metadataForRequestor = 7;
}

request struct ApplyUpdateRequestRequest {
octet_string<32> updateToken = 0;
int32u newVersion = 1;
}

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

request struct NotifyUpdateAppliedRequest {
octet_string<32> updateToken = 0;
int32u softwareVersion = 1;
}

/** Determine availability of a new Software Image */
command QueryImage(QueryImageRequest): QueryImageResponse = 0;
/** Determine next action to take for a downloaded Software Image */
command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2;
/** Notify OTA Provider that an update was applied */
command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4;
}

/** Provides an interface for downloading and applying OTA software updates */
cluster OtaSoftwareUpdateRequestor = 42 {
revision 1; // NOTE: Default/not specifically set
Expand Down Expand Up @@ -1641,6 +1717,21 @@ endpoint 0 {
ram attribute clusterRevision default = 3;
}

server cluster OtaSoftwareUpdateProvider {
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 1;

handle command QueryImage;
handle command QueryImageResponse;
handle command ApplyUpdateRequest;
handle command ApplyUpdateResponse;
handle command NotifyUpdateApplied;
}

server cluster OtaSoftwareUpdateRequestor {
callback attribute defaultOTAProviders;
ram attribute updatePossible default = true;
Expand Down
172 changes: 156 additions & 16 deletions examples/refrigerator-app/silabs/data_model/refrigerator-thread-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,14 @@
"code": 22,
"profileId": 259,
"label": "MA-rootdevice",
"name": "MA-rootdevice",
"deviceTypeOrder": 0
"name": "MA-rootdevice"
},
"deviceTypes": [
{
"code": 22,
"profileId": 259,
"label": "MA-rootdevice",
"name": "MA-rootdevice",
"deviceTypeOrder": 0
"name": "MA-rootdevice"
}
],
"deviceVersions": [
Expand Down Expand Up @@ -1024,6 +1022,154 @@
}
]
},
{
"name": "OTA Software Update Provider",
"code": 41,
"mfgCode": null,
"define": "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER",
"side": "server",
"enabled": 1,
"commands": [
{
"name": "QueryImage",
"code": 0,
"mfgCode": null,
"source": "client",
"isIncoming": 1,
"isEnabled": 1
},
{
"name": "QueryImageResponse",
"code": 1,
"mfgCode": null,
"source": "server",
"isIncoming": 0,
"isEnabled": 1
},
{
"name": "ApplyUpdateRequest",
"code": 2,
"mfgCode": null,
"source": "client",
"isIncoming": 1,
"isEnabled": 1
},
{
"name": "ApplyUpdateResponse",
"code": 3,
"mfgCode": null,
"source": "server",
"isIncoming": 0,
"isEnabled": 1
},
{
"name": "NotifyUpdateApplied",
"code": 4,
"mfgCode": null,
"source": "client",
"isIncoming": 1,
"isEnabled": 1
}
],
"attributes": [
{
"name": "GeneratedCommandList",
"code": 65528,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "AcceptedCommandList",
"code": 65529,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "EventList",
"code": 65530,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "AttributeList",
"code": 65531,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "FeatureMap",
"code": 65532,
"mfgCode": null,
"side": "server",
"type": "bitmap32",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "ClusterRevision",
"code": 65533,
"mfgCode": null,
"side": "server",
"type": "int16u",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "1",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
}
]
},
{
"name": "OTA Software Update Requestor",
"code": 42,
Expand Down Expand Up @@ -3003,16 +3149,14 @@
"code": 112,
"profileId": 259,
"label": "MA-refrigerator",
"name": "MA-refrigerator",
"deviceTypeOrder": 0
"name": "MA-refrigerator"
},
"deviceTypes": [
{
"code": 112,
"profileId": 259,
"label": "MA-refrigerator",
"name": "MA-refrigerator",
"deviceTypeOrder": 0
"name": "MA-refrigerator"
}
],
"deviceVersions": [
Expand Down Expand Up @@ -3498,16 +3642,14 @@
"code": 113,
"profileId": 259,
"label": "MA-temperature-controlled-cabinet",
"name": "MA-temperature-controlled-cabinet",
"deviceTypeOrder": 0
"name": "MA-temperature-controlled-cabinet"
},
"deviceTypes": [
{
"code": 113,
"profileId": 259,
"label": "MA-temperature-controlled-cabinet",
"name": "MA-temperature-controlled-cabinet",
"deviceTypeOrder": 0
"name": "MA-temperature-controlled-cabinet"
}
],
"deviceVersions": [
Expand Down Expand Up @@ -3847,16 +3989,14 @@
"code": 113,
"profileId": 259,
"label": "MA-temperature-controlled-cabinet",
"name": "MA-temperature-controlled-cabinet",
"deviceTypeOrder": 0
"name": "MA-temperature-controlled-cabinet"
},
"deviceTypes": [
{
"code": 113,
"profileId": 259,
"label": "MA-temperature-controlled-cabinet",
"name": "MA-temperature-controlled-cabinet",
"deviceTypeOrder": 0
"name": "MA-temperature-controlled-cabinet"
}
],
"deviceVersions": [
Expand Down
Loading

0 comments on commit 289a2be

Please sign in to comment.