Skip to content

Commit

Permalink
Implement encoding empty list for DefaultOTAProviders
Browse files Browse the repository at this point in the history
- Remove length for DefaultOTAProviders attribute from XML file
  • Loading branch information
carol-apple committed Dec 17, 2021
1 parent aea5db2 commit a7388f2
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ OtaSoftwareUpdateRequestorAttrAccess gAttrAccess;

CHIP_ERROR OtaSoftwareUpdateRequestorAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
{
switch (aPath.mAttributeId)
{
case Attributes::DefaultOtaProviders::Id:
return aEncoder.Encode(DataModel::List<uint8_t>());
case Attributes::UpdatePossible::Id:
return aEncoder.Encode(true);
default:
break;
}

return CHIP_NO_ERROR;
}

Expand Down
8 changes: 4 additions & 4 deletions examples/thermostat/thermostat-common/thermostat.zap
Original file line number Diff line number Diff line change
Expand Up @@ -4068,7 +4068,7 @@
"commands": [],
"attributes": [
{
"name": "groups",
"name": "groupKeyMap",
"code": 0,
"mfgCode": null,
"side": "server",
Expand All @@ -4083,7 +4083,7 @@
"reportableChange": 0
},
{
"name": "group keys",
"name": "groupTable",
"code": 1,
"mfgCode": null,
"side": "server",
Expand Down Expand Up @@ -8938,7 +8938,7 @@
"commands": [],
"attributes": [
{
"name": "groups",
"name": "groupKeyMap",
"code": 0,
"mfgCode": null,
"side": "server",
Expand All @@ -8953,7 +8953,7 @@
"reportableChange": 0
},
{
"name": "group keys",
"name": "groupTable",
"code": 1,
"mfgCode": null,
"side": "server",
Expand Down
4 changes: 2 additions & 2 deletions examples/tv-app/tv-common/tv-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -4083,7 +4083,7 @@
"commands": [],
"attributes": [
{
"name": "groups",
"name": "groupKeyMap",
"code": 0,
"mfgCode": null,
"side": "server",
Expand All @@ -4098,7 +4098,7 @@
"reportableChange": 0
},
{
"name": "group keys",
"name": "groupTable",
"code": 1,
"mfgCode": null,
"side": "server",
Expand Down
8 changes: 4 additions & 4 deletions examples/tv-casting-app/tv-casting-common/tv-casting-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -4068,7 +4068,7 @@
"commands": [],
"attributes": [
{
"name": "groups",
"name": "groupKeyMap",
"code": 0,
"mfgCode": null,
"side": "server",
Expand All @@ -4083,7 +4083,7 @@
"reportableChange": 0
},
{
"name": "group keys",
"name": "groupTable",
"code": 1,
"mfgCode": null,
"side": "server",
Expand Down Expand Up @@ -8770,7 +8770,7 @@
"commands": [],
"attributes": [
{
"name": "groups",
"name": "groupKeyMap",
"code": 0,
"mfgCode": null,
"side": "server",
Expand All @@ -8785,7 +8785,7 @@
"reportableChange": 0
},
{
"name": "group keys",
"name": "groupTable",
"code": 1,
"mfgCode": null,
"side": "server",
Expand Down
2 changes: 1 addition & 1 deletion src/app/zap-templates/zcl/data-model/chip/chip-ota.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ limitations under the License.
<define>OTA_REQUESTOR_CLUSTER</define>
<client tick="false" init="false">true</client>
<server tick="false" init="false">true</server>
<attribute side="server" code="0x0000" define="DEFAULT_OTA_PROVIDERS" type="ARRAY" entryType="ProviderLocation" length="16" writable="true" optional="false">DefaultOtaProviders</attribute>
<attribute side="server" code="0x0000" define="DEFAULT_OTA_PROVIDERS" type="ARRAY" entryType="ProviderLocation" writable="true" optional="false">DefaultOtaProviders</attribute>
<attribute side="server" code="0x0001" define="UPDATE_POSSIBLE" type="BOOLEAN" default="true" writable="false" optional="false">UpdatePossible</attribute>
<attribute side="server" code="0x0002" define="UPDATE_STATE" type="UpdateStateEnum" default="Unknown" writable="false" optional="false">UpdateState</attribute>
<attribute side="server" code="0x0003" define="UPDATE_STATE_PROGRESS" type="INT8U" min="0" max="100" writable="false" isNullable="true" optional="false">UpdateStateProgress</attribute>
Expand Down
Loading

0 comments on commit a7388f2

Please sign in to comment.