Skip to content

Commit

Permalink
Make the "status" type match the spec. (#26329)
Browse files Browse the repository at this point in the history
It's 8 bits in the spec, not 16 bits.

Fixes #26317
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Jun 2, 2023
1 parent 97ca3f0 commit 2291552
Show file tree
Hide file tree
Showing 13 changed files with 70 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,13 @@ server cluster Scenes = 5 {
}

response struct AddSceneResponse = 0 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
INT8U sceneID = 2;
}

response struct ViewSceneResponse = 1 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
INT8U sceneID = 2;
optional INT16U transitionTime = 3;
Expand All @@ -207,24 +207,24 @@ server cluster Scenes = 5 {
}

response struct RemoveSceneResponse = 2 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
INT8U sceneID = 2;
}

response struct RemoveAllScenesResponse = 3 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
}

response struct StoreSceneResponse = 4 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
INT8U sceneID = 2;
}

response struct GetSceneMembershipResponse = 6 {
ENUM8 status = 0;
status status = 0;
nullable INT8U capacity = 1;
group_id groupID = 2;
optional INT8U sceneList[] = 3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,13 @@ server cluster Scenes = 5 {
}

response struct AddSceneResponse = 0 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
INT8U sceneID = 2;
}

response struct ViewSceneResponse = 1 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
INT8U sceneID = 2;
optional INT16U transitionTime = 3;
Expand All @@ -201,24 +201,24 @@ server cluster Scenes = 5 {
}

response struct RemoveSceneResponse = 2 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
INT8U sceneID = 2;
}

response struct RemoveAllScenesResponse = 3 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
}

response struct StoreSceneResponse = 4 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
INT8U sceneID = 2;
}

response struct GetSceneMembershipResponse = 6 {
ENUM8 status = 0;
status status = 0;
nullable INT8U capacity = 1;
group_id groupID = 2;
optional INT8U sceneList[] = 3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ client cluster Scenes = 5 {
}

response struct AddSceneResponse = 0 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
INT8U sceneID = 2;
}
Expand All @@ -223,7 +223,7 @@ client cluster Scenes = 5 {
}

response struct ViewSceneResponse = 1 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
INT8U sceneID = 2;
optional INT16U transitionTime = 3;
Expand All @@ -237,7 +237,7 @@ client cluster Scenes = 5 {
}

response struct RemoveSceneResponse = 2 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
INT8U sceneID = 2;
}
Expand All @@ -247,7 +247,7 @@ client cluster Scenes = 5 {
}

response struct RemoveAllScenesResponse = 3 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
}

Expand All @@ -257,7 +257,7 @@ client cluster Scenes = 5 {
}

response struct StoreSceneResponse = 4 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
INT8U sceneID = 2;
}
Expand All @@ -273,7 +273,7 @@ client cluster Scenes = 5 {
}

response struct GetSceneMembershipResponse = 6 {
ENUM8 status = 0;
status status = 0;
nullable INT8U capacity = 1;
group_id groupID = 2;
optional INT8U sceneList[] = 3;
Expand All @@ -288,7 +288,7 @@ client cluster Scenes = 5 {
}

response struct EnhancedAddSceneResponse = 64 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
INT8U sceneID = 2;
}
Expand All @@ -299,7 +299,7 @@ client cluster Scenes = 5 {
}

response struct EnhancedViewSceneResponse = 65 {
ENUM8 status = 0;
status status = 0;
group_Id groupID = 1;
INT8U sceneID = 2;
optional INT16U transitionTime = 3;
Expand All @@ -316,7 +316,7 @@ client cluster Scenes = 5 {
}

response struct CopySceneResponse = 66 {
ENUM8 status = 0;
status status = 0;
group_Id groupIdentifierFrom = 1;
INT8U sceneIdentifierFrom = 2;
}
Expand Down
12 changes: 6 additions & 6 deletions examples/placeholder/linux/apps/app1/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,13 @@ server cluster Scenes = 5 {
}

response struct AddSceneResponse = 0 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
INT8U sceneID = 2;
}

response struct ViewSceneResponse = 1 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
INT8U sceneID = 2;
optional INT16U transitionTime = 3;
Expand All @@ -207,24 +207,24 @@ server cluster Scenes = 5 {
}

response struct RemoveSceneResponse = 2 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
INT8U sceneID = 2;
}

response struct RemoveAllScenesResponse = 3 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
}

response struct StoreSceneResponse = 4 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
INT8U sceneID = 2;
}

response struct GetSceneMembershipResponse = 6 {
ENUM8 status = 0;
status status = 0;
nullable INT8U capacity = 1;
group_id groupID = 2;
optional INT8U sceneList[] = 3;
Expand Down
12 changes: 6 additions & 6 deletions examples/placeholder/linux/apps/app2/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,13 @@ server cluster Scenes = 5 {
}

response struct AddSceneResponse = 0 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
INT8U sceneID = 2;
}

response struct ViewSceneResponse = 1 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
INT8U sceneID = 2;
optional INT16U transitionTime = 3;
Expand All @@ -207,24 +207,24 @@ server cluster Scenes = 5 {
}

response struct RemoveSceneResponse = 2 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
INT8U sceneID = 2;
}

response struct RemoveAllScenesResponse = 3 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
}

response struct StoreSceneResponse = 4 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
INT8U sceneID = 2;
}

response struct GetSceneMembershipResponse = 6 {
ENUM8 status = 0;
status status = 0;
nullable INT8U capacity = 1;
group_id groupID = 2;
optional INT8U sceneList[] = 3;
Expand Down
12 changes: 6 additions & 6 deletions examples/thermostat/thermostat-common/thermostat.matter
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,13 @@ server cluster Scenes = 5 {
}

response struct AddSceneResponse = 0 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
INT8U sceneID = 2;
}

response struct ViewSceneResponse = 1 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
INT8U sceneID = 2;
optional INT16U transitionTime = 3;
Expand All @@ -255,24 +255,24 @@ server cluster Scenes = 5 {
}

response struct RemoveSceneResponse = 2 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
INT8U sceneID = 2;
}

response struct RemoveAllScenesResponse = 3 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
}

response struct StoreSceneResponse = 4 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
INT8U sceneID = 2;
}

response struct GetSceneMembershipResponse = 6 {
ENUM8 status = 0;
status status = 0;
nullable INT8U capacity = 1;
group_id groupID = 2;
optional INT8U sceneList[] = 3;
Expand Down
12 changes: 6 additions & 6 deletions examples/window-app/common/window-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,13 @@ server cluster Scenes = 5 {
}

response struct AddSceneResponse = 0 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
INT8U sceneID = 2;
}

response struct ViewSceneResponse = 1 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
INT8U sceneID = 2;
optional INT16U transitionTime = 3;
Expand All @@ -207,24 +207,24 @@ server cluster Scenes = 5 {
}

response struct RemoveSceneResponse = 2 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
INT8U sceneID = 2;
}

response struct RemoveAllScenesResponse = 3 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
}

response struct StoreSceneResponse = 4 {
ENUM8 status = 0;
status status = 0;
group_id groupID = 1;
INT8U sceneID = 2;
}

response struct GetSceneMembershipResponse = 6 {
ENUM8 status = 0;
status status = 0;
nullable INT8U capacity = 1;
group_id groupID = 2;
optional INT8U sceneList[] = 3;
Expand Down
2 changes: 1 addition & 1 deletion src/app/util/ember-compatibility-functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ EmberAfAttributeType BaseType(EmberAfAttributeType type)
case ZCL_FABRIC_IDX_ATTRIBUTE_TYPE: // Fabric Index
case ZCL_BITMAP8_ATTRIBUTE_TYPE: // 8-bit bitmap
case ZCL_ENUM8_ATTRIBUTE_TYPE: // 8-bit enumeration
case ZCL_STATUS_ATTRIBUTE_TYPE: // Status Code
case ZCL_PERCENT_ATTRIBUTE_TYPE: // Percentage
static_assert(std::is_same<chip::Percent, uint8_t>::value,
"chip::Percent is expected to be uint8_t, change this when necessary");
Expand All @@ -83,7 +84,6 @@ EmberAfAttributeType BaseType(EmberAfAttributeType type)
case ZCL_VENDOR_ID_ATTRIBUTE_TYPE: // Vendor Id
case ZCL_ENUM16_ATTRIBUTE_TYPE: // 16-bit enumeration
case ZCL_BITMAP16_ATTRIBUTE_TYPE: // 16-bit bitmap
case ZCL_STATUS_ATTRIBUTE_TYPE: // Status Code
case ZCL_PERCENT100THS_ATTRIBUTE_TYPE: // 100ths of a percent
static_assert(std::is_same<chip::EndpointId, uint16_t>::value,
"chip::EndpointId is expected to be uint16_t, change this when necessary");
Expand Down
4 changes: 4 additions & 0 deletions src/app/zap-templates/common/override.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ function atomicType(arg)
return 'chip::EventNumber';
case 'fabric_idx':
return 'chip::FabricIndex';
case 'status':
// We can't make this into InteractionModel::Status, since it might be a
// cluster-specific status.
return 'uint8_t';
case 'octet_string':
case 'long_octet_string':
return 'chip::ByteSpan';
Expand Down
2 changes: 1 addition & 1 deletion src/app/zap-templates/zcl/data-model/chip/chip-types.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ limitations under the License.
<type id="0xF2" description="Device Type ID" name="devtype_id" size="4" discrete="true" />
<type id="0xF3" description="Fabric ID" name="fabric_id" size="8" discrete="true" />
<type id="0xF4" description="Group ID" name="group_id" size="2" discrete="true" />
<type id="0xF5" description="Status Code" name="status" size="2" discrete="true" />
<type id="0xF5" description="Status Code" name="status" size="1" discrete="true" />
<type id="0xF6" description="Data Version" name="data_ver" size="4" discrete="true" />
<type id="0xF7" description="Event Number" name="event_no" size="8" discrete="true" />
<type id="0xF8" description="Endpoint Number" name="endpoint_no" size="2" discrete="true" />
Expand Down
Loading

0 comments on commit 2291552

Please sign in to comment.