Skip to content

Commit

Permalink
Add code in matter IDL for responses (#17561)
Browse files Browse the repository at this point in the history
* Add code support for response structs since they are commands based on the spec

* Restyle

* Add response ID into zap generator
  • Loading branch information
andy31415 authored and pull[bot] committed Jul 26, 2023
1 parent bffb03b commit 2243557
Show file tree
Hide file tree
Showing 24 changed files with 414 additions and 410 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1269,7 +1269,7 @@ server cluster DoorLock = 257 {
nullable DlCredential credential = 0;
}

response struct GetUserResponse {
response struct GetUserResponse = 28 {
INT16U userIndex = 0;
nullable CHAR_STRING userName = 1;
nullable INT32U userUniqueId = 2;
Expand All @@ -1282,13 +1282,13 @@ server cluster DoorLock = 257 {
nullable INT16U nextUserIndex = 9;
}

response struct SetCredentialResponse {
response struct SetCredentialResponse = 35 {
DlStatus status = 0;
nullable INT16U userIndex = 1;
nullable INT16U nextCredentialIndex = 2;
}

response struct GetCredentialStatusResponse {
response struct GetCredentialStatusResponse = 37 {
boolean credentialExists = 0;
nullable INT16U userIndex = 1;
nullable INT16U nextCredentialIndex = 2;
Expand Down Expand Up @@ -1462,17 +1462,17 @@ server cluster GeneralCommissioning = 48 {
INT64U breadcrumb = 2;
}

response struct ArmFailSafeResponse {
response struct ArmFailSafeResponse = 1 {
CommissioningError errorCode = 0;
CHAR_STRING debugText = 1;
}

response struct SetRegulatoryConfigResponse {
response struct SetRegulatoryConfigResponse = 3 {
CommissioningError errorCode = 0;
CHAR_STRING debugText = 1;
}

response struct CommissioningCompleteResponse {
response struct CommissioningCompleteResponse = 5 {
CommissioningError errorCode = 0;
CHAR_STRING debugText = 1;
}
Expand Down Expand Up @@ -1625,11 +1625,11 @@ server cluster GroupKeyManagement = 63 {
INT16U groupKeySetIDs[] = 0;
}

response struct KeySetReadResponse {
response struct KeySetReadResponse = 2 {
GroupKeySetStruct groupKeySet = 0;
}

response struct KeySetReadAllIndicesResponse {
response struct KeySetReadAllIndicesResponse = 5 {
INT16U groupKeySetIDs[] = 0;
}

Expand Down Expand Up @@ -1665,23 +1665,23 @@ server cluster Groups = 4 {
CHAR_STRING groupName = 1;
}

response struct AddGroupResponse {
response struct AddGroupResponse = 0 {
ENUM8 status = 0;
group_id groupId = 1;
}

response struct ViewGroupResponse {
response struct ViewGroupResponse = 1 {
ENUM8 status = 0;
group_id groupId = 1;
CHAR_STRING groupName = 2;
}

response struct GetGroupMembershipResponse {
response struct GetGroupMembershipResponse = 2 {
nullable INT8U capacity = 0;
group_id groupList[] = 1;
}

response struct RemoveGroupResponse {
response struct RemoveGroupResponse = 3 {
ENUM8 status = 0;
group_id groupId = 1;
}
Expand Down Expand Up @@ -1746,14 +1746,14 @@ server cluster IasZone = 1280 {
INT8U zoneId = 1;
}

response struct ZoneStatusChangeNotification {
response struct ZoneStatusChangeNotification = 0 {
IasZoneStatus zoneStatus = 0;
BITMAP8 extendedStatus = 1;
INT8U zoneId = 2;
INT16U delay = 3;
}

response struct ZoneEnrollRequest {
response struct ZoneEnrollRequest = 1 {
IasZoneType zoneType = 0;
INT16U manufacturerCode = 1;
}
Expand Down Expand Up @@ -1797,7 +1797,7 @@ server cluster Identify = 3 {
IdentifyEffectVariant effectVariant = 1;
}

response struct IdentifyQueryResponse {
response struct IdentifyQueryResponse = 0 {
INT16U timeout = 0;
}

Expand Down Expand Up @@ -2219,20 +2219,20 @@ server cluster NetworkCommissioning = 49 {
optional INT64U breadcrumb = 2;
}

response struct ScanNetworksResponse {
response struct ScanNetworksResponse = 1 {
NetworkCommissioningStatus networkingStatus = 0;
optional CHAR_STRING debugText = 1;
optional WiFiInterfaceScanResult wiFiScanResults[] = 2;
optional ThreadInterfaceScanResult threadScanResults[] = 3;
}

response struct NetworkConfigResponse {
response struct NetworkConfigResponse = 5 {
NetworkCommissioningStatus networkingStatus = 0;
optional CHAR_STRING debugText = 1;
optional INT8U networkIndex = 2;
}

response struct ConnectNetworkResponse {
response struct ConnectNetworkResponse = 7 {
NetworkCommissioningStatus networkingStatus = 0;
optional CHAR_STRING debugText = 1;
nullable INT32S errorValue = 2;
Expand Down Expand Up @@ -2290,7 +2290,7 @@ client cluster OtaSoftwareUpdateProvider = 41 {
INT32U softwareVersion = 1;
}

response struct ApplyUpdateResponse {
response struct ApplyUpdateResponse = 3 {
OTAApplyUpdateAction action = 0;
INT32U delayedActionTime = 1;
}
Expand Down Expand Up @@ -2517,21 +2517,21 @@ server cluster OperationalCredentials = 62 {
OCTET_STRING trustedRootIdentifier = 0;
}

response struct AttestationResponse {
response struct AttestationResponse = 1 {
OCTET_STRING attestationElements = 0;
OCTET_STRING signature = 1;
}

response struct CertificateChainResponse {
response struct CertificateChainResponse = 3 {
OCTET_STRING certificate = 0;
}

response struct CSRResponse {
response struct CSRResponse = 5 {
OCTET_STRING NOCSRElements = 0;
OCTET_STRING attestationSignature = 1;
}

response struct NOCResponse {
response struct NOCResponse = 8 {
OperationalCertStatus statusCode = 0;
optional fabric_idx fabricIndex = 1;
optional CHAR_STRING debugText = 2;
Expand Down Expand Up @@ -2814,13 +2814,13 @@ server cluster Scenes = 5 {
INT16U groupId = 0;
}

response struct AddSceneResponse {
response struct AddSceneResponse = 0 {
ENUM8 status = 0;
INT16U groupId = 1;
INT8U sceneId = 2;
}

response struct ViewSceneResponse {
response struct ViewSceneResponse = 1 {
ENUM8 status = 0;
INT16U groupId = 1;
INT8U sceneId = 2;
Expand All @@ -2829,24 +2829,24 @@ server cluster Scenes = 5 {
SceneExtensionFieldSet extensionFieldSets[] = 5;
}

response struct RemoveSceneResponse {
response struct RemoveSceneResponse = 2 {
ENUM8 status = 0;
INT16U groupId = 1;
INT8U sceneId = 2;
}

response struct RemoveAllScenesResponse {
response struct RemoveAllScenesResponse = 3 {
ENUM8 status = 0;
INT16U groupId = 1;
}

response struct StoreSceneResponse {
response struct StoreSceneResponse = 4 {
ENUM8 status = 0;
INT16U groupId = 1;
INT8U sceneId = 2;
}

response struct GetSceneMembershipResponse {
response struct GetSceneMembershipResponse = 6 {
ENUM8 status = 0;
INT8U capacity = 1;
INT16U groupId = 2;
Expand Down Expand Up @@ -3204,39 +3204,39 @@ server cluster TestCluster = 1295 {
INT8U arg1 = 0;
}

response struct TestSpecificResponse {
response struct TestSpecificResponse = 0 {
INT8U returnValue = 0;
}

response struct TestAddArgumentsResponse {
response struct TestAddArgumentsResponse = 1 {
INT8U returnValue = 0;
}

response struct TestListInt8UReverseResponse {
response struct TestListInt8UReverseResponse = 4 {
INT8U arg1[] = 0;
}

response struct TestEnumsResponse {
response struct TestEnumsResponse = 5 {
vendor_id arg1 = 0;
SimpleEnum arg2 = 1;
}

response struct TestNullableOptionalResponse {
response struct TestNullableOptionalResponse = 6 {
BOOLEAN wasPresent = 0;
optional BOOLEAN wasNull = 1;
optional INT8U value = 2;
optional nullable INT8U originalValue = 3;
}

response struct SimpleStructResponse {
response struct SimpleStructResponse = 9 {
SimpleStruct arg1 = 0;
}

response struct TestEmitTestEventResponse {
response struct TestEmitTestEventResponse = 10 {
INT64U value = 0;
}

response struct TestEmitTestFabricScopedEventResponse {
response struct TestEmitTestFabricScopedEventResponse = 11 {
INT64U value = 0;
}

Expand Down
20 changes: 10 additions & 10 deletions examples/bridge-app/bridge-common/bridge-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -327,17 +327,17 @@ server cluster GeneralCommissioning = 48 {
INT64U breadcrumb = 2;
}

response struct ArmFailSafeResponse {
response struct ArmFailSafeResponse = 1 {
CommissioningError errorCode = 0;
CHAR_STRING debugText = 1;
}

response struct SetRegulatoryConfigResponse {
response struct SetRegulatoryConfigResponse = 3 {
CommissioningError errorCode = 0;
CHAR_STRING debugText = 1;
}

response struct CommissioningCompleteResponse {
response struct CommissioningCompleteResponse = 5 {
CommissioningError errorCode = 0;
CHAR_STRING debugText = 1;
}
Expand Down Expand Up @@ -638,20 +638,20 @@ server cluster NetworkCommissioning = 49 {
optional INT64U breadcrumb = 2;
}

response struct ScanNetworksResponse {
response struct ScanNetworksResponse = 1 {
NetworkCommissioningStatus networkingStatus = 0;
optional CHAR_STRING debugText = 1;
optional WiFiInterfaceScanResult wiFiScanResults[] = 2;
optional ThreadInterfaceScanResult threadScanResults[] = 3;
}

response struct NetworkConfigResponse {
response struct NetworkConfigResponse = 5 {
NetworkCommissioningStatus networkingStatus = 0;
optional CHAR_STRING debugText = 1;
optional INT8U networkIndex = 2;
}

response struct ConnectNetworkResponse {
response struct ConnectNetworkResponse = 7 {
NetworkCommissioningStatus networkingStatus = 0;
optional CHAR_STRING debugText = 1;
nullable INT32S errorValue = 2;
Expand Down Expand Up @@ -781,21 +781,21 @@ server cluster OperationalCredentials = 62 {
OCTET_STRING trustedRootIdentifier = 0;
}

response struct AttestationResponse {
response struct AttestationResponse = 1 {
OCTET_STRING attestationElements = 0;
OCTET_STRING signature = 1;
}

response struct CertificateChainResponse {
response struct CertificateChainResponse = 3 {
OCTET_STRING certificate = 0;
}

response struct CSRResponse {
response struct CSRResponse = 5 {
OCTET_STRING NOCSRElements = 0;
OCTET_STRING attestationSignature = 1;
}

response struct NOCResponse {
response struct NOCResponse = 8 {
OperationalCertStatus statusCode = 0;
optional fabric_idx fabricIndex = 1;
optional CHAR_STRING debugText = 2;
Expand Down
Loading

0 comments on commit 2243557

Please sign in to comment.