Skip to content

Commit

Permalink
Use chip::Protocols::InteractionModel::Status for ZCL status (#10281)
Browse files Browse the repository at this point in the history
* Use chip::Protocols::InteractionModel::Status for ZCL status

* Update generated content
  • Loading branch information
vivien-apple authored Oct 6, 2021
1 parent 3825d10 commit 962faf8
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 89 deletions.
1 change: 0 additions & 1 deletion src/app/util/basic-types.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ typedef uint8_t FabricIndex;
typedef uint32_t FieldId;
typedef uint16_t ListIndex;
typedef uint32_t TransactionId;
typedef uint32_t StatusCode;
typedef uint8_t Percent;
typedef uint16_t Percent100ths;

Expand Down
4 changes: 1 addition & 3 deletions src/app/util/ember-compatibility-functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ 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
static_assert(std::is_same<chip::EndpointId, uint16_t>::value,
"chip::EndpointId is expected to be uint8_t, change this when necessary");
static_assert(std::is_same<chip::GroupId, uint16_t>::value,
Expand All @@ -89,7 +90,6 @@ EmberAfAttributeType BaseType(EmberAfAttributeType type)
case ZCL_COMMAND_ID_ATTRIBUTE_TYPE: // Command Id
case ZCL_TRANS_ID_ATTRIBUTE_TYPE: // Transaction Id
case ZCL_DEVTYPE_ID_ATTRIBUTE_TYPE: // Device Type Id
case ZCL_STATUS_ATTRIBUTE_TYPE: // Status Code
case ZCL_DATA_VER_ATTRIBUTE_TYPE: // Data Version
case ZCL_BITMAP32_ATTRIBUTE_TYPE: // 32-bit bitmap
case ZCL_EPOCH_S_ATTRIBUTE_TYPE: // Epoch Seconds
Expand All @@ -107,8 +107,6 @@ EmberAfAttributeType BaseType(EmberAfAttributeType type)
"chip::TransactionId is expected to be uint32_t, change this when necessary");
static_assert(std::is_same<chip::DeviceTypeId, uint32_t>::value,
"chip::DeviceTypeId is expected to be uint32_t, change this when necessary");
static_assert(std::is_same<chip::StatusCode, uint32_t>::value,
"chip::StatusCode is expected to be uint32_t, change this when necessary");
static_assert(std::is_same<chip::DataVersion, uint32_t>::value,
"chip::DataVersion is expected to be uint32_t, change this when necessary");
return ZCL_INT32U_ATTRIBUTE_TYPE;
Expand Down
1 change: 1 addition & 0 deletions src/app/zap-templates/common/ChipTypesHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ function asBasicType(type)
case 'chip::GroupId':
case 'chip::VendorId':
case 'chip::Percent100ths':
case 'chip::Protocols::InteractionModel::Status':
return 'uint16_t';
case 'chip::ClusterId':
case 'chip::AttributeId':
Expand Down
2 changes: 1 addition & 1 deletion src/app/zap-templates/common/override.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function atomicType(arg)
case 'fabric_idx':
return 'chip::FabricIndex';
case 'status':
return 'chip::StatusCode';
return 'chip::Protocols::InteractionModel::Status';
case 'octet_string':
case 'long_octet_string':
return 'chip::ByteSpan';
Expand Down
1 change: 1 addition & 0 deletions src/app/zap-templates/templates/app/af-structs.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include <app/util/basic-types.h>
#include <lib/support/Span.h>
#include <protocols/interaction_model/Constants.h>

#include "enums.h"

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="4" discrete="true" />
<type id="0xF5" description="Status Code" name="status" size="2" 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
20 changes: 10 additions & 10 deletions src/app/zap-templates/zcl/data-model/silabs/general.xml
Original file line number Diff line number Diff line change
Expand Up @@ -301,14 +301,14 @@ limitations under the License.
<description>
Command description for AddGroupResponse
</description>
<arg name="status" type="Status"/>
<arg name="status" type="ENUM8"/>
<arg name="groupId" type="INT16U"/>
</command>
<command source="server" code="0x01" name="ViewGroupResponse" optional="false" disableDefaultResponse="true">
<description>
Command description for ViewGroupResponse
</description>
<arg name="status" type="Status"/>
<arg name="status" type="ENUM8"/>
<arg name="groupId" type="INT16U"/>
<arg name="groupName" type="CHAR_STRING"/>
</command>
Expand All @@ -324,7 +324,7 @@ limitations under the License.
<description>
Command description for RemoveGroupResponse
</description>
<arg name="status" type="Status"/>
<arg name="status" type="ENUM8"/>
<arg name="groupId" type="INT16U"/>
</command>
</cluster>
Expand Down Expand Up @@ -399,15 +399,15 @@ limitations under the License.
<description>
Command description for AddSceneResponse
</description>
<arg name="status" type="Status"/>
<arg name="status" type="ENUM8"/>
<arg name="groupId" type="INT16U"/>
<arg name="sceneId" type="INT8U"/>
</command>
<command source="server" code="0x01" name="ViewSceneResponse" optional="false" disableDefaultResponse="true">
<description>
Command description for ViewSceneResponse
</description>
<arg name="status" type="Status"/>
<arg name="status" type="ENUM8"/>
<arg name="groupId" type="INT16U"/>
<arg name="sceneId" type="INT8U"/>
<arg name="transitionTime" type="INT16U" presentIf="status==0"/>
Expand All @@ -418,30 +418,30 @@ limitations under the License.
<description>
Command description for RemoveSceneResponse
</description>
<arg name="status" type="Status"/>
<arg name="status" type="ENUM8"/>
<arg name="groupId" type="INT16U"/>
<arg name="sceneId" type="INT8U"/>
</command>
<command source="server" code="0x03" name="RemoveAllScenesResponse" optional="false" disableDefaultResponse="true">
<description>
Command description for RemoveAllScenesResponse
</description>
<arg name="status" type="Status"/>
<arg name="status" type="ENUM8"/>
<arg name="groupId" type="INT16U"/>
</command>
<command source="server" code="0x04" name="StoreSceneResponse" optional="false" disableDefaultResponse="true">
<description>
Command description for StoreSceneResponse
</description>
<arg name="status" type="Status"/>
<arg name="status" type="ENUM8"/>
<arg name="groupId" type="INT16U"/>
<arg name="sceneId" type="INT8U"/>
</command>
<command source="server" code="0x06" name="GetSceneMembershipResponse" optional="false" disableDefaultResponse="true">
<description>
Command description for GetSceneMembershipResponse
</description>
<arg name="status" type="Status"/>
<arg name="status" type="ENUM8"/>
<arg name="capacity" type="INT8U"/>
<arg name="groupId" type="INT16U"/>
<arg name="sceneCount" type="INT8U" arrayLength="true" presentIf="status==0"/>
Expand Down Expand Up @@ -583,7 +583,7 @@ limitations under the License.
<description>
Command description for GetAlarmResponse
</description>
<arg name="status" type="Status"/>
<arg name="status" type="ENUM8"/>
<arg name="alarmCode" type="ENUM8"/>
<arg name="clusterId" type="CLUSTER_ID"/>
<arg name="timeStamp" type="epoch_s"/>
Expand Down
52 changes: 1 addition & 51 deletions src/app/zap-templates/zcl/data-model/silabs/types.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,56 +93,6 @@ limitations under the License.
<item name="normal" value="0x0"/>
<item name="configure" value="0x1"/>
</enum>
<enum name="Status" type="INT8U" description="Status codes used in the ZigBee Cluster Library">
<item name="SUCCESS" value="0x00"/>
<item name="FAILURE" value="0x01"/>
<item name="NOT_AUTHORIZED" value="0x7E"/>
<!-- item name="reserved" value="0x7F"/ -->
<item name="MALFORMED_COMMAND" value="0x80"/>
<item name="UNSUP_COMMAND" value="0x81"/>
<!-- renamed from UNSUP_CLUSTER_COMMAND -->
<item name="UNSUP_GENERAL_COMMAND" value="0x82"/>
<!-- DEPRECATED use UNSUP_COMMAND -->
<item name="UNSUP_MANUF_CLUSTER_COMMAND" value="0x83"/>
<!-- DEPRECATED use UNSUP_COMMAND -->
<item name="UNSUP_MANUF_GENERAL_COMMAND" value="0x84"/>
<!-- DEPRECATED use UNSUP_COMMAND -->
<item name="INVALID_FIELD" value="0x85"/>
<item name="UNSUPPORTED_ATTRIBUTE" value="0x86"/>
<item name="INVALID_VALUE" value="0x87"/>
<item name="READ_ONLY" value="0x88"/>
<item name="INSUFFICIENT_SPACE" value="0x89"/>
<item name="DUPLICATE_EXISTS" value="0x8A"/>
<!-- DEPRECATED use SUCCESS -->
<item name="NOT_FOUND" value="0x8B"/>
<item name="UNREPORTABLE_ATTRIBUTE" value="0x8C"/>
<item name="INVALID_DATA_TYPE" value="0x8D"/>
<item name="INVALID_SELECTOR" value="0x8E"/>
<item name="WRITE_ONLY" value="0x8F"/>
<!-- DEPRECATED use NOT_AUTHORIZED -->
<item name="INCONSISTENT_STARTUP_STATE" value="0x90"/>
<!-- DEPRECATED use FAILURE -->
<item name="DEFINED_OUT_OF_BAND" value="0x91"/>
<!-- DEPRECATED use FAILURE -->
<!-- item name="reserved" value="0x92"/ -->
<item name="ACTION_DENIED" value="0x93"/>
<!-- DEPRECATED use FAILURE -->
<item name="TIMEOUT" value="0x94"/>
<item name="ABORT" value="0x95"/>
<item name="INVALID_IMAGE" value="0x96"/>
<item name="WAIT_FOR_DATA" value="0x97"/>
<item name="NO_IMAGE_AVAILABLE" value="0x98"/>
<item name="REQUIRE_MORE_IMAGE" value="0x99"/>
<item name="NOTIFICATION_PENDING" value="0x9A"/>
<item name="HARDWARE_FAILURE" value="0xC0"/>
<!-- DEPRECATED use FAILURE -->
<item name="SOFTWARE_FAILURE" value="0xC1"/>
<!-- DEPRECATED use FAILURE -->
<!-- item name="reserved" value="0xC2"/ -->
<item name="UNSUPPORTED_CLUSTER" value="0xC3"/>
<item name="LIMIT_REACHED" value="0xC4"/>
<!-- DEPRECATED use SUCCESS -->
</enum>
<enum name="PowerSource" type="ENUM8">
<item name="Unknown" value="0x0"/>
<item name="SinglePhaseMains" value="0x1"/>
Expand Down Expand Up @@ -546,7 +496,7 @@ limitations under the License.
</struct>
<struct name="Notification">
<item name="contentId" type="INT16U"/>
<item name="statusFeedback" type="Status"/>
<item name="statusFeedback" type="ENUM8"/>
</struct>
<bitmap name="EnergyFormatting" type="BITMAP8">
<field name="NumberOfDigitsToTheRightOfTheDecimalPoint" mask="0x07"/>
Expand Down
6 changes: 3 additions & 3 deletions src/app/zap-templates/zcl/data-model/silabs/zll.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ limitations under the License.
<description>
Command description for EnhancedAddSceneResponse
</description>
<arg name="status" type="Status"/>
<arg name="status" type="ENUM8"/>
<arg name="groupId" type="INT16U"/>
<arg name="sceneId" type="INT8U"/>
</command>
<command source="server" code="0x41" name="EnhancedViewSceneResponse" optional="true" introducedIn="zll-1.0-11-0037-10" disableDefaultResponse="true">
<description>
Command description for EnhancedViewSceneResponse
</description>
<arg name="status" type="Status"/>
<arg name="status" type="ENUM8"/>
<arg name="groupId" type="INT16U"/>
<arg name="sceneId" type="INT8U"/>
<arg name="transitionTime" type="INT16U"/>
Expand All @@ -104,7 +104,7 @@ limitations under the License.
<description>
Command description for CopySceneResponse
</description>
<arg name="status" type="Status"/>
<arg name="status" type="ENUM8"/>
<arg name="groupIdFrom" type="INT16U"/>
<arg name="sceneIdFrom" type="INT8U"/>
</command>
Expand Down
11 changes: 6 additions & 5 deletions zzz_generated/app-common/app-common/zap-generated/af-structs.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 962faf8

Please sign in to comment.