From 11323263f86a023677e838c52c687717f8db7787 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 28 Mar 2023 16:23:26 -0400 Subject: [PATCH] Ensure all commands are generated for client cluster definitions in .matter IDL files (#25853) * Generate all client-side commands and structures. This requires zap updates after https://github.com/project-chip/zap/pull/981 * ZAP regen all * Use zap 2023.03.27 to pick up clusterName and responseName access * Update minimum zap version * Start using zcl_commands_source_client instead of chip_cluster_responses * Update invoke callbacks too to use updated stateless loop methods * Noop update: switch loop method and conditional that is not needed * Switch to source_server instead of source_client --------- Co-authored-by: Andrei Litvin --- .../all-clusters-app.matter | 35 +- .../all-clusters-minimal-app.matter | 21 +- ...p_rootnode_dimmablelight_bCwGYSDpoe.matter | 20 +- ...de_colortemperaturelight_hbUnzYVeyn.matter | 20 +- .../rootnode_contactsensor_lFAGG1bfRO.matter | 20 +- .../rootnode_dimmablelight_bCwGYSDpoe.matter | 20 +- .../rootnode_doorlock_aNKYAreMXE.matter | 20 +- ...tnode_extendedcolorlight_8lcaaYJVAa.matter | 20 +- .../devices/rootnode_fan_7N2TobIlOX.matter | 20 +- .../rootnode_flowsensor_1zVxHedlaV.matter | 70 +- ...tnode_heatingcoolingunit_ncdGai1E5a.matter | 49 +- .../rootnode_humiditysensor_Xyj4gda6Hb.matter | 70 +- .../rootnode_lightsensor_lZQycTFcJK.matter | 70 +- ...rootnode_occupancysensor_iHyVgifZuo.matter | 70 +- .../rootnode_onofflight_bbs1b7IaOV.matter | 20 +- ...ootnode_onofflightswitch_FsPlMr090Q.matter | 34 +- ...rootnode_onoffpluginunit_Wtf8ss5EBY.matter | 20 +- .../rootnode_pressuresensor_s0qC9wLH4k.matter | 70 +- .../rootnode_speaker_RpzeXdimqA.matter | 20 +- ...otnode_temperaturesensor_Qy1zkNW7c3.matter | 70 +- .../rootnode_thermostat_bm3fb8dhYi.matter | 20 +- .../rootnode_windowcovering_RLCxaGi9Yx.matter | 20 +- .../contact-sensor-app.matter | 20 +- .../light-switch-app.matter | 158 +- .../lighting-common/lighting-app.matter | 20 +- .../nxp/zap/lighting-on-off.matter | 20 +- examples/lighting-app/qpg/zap/light.matter | 20 +- .../data_model/lighting-wifi-app.matter | 20 +- .../data_model/lighting-thread-app.matter | 20 +- .../efr32/data_model/lighting-wifi-app.matter | 20 +- examples/lock-app/lock-common/lock-app.matter | 20 +- examples/lock-app/qpg/zap/lock.matter | 20 +- .../log-source-common/log-source-app.matter | 15 + .../ota-requestor-app.matter | 20 +- .../placeholder/linux/apps/app1/config.matter | 35 + .../placeholder/linux/apps/app2/config.matter | 35 + examples/pump-app/pump-common/pump-app.matter | 20 +- .../pump-controller-app.matter | 34 +- .../thermostat-common/thermostat.matter | 26 +- examples/tv-app/tv-common/tv-app.matter | 92 +- .../tv-casting-common/tv-casting-app.matter | 52 + examples/window-app/common/window-app.matter | 20 +- .../docker/images/chip-cert-bins/Dockerfile | 2 +- scripts/setup/zap.json | 2 +- scripts/tools/zap/zap_execution.py | 2 +- .../templates/app/MatterIDL.zapt | 17 +- .../data_model/controller-clusters.matter | 554 ++-- .../templates/CHIPInvokeCallbacks-src.zapt | 18 +- .../java/templates/CHIPInvokeCallbacks.zapt | 18 +- .../java/templates/CHIPReadCallbacks.zapt | 7 +- .../zap-generated/CHIPInvokeCallbacks.cpp | 2382 ++++++++++++++--- .../java/zap-generated/CHIPInvokeCallbacks.h | 137 + 52 files changed, 3608 insertions(+), 1017 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 99acb67bc867a9..15952f97027fef 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -273,9 +273,23 @@ client cluster OnOff = 6 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + request struct OffWithEffectRequest { + OnOffEffectIdentifier effectIdentifier = 0; + int8u effectVariant = 1; + } + + request struct OnWithTimedOffRequest { + OnOffControl onOffControl = 0; + int16u onTime = 1; + int16u offWaitTime = 2; + } + command Off(): DefaultSuccess = 0; command On(): DefaultSuccess = 1; command Toggle(): DefaultSuccess = 2; + command OffWithEffect(OffWithEffectRequest): DefaultSuccess = 64; + command OnWithRecallGlobalScene(): DefaultSuccess = 65; + command OnWithTimedOff(OnWithTimedOffRequest): DefaultSuccess = 66; } server cluster OnOff = 6 { @@ -746,14 +760,20 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; + response struct QueryImageResponse = 1 { + OTAQueryStatus 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 NotifyUpdateAppliedRequest { + request struct ApplyUpdateRequestRequest { OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; + INT32U newVersion = 1; } response struct ApplyUpdateResponse = 3 { @@ -761,6 +781,11 @@ client cluster OtaSoftwareUpdateProvider = 41 { INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index 6a8b066ef5148a..1239b9e94b7be8 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -631,14 +631,20 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; + response struct QueryImageResponse = 1 { + OTAQueryStatus 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 NotifyUpdateAppliedRequest { + request struct ApplyUpdateRequestRequest { OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; + INT32U newVersion = 1; } response struct ApplyUpdateResponse = 3 { @@ -646,6 +652,11 @@ client cluster OtaSoftwareUpdateProvider = 41 { INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter index 0138aa3207b6b2..445c03d26ec6f9 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter @@ -435,16 +435,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -456,11 +446,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter index 73f0fad8aa24b5..7e502f5b82b5f9 100644 --- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter +++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter @@ -444,16 +444,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -465,11 +455,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter index d69ad8d02016c8..a8e012b68e2b8a 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter @@ -288,16 +288,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -309,11 +299,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter index fa8f85729e31a4..8ebc417d54a189 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter @@ -435,16 +435,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -456,11 +446,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter index 0dda840f15e723..e0605669e54629 100644 --- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter +++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter @@ -288,16 +288,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -309,11 +299,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter index 8e42c417cef86f..1f87452815d8d8 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter @@ -435,16 +435,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -456,11 +446,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter index af6104234a63ff..c3ec45249a26a4 100644 --- a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter +++ b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter @@ -285,16 +285,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -306,11 +296,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter index 004787645dcf69..2d15955cae04fd 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter @@ -52,6 +52,56 @@ client cluster Groups = 4 { readonly attribute attrib_id attributeList[] = 65531; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + + request struct AddGroupRequest { + group_id groupID = 0; + CHAR_STRING groupName = 1; + } + + response struct AddGroupResponse = 0 { + ENUM8 status = 0; + group_id groupID = 1; + } + + request struct ViewGroupRequest { + group_id groupID = 0; + } + + response struct ViewGroupResponse = 1 { + ENUM8 status = 0; + group_id groupID = 1; + CHAR_STRING groupName = 2; + } + + request struct GetGroupMembershipRequest { + group_id groupList[] = 0; + } + + response struct GetGroupMembershipResponse = 2 { + nullable INT8U capacity = 0; + group_id groupList[] = 1; + } + + request struct RemoveGroupRequest { + group_id groupID = 0; + } + + response struct RemoveGroupResponse = 3 { + ENUM8 status = 0; + group_id groupID = 1; + } + + request struct AddGroupIfIdentifyingRequest { + group_id groupID = 0; + CHAR_STRING groupName = 1; + } + + fabric command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; + fabric command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; + fabric command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; + fabric command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; + fabric command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; + fabric command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; } server cluster Groups = 4 { @@ -302,16 +352,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -323,11 +363,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter index 8bfe255db605df..38d19b3fa41916 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter @@ -428,16 +428,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -449,11 +439,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; @@ -1356,6 +1356,35 @@ client cluster Thermostat = 513 { readonly attribute attrib_id attributeList[] = 65531; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + + request struct SetpointRaiseLowerRequest { + SetpointAdjustMode mode = 0; + INT8S amount = 1; + } + + response struct GetWeeklyScheduleResponse = 0 { + INT8U numberOfTransitionsForSequence = 0; + DayOfWeek dayOfWeekForSequence = 1; + ModeForSequence modeForSequence = 2; + ThermostatScheduleTransition transitions[] = 3; + } + + request struct SetWeeklyScheduleRequest { + INT8U numberOfTransitionsForSequence = 0; + DayOfWeek dayOfWeekForSequence = 1; + ModeForSequence modeForSequence = 2; + ThermostatScheduleTransition transitions[] = 3; + } + + request struct GetWeeklyScheduleRequest { + DayOfWeek daysToReturn = 0; + ModeForSequence modeToReturn = 1; + } + + command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; + command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; + command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; + command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; } server cluster FanControl = 514 { diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter index 7a45ce19377ed4..590522e2fc585a 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter @@ -52,6 +52,56 @@ client cluster Groups = 4 { readonly attribute attrib_id attributeList[] = 65531; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + + request struct AddGroupRequest { + group_id groupID = 0; + CHAR_STRING groupName = 1; + } + + response struct AddGroupResponse = 0 { + ENUM8 status = 0; + group_id groupID = 1; + } + + request struct ViewGroupRequest { + group_id groupID = 0; + } + + response struct ViewGroupResponse = 1 { + ENUM8 status = 0; + group_id groupID = 1; + CHAR_STRING groupName = 2; + } + + request struct GetGroupMembershipRequest { + group_id groupList[] = 0; + } + + response struct GetGroupMembershipResponse = 2 { + nullable INT8U capacity = 0; + group_id groupList[] = 1; + } + + request struct RemoveGroupRequest { + group_id groupID = 0; + } + + response struct RemoveGroupResponse = 3 { + ENUM8 status = 0; + group_id groupID = 1; + } + + request struct AddGroupIfIdentifyingRequest { + group_id groupID = 0; + CHAR_STRING groupName = 1; + } + + fabric command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; + fabric command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; + fabric command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; + fabric command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; + fabric command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; + fabric command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; } server cluster Groups = 4 { @@ -302,16 +352,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -323,11 +363,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter index b49f38eb025857..3dcf17d48c7ff0 100644 --- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter +++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter @@ -52,6 +52,56 @@ client cluster Groups = 4 { readonly attribute attrib_id attributeList[] = 65531; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + + request struct AddGroupRequest { + group_id groupID = 0; + CHAR_STRING groupName = 1; + } + + response struct AddGroupResponse = 0 { + ENUM8 status = 0; + group_id groupID = 1; + } + + request struct ViewGroupRequest { + group_id groupID = 0; + } + + response struct ViewGroupResponse = 1 { + ENUM8 status = 0; + group_id groupID = 1; + CHAR_STRING groupName = 2; + } + + request struct GetGroupMembershipRequest { + group_id groupList[] = 0; + } + + response struct GetGroupMembershipResponse = 2 { + nullable INT8U capacity = 0; + group_id groupList[] = 1; + } + + request struct RemoveGroupRequest { + group_id groupID = 0; + } + + response struct RemoveGroupResponse = 3 { + ENUM8 status = 0; + group_id groupID = 1; + } + + request struct AddGroupIfIdentifyingRequest { + group_id groupID = 0; + CHAR_STRING groupName = 1; + } + + fabric command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; + fabric command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; + fabric command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; + fabric command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; + fabric command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; + fabric command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; } server cluster Groups = 4 { @@ -302,16 +352,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -323,11 +363,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter index 4e218927f80eee..065f90ec06ecb0 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter @@ -52,6 +52,56 @@ client cluster Groups = 4 { readonly attribute attrib_id attributeList[] = 65531; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + + request struct AddGroupRequest { + group_id groupID = 0; + CHAR_STRING groupName = 1; + } + + response struct AddGroupResponse = 0 { + ENUM8 status = 0; + group_id groupID = 1; + } + + request struct ViewGroupRequest { + group_id groupID = 0; + } + + response struct ViewGroupResponse = 1 { + ENUM8 status = 0; + group_id groupID = 1; + CHAR_STRING groupName = 2; + } + + request struct GetGroupMembershipRequest { + group_id groupList[] = 0; + } + + response struct GetGroupMembershipResponse = 2 { + nullable INT8U capacity = 0; + group_id groupList[] = 1; + } + + request struct RemoveGroupRequest { + group_id groupID = 0; + } + + response struct RemoveGroupResponse = 3 { + ENUM8 status = 0; + group_id groupID = 1; + } + + request struct AddGroupIfIdentifyingRequest { + group_id groupID = 0; + CHAR_STRING groupName = 1; + } + + fabric command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; + fabric command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; + fabric command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; + fabric command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; + fabric command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; + fabric command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; } server cluster Groups = 4 { @@ -302,16 +352,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -323,11 +363,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter index 5c079a5eafd9e2..6d18c741e0aad5 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter @@ -435,16 +435,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -456,11 +446,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter index e4ad689f018f34..3c9508c676353e 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter @@ -146,9 +146,23 @@ client cluster OnOff = 6 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + request struct OffWithEffectRequest { + OnOffEffectIdentifier effectIdentifier = 0; + int8u effectVariant = 1; + } + + request struct OnWithTimedOffRequest { + OnOffControl onOffControl = 0; + int16u onTime = 1; + int16u offWaitTime = 2; + } + command Off(): DefaultSuccess = 0; command On(): DefaultSuccess = 1; command Toggle(): DefaultSuccess = 2; + command OffWithEffect(OffWithEffectRequest): DefaultSuccess = 64; + command OnWithRecallGlobalScene(): DefaultSuccess = 65; + command OnWithTimedOff(OnWithTimedOffRequest): DefaultSuccess = 66; } server cluster OnOff = 6 { @@ -378,16 +392,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -399,11 +403,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter index 2c7d1b9e16bab8..0276bf5ae756a8 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter @@ -335,16 +335,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -356,11 +346,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter index 146e6d58ad75f3..5ed77f2bbce450 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter @@ -57,6 +57,56 @@ client cluster Groups = 4 { readonly attribute attrib_id attributeList[] = 65531; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + + request struct AddGroupRequest { + group_id groupID = 0; + CHAR_STRING groupName = 1; + } + + response struct AddGroupResponse = 0 { + ENUM8 status = 0; + group_id groupID = 1; + } + + request struct ViewGroupRequest { + group_id groupID = 0; + } + + response struct ViewGroupResponse = 1 { + ENUM8 status = 0; + group_id groupID = 1; + CHAR_STRING groupName = 2; + } + + request struct GetGroupMembershipRequest { + group_id groupList[] = 0; + } + + response struct GetGroupMembershipResponse = 2 { + nullable INT8U capacity = 0; + group_id groupList[] = 1; + } + + request struct RemoveGroupRequest { + group_id groupID = 0; + } + + response struct RemoveGroupResponse = 3 { + ENUM8 status = 0; + group_id groupID = 1; + } + + request struct AddGroupIfIdentifyingRequest { + group_id groupID = 0; + CHAR_STRING groupName = 1; + } + + fabric command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; + fabric command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; + fabric command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; + fabric command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; + fabric command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; + fabric command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; } server cluster Groups = 4 { @@ -307,16 +357,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -328,11 +368,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter index 0c1041f3c77441..743bd76be3c33f 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter @@ -429,16 +429,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -450,11 +440,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter index 951abb3781f2b6..457122418c3c17 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter @@ -52,6 +52,56 @@ client cluster Groups = 4 { readonly attribute attrib_id attributeList[] = 65531; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + + request struct AddGroupRequest { + group_id groupID = 0; + CHAR_STRING groupName = 1; + } + + response struct AddGroupResponse = 0 { + ENUM8 status = 0; + group_id groupID = 1; + } + + request struct ViewGroupRequest { + group_id groupID = 0; + } + + response struct ViewGroupResponse = 1 { + ENUM8 status = 0; + group_id groupID = 1; + CHAR_STRING groupName = 2; + } + + request struct GetGroupMembershipRequest { + group_id groupList[] = 0; + } + + response struct GetGroupMembershipResponse = 2 { + nullable INT8U capacity = 0; + group_id groupList[] = 1; + } + + request struct RemoveGroupRequest { + group_id groupID = 0; + } + + response struct RemoveGroupResponse = 3 { + ENUM8 status = 0; + group_id groupID = 1; + } + + request struct AddGroupIfIdentifyingRequest { + group_id groupID = 0; + CHAR_STRING groupName = 1; + } + + fabric command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; + fabric command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; + fabric command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; + fabric command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; + fabric command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; + fabric command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; } server cluster Groups = 4 { @@ -302,16 +352,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -323,11 +363,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter index 03bc1853fbd387..19e12b4c59cd30 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter @@ -288,16 +288,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -309,11 +299,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter index 7eb2860ebe40b4..0964ab1c480122 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter @@ -288,16 +288,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -309,11 +299,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter index 7b59e70d22e86c..8d5733d7027a5f 100644 --- a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter +++ b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter @@ -290,16 +290,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -311,11 +301,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.matter b/examples/light-switch-app/light-switch-common/light-switch-app.matter index 8c609e0e857717..0e76a36aae3e85 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.matter +++ b/examples/light-switch-app/light-switch-common/light-switch-app.matter @@ -37,6 +37,18 @@ client cluster Identify = 3 { readonly attribute attrib_id attributeList[] = 65531; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + + request struct IdentifyRequest { + INT16U identifyTime = 0; + } + + request struct TriggerEffectRequest { + IdentifyEffectIdentifier effectIdentifier = 0; + IdentifyEffectVariant effectVariant = 1; + } + + command access(invoke: manage) Identify(IdentifyRequest): DefaultSuccess = 0; + command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; } server cluster Identify = 3 { @@ -188,25 +200,57 @@ client cluster Scenes = 5 { ExtensionFieldSet extensionFieldSets[] = 4; } + response struct AddSceneResponse = 0 { + ENUM8 status = 0; + group_id groupID = 1; + INT8U sceneID = 2; + } + request struct ViewSceneRequest { group_id groupID = 0; INT8U sceneID = 1; } + response struct ViewSceneResponse = 1 { + ENUM8 status = 0; + group_id groupID = 1; + INT8U sceneID = 2; + optional INT16U transitionTime = 3; + optional CHAR_STRING sceneName = 4; + optional ExtensionFieldSet extensionFieldSets[] = 5; + } + request struct RemoveSceneRequest { group_id groupID = 0; INT8U sceneID = 1; } + response struct RemoveSceneResponse = 2 { + ENUM8 status = 0; + group_id groupID = 1; + INT8U sceneID = 2; + } + request struct RemoveAllScenesRequest { group_id groupID = 0; } + response struct RemoveAllScenesResponse = 3 { + ENUM8 status = 0; + group_id groupID = 1; + } + request struct StoreSceneRequest { group_id groupID = 0; INT8U sceneID = 1; } + response struct StoreSceneResponse = 4 { + ENUM8 status = 0; + group_id groupID = 1; + INT8U sceneID = 2; + } + request struct RecallSceneRequest { group_id groupID = 0; INT8U sceneID = 1; @@ -217,43 +261,53 @@ client cluster Scenes = 5 { group_id groupID = 0; } - response struct AddSceneResponse = 0 { + response struct GetSceneMembershipResponse = 6 { ENUM8 status = 0; - group_id groupID = 1; - INT8U sceneID = 2; + nullable INT8U capacity = 1; + group_id groupID = 2; + optional INT8U sceneList[] = 3; } - response struct ViewSceneResponse = 1 { - ENUM8 status = 0; - group_id groupID = 1; - INT8U sceneID = 2; - optional INT16U transitionTime = 3; - optional CHAR_STRING sceneName = 4; - optional ExtensionFieldSet extensionFieldSets[] = 5; + request struct EnhancedAddSceneRequest { + group_id groupID = 0; + INT8U sceneID = 1; + INT16U transitionTime = 2; + CHAR_STRING sceneName = 3; + ExtensionFieldSet extensionFieldSets[] = 4; } - response struct RemoveSceneResponse = 2 { + response struct EnhancedAddSceneResponse = 64 { ENUM8 status = 0; group_id groupID = 1; INT8U sceneID = 2; } - response struct RemoveAllScenesResponse = 3 { - ENUM8 status = 0; - group_id groupID = 1; + request struct EnhancedViewSceneRequest { + group_id groupID = 0; + INT8U sceneID = 1; } - response struct StoreSceneResponse = 4 { + response struct EnhancedViewSceneResponse = 65 { ENUM8 status = 0; - group_id groupID = 1; + group_Id groupID = 1; INT8U sceneID = 2; + optional INT16U transitionTime = 3; + optional CHAR_STRING sceneName = 4; + optional ExtensionFieldSet extensionFieldSets[] = 5; } - response struct GetSceneMembershipResponse = 6 { + request struct CopySceneRequest { + ScenesCopyMode mode = 0; + group_id groupIdentifierFrom = 1; + INT8U sceneIdentifierFrom = 2; + group_id groupIdentifierTo = 3; + INT8U sceneIdentifierTo = 4; + } + + response struct CopySceneResponse = 66 { ENUM8 status = 0; - nullable INT8U capacity = 1; - group_id groupID = 2; - optional INT8U sceneList[] = 3; + group_Id groupIdentifierFrom = 1; + INT8U sceneIdentifierFrom = 2; } fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; @@ -263,6 +317,9 @@ client cluster Scenes = 5 { fabric command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; fabric command RecallScene(RecallSceneRequest): DefaultSuccess = 5; fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; + fabric command EnhancedAddScene(EnhancedAddSceneRequest): EnhancedAddSceneResponse = 64; + fabric command EnhancedViewScene(EnhancedViewSceneRequest): EnhancedViewSceneResponse = 65; + fabric command CopyScene(CopySceneRequest): CopySceneResponse = 66; } client cluster OnOff = 6 { @@ -307,9 +364,23 @@ client cluster OnOff = 6 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + request struct OffWithEffectRequest { + OnOffEffectIdentifier effectIdentifier = 0; + int8u effectVariant = 1; + } + + request struct OnWithTimedOffRequest { + OnOffControl onOffControl = 0; + int16u onTime = 1; + int16u offWaitTime = 2; + } + command Off(): DefaultSuccess = 0; command On(): DefaultSuccess = 1; command Toggle(): DefaultSuccess = 2; + command OffWithEffect(OffWithEffectRequest): DefaultSuccess = 64; + command OnWithRecallGlobalScene(): DefaultSuccess = 65; + command OnWithTimedOff(OnWithTimedOffRequest): DefaultSuccess = 66; } server cluster Descriptor = 29 { @@ -505,16 +576,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -526,11 +587,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; @@ -1847,6 +1918,30 @@ client cluster ColorControl = 768 { BITMAP8 optionsOverride = 6; } + request struct StopMoveStepRequest { + BITMAP8 optionsMask = 0; + BITMAP8 optionsOverride = 1; + } + + request struct MoveColorTemperatureRequest { + HueMoveMode moveMode = 0; + INT16U rate = 1; + INT16U colorTemperatureMinimumMireds = 2; + INT16U colorTemperatureMaximumMireds = 3; + BITMAP8 optionsMask = 4; + BITMAP8 optionsOverride = 5; + } + + request struct StepColorTemperatureRequest { + HueStepMode stepMode = 0; + INT16U stepSize = 1; + INT16U transitionTime = 2; + INT16U colorTemperatureMinimumMireds = 3; + INT16U colorTemperatureMaximumMireds = 4; + BITMAP8 optionsMask = 5; + BITMAP8 optionsOverride = 6; + } + command MoveToHue(MoveToHueRequest): DefaultSuccess = 0; command MoveHue(MoveHueRequest): DefaultSuccess = 1; command StepHue(StepHueRequest): DefaultSuccess = 2; @@ -1863,6 +1958,9 @@ client cluster ColorControl = 768 { command EnhancedStepHue(EnhancedStepHueRequest): DefaultSuccess = 66; command EnhancedMoveToHueAndSaturation(EnhancedMoveToHueAndSaturationRequest): DefaultSuccess = 67; command ColorLoopSet(ColorLoopSetRequest): DefaultSuccess = 68; + command StopMoveStep(StopMoveStepRequest): DefaultSuccess = 71; + command MoveColorTemperature(MoveColorTemperatureRequest): DefaultSuccess = 75; + command StepColorTemperature(StepColorTemperatureRequest): DefaultSuccess = 76; } endpoint 0 { diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index 73f3b486a12dbd..1e161ac23a4dd4 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -458,16 +458,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -479,11 +469,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/lighting-app/nxp/zap/lighting-on-off.matter b/examples/lighting-app/nxp/zap/lighting-on-off.matter index 0dba423775462d..3500e8495eeea3 100644 --- a/examples/lighting-app/nxp/zap/lighting-on-off.matter +++ b/examples/lighting-app/nxp/zap/lighting-on-off.matter @@ -432,16 +432,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -453,11 +443,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/lighting-app/qpg/zap/light.matter b/examples/lighting-app/qpg/zap/light.matter index 27e8f79439d858..9d834376448eef 100644 --- a/examples/lighting-app/qpg/zap/light.matter +++ b/examples/lighting-app/qpg/zap/light.matter @@ -448,16 +448,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -469,11 +459,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/lighting-app/silabs/SiWx917/data_model/lighting-wifi-app.matter b/examples/lighting-app/silabs/SiWx917/data_model/lighting-wifi-app.matter index 0ca16845849b6a..6a42b154aac475 100644 --- a/examples/lighting-app/silabs/SiWx917/data_model/lighting-wifi-app.matter +++ b/examples/lighting-app/silabs/SiWx917/data_model/lighting-wifi-app.matter @@ -458,16 +458,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -479,11 +469,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/lighting-app/silabs/efr32/data_model/lighting-thread-app.matter b/examples/lighting-app/silabs/efr32/data_model/lighting-thread-app.matter index 34ecc1a58681f0..4d385620740e39 100644 --- a/examples/lighting-app/silabs/efr32/data_model/lighting-thread-app.matter +++ b/examples/lighting-app/silabs/efr32/data_model/lighting-thread-app.matter @@ -458,16 +458,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -479,11 +469,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/lighting-app/silabs/efr32/data_model/lighting-wifi-app.matter b/examples/lighting-app/silabs/efr32/data_model/lighting-wifi-app.matter index 0ca16845849b6a..6a42b154aac475 100644 --- a/examples/lighting-app/silabs/efr32/data_model/lighting-wifi-app.matter +++ b/examples/lighting-app/silabs/efr32/data_model/lighting-wifi-app.matter @@ -458,16 +458,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -479,11 +469,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index 3f175fc88bea6a..3eda18cb740025 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -267,16 +267,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -288,11 +278,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/lock-app/qpg/zap/lock.matter b/examples/lock-app/qpg/zap/lock.matter index 163de91d88ab64..4ddc5031fcbd35 100644 --- a/examples/lock-app/qpg/zap/lock.matter +++ b/examples/lock-app/qpg/zap/lock.matter @@ -284,16 +284,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -305,11 +295,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/log-source-app/log-source-common/log-source-app.matter b/examples/log-source-app/log-source-common/log-source-app.matter index 70fa6cfcede0ac..78d2373c901fff 100644 --- a/examples/log-source-app/log-source-common/log-source-app.matter +++ b/examples/log-source-app/log-source-common/log-source-app.matter @@ -282,6 +282,21 @@ client cluster DiagnosticLogs = 50 { readonly attribute attrib_id attributeList[] = 65531; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + + request struct RetrieveLogsRequestRequest { + IntentEnum intent = 0; + TransferProtocolEnum requestedProtocol = 1; + optional CHAR_STRING<32> transferFileDesignator = 2; + } + + response struct RetrieveLogsResponse = 1 { + StatusEnum status = 0; + LONG_OCTET_STRING logContent = 1; + optional epoch_us UTCTimeStamp = 2; + optional systime_us timeSinceBoot = 3; + } + + command RetrieveLogsRequest(RetrieveLogsRequestRequest): RetrieveLogsResponse = 0; } server cluster DiagnosticLogs = 50 { diff --git a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter index aa541eeaf95d44..7703e5868d8de9 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter +++ b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter @@ -351,16 +351,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -372,11 +362,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index e7951c4c0ac5d6..431355947c74b7 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -1046,12 +1046,27 @@ client cluster GeneralCommissioning = 48 { INT64U breadcrumb = 1; } + response struct ArmFailSafeResponse = 1 { + CommissioningError errorCode = 0; + CHAR_STRING debugText = 1; + } + request struct SetRegulatoryConfigRequest { RegulatoryLocationType newRegulatoryConfig = 0; CHAR_STRING countryCode = 1; INT64U breadcrumb = 2; } + response struct SetRegulatoryConfigResponse = 3 { + CommissioningError errorCode = 0; + CHAR_STRING debugText = 1; + } + + response struct CommissioningCompleteResponse = 5 { + CommissioningError errorCode = 0; + CHAR_STRING debugText = 1; + } + command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; @@ -1696,15 +1711,29 @@ client cluster OperationalCredentials = 62 { OCTET_STRING attestationNonce = 0; } + response struct AttestationResponse = 1 { + OCTET_STRING attestationElements = 0; + OCTET_STRING attestationSignature = 1; + } + request struct CertificateChainRequestRequest { CertificateChainTypeEnum certificateType = 0; } + response struct CertificateChainResponse = 3 { + OCTET_STRING certificate = 0; + } + request struct CSRRequestRequest { OCTET_STRING CSRNonce = 0; optional boolean isForUpdateNOC = 1; } + response struct CSRResponse = 5 { + OCTET_STRING NOCSRElements = 0; + OCTET_STRING attestationSignature = 1; + } + request struct AddNOCRequest { OCTET_STRING NOCValue = 0; optional OCTET_STRING ICACValue = 1; @@ -1718,6 +1747,12 @@ client cluster OperationalCredentials = 62 { optional OCTET_STRING ICACValue = 1; } + response struct NOCResponse = 8 { + NodeOperationalCertStatusEnum statusCode = 0; + optional fabric_idx fabricIndex = 1; + optional CHAR_STRING debugText = 2; + } + request struct UpdateFabricLabelRequest { CHAR_STRING<32> label = 0; } diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 4027d5b05c70a8..83e613404cf957 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -1015,12 +1015,27 @@ client cluster GeneralCommissioning = 48 { INT64U breadcrumb = 1; } + response struct ArmFailSafeResponse = 1 { + CommissioningError errorCode = 0; + CHAR_STRING debugText = 1; + } + request struct SetRegulatoryConfigRequest { RegulatoryLocationType newRegulatoryConfig = 0; CHAR_STRING countryCode = 1; INT64U breadcrumb = 2; } + response struct SetRegulatoryConfigResponse = 3 { + CommissioningError errorCode = 0; + CHAR_STRING debugText = 1; + } + + response struct CommissioningCompleteResponse = 5 { + CommissioningError errorCode = 0; + CHAR_STRING debugText = 1; + } + command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; @@ -1665,15 +1680,29 @@ client cluster OperationalCredentials = 62 { OCTET_STRING attestationNonce = 0; } + response struct AttestationResponse = 1 { + OCTET_STRING attestationElements = 0; + OCTET_STRING attestationSignature = 1; + } + request struct CertificateChainRequestRequest { CertificateChainTypeEnum certificateType = 0; } + response struct CertificateChainResponse = 3 { + OCTET_STRING certificate = 0; + } + request struct CSRRequestRequest { OCTET_STRING CSRNonce = 0; optional boolean isForUpdateNOC = 1; } + response struct CSRResponse = 5 { + OCTET_STRING NOCSRElements = 0; + OCTET_STRING attestationSignature = 1; + } + request struct AddNOCRequest { OCTET_STRING NOCValue = 0; optional OCTET_STRING ICACValue = 1; @@ -1687,6 +1716,12 @@ client cluster OperationalCredentials = 62 { optional OCTET_STRING ICACValue = 1; } + response struct NOCResponse = 8 { + NodeOperationalCertStatusEnum statusCode = 0; + optional fabric_idx fabricIndex = 1; + optional CHAR_STRING debugText = 2; + } + request struct UpdateFabricLabelRequest { CHAR_STRING<32> label = 0; } diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter index 00ebcb517d0681..373f97b9009088 100644 --- a/examples/pump-app/pump-common/pump-app.matter +++ b/examples/pump-app/pump-common/pump-app.matter @@ -371,16 +371,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -392,11 +382,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter index 28c489b5177d1c..b946e34e98496c 100644 --- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter +++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter @@ -82,9 +82,23 @@ client cluster OnOff = 6 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + request struct OffWithEffectRequest { + OnOffEffectIdentifier effectIdentifier = 0; + int8u effectVariant = 1; + } + + request struct OnWithTimedOffRequest { + OnOffControl onOffControl = 0; + int16u onTime = 1; + int16u offWaitTime = 2; + } + command Off(): DefaultSuccess = 0; command On(): DefaultSuccess = 1; command Toggle(): DefaultSuccess = 2; + command OffWithEffect(OffWithEffectRequest): DefaultSuccess = 64; + command OnWithRecallGlobalScene(): DefaultSuccess = 65; + command OnWithTimedOff(OnWithTimedOffRequest): DefaultSuccess = 66; } server cluster Descriptor = 29 { @@ -277,16 +291,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -298,11 +302,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index 14a7a104b6c205..22f2349c5bbab4 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -42,7 +42,13 @@ client cluster Identify = 3 { INT16U identifyTime = 0; } + request struct TriggerEffectRequest { + IdentifyEffectIdentifier effectIdentifier = 0; + IdentifyEffectVariant effectVariant = 1; + } + command access(invoke: manage) Identify(IdentifyRequest): DefaultSuccess = 0; + command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; } server cluster Identify = 3 { @@ -463,16 +469,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -484,11 +480,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index 27726bd2435045..7fc27309c83ad8 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -503,17 +503,17 @@ client cluster GeneralCommissioning = 48 { INT64U breadcrumb = 1; } + response struct ArmFailSafeResponse = 1 { + CommissioningError errorCode = 0; + CHAR_STRING debugText = 1; + } + request struct SetRegulatoryConfigRequest { RegulatoryLocationType newRegulatoryConfig = 0; CHAR_STRING countryCode = 1; INT64U breadcrumb = 2; } - response struct ArmFailSafeResponse = 1 { - CommissioningError errorCode = 0; - CHAR_STRING debugText = 1; - } - response struct SetRegulatoryConfigResponse = 3 { CommissioningError errorCode = 0; CHAR_STRING debugText = 1; @@ -676,6 +676,13 @@ client cluster NetworkCommissioning = 49 { optional INT64U breadcrumb = 1; } + response struct ScanNetworksResponse = 1 { + NetworkCommissioningStatus networkingStatus = 0; + optional CHAR_STRING debugText = 1; + optional WiFiInterfaceScanResult wiFiScanResults[] = 2; + optional ThreadInterfaceScanResult threadScanResults[] = 3; + } + request struct AddOrUpdateWiFiNetworkRequest { OCTET_STRING<32> ssid = 0; OCTET_STRING<64> credentials = 1; @@ -692,36 +699,29 @@ client cluster NetworkCommissioning = 49 { optional INT64U breadcrumb = 1; } - request struct ConnectNetworkRequest { - OCTET_STRING<32> networkID = 0; - optional INT64U breadcrumb = 1; - } - - request struct ReorderNetworkRequest { - OCTET_STRING<32> networkID = 0; - INT8U networkIndex = 1; - optional INT64U breadcrumb = 2; - } - - response struct ScanNetworksResponse = 1 { - NetworkCommissioningStatus networkingStatus = 0; - optional CHAR_STRING debugText = 1; - optional WiFiInterfaceScanResult wiFiScanResults[] = 2; - optional ThreadInterfaceScanResult threadScanResults[] = 3; - } - response struct NetworkConfigResponse = 5 { NetworkCommissioningStatus networkingStatus = 0; optional CHAR_STRING<512> debugText = 1; optional INT8U networkIndex = 2; } + request struct ConnectNetworkRequest { + OCTET_STRING<32> networkID = 0; + optional INT64U breadcrumb = 1; + } + response struct ConnectNetworkResponse = 7 { NetworkCommissioningStatus networkingStatus = 0; optional CHAR_STRING debugText = 1; nullable INT32S errorValue = 2; } + request struct ReorderNetworkRequest { + OCTET_STRING<32> networkID = 0; + INT8U networkIndex = 1; + optional INT64U breadcrumb = 2; + } + command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; @@ -1398,15 +1398,29 @@ client cluster OperationalCredentials = 62 { OCTET_STRING attestationNonce = 0; } + response struct AttestationResponse = 1 { + OCTET_STRING attestationElements = 0; + OCTET_STRING attestationSignature = 1; + } + request struct CertificateChainRequestRequest { CertificateChainTypeEnum certificateType = 0; } + response struct CertificateChainResponse = 3 { + OCTET_STRING certificate = 0; + } + request struct CSRRequestRequest { OCTET_STRING CSRNonce = 0; optional boolean isForUpdateNOC = 1; } + response struct CSRResponse = 5 { + OCTET_STRING NOCSRElements = 0; + OCTET_STRING attestationSignature = 1; + } + request struct AddNOCRequest { OCTET_STRING NOCValue = 0; optional OCTET_STRING ICACValue = 1; @@ -1415,6 +1429,17 @@ client cluster OperationalCredentials = 62 { VENDOR_ID adminVendorId = 4; } + request struct UpdateNOCRequest { + OCTET_STRING NOCValue = 0; + optional OCTET_STRING ICACValue = 1; + } + + response struct NOCResponse = 8 { + NodeOperationalCertStatusEnum statusCode = 0; + optional fabric_idx fabricIndex = 1; + optional CHAR_STRING debugText = 2; + } + request struct UpdateFabricLabelRequest { CHAR_STRING<32> label = 0; } @@ -1427,30 +1452,11 @@ client cluster OperationalCredentials = 62 { OCTET_STRING rootCACertificate = 0; } - response struct AttestationResponse = 1 { - OCTET_STRING attestationElements = 0; - OCTET_STRING attestationSignature = 1; - } - - response struct CertificateChainResponse = 3 { - OCTET_STRING certificate = 0; - } - - response struct CSRResponse = 5 { - OCTET_STRING NOCSRElements = 0; - OCTET_STRING attestationSignature = 1; - } - - response struct NOCResponse = 8 { - NodeOperationalCertStatusEnum statusCode = 0; - optional fabric_idx fabricIndex = 1; - optional CHAR_STRING debugText = 2; - } - command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; + fabric command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; fabric command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10; command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter index 5407e91327de6e..6a6265db98c4b4 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter @@ -267,9 +267,23 @@ client cluster OnOff = 6 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + request struct OffWithEffectRequest { + OnOffEffectIdentifier effectIdentifier = 0; + int8u effectVariant = 1; + } + + request struct OnWithTimedOffRequest { + OnOffControl onOffControl = 0; + int16u onTime = 1; + int16u offWaitTime = 2; + } + command Off(): DefaultSuccess = 0; command On(): DefaultSuccess = 1; command Toggle(): DefaultSuccess = 2; + command OffWithEffect(OffWithEffectRequest): DefaultSuccess = 64; + command OnWithRecallGlobalScene(): DefaultSuccess = 65; + command OnWithTimedOff(OnWithTimedOffRequest): DefaultSuccess = 66; } server cluster OnOff = 6 { @@ -416,6 +430,10 @@ client cluster LevelControl = 8 { LevelControlOptions optionsOverride = 1; } + request struct MoveToClosestFrequencyRequest { + INT16U frequency = 0; + } + command MoveToLevel(MoveToLevelRequest): DefaultSuccess = 0; command Move(MoveRequest): DefaultSuccess = 1; command Step(StepRequest): DefaultSuccess = 2; @@ -424,6 +442,7 @@ client cluster LevelControl = 8 { command MoveWithOnOff(MoveWithOnOffRequest): DefaultSuccess = 5; command StepWithOnOff(StepWithOnOffRequest): DefaultSuccess = 6; command StopWithOnOff(StopWithOnOffRequest): DefaultSuccess = 7; + command MoveToClosestFrequency(MoveToClosestFrequencyRequest): DefaultSuccess = 8; } server cluster LevelControl = 8 { @@ -1852,6 +1871,11 @@ client cluster Channel = 1284 { CHAR_STRING match = 0; } + response struct ChangeChannelResponse = 1 { + ChannelStatusEnum status = 0; + optional CHAR_STRING data = 1; + } + request struct ChangeChannelByNumberRequest { INT16U majorNumber = 0; INT16U minorNumber = 1; @@ -1892,6 +1916,11 @@ client cluster TargetNavigator = 1285 { optional CHAR_STRING data = 1; } + response struct NavigateTargetResponse = 1 { + TargetNavigatorStatusEnum status = 0; + optional CHAR_STRING data = 1; + } + command NavigateTarget(NavigateTargetRequest): NavigateTargetResponse = 0; } @@ -1944,6 +1973,11 @@ client cluster MediaPlayback = 1286 { INT64U deltaPositionMilliseconds = 0; } + response struct PlaybackResponse = 10 { + MediaPlaybackStatusEnum status = 0; + optional CHAR_STRING data = 1; + } + request struct SeekRequest { INT64U position = 0; } @@ -2125,6 +2159,10 @@ client cluster KeypadInput = 1289 { CecKeyCode keyCode = 0; } + response struct SendKeyResponse = 1 { + KeypadInputStatusEnum status = 0; + } + command SendKey(SendKeyRequest): SendKeyResponse = 0; } @@ -2224,6 +2262,11 @@ client cluster ContentLauncher = 1290 { optional BrandingInformationStruct brandingInformation = 2; } + response struct LauncherResponse = 2 { + ContentLaunchStatusEnum status = 0; + optional CHAR_STRING data = 1; + } + command LaunchContent(LaunchContentRequest): LauncherResponse = 0; command LaunchURL(LaunchURLRequest): LauncherResponse = 1; } @@ -2313,6 +2356,11 @@ client cluster ApplicationLauncher = 1292 { optional ApplicationStruct application = 0; } + response struct LauncherResponse = 3 { + ApplicationLauncherStatusEnum status = 0; + optional OCTET_STRING data = 1; + } + command LaunchApp(LaunchAppRequest): LauncherResponse = 0; command StopApp(StopAppRequest): LauncherResponse = 1; command HideApp(HideAppRequest): LauncherResponse = 2; @@ -2359,6 +2407,10 @@ client cluster AccountLogin = 1294 { CHAR_STRING<100> tempAccountIdentifier = 0; } + response struct GetSetupPINResponse = 1 { + CHAR_STRING setupPIN = 0; + } + request struct LoginRequest { CHAR_STRING<100> tempAccountIdentifier = 0; CHAR_STRING setupPIN = 1; diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index 76f47712d12acc..533148aa5ea7f2 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -406,16 +406,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -427,11 +417,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; diff --git a/integrations/docker/images/chip-cert-bins/Dockerfile b/integrations/docker/images/chip-cert-bins/Dockerfile index cef22b4e632eea..94a650d139ae0b 100644 --- a/integrations/docker/images/chip-cert-bins/Dockerfile +++ b/integrations/docker/images/chip-cert-bins/Dockerfile @@ -7,7 +7,7 @@ ARG COMMITHASH=7b99e6399c6069037c613782d78132c69b9dcabb # ZAP Development install, so that it runs on both x64 and arm64 # Generally this should match with the ZAP version that is used for codegen within the # specified SHA -ARG ZAP_VERSION=v2023.03.23-nightly +ARG ZAP_VERSION=v2023.03.27-nightly # Ensure TARGETPLATFORM is set RUN case ${TARGETPLATFORM} in \ diff --git a/scripts/setup/zap.json b/scripts/setup/zap.json index a6a2a4c7d16e95..c27c39a1674dae 100644 --- a/scripts/setup/zap.json +++ b/scripts/setup/zap.json @@ -8,7 +8,7 @@ "mac-arm64", "windows-amd64" ], - "tags": ["version:2@v2023.03.23-nightly.1"] + "tags": ["version:2@v2023.03.27-nightly.1"] } ] } diff --git a/scripts/tools/zap/zap_execution.py b/scripts/tools/zap/zap_execution.py index 0a47b95160cfc3..6e5fbab32fe7e2 100644 --- a/scripts/tools/zap/zap_execution.py +++ b/scripts/tools/zap/zap_execution.py @@ -23,7 +23,7 @@ # Use scripts/tools/zap/version_update.py to manage ZAP versioning as many # files may need updating for versions # -MIN_ZAP_VERSION = '2023.3.23' +MIN_ZAP_VERSION = '2023.3.27' class ZapTool: diff --git a/src/app/zap-templates/templates/app/MatterIDL.zapt b/src/app/zap-templates/templates/app/MatterIDL.zapt index 875b1fb3f562e5..6861166ef75195 100644 --- a/src/app/zap-templates/templates/app/MatterIDL.zapt +++ b/src/app/zap-templates/templates/app/MatterIDL.zapt @@ -82,17 +82,16 @@ {{~!--Close:Generating command request structs for all incoming commands into server side--~}} {{~!--Open:Generating command request structs for all outgoing commands from client side--~}} {{#if (is_client side)}} - {{#all_outgoing_commands_for_cluster name side}} + {{#zcl_commands}} + {{#if (isStrEqual source "client")}} {{~>idl_command_request_struct}} - {{/all_outgoing_commands_for_cluster}} + {{else}} + {{~>idl_command_response_struct}} + {{/if}} + {{/zcl_commands}} {{/if}} {{~!--Close:Generating command request structs for all outgoing commands from client side--~}} {{~!--Open:Generating command response structs for all incoming commands into client side--~}} - {{#if (is_client side)}} - {{#all_incoming_commands_for_cluster name side}} - {{~>idl_command_response_struct}} - {{/all_incoming_commands_for_cluster}} - {{/if}} {{~!--Close:Generating command response structs for all incoming commands into client side--~}} {{~!--Open:Generating command response structs for all outgoing commands from server side--~}} {{#if (is_server side)}} @@ -107,9 +106,9 @@ {{/all_incoming_commands_for_cluster}} {{/if}} {{#if (is_client side)}} - {{#all_outgoing_commands_for_cluster name side}} + {{#zcl_commands_source_client}} {{~>idl_command_request_response}}{{~new_line 1~}} - {{/all_outgoing_commands_for_cluster}} + {{/zcl_commands_source_client}} {{/if}} } diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 0779181c512f58..0e313ecd0b564b 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -74,44 +74,44 @@ client cluster Groups = 4 { CHAR_STRING groupName = 1; } - request struct ViewGroupRequest { - group_id groupID = 0; - } - - request struct GetGroupMembershipRequest { - group_id groupList[] = 0; - } - - request struct RemoveGroupRequest { - group_id groupID = 0; - } - - request struct AddGroupIfIdentifyingRequest { - group_id groupID = 0; - CHAR_STRING groupName = 1; - } - response struct AddGroupResponse = 0 { ENUM8 status = 0; group_id groupID = 1; } + request struct ViewGroupRequest { + group_id groupID = 0; + } + response struct ViewGroupResponse = 1 { ENUM8 status = 0; group_id groupID = 1; CHAR_STRING groupName = 2; } + request struct GetGroupMembershipRequest { + group_id groupList[] = 0; + } + response struct GetGroupMembershipResponse = 2 { nullable INT8U capacity = 0; group_id groupList[] = 1; } + request struct RemoveGroupRequest { + group_id groupID = 0; + } + response struct RemoveGroupResponse = 3 { ENUM8 status = 0; group_id groupID = 1; } + request struct AddGroupIfIdentifyingRequest { + group_id groupID = 0; + CHAR_STRING groupName = 1; + } + fabric command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; fabric command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; fabric command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; @@ -160,25 +160,57 @@ client cluster Scenes = 5 { ExtensionFieldSet extensionFieldSets[] = 4; } + response struct AddSceneResponse = 0 { + ENUM8 status = 0; + group_id groupID = 1; + INT8U sceneID = 2; + } + request struct ViewSceneRequest { group_id groupID = 0; INT8U sceneID = 1; } + response struct ViewSceneResponse = 1 { + ENUM8 status = 0; + group_id groupID = 1; + INT8U sceneID = 2; + optional INT16U transitionTime = 3; + optional CHAR_STRING sceneName = 4; + optional ExtensionFieldSet extensionFieldSets[] = 5; + } + request struct RemoveSceneRequest { group_id groupID = 0; INT8U sceneID = 1; } + response struct RemoveSceneResponse = 2 { + ENUM8 status = 0; + group_id groupID = 1; + INT8U sceneID = 2; + } + request struct RemoveAllScenesRequest { group_id groupID = 0; } + response struct RemoveAllScenesResponse = 3 { + ENUM8 status = 0; + group_id groupID = 1; + } + request struct StoreSceneRequest { group_id groupID = 0; INT8U sceneID = 1; } + response struct StoreSceneResponse = 4 { + ENUM8 status = 0; + group_id groupID = 1; + INT8U sceneID = 2; + } + request struct RecallSceneRequest { group_id groupID = 0; INT8U sceneID = 1; @@ -189,43 +221,53 @@ client cluster Scenes = 5 { group_id groupID = 0; } - response struct AddSceneResponse = 0 { + response struct GetSceneMembershipResponse = 6 { ENUM8 status = 0; - group_id groupID = 1; - INT8U sceneID = 2; + nullable INT8U capacity = 1; + group_id groupID = 2; + optional INT8U sceneList[] = 3; } - response struct ViewSceneResponse = 1 { - ENUM8 status = 0; - group_id groupID = 1; - INT8U sceneID = 2; - optional INT16U transitionTime = 3; - optional CHAR_STRING sceneName = 4; - optional ExtensionFieldSet extensionFieldSets[] = 5; + request struct EnhancedAddSceneRequest { + group_id groupID = 0; + INT8U sceneID = 1; + INT16U transitionTime = 2; + CHAR_STRING sceneName = 3; + ExtensionFieldSet extensionFieldSets[] = 4; } - response struct RemoveSceneResponse = 2 { + response struct EnhancedAddSceneResponse = 64 { ENUM8 status = 0; group_id groupID = 1; INT8U sceneID = 2; } - response struct RemoveAllScenesResponse = 3 { - ENUM8 status = 0; - group_id groupID = 1; + request struct EnhancedViewSceneRequest { + group_id groupID = 0; + INT8U sceneID = 1; } - response struct StoreSceneResponse = 4 { + response struct EnhancedViewSceneResponse = 65 { ENUM8 status = 0; - group_id groupID = 1; + group_Id groupID = 1; INT8U sceneID = 2; + optional INT16U transitionTime = 3; + optional CHAR_STRING sceneName = 4; + optional ExtensionFieldSet extensionFieldSets[] = 5; } - response struct GetSceneMembershipResponse = 6 { + request struct CopySceneRequest { + ScenesCopyMode mode = 0; + group_id groupIdentifierFrom = 1; + INT8U sceneIdentifierFrom = 2; + group_id groupIdentifierTo = 3; + INT8U sceneIdentifierTo = 4; + } + + response struct CopySceneResponse = 66 { ENUM8 status = 0; - nullable INT8U capacity = 1; - group_id groupID = 2; - optional INT8U sceneList[] = 3; + group_Id groupIdentifierFrom = 1; + INT8U sceneIdentifierFrom = 2; } fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; @@ -235,6 +277,9 @@ client cluster Scenes = 5 { fabric command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; fabric command RecallScene(RecallSceneRequest): DefaultSuccess = 5; fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; + fabric command EnhancedAddScene(EnhancedAddSceneRequest): EnhancedAddSceneResponse = 64; + fabric command EnhancedViewScene(EnhancedViewSceneRequest): EnhancedViewSceneResponse = 65; + fabric command CopyScene(CopySceneRequest): CopySceneResponse = 66; } client cluster OnOff = 6 { @@ -406,6 +451,10 @@ client cluster LevelControl = 8 { LevelControlOptions optionsOverride = 1; } + request struct MoveToClosestFrequencyRequest { + INT16U frequency = 0; + } + command MoveToLevel(MoveToLevelRequest): DefaultSuccess = 0; command Move(MoveRequest): DefaultSuccess = 1; command Step(StepRequest): DefaultSuccess = 2; @@ -414,6 +463,7 @@ client cluster LevelControl = 8 { command MoveWithOnOff(MoveWithOnOffRequest): DefaultSuccess = 5; command StepWithOnOff(StepWithOnOffRequest): DefaultSuccess = 6; command StopWithOnOff(StopWithOnOffRequest): DefaultSuccess = 7; + command MoveToClosestFrequency(MoveToClosestFrequencyRequest): DefaultSuccess = 8; } client cluster BinaryInputBasic = 15 { @@ -748,6 +798,8 @@ client cluster BasicInformation = 40 { readonly attribute attrib_id attributeList[] = 65531; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + + command MfgSpecificPing(): DefaultSuccess = 0; } client cluster OtaSoftwareUpdateProvider = 41 { @@ -789,16 +841,6 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForProvider = 7; } - request struct ApplyUpdateRequestRequest { - OCTET_STRING<32> updateToken = 0; - INT32U newVersion = 1; - } - - request struct NotifyUpdateAppliedRequest { - OCTET_STRING<32> updateToken = 0; - INT32U softwareVersion = 1; - } - response struct QueryImageResponse = 1 { OTAQueryStatus status = 0; optional INT32U delayedActionTime = 1; @@ -810,11 +852,21 @@ client cluster OtaSoftwareUpdateProvider = 41 { optional OCTET_STRING<512> metadataForRequestor = 7; } + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + response struct ApplyUpdateResponse = 3 { OTAApplyUpdateAction action = 0; INT32U delayedActionTime = 1; } + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + command QueryImage(QueryImageRequest): QueryImageResponse = 0; command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; @@ -1259,17 +1311,17 @@ client cluster GeneralCommissioning = 48 { INT64U breadcrumb = 1; } + response struct ArmFailSafeResponse = 1 { + CommissioningError errorCode = 0; + CHAR_STRING debugText = 1; + } + request struct SetRegulatoryConfigRequest { RegulatoryLocationType newRegulatoryConfig = 0; CHAR_STRING countryCode = 1; INT64U breadcrumb = 2; } - response struct ArmFailSafeResponse = 1 { - CommissioningError errorCode = 0; - CHAR_STRING debugText = 1; - } - response struct SetRegulatoryConfigResponse = 3 { CommissioningError errorCode = 0; CHAR_STRING debugText = 1; @@ -1369,6 +1421,13 @@ client cluster NetworkCommissioning = 49 { optional INT64U breadcrumb = 1; } + response struct ScanNetworksResponse = 1 { + NetworkCommissioningStatus networkingStatus = 0; + optional CHAR_STRING debugText = 1; + optional WiFiInterfaceScanResult wiFiScanResults[] = 2; + optional ThreadInterfaceScanResult threadScanResults[] = 3; + } + request struct AddOrUpdateWiFiNetworkRequest { OCTET_STRING<32> ssid = 0; OCTET_STRING<64> credentials = 1; @@ -1385,36 +1444,29 @@ client cluster NetworkCommissioning = 49 { optional INT64U breadcrumb = 1; } - request struct ConnectNetworkRequest { - OCTET_STRING<32> networkID = 0; - optional INT64U breadcrumb = 1; - } - - request struct ReorderNetworkRequest { - OCTET_STRING<32> networkID = 0; - INT8U networkIndex = 1; - optional INT64U breadcrumb = 2; - } - - response struct ScanNetworksResponse = 1 { - NetworkCommissioningStatus networkingStatus = 0; - optional CHAR_STRING debugText = 1; - optional WiFiInterfaceScanResult wiFiScanResults[] = 2; - optional ThreadInterfaceScanResult threadScanResults[] = 3; - } - response struct NetworkConfigResponse = 5 { NetworkCommissioningStatus networkingStatus = 0; optional CHAR_STRING<512> debugText = 1; optional INT8U networkIndex = 2; } + request struct ConnectNetworkRequest { + OCTET_STRING<32> networkID = 0; + optional INT64U breadcrumb = 1; + } + response struct ConnectNetworkResponse = 7 { NetworkCommissioningStatus networkingStatus = 0; optional CHAR_STRING debugText = 1; nullable INT32S errorValue = 2; } + request struct ReorderNetworkRequest { + OCTET_STRING<32> networkID = 0; + INT8U networkIndex = 1; + optional INT64U breadcrumb = 2; + } + command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; @@ -2054,15 +2106,29 @@ client cluster OperationalCredentials = 62 { OCTET_STRING attestationNonce = 0; } + response struct AttestationResponse = 1 { + OCTET_STRING attestationElements = 0; + OCTET_STRING attestationSignature = 1; + } + request struct CertificateChainRequestRequest { CertificateChainTypeEnum certificateType = 0; } + response struct CertificateChainResponse = 3 { + OCTET_STRING certificate = 0; + } + request struct CSRRequestRequest { OCTET_STRING CSRNonce = 0; optional boolean isForUpdateNOC = 1; } + response struct CSRResponse = 5 { + OCTET_STRING NOCSRElements = 0; + OCTET_STRING attestationSignature = 1; + } + request struct AddNOCRequest { OCTET_STRING NOCValue = 0; optional OCTET_STRING ICACValue = 1; @@ -2076,6 +2142,12 @@ client cluster OperationalCredentials = 62 { optional OCTET_STRING ICACValue = 1; } + response struct NOCResponse = 8 { + NodeOperationalCertStatusEnum statusCode = 0; + optional fabric_idx fabricIndex = 1; + optional CHAR_STRING debugText = 2; + } + request struct UpdateFabricLabelRequest { CHAR_STRING<32> label = 0; } @@ -2088,26 +2160,6 @@ client cluster OperationalCredentials = 62 { OCTET_STRING rootCACertificate = 0; } - response struct AttestationResponse = 1 { - OCTET_STRING attestationElements = 0; - OCTET_STRING attestationSignature = 1; - } - - response struct CertificateChainResponse = 3 { - OCTET_STRING certificate = 0; - } - - response struct CSRResponse = 5 { - OCTET_STRING NOCSRElements = 0; - OCTET_STRING attestationSignature = 1; - } - - response struct NOCResponse = 8 { - NodeOperationalCertStatusEnum statusCode = 0; - optional fabric_idx fabricIndex = 1; - optional CHAR_STRING debugText = 2; - } - command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; @@ -2167,6 +2219,10 @@ client cluster GroupKeyManagement = 63 { INT16U groupKeySetID = 0; } + response struct KeySetReadResponse = 2 { + GroupKeySetStruct groupKeySet = 0; + } + request struct KeySetRemoveRequest { INT16U groupKeySetID = 0; } @@ -2175,10 +2231,6 @@ client cluster GroupKeyManagement = 63 { INT16U groupKeySetIDs[] = 0; } - response struct KeySetReadResponse = 2 { - GroupKeySetStruct groupKeySet = 0; - } - response struct KeySetReadAllIndicesResponse = 5 { INT16U groupKeySetIDs[] = 0; } @@ -2714,6 +2766,17 @@ client cluster DoorLock = 257 { INT16U userIndex = 1; } + response struct GetWeekDayScheduleResponse = 12 { + INT8U weekDayIndex = 0; + INT16U userIndex = 1; + DlStatus status = 2; + optional DaysMaskMap daysMask = 3; + optional INT8U startHour = 4; + optional INT8U startMinute = 5; + optional INT8U endHour = 6; + optional INT8U endMinute = 7; + } + request struct ClearWeekDayScheduleRequest { INT8U weekDayIndex = 0; INT16U userIndex = 1; @@ -2731,6 +2794,14 @@ client cluster DoorLock = 257 { INT16U userIndex = 1; } + response struct GetYearDayScheduleResponse = 15 { + INT8U yearDayIndex = 0; + INT16U userIndex = 1; + DlStatus status = 2; + optional epoch_s localStartTime = 3; + optional epoch_s localEndTime = 4; + } + request struct ClearYearDayScheduleRequest { INT8U yearDayIndex = 0; INT16U userIndex = 1; @@ -2747,6 +2818,14 @@ client cluster DoorLock = 257 { INT8U holidayIndex = 0; } + response struct GetHolidayScheduleResponse = 18 { + INT8U holidayIndex = 0; + DlStatus status = 1; + optional epoch_s localStartTime = 2; + optional epoch_s localEndTime = 3; + optional OperatingModeEnum operatingMode = 4; + } + request struct ClearHolidayScheduleRequest { INT8U holidayIndex = 0; } @@ -2765,54 +2844,6 @@ client cluster DoorLock = 257 { INT16U userIndex = 0; } - request struct ClearUserRequest { - INT16U userIndex = 0; - } - - request struct SetCredentialRequest { - DataOperationTypeEnum operationType = 0; - CredentialStruct credential = 1; - LONG_OCTET_STRING credentialData = 2; - nullable INT16U userIndex = 3; - nullable UserStatusEnum userStatus = 4; - nullable UserTypeEnum userType = 5; - } - - request struct GetCredentialStatusRequest { - CredentialStruct credential = 0; - } - - request struct ClearCredentialRequest { - nullable CredentialStruct credential = 0; - } - - response struct GetWeekDayScheduleResponse = 12 { - INT8U weekDayIndex = 0; - INT16U userIndex = 1; - DlStatus status = 2; - optional DaysMaskMap daysMask = 3; - optional INT8U startHour = 4; - optional INT8U startMinute = 5; - optional INT8U endHour = 6; - optional INT8U endMinute = 7; - } - - response struct GetYearDayScheduleResponse = 15 { - INT8U yearDayIndex = 0; - INT16U userIndex = 1; - DlStatus status = 2; - optional epoch_s localStartTime = 3; - optional epoch_s localEndTime = 4; - } - - response struct GetHolidayScheduleResponse = 18 { - INT8U holidayIndex = 0; - DlStatus status = 1; - optional epoch_s localStartTime = 2; - optional epoch_s localEndTime = 3; - optional OperatingModeEnum operatingMode = 4; - } - response struct GetUserResponse = 28 { INT16U userIndex = 0; nullable CHAR_STRING userName = 1; @@ -2826,12 +2857,29 @@ client cluster DoorLock = 257 { nullable INT16U nextUserIndex = 9; } + request struct ClearUserRequest { + INT16U userIndex = 0; + } + + request struct SetCredentialRequest { + DataOperationTypeEnum operationType = 0; + CredentialStruct credential = 1; + LONG_OCTET_STRING credentialData = 2; + nullable INT16U userIndex = 3; + nullable UserStatusEnum userStatus = 4; + nullable UserTypeEnum userType = 5; + } + response struct SetCredentialResponse = 35 { DlStatus status = 0; nullable INT16U userIndex = 1; nullable INT16U nextCredentialIndex = 2; } + request struct GetCredentialStatusRequest { + CredentialStruct credential = 0; + } + response struct GetCredentialStatusResponse = 37 { boolean credentialExists = 0; nullable INT16U userIndex = 1; @@ -2840,6 +2888,10 @@ client cluster DoorLock = 257 { nullable INT16U nextCredentialIndex = 4; } + request struct ClearCredentialRequest { + nullable CredentialStruct credential = 0; + } + timed command LockDoor(LockDoorRequest): DefaultSuccess = 0; timed command UnlockDoor(UnlockDoorRequest): DefaultSuccess = 1; timed command UnlockWithTimeout(UnlockWithTimeoutRequest): DefaultSuccess = 3; @@ -3276,25 +3328,25 @@ client cluster Thermostat = 513 { INT8S amount = 1; } - request struct SetWeeklyScheduleRequest { + response struct GetWeeklyScheduleResponse = 0 { INT8U numberOfTransitionsForSequence = 0; DayOfWeek dayOfWeekForSequence = 1; ModeForSequence modeForSequence = 2; ThermostatScheduleTransition transitions[] = 3; } - request struct GetWeeklyScheduleRequest { - DayOfWeek daysToReturn = 0; - ModeForSequence modeToReturn = 1; - } - - response struct GetWeeklyScheduleResponse = 0 { + request struct SetWeeklyScheduleRequest { INT8U numberOfTransitionsForSequence = 0; DayOfWeek dayOfWeekForSequence = 1; ModeForSequence modeForSequence = 2; ThermostatScheduleTransition transitions[] = 3; } + request struct GetWeeklyScheduleRequest { + DayOfWeek daysToReturn = 0; + ModeForSequence modeToReturn = 1; + } + command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; @@ -3869,6 +3921,11 @@ client cluster Channel = 1284 { CHAR_STRING match = 0; } + response struct ChangeChannelResponse = 1 { + ChannelStatusEnum status = 0; + optional CHAR_STRING data = 1; + } + request struct ChangeChannelByNumberRequest { INT16U majorNumber = 0; INT16U minorNumber = 1; @@ -3878,11 +3935,6 @@ client cluster Channel = 1284 { INT16U count = 0; } - response struct ChangeChannelResponse = 1 { - ChannelStatusEnum status = 0; - optional CHAR_STRING data = 1; - } - command ChangeChannel(ChangeChannelRequest): ChangeChannelResponse = 0; command ChangeChannelByNumber(ChangeChannelByNumberRequest): DefaultSuccess = 2; command SkipChannel(SkipChannelRequest): DefaultSuccess = 3; @@ -3971,15 +4023,15 @@ client cluster MediaPlayback = 1286 { INT64U deltaPositionMilliseconds = 0; } - request struct SeekRequest { - INT64U position = 0; - } - response struct PlaybackResponse = 10 { MediaPlaybackStatusEnum status = 0; optional CHAR_STRING data = 1; } + request struct SeekRequest { + INT64U position = 0; + } + command Play(): PlaybackResponse = 0; command Pause(): PlaybackResponse = 1; command Stop(): PlaybackResponse = 2; @@ -4416,15 +4468,15 @@ client cluster AccountLogin = 1294 { CHAR_STRING<100> tempAccountIdentifier = 0; } + response struct GetSetupPINResponse = 1 { + CHAR_STRING setupPIN = 0; + } + request struct LoginRequest { CHAR_STRING<100> tempAccountIdentifier = 0; CHAR_STRING setupPIN = 1; } - response struct GetSetupPINResponse = 1 { - CHAR_STRING setupPIN = 0; - } - timed command GetSetupPIN(GetSetupPINRequest): GetSetupPINResponse = 0; timed command Login(LoginRequest): DefaultSuccess = 2; timed command Logout(): DefaultSuccess = 3; @@ -4565,6 +4617,31 @@ client cluster ElectricalMeasurement = 2820 { readonly attribute attrib_id attributeList[] = 65531; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + + response struct GetProfileInfoResponseCommand = 0 { + INT8U profileCount = 0; + ENUM8 profileIntervalPeriod = 1; + INT8U maxNumberOfIntervals = 2; + INT16U listOfAttributes[] = 3; + } + + response struct GetMeasurementProfileResponseCommand = 1 { + INT32U startTime = 0; + ENUM8 status = 1; + ENUM8 profileIntervalPeriod = 2; + INT8U numberOfIntervalsDelivered = 3; + INT16U attributeId = 4; + INT8U intervals[] = 5; + } + + request struct GetMeasurementProfileCommandRequest { + INT16U attributeId = 0; + INT32U startTime = 1; + ENUM8 numberOfIntervals = 2; + } + + command GetProfileInfoCommand(): DefaultSuccess = 0; + command GetMeasurementProfileCommand(GetMeasurementProfileCommandRequest): DefaultSuccess = 1; } client cluster ClientMonitoring = 4166 { @@ -4597,6 +4674,7 @@ client cluster ClientMonitoring = 4166 { command access(invoke: manage) RegisterClientMonitoring(RegisterClientMonitoringRequest): DefaultSuccess = 0; command access(invoke: manage) UnregisterClientMonitoring(UnregisterClientMonitoringRequest): DefaultSuccess = 1; + command access(invoke: manage) StayAwakeRequest(): DefaultSuccess = 2; } client cluster UnitTesting = 4294048773 { @@ -4805,31 +4883,128 @@ client cluster UnitTesting = 4294048773 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + response struct TestSpecificResponse = 0 { + INT8U returnValue = 0; + } + + response struct TestAddArgumentsResponse = 1 { + INT8U returnValue = 0; + } + + response struct TestSimpleArgumentResponse = 2 { + BOOLEAN returnValue = 0; + } + + response struct TestStructArrayArgumentResponse = 3 { + NestedStructList arg1[] = 0; + SimpleStruct arg2[] = 1; + SimpleEnum arg3[] = 2; + BOOLEAN arg4[] = 3; + SimpleEnum arg5 = 4; + BOOLEAN arg6 = 5; + } + request struct TestAddArgumentsRequest { INT8U arg1 = 0; INT8U arg2 = 1; } + response struct TestListInt8UReverseResponse = 4 { + INT8U arg1[] = 0; + } + + request struct TestSimpleArgumentRequestRequest { + BOOLEAN arg1 = 0; + } + + response struct TestEnumsResponse = 5 { + vendor_id arg1 = 0; + SimpleEnum arg2 = 1; + } + + request struct TestStructArrayArgumentRequestRequest { + NestedStructList arg1[] = 0; + SimpleStruct arg2[] = 1; + SimpleEnum arg3[] = 2; + BOOLEAN arg4[] = 3; + SimpleEnum arg5 = 4; + BOOLEAN arg6 = 5; + } + + response struct TestNullableOptionalResponse = 6 { + BOOLEAN wasPresent = 0; + optional BOOLEAN wasNull = 1; + optional INT8U value = 2; + optional nullable INT8U originalValue = 3; + } + request struct TestStructArgumentRequestRequest { SimpleStruct arg1 = 0; } + response struct TestComplexNullableOptionalResponse = 7 { + BOOLEAN nullableIntWasNull = 0; + optional INT16U nullableIntValue = 1; + BOOLEAN optionalIntWasPresent = 2; + optional INT16U optionalIntValue = 3; + BOOLEAN nullableOptionalIntWasPresent = 4; + optional BOOLEAN nullableOptionalIntWasNull = 5; + optional INT16U nullableOptionalIntValue = 6; + BOOLEAN nullableStringWasNull = 7; + optional CHAR_STRING nullableStringValue = 8; + BOOLEAN optionalStringWasPresent = 9; + optional CHAR_STRING optionalStringValue = 10; + BOOLEAN nullableOptionalStringWasPresent = 11; + optional BOOLEAN nullableOptionalStringWasNull = 12; + optional CHAR_STRING nullableOptionalStringValue = 13; + BOOLEAN nullableStructWasNull = 14; + optional SimpleStruct nullableStructValue = 15; + BOOLEAN optionalStructWasPresent = 16; + optional SimpleStruct optionalStructValue = 17; + BOOLEAN nullableOptionalStructWasPresent = 18; + optional BOOLEAN nullableOptionalStructWasNull = 19; + optional SimpleStruct nullableOptionalStructValue = 20; + BOOLEAN nullableListWasNull = 21; + optional SimpleEnum nullableListValue[] = 22; + BOOLEAN optionalListWasPresent = 23; + optional SimpleEnum optionalListValue[] = 24; + BOOLEAN nullableOptionalListWasPresent = 25; + optional BOOLEAN nullableOptionalListWasNull = 26; + optional SimpleEnum nullableOptionalListValue[] = 27; + } + request struct TestNestedStructArgumentRequestRequest { NestedStruct arg1 = 0; } + response struct BooleanResponse = 8 { + BOOLEAN value = 0; + } + request struct TestListStructArgumentRequestRequest { SimpleStruct arg1[] = 0; } + response struct SimpleStructResponse = 9 { + SimpleStruct arg1 = 0; + } + request struct TestListInt8UArgumentRequestRequest { INT8U arg1[] = 0; } + response struct TestEmitTestEventResponse = 10 { + INT64U value = 0; + } + request struct TestNestedStructListArgumentRequestRequest { NestedStructList arg1 = 0; } + response struct TestEmitTestFabricScopedEventResponse = 11 { + INT64U value = 0; + } + request struct TestListNestedStructListArgumentRequestRequest { NestedStructList arg1[] = 0; } @@ -4847,6 +5022,21 @@ client cluster UnitTesting = 4294048773 { optional nullable INT8U arg1 = 0; } + request struct TestComplexNullableOptionalRequestRequest { + nullable INT16U nullableInt = 0; + optional INT16U optionalInt = 1; + optional nullable INT16U nullableOptionalInt = 2; + nullable CHAR_STRING nullableString = 3; + optional CHAR_STRING optionalString = 4; + optional nullable CHAR_STRING nullableOptionalString = 5; + nullable SimpleStruct nullableStruct = 6; + optional SimpleStruct optionalStruct = 7; + optional nullable SimpleStruct nullableOptionalStruct = 8; + nullable SimpleEnum nullableList[] = 9; + optional SimpleEnum optionalList[] = 10; + optional nullable SimpleEnum nullableOptionalList[] = 11; + } + request struct SimpleStructEchoRequestRequest { SimpleStruct arg1 = 0; } @@ -4861,40 +5051,8 @@ client cluster UnitTesting = 4294048773 { BOOLEAN arg3 = 2; } - response struct TestSpecificResponse = 0 { - INT8U returnValue = 0; - } - - response struct TestAddArgumentsResponse = 1 { - INT8U returnValue = 0; - } - - response struct TestListInt8UReverseResponse = 4 { - INT8U arg1[] = 0; - } - - response struct TestEnumsResponse = 5 { - vendor_id arg1 = 0; - SimpleEnum arg2 = 1; - } - - response struct TestNullableOptionalResponse = 6 { - BOOLEAN wasPresent = 0; - optional BOOLEAN wasNull = 1; - optional INT8U value = 2; - optional nullable INT8U originalValue = 3; - } - - response struct BooleanResponse = 8 { - BOOLEAN value = 0; - } - - response struct SimpleStructResponse = 9 { - SimpleStruct arg1 = 0; - } - - response struct TestEmitTestEventResponse = 10 { - INT64U value = 0; + request struct TestEmitTestFabricScopedEventRequestRequest { + INT8U arg1 = 0; } command Test(): DefaultSuccess = 0; @@ -4902,6 +5060,8 @@ client cluster UnitTesting = 4294048773 { command TestSpecific(): TestSpecificResponse = 2; command TestUnknownCommand(): DefaultSuccess = 3; command TestAddArguments(TestAddArgumentsRequest): TestAddArgumentsResponse = 4; + command TestSimpleArgumentRequest(TestSimpleArgumentRequestRequest): TestSimpleArgumentResponse = 5; + command TestStructArrayArgumentRequest(TestStructArrayArgumentRequestRequest): TestStructArrayArgumentResponse = 6; command TestStructArgumentRequest(TestStructArgumentRequestRequest): BooleanResponse = 7; command TestNestedStructArgumentRequest(TestNestedStructArgumentRequestRequest): BooleanResponse = 8; command TestListStructArgumentRequest(TestListStructArgumentRequestRequest): BooleanResponse = 9; @@ -4911,10 +5071,12 @@ client cluster UnitTesting = 4294048773 { command TestListInt8UReverseRequest(TestListInt8UReverseRequestRequest): TestListInt8UReverseResponse = 13; command TestEnumsRequest(TestEnumsRequestRequest): TestEnumsResponse = 14; command TestNullableOptionalRequest(TestNullableOptionalRequestRequest): TestNullableOptionalResponse = 15; + command TestComplexNullableOptionalRequest(TestComplexNullableOptionalRequestRequest): TestComplexNullableOptionalResponse = 16; command SimpleStructEchoRequest(SimpleStructEchoRequestRequest): SimpleStructResponse = 17; timed command TimedInvokeRequest(): DefaultSuccess = 18; command TestSimpleOptionalArgumentRequest(TestSimpleOptionalArgumentRequestRequest): DefaultSuccess = 19; command TestEmitTestEventRequest(TestEmitTestEventRequestRequest): TestEmitTestEventResponse = 20; + command TestEmitTestFabricScopedEventRequest(TestEmitTestFabricScopedEventRequestRequest): TestEmitTestFabricScopedEventResponse = 21; } endpoint 1 { diff --git a/src/controller/java/templates/CHIPInvokeCallbacks-src.zapt b/src/controller/java/templates/CHIPInvokeCallbacks-src.zapt index f5f8b8cdf4b288..9f4d999174ce21 100644 --- a/src/controller/java/templates/CHIPInvokeCallbacks-src.zapt +++ b/src/controller/java/templates/CHIPInvokeCallbacks-src.zapt @@ -1,5 +1,4 @@ {{> header}} -{{#if (chip_has_client_clusters)}} #include #include "CHIPInvokeCallbacks.h" @@ -15,8 +14,8 @@ namespace chip { -{{#chip_client_clusters}} -{{#chip_cluster_responses}} +{{#all_user_clusters}} + {{#zcl_commands_source_server}} CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callback::CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callback(jobject javaCallback): Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -61,16 +60,15 @@ void CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callbac // Java callback is allowed to be null, exit early if this is the case. VerifyOrReturn(javaCallbackRef != nullptr); - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "({{#chip_cluster_response_arguments}}{{asJniSignature type null parent.parent.name true}}{{/chip_cluster_response_arguments}})V", &javaMethod); + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "({{#zcl_command_arguments}}{{asJniSignature type null parent.parent.name true}}{{/zcl_command_arguments}})V", &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - {{#chip_cluster_response_arguments}} + {{#zcl_command_arguments}} {{>decode_value source=(concat "dataResponse." (asLowerCamelCase name)) target=(asSymbol label) cluster=(asUpperCamelCase parent.parent.name) depth=0}} - {{/chip_cluster_response_arguments}} + {{/zcl_command_arguments}} - env->CallVoidMethod(javaCallbackRef, javaMethod{{#chip_cluster_response_arguments}}, {{asSymbol label}}{{/chip_cluster_response_arguments}}); + env->CallVoidMethod(javaCallbackRef, javaMethod{{#zcl_command_arguments}}, {{asSymbol label}}{{/zcl_command_arguments}}); } -{{/chip_cluster_responses}} -{{/chip_client_clusters}} + {{/zcl_commands_source_server}} +{{/all_user_clusters}} } // namespace chip -{{/if}} diff --git a/src/controller/java/templates/CHIPInvokeCallbacks.zapt b/src/controller/java/templates/CHIPInvokeCallbacks.zapt index d0058b4435a506..81fe85ffc713f0 100644 --- a/src/controller/java/templates/CHIPInvokeCallbacks.zapt +++ b/src/controller/java/templates/CHIPInvokeCallbacks.zapt @@ -8,22 +8,22 @@ namespace chip { -{{#chip_client_clusters}} -{{#chip_cluster_responses}} -class CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callback : public Callback::Callback +{{#all_user_clusters}} + {{#zcl_commands_source_server}} +class CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase commandName}}Callback : public Callback::Callback { public: - CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callback(jobject javaCallback); + CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase commandName}}Callback(jobject javaCallback); - ~CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callback(); + ~CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase commandName}}Callback(); + + static void CallbackFn(void * context, const chip::app::Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase commandName}}::DecodableType & data); - static void CallbackFn(void * context, const chip::app::Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::DecodableType & data); - private: jobject javaCallbackRef; }; -{{/chip_cluster_responses}} -{{/chip_client_clusters}} + {{/zcl_commands_source_server}} +{{/all_user_clusters}} } // namespace chip {{/if}} diff --git a/src/controller/java/templates/CHIPReadCallbacks.zapt b/src/controller/java/templates/CHIPReadCallbacks.zapt index 44df0869f95515..f15b4ec9e0f1bf 100644 --- a/src/controller/java/templates/CHIPReadCallbacks.zapt +++ b/src/controller/java/templates/CHIPReadCallbacks.zapt @@ -1,5 +1,4 @@ {{> header}} -{{#if (chip_has_client_clusters)}} #include #include @@ -36,7 +35,7 @@ private: {{/unless}} {{/chip_server_global_responses}} -{{#chip_client_clusters}} +{{#all_user_clusters}} {{#zcl_attributes_server removeKeys='isOptional'}} {{#if_unsupported_attribute_callback type isArray ../id}} {{else}} @@ -70,6 +69,4 @@ private: {{/if_unsupported_attribute_callback}} {{/zcl_attributes_server}} -{{/chip_client_clusters}} - -{{/if}} +{{/all_user_clusters}} diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp index 88afa7fa20233d..f2527732efb160 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp @@ -888,6 +888,353 @@ void CHIPScenesClusterGetSceneMembershipResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, Status, Capacity, GroupID, SceneList); } +CHIPScenesClusterEnhancedAddSceneResponseCallback::CHIPScenesClusterEnhancedAddSceneResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPScenesClusterEnhancedAddSceneResponseCallback::~CHIPScenesClusterEnhancedAddSceneResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPScenesClusterEnhancedAddSceneResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::Scenes::Commands::EnhancedAddSceneResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject Status; + std::string StatusClassName = "java/lang/Integer"; + std::string StatusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(StatusClassName.c_str(), StatusCtorSignature.c_str(), + dataResponse.status, Status); + jobject GroupID; + std::string GroupIDClassName = "java/lang/Integer"; + std::string GroupIDCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(GroupIDClassName.c_str(), GroupIDCtorSignature.c_str(), + dataResponse.groupID, GroupID); + jobject SceneID; + std::string SceneIDClassName = "java/lang/Integer"; + std::string SceneIDCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(SceneIDClassName.c_str(), SceneIDCtorSignature.c_str(), + dataResponse.sceneID, SceneID); + + env->CallVoidMethod(javaCallbackRef, javaMethod, Status, GroupID, SceneID); +} +CHIPScenesClusterEnhancedViewSceneResponseCallback::CHIPScenesClusterEnhancedViewSceneResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPScenesClusterEnhancedViewSceneResponseCallback::~CHIPScenesClusterEnhancedViewSceneResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPScenesClusterEnhancedViewSceneResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::Scenes::Commands::EnhancedViewSceneResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod( + env, javaCallbackRef, "onSuccess", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject Status; + std::string StatusClassName = "java/lang/Integer"; + std::string StatusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(StatusClassName.c_str(), StatusCtorSignature.c_str(), + dataResponse.status, Status); + jobject GroupID; + std::string GroupIDClassName = "java/lang/Integer"; + std::string GroupIDCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(GroupIDClassName.c_str(), GroupIDCtorSignature.c_str(), + dataResponse.groupID, GroupID); + jobject SceneID; + std::string SceneIDClassName = "java/lang/Integer"; + std::string SceneIDCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(SceneIDClassName.c_str(), SceneIDCtorSignature.c_str(), + dataResponse.sceneID, SceneID); + jobject TransitionTime; + if (!dataResponse.transitionTime.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, TransitionTime); + } + else + { + jobject TransitionTimeInsideOptional; + std::string TransitionTimeInsideOptionalClassName = "java/lang/Integer"; + std::string TransitionTimeInsideOptionalCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + TransitionTimeInsideOptionalClassName.c_str(), TransitionTimeInsideOptionalCtorSignature.c_str(), + dataResponse.transitionTime.Value(), TransitionTimeInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(TransitionTimeInsideOptional, TransitionTime); + } + jobject SceneName; + if (!dataResponse.sceneName.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, SceneName); + } + else + { + jobject SceneNameInsideOptional; + SceneNameInsideOptional = + env->NewStringUTF(std::string(dataResponse.sceneName.Value().data(), dataResponse.sceneName.Value().size()).c_str()); + chip::JniReferences::GetInstance().CreateOptional(SceneNameInsideOptional, SceneName); + } + jobject ExtensionFieldSets; + if (!dataResponse.extensionFieldSets.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, ExtensionFieldSets); + } + else + { + jobject ExtensionFieldSetsInsideOptional; + chip::JniReferences::GetInstance().CreateArrayList(ExtensionFieldSetsInsideOptional); + + auto iter_ExtensionFieldSetsInsideOptional_1 = dataResponse.extensionFieldSets.Value().begin(); + while (iter_ExtensionFieldSetsInsideOptional_1.Next()) + { + auto & entry_1 = iter_ExtensionFieldSetsInsideOptional_1.GetValue(); + jobject newElement_1; + jobject newElement_1_clusterID; + std::string newElement_1_clusterIDClassName = "java/lang/Long"; + std::string newElement_1_clusterIDCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_1_clusterIDClassName.c_str(), + newElement_1_clusterIDCtorSignature.c_str(), + entry_1.clusterID, newElement_1_clusterID); + jobject newElement_1_attributeValueList; + chip::JniReferences::GetInstance().CreateArrayList(newElement_1_attributeValueList); + + auto iter_newElement_1_attributeValueList_3 = entry_1.attributeValueList.begin(); + while (iter_newElement_1_attributeValueList_3.Next()) + { + auto & entry_3 = iter_newElement_1_attributeValueList_3.GetValue(); + jobject newElement_3; + jobject newElement_3_attributeID; + if (!entry_3.attributeID.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_3_attributeID); + } + else + { + jobject newElement_3_attributeIDInsideOptional; + std::string newElement_3_attributeIDInsideOptionalClassName = "java/lang/Long"; + std::string newElement_3_attributeIDInsideOptionalCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_3_attributeIDInsideOptionalClassName.c_str(), + newElement_3_attributeIDInsideOptionalCtorSignature.c_str(), entry_3.attributeID.Value(), + newElement_3_attributeIDInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_3_attributeIDInsideOptional, + newElement_3_attributeID); + } + jobject newElement_3_attributeValue; + chip::JniReferences::GetInstance().CreateArrayList(newElement_3_attributeValue); + + auto iter_newElement_3_attributeValue_5 = entry_3.attributeValue.begin(); + while (iter_newElement_3_attributeValue_5.Next()) + { + auto & entry_5 = iter_newElement_3_attributeValue_5.GetValue(); + jobject newElement_5; + std::string newElement_5ClassName = "java/lang/Integer"; + std::string newElement_5CtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_5ClassName.c_str(), newElement_5CtorSignature.c_str(), entry_5, newElement_5); + chip::JniReferences::GetInstance().AddToList(newElement_3_attributeValue, newElement_5); + } + + jclass attributeValuePairStructClass_4; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$ScenesClusterAttributeValuePair", attributeValuePairStructClass_4); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ScenesClusterAttributeValuePair"); + return; + } + jmethodID attributeValuePairStructCtor_4 = + env->GetMethodID(attributeValuePairStructClass_4, "", "(Ljava/util/Optional;Ljava/util/ArrayList;)V"); + if (attributeValuePairStructCtor_4 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ScenesClusterAttributeValuePair constructor"); + return; + } + + newElement_3 = env->NewObject(attributeValuePairStructClass_4, attributeValuePairStructCtor_4, + newElement_3_attributeID, newElement_3_attributeValue); + chip::JniReferences::GetInstance().AddToList(newElement_1_attributeValueList, newElement_3); + } + + jclass extensionFieldSetStructClass_2; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$ScenesClusterExtensionFieldSet", extensionFieldSetStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ScenesClusterExtensionFieldSet"); + return; + } + jmethodID extensionFieldSetStructCtor_2 = + env->GetMethodID(extensionFieldSetStructClass_2, "", "(Ljava/lang/Long;Ljava/util/ArrayList;)V"); + if (extensionFieldSetStructCtor_2 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ScenesClusterExtensionFieldSet constructor"); + return; + } + + newElement_1 = env->NewObject(extensionFieldSetStructClass_2, extensionFieldSetStructCtor_2, newElement_1_clusterID, + newElement_1_attributeValueList); + chip::JniReferences::GetInstance().AddToList(ExtensionFieldSetsInsideOptional, newElement_1); + } + chip::JniReferences::GetInstance().CreateOptional(ExtensionFieldSetsInsideOptional, ExtensionFieldSets); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, Status, GroupID, SceneID, TransitionTime, SceneName, ExtensionFieldSets); +} +CHIPScenesClusterCopySceneResponseCallback::CHIPScenesClusterCopySceneResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPScenesClusterCopySceneResponseCallback::~CHIPScenesClusterCopySceneResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPScenesClusterCopySceneResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::Scenes::Commands::CopySceneResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject Status; + std::string StatusClassName = "java/lang/Integer"; + std::string StatusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(StatusClassName.c_str(), StatusCtorSignature.c_str(), + dataResponse.status, Status); + jobject GroupIdentifierFrom; + std::string GroupIdentifierFromClassName = "java/lang/Integer"; + std::string GroupIdentifierFromCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(GroupIdentifierFromClassName.c_str(), + GroupIdentifierFromCtorSignature.c_str(), + dataResponse.groupIdentifierFrom, GroupIdentifierFrom); + jobject SceneIdentifierFrom; + std::string SceneIdentifierFromClassName = "java/lang/Integer"; + std::string SceneIdentifierFromCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(SceneIdentifierFromClassName.c_str(), + SceneIdentifierFromCtorSignature.c_str(), + dataResponse.sceneIdentifierFrom, SceneIdentifierFrom); + + env->CallVoidMethod(javaCallbackRef, javaMethod, Status, GroupIdentifierFrom, SceneIdentifierFrom); +} CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseCallback::CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseCallback( jobject javaCallback) : Callback::Callback(CallbackFn, this) @@ -2919,21 +3266,360 @@ void CHIPDoorLockClusterGetUserResponseCallback::CallbackFn( jobject NextUserIndex; if (dataResponse.nextUserIndex.IsNull()) { - NextUserIndex = nullptr; + NextUserIndex = nullptr; + } + else + { + std::string NextUserIndexClassName = "java/lang/Integer"; + std::string NextUserIndexCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + NextUserIndexClassName.c_str(), NextUserIndexCtorSignature.c_str(), dataResponse.nextUserIndex.Value(), NextUserIndex); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, UserIndex, UserName, UserUniqueID, UserStatus, UserType, CredentialRule, + Credentials, CreatorFabricIndex, LastModifiedFabricIndex, NextUserIndex); +} +CHIPDoorLockClusterSetCredentialResponseCallback::CHIPDoorLockClusterSetCredentialResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPDoorLockClusterSetCredentialResponseCallback::~CHIPDoorLockClusterSetCredentialResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPDoorLockClusterSetCredentialResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject Status; + std::string StatusClassName = "java/lang/Integer"; + std::string StatusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(StatusClassName.c_str(), StatusCtorSignature.c_str(), + static_cast(dataResponse.status), Status); + jobject UserIndex; + if (dataResponse.userIndex.IsNull()) + { + UserIndex = nullptr; + } + else + { + std::string UserIndexClassName = "java/lang/Integer"; + std::string UserIndexCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(UserIndexClassName.c_str(), UserIndexCtorSignature.c_str(), + dataResponse.userIndex.Value(), UserIndex); + } + jobject NextCredentialIndex; + if (dataResponse.nextCredentialIndex.IsNull()) + { + NextCredentialIndex = nullptr; + } + else + { + std::string NextCredentialIndexClassName = "java/lang/Integer"; + std::string NextCredentialIndexCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + NextCredentialIndexClassName.c_str(), NextCredentialIndexCtorSignature.c_str(), + dataResponse.nextCredentialIndex.Value(), NextCredentialIndex); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, Status, UserIndex, NextCredentialIndex); +} +CHIPDoorLockClusterGetCredentialStatusResponseCallback::CHIPDoorLockClusterGetCredentialStatusResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPDoorLockClusterGetCredentialStatusResponseCallback::~CHIPDoorLockClusterGetCredentialStatusResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPDoorLockClusterGetCredentialStatusResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod( + env, javaCallbackRef, "onSuccess", + "(Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject CredentialExists; + std::string CredentialExistsClassName = "java/lang/Boolean"; + std::string CredentialExistsCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + CredentialExistsClassName.c_str(), CredentialExistsCtorSignature.c_str(), dataResponse.credentialExists, CredentialExists); + jobject UserIndex; + if (dataResponse.userIndex.IsNull()) + { + UserIndex = nullptr; + } + else + { + std::string UserIndexClassName = "java/lang/Integer"; + std::string UserIndexCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(UserIndexClassName.c_str(), UserIndexCtorSignature.c_str(), + dataResponse.userIndex.Value(), UserIndex); + } + jobject CreatorFabricIndex; + if (dataResponse.creatorFabricIndex.IsNull()) + { + CreatorFabricIndex = nullptr; + } + else + { + std::string CreatorFabricIndexClassName = "java/lang/Integer"; + std::string CreatorFabricIndexCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(CreatorFabricIndexClassName.c_str(), + CreatorFabricIndexCtorSignature.c_str(), + dataResponse.creatorFabricIndex.Value(), CreatorFabricIndex); + } + jobject LastModifiedFabricIndex; + if (dataResponse.lastModifiedFabricIndex.IsNull()) + { + LastModifiedFabricIndex = nullptr; + } + else + { + std::string LastModifiedFabricIndexClassName = "java/lang/Integer"; + std::string LastModifiedFabricIndexCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + LastModifiedFabricIndexClassName.c_str(), LastModifiedFabricIndexCtorSignature.c_str(), + dataResponse.lastModifiedFabricIndex.Value(), LastModifiedFabricIndex); + } + jobject NextCredentialIndex; + if (dataResponse.nextCredentialIndex.IsNull()) + { + NextCredentialIndex = nullptr; + } + else + { + std::string NextCredentialIndexClassName = "java/lang/Integer"; + std::string NextCredentialIndexCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + NextCredentialIndexClassName.c_str(), NextCredentialIndexCtorSignature.c_str(), + dataResponse.nextCredentialIndex.Value(), NextCredentialIndex); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, CredentialExists, UserIndex, CreatorFabricIndex, LastModifiedFabricIndex, + NextCredentialIndex); +} +CHIPThermostatClusterGetWeeklyScheduleResponseCallback::CHIPThermostatClusterGetWeeklyScheduleResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPThermostatClusterGetWeeklyScheduleResponseCallback::~CHIPThermostatClusterGetWeeklyScheduleResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; } - else + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPThermostatClusterGetWeeklyScheduleResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::Thermostat::Commands::GetWeeklyScheduleResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod( + env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/ArrayList;)V", + &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject NumberOfTransitionsForSequence; + std::string NumberOfTransitionsForSequenceClassName = "java/lang/Integer"; + std::string NumberOfTransitionsForSequenceCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + NumberOfTransitionsForSequenceClassName.c_str(), NumberOfTransitionsForSequenceCtorSignature.c_str(), + dataResponse.numberOfTransitionsForSequence, NumberOfTransitionsForSequence); + jobject DayOfWeekForSequence; + std::string DayOfWeekForSequenceClassName = "java/lang/Integer"; + std::string DayOfWeekForSequenceCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(DayOfWeekForSequenceClassName.c_str(), + DayOfWeekForSequenceCtorSignature.c_str(), + dataResponse.dayOfWeekForSequence.Raw(), DayOfWeekForSequence); + jobject ModeForSequence; + std::string ModeForSequenceClassName = "java/lang/Integer"; + std::string ModeForSequenceCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(ModeForSequenceClassName.c_str(), + ModeForSequenceCtorSignature.c_str(), + dataResponse.modeForSequence.Raw(), ModeForSequence); + jobject Transitions; + chip::JniReferences::GetInstance().CreateArrayList(Transitions); + + auto iter_Transitions_0 = dataResponse.transitions.begin(); + while (iter_Transitions_0.Next()) { - std::string NextUserIndexClassName = "java/lang/Integer"; - std::string NextUserIndexCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - NextUserIndexClassName.c_str(), NextUserIndexCtorSignature.c_str(), dataResponse.nextUserIndex.Value(), NextUserIndex); + auto & entry_0 = iter_Transitions_0.GetValue(); + jobject newElement_0; + jobject newElement_0_transitionTime; + std::string newElement_0_transitionTimeClassName = "java/lang/Integer"; + std::string newElement_0_transitionTimeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_transitionTimeClassName.c_str(), + newElement_0_transitionTimeCtorSignature.c_str(), + entry_0.transitionTime, newElement_0_transitionTime); + jobject newElement_0_heatSetpoint; + if (entry_0.heatSetpoint.IsNull()) + { + newElement_0_heatSetpoint = nullptr; + } + else + { + std::string newElement_0_heatSetpointClassName = "java/lang/Integer"; + std::string newElement_0_heatSetpointCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_heatSetpointClassName.c_str(), + newElement_0_heatSetpointCtorSignature.c_str(), + entry_0.heatSetpoint.Value(), newElement_0_heatSetpoint); + } + jobject newElement_0_coolSetpoint; + if (entry_0.coolSetpoint.IsNull()) + { + newElement_0_coolSetpoint = nullptr; + } + else + { + std::string newElement_0_coolSetpointClassName = "java/lang/Integer"; + std::string newElement_0_coolSetpointCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_coolSetpointClassName.c_str(), + newElement_0_coolSetpointCtorSignature.c_str(), + entry_0.coolSetpoint.Value(), newElement_0_coolSetpoint); + } + + jclass thermostatScheduleTransitionStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$ThermostatClusterThermostatScheduleTransition", + thermostatScheduleTransitionStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ThermostatClusterThermostatScheduleTransition"); + return; + } + jmethodID thermostatScheduleTransitionStructCtor_1 = env->GetMethodID( + thermostatScheduleTransitionStructClass_1, "", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V"); + if (thermostatScheduleTransitionStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ThermostatClusterThermostatScheduleTransition constructor"); + return; + } + + newElement_0 = env->NewObject(thermostatScheduleTransitionStructClass_1, thermostatScheduleTransitionStructCtor_1, + newElement_0_transitionTime, newElement_0_heatSetpoint, newElement_0_coolSetpoint); + chip::JniReferences::GetInstance().AddToList(Transitions, newElement_0); } - env->CallVoidMethod(javaCallbackRef, javaMethod, UserIndex, UserName, UserUniqueID, UserStatus, UserType, CredentialRule, - Credentials, CreatorFabricIndex, LastModifiedFabricIndex, NextUserIndex); + env->CallVoidMethod(javaCallbackRef, javaMethod, NumberOfTransitionsForSequence, DayOfWeekForSequence, ModeForSequence, + Transitions); } -CHIPDoorLockClusterSetCredentialResponseCallback::CHIPDoorLockClusterSetCredentialResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) +CHIPChannelClusterChangeChannelResponseCallback::CHIPChannelClusterChangeChannelResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -2949,7 +3635,7 @@ CHIPDoorLockClusterSetCredentialResponseCallback::CHIPDoorLockClusterSetCredenti } } -CHIPDoorLockClusterSetCredentialResponseCallback::~CHIPDoorLockClusterSetCredentialResponseCallback() +CHIPChannelClusterChangeChannelResponseCallback::~CHIPChannelClusterChangeChannelResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -2960,8 +3646,8 @@ CHIPDoorLockClusterSetCredentialResponseCallback::~CHIPDoorLockClusterSetCredent env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPDoorLockClusterSetCredentialResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType & dataResponse) +void CHIPChannelClusterChangeChannelResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::Channel::Commands::ChangeChannelResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -2971,17 +3657,17 @@ void CHIPDoorLockClusterSetCredentialResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; // Java callback is allowed to be null, exit early if this is the case. VerifyOrReturn(javaCallbackRef != nullptr); - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", &javaMethod); + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/util/Optional;)V", + &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); jobject Status; @@ -2989,37 +3675,24 @@ void CHIPDoorLockClusterSetCredentialResponseCallback::CallbackFn( std::string StatusCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject(StatusClassName.c_str(), StatusCtorSignature.c_str(), static_cast(dataResponse.status), Status); - jobject UserIndex; - if (dataResponse.userIndex.IsNull()) - { - UserIndex = nullptr; - } - else - { - std::string UserIndexClassName = "java/lang/Integer"; - std::string UserIndexCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(UserIndexClassName.c_str(), UserIndexCtorSignature.c_str(), - dataResponse.userIndex.Value(), UserIndex); - } - jobject NextCredentialIndex; - if (dataResponse.nextCredentialIndex.IsNull()) + jobject Data; + if (!dataResponse.data.HasValue()) { - NextCredentialIndex = nullptr; + chip::JniReferences::GetInstance().CreateOptional(nullptr, Data); } else { - std::string NextCredentialIndexClassName = "java/lang/Integer"; - std::string NextCredentialIndexCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - NextCredentialIndexClassName.c_str(), NextCredentialIndexCtorSignature.c_str(), - dataResponse.nextCredentialIndex.Value(), NextCredentialIndex); + jobject DataInsideOptional; + DataInsideOptional = + env->NewStringUTF(std::string(dataResponse.data.Value().data(), dataResponse.data.Value().size()).c_str()); + chip::JniReferences::GetInstance().CreateOptional(DataInsideOptional, Data); } - env->CallVoidMethod(javaCallbackRef, javaMethod, Status, UserIndex, NextCredentialIndex); + env->CallVoidMethod(javaCallbackRef, javaMethod, Status, Data); } -CHIPDoorLockClusterGetCredentialStatusResponseCallback::CHIPDoorLockClusterGetCredentialStatusResponseCallback( +CHIPTargetNavigatorClusterNavigateTargetResponseCallback::CHIPTargetNavigatorClusterNavigateTargetResponseCallback( jobject javaCallback) : - Callback::Callback(CallbackFn, this) + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3035,7 +3708,7 @@ CHIPDoorLockClusterGetCredentialStatusResponseCallback::CHIPDoorLockClusterGetCr } } -CHIPDoorLockClusterGetCredentialStatusResponseCallback::~CHIPDoorLockClusterGetCredentialStatusResponseCallback() +CHIPTargetNavigatorClusterNavigateTargetResponseCallback::~CHIPTargetNavigatorClusterNavigateTargetResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3046,8 +3719,8 @@ CHIPDoorLockClusterGetCredentialStatusResponseCallback::~CHIPDoorLockClusterGetC env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPDoorLockClusterGetCredentialStatusResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType & dataResponse) +void CHIPTargetNavigatorClusterNavigateTargetResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -3057,84 +3730,42 @@ void CHIPDoorLockClusterGetCredentialStatusResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; // Java callback is allowed to be null, exit early if this is the case. VerifyOrReturn(javaCallbackRef != nullptr); - err = JniReferences::GetInstance().FindMethod( - env, javaCallbackRef, "onSuccess", - "(Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", &javaMethod); + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/util/Optional;)V", + &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - jobject CredentialExists; - std::string CredentialExistsClassName = "java/lang/Boolean"; - std::string CredentialExistsCtorSignature = "(Z)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - CredentialExistsClassName.c_str(), CredentialExistsCtorSignature.c_str(), dataResponse.credentialExists, CredentialExists); - jobject UserIndex; - if (dataResponse.userIndex.IsNull()) - { - UserIndex = nullptr; - } - else - { - std::string UserIndexClassName = "java/lang/Integer"; - std::string UserIndexCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(UserIndexClassName.c_str(), UserIndexCtorSignature.c_str(), - dataResponse.userIndex.Value(), UserIndex); - } - jobject CreatorFabricIndex; - if (dataResponse.creatorFabricIndex.IsNull()) - { - CreatorFabricIndex = nullptr; - } - else - { - std::string CreatorFabricIndexClassName = "java/lang/Integer"; - std::string CreatorFabricIndexCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(CreatorFabricIndexClassName.c_str(), - CreatorFabricIndexCtorSignature.c_str(), - dataResponse.creatorFabricIndex.Value(), CreatorFabricIndex); - } - jobject LastModifiedFabricIndex; - if (dataResponse.lastModifiedFabricIndex.IsNull()) - { - LastModifiedFabricIndex = nullptr; - } - else - { - std::string LastModifiedFabricIndexClassName = "java/lang/Integer"; - std::string LastModifiedFabricIndexCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - LastModifiedFabricIndexClassName.c_str(), LastModifiedFabricIndexCtorSignature.c_str(), - dataResponse.lastModifiedFabricIndex.Value(), LastModifiedFabricIndex); - } - jobject NextCredentialIndex; - if (dataResponse.nextCredentialIndex.IsNull()) - { - NextCredentialIndex = nullptr; - } - else + jobject Status; + std::string StatusClassName = "java/lang/Integer"; + std::string StatusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(StatusClassName.c_str(), StatusCtorSignature.c_str(), + static_cast(dataResponse.status), Status); + jobject Data; + if (!dataResponse.data.HasValue()) { - std::string NextCredentialIndexClassName = "java/lang/Integer"; - std::string NextCredentialIndexCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - NextCredentialIndexClassName.c_str(), NextCredentialIndexCtorSignature.c_str(), - dataResponse.nextCredentialIndex.Value(), NextCredentialIndex); + chip::JniReferences::GetInstance().CreateOptional(nullptr, Data); + } + else + { + jobject DataInsideOptional; + DataInsideOptional = + env->NewStringUTF(std::string(dataResponse.data.Value().data(), dataResponse.data.Value().size()).c_str()); + chip::JniReferences::GetInstance().CreateOptional(DataInsideOptional, Data); } - env->CallVoidMethod(javaCallbackRef, javaMethod, CredentialExists, UserIndex, CreatorFabricIndex, LastModifiedFabricIndex, - NextCredentialIndex); + env->CallVoidMethod(javaCallbackRef, javaMethod, Status, Data); } -CHIPThermostatClusterGetWeeklyScheduleResponseCallback::CHIPThermostatClusterGetWeeklyScheduleResponseCallback( - jobject javaCallback) : - Callback::Callback(CallbackFn, this) +CHIPMediaPlaybackClusterPlaybackResponseCallback::CHIPMediaPlaybackClusterPlaybackResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3150,7 +3781,7 @@ CHIPThermostatClusterGetWeeklyScheduleResponseCallback::CHIPThermostatClusterGet } } -CHIPThermostatClusterGetWeeklyScheduleResponseCallback::~CHIPThermostatClusterGetWeeklyScheduleResponseCallback() +CHIPMediaPlaybackClusterPlaybackResponseCallback::~CHIPMediaPlaybackClusterPlaybackResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3161,8 +3792,8 @@ CHIPThermostatClusterGetWeeklyScheduleResponseCallback::~CHIPThermostatClusterGe env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPThermostatClusterGetWeeklyScheduleResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::Thermostat::Commands::GetWeeklyScheduleResponse::DecodableType & dataResponse) +void CHIPMediaPlaybackClusterPlaybackResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -3172,107 +3803,41 @@ void CHIPThermostatClusterGetWeeklyScheduleResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; // Java callback is allowed to be null, exit early if this is the case. VerifyOrReturn(javaCallbackRef != nullptr); - err = JniReferences::GetInstance().FindMethod( - env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/ArrayList;)V", - &javaMethod); + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/util/Optional;)V", + &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - jobject NumberOfTransitionsForSequence; - std::string NumberOfTransitionsForSequenceClassName = "java/lang/Integer"; - std::string NumberOfTransitionsForSequenceCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - NumberOfTransitionsForSequenceClassName.c_str(), NumberOfTransitionsForSequenceCtorSignature.c_str(), - dataResponse.numberOfTransitionsForSequence, NumberOfTransitionsForSequence); - jobject DayOfWeekForSequence; - std::string DayOfWeekForSequenceClassName = "java/lang/Integer"; - std::string DayOfWeekForSequenceCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(DayOfWeekForSequenceClassName.c_str(), - DayOfWeekForSequenceCtorSignature.c_str(), - dataResponse.dayOfWeekForSequence.Raw(), DayOfWeekForSequence); - jobject ModeForSequence; - std::string ModeForSequenceClassName = "java/lang/Integer"; - std::string ModeForSequenceCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(ModeForSequenceClassName.c_str(), - ModeForSequenceCtorSignature.c_str(), - dataResponse.modeForSequence.Raw(), ModeForSequence); - jobject Transitions; - chip::JniReferences::GetInstance().CreateArrayList(Transitions); - - auto iter_Transitions_0 = dataResponse.transitions.begin(); - while (iter_Transitions_0.Next()) + jobject Status; + std::string StatusClassName = "java/lang/Integer"; + std::string StatusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(StatusClassName.c_str(), StatusCtorSignature.c_str(), + static_cast(dataResponse.status), Status); + jobject Data; + if (!dataResponse.data.HasValue()) { - auto & entry_0 = iter_Transitions_0.GetValue(); - jobject newElement_0; - jobject newElement_0_transitionTime; - std::string newElement_0_transitionTimeClassName = "java/lang/Integer"; - std::string newElement_0_transitionTimeCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_transitionTimeClassName.c_str(), - newElement_0_transitionTimeCtorSignature.c_str(), - entry_0.transitionTime, newElement_0_transitionTime); - jobject newElement_0_heatSetpoint; - if (entry_0.heatSetpoint.IsNull()) - { - newElement_0_heatSetpoint = nullptr; - } - else - { - std::string newElement_0_heatSetpointClassName = "java/lang/Integer"; - std::string newElement_0_heatSetpointCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_heatSetpointClassName.c_str(), - newElement_0_heatSetpointCtorSignature.c_str(), - entry_0.heatSetpoint.Value(), newElement_0_heatSetpoint); - } - jobject newElement_0_coolSetpoint; - if (entry_0.coolSetpoint.IsNull()) - { - newElement_0_coolSetpoint = nullptr; - } - else - { - std::string newElement_0_coolSetpointClassName = "java/lang/Integer"; - std::string newElement_0_coolSetpointCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_coolSetpointClassName.c_str(), - newElement_0_coolSetpointCtorSignature.c_str(), - entry_0.coolSetpoint.Value(), newElement_0_coolSetpoint); - } - - jclass thermostatScheduleTransitionStructClass_1; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$ThermostatClusterThermostatScheduleTransition", - thermostatScheduleTransitionStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$ThermostatClusterThermostatScheduleTransition"); - return; - } - jmethodID thermostatScheduleTransitionStructCtor_1 = env->GetMethodID( - thermostatScheduleTransitionStructClass_1, "", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V"); - if (thermostatScheduleTransitionStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ThermostatClusterThermostatScheduleTransition constructor"); - return; - } - - newElement_0 = env->NewObject(thermostatScheduleTransitionStructClass_1, thermostatScheduleTransitionStructCtor_1, - newElement_0_transitionTime, newElement_0_heatSetpoint, newElement_0_coolSetpoint); - chip::JniReferences::GetInstance().AddToList(Transitions, newElement_0); + chip::JniReferences::GetInstance().CreateOptional(nullptr, Data); + } + else + { + jobject DataInsideOptional; + DataInsideOptional = + env->NewStringUTF(std::string(dataResponse.data.Value().data(), dataResponse.data.Value().size()).c_str()); + chip::JniReferences::GetInstance().CreateOptional(DataInsideOptional, Data); } - env->CallVoidMethod(javaCallbackRef, javaMethod, NumberOfTransitionsForSequence, DayOfWeekForSequence, ModeForSequence, - Transitions); + env->CallVoidMethod(javaCallbackRef, javaMethod, Status, Data); } -CHIPChannelClusterChangeChannelResponseCallback::CHIPChannelClusterChangeChannelResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) +CHIPKeypadInputClusterSendKeyResponseCallback::CHIPKeypadInputClusterSendKeyResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3288,7 +3853,7 @@ CHIPChannelClusterChangeChannelResponseCallback::CHIPChannelClusterChangeChannel } } -CHIPChannelClusterChangeChannelResponseCallback::~CHIPChannelClusterChangeChannelResponseCallback() +CHIPKeypadInputClusterSendKeyResponseCallback::~CHIPKeypadInputClusterSendKeyResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3299,8 +3864,8 @@ CHIPChannelClusterChangeChannelResponseCallback::~CHIPChannelClusterChangeChanne env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPChannelClusterChangeChannelResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::Channel::Commands::ChangeChannelResponse::DecodableType & dataResponse) +void CHIPKeypadInputClusterSendKeyResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -3310,17 +3875,16 @@ void CHIPChannelClusterChangeChannelResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; // Java callback is allowed to be null, exit early if this is the case. VerifyOrReturn(javaCallbackRef != nullptr); - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/util/Optional;)V", - &javaMethod); + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); jobject Status; @@ -3328,24 +3892,11 @@ void CHIPChannelClusterChangeChannelResponseCallback::CallbackFn( std::string StatusCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject(StatusClassName.c_str(), StatusCtorSignature.c_str(), static_cast(dataResponse.status), Status); - jobject Data; - if (!dataResponse.data.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, Data); - } - else - { - jobject DataInsideOptional; - DataInsideOptional = - env->NewStringUTF(std::string(dataResponse.data.Value().data(), dataResponse.data.Value().size()).c_str()); - chip::JniReferences::GetInstance().CreateOptional(DataInsideOptional, Data); - } - env->CallVoidMethod(javaCallbackRef, javaMethod, Status, Data); + env->CallVoidMethod(javaCallbackRef, javaMethod, Status); } -CHIPTargetNavigatorClusterNavigateTargetResponseCallback::CHIPTargetNavigatorClusterNavigateTargetResponseCallback( - jobject javaCallback) : - Callback::Callback(CallbackFn, this) +CHIPContentLauncherClusterLauncherResponseCallback::CHIPContentLauncherClusterLauncherResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3361,7 +3912,7 @@ CHIPTargetNavigatorClusterNavigateTargetResponseCallback::CHIPTargetNavigatorClu } } -CHIPTargetNavigatorClusterNavigateTargetResponseCallback::~CHIPTargetNavigatorClusterNavigateTargetResponseCallback() +CHIPContentLauncherClusterLauncherResponseCallback::~CHIPContentLauncherClusterLauncherResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3372,8 +3923,8 @@ CHIPTargetNavigatorClusterNavigateTargetResponseCallback::~CHIPTargetNavigatorCl env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPTargetNavigatorClusterNavigateTargetResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::DecodableType & dataResponse) +void CHIPContentLauncherClusterLauncherResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -3383,10 +3934,10 @@ void CHIPTargetNavigatorClusterNavigateTargetResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; @@ -3417,8 +3968,9 @@ void CHIPTargetNavigatorClusterNavigateTargetResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, Status, Data); } -CHIPMediaPlaybackClusterPlaybackResponseCallback::CHIPMediaPlaybackClusterPlaybackResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) +CHIPApplicationLauncherClusterLauncherResponseCallback::CHIPApplicationLauncherClusterLauncherResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3434,7 +3986,7 @@ CHIPMediaPlaybackClusterPlaybackResponseCallback::CHIPMediaPlaybackClusterPlayba } } -CHIPMediaPlaybackClusterPlaybackResponseCallback::~CHIPMediaPlaybackClusterPlaybackResponseCallback() +CHIPApplicationLauncherClusterLauncherResponseCallback::~CHIPApplicationLauncherClusterLauncherResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3445,8 +3997,8 @@ CHIPMediaPlaybackClusterPlaybackResponseCallback::~CHIPMediaPlaybackClusterPlayb env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPMediaPlaybackClusterPlaybackResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType & dataResponse) +void CHIPApplicationLauncherClusterLauncherResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -3456,9 +4008,10 @@ void CHIPMediaPlaybackClusterPlaybackResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; @@ -3482,15 +4035,75 @@ void CHIPMediaPlaybackClusterPlaybackResponseCallback::CallbackFn( else { jobject DataInsideOptional; - DataInsideOptional = - env->NewStringUTF(std::string(dataResponse.data.Value().data(), dataResponse.data.Value().size()).c_str()); + jbyteArray DataInsideOptionalByteArray = env->NewByteArray(static_cast(dataResponse.data.Value().size())); + env->SetByteArrayRegion(DataInsideOptionalByteArray, 0, static_cast(dataResponse.data.Value().size()), + reinterpret_cast(dataResponse.data.Value().data())); + DataInsideOptional = DataInsideOptionalByteArray; chip::JniReferences::GetInstance().CreateOptional(DataInsideOptional, Data); } - env->CallVoidMethod(javaCallbackRef, javaMethod, Status, Data); + env->CallVoidMethod(javaCallbackRef, javaMethod, Status, Data); +} +CHIPAccountLoginClusterGetSetupPINResponseCallback::CHIPAccountLoginClusterGetSetupPINResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPAccountLoginClusterGetSetupPINResponseCallback::~CHIPAccountLoginClusterGetSetupPINResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPAccountLoginClusterGetSetupPINResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/String;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject SetupPIN; + SetupPIN = env->NewStringUTF(std::string(dataResponse.setupPIN.data(), dataResponse.setupPIN.size()).c_str()); + + env->CallVoidMethod(javaCallbackRef, javaMethod, SetupPIN); } -CHIPKeypadInputClusterSendKeyResponseCallback::CHIPKeypadInputClusterSendKeyResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) +CHIPElectricalMeasurementClusterGetProfileInfoResponseCommandCallback:: + CHIPElectricalMeasurementClusterGetProfileInfoResponseCommandCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3506,7 +4119,8 @@ CHIPKeypadInputClusterSendKeyResponseCallback::CHIPKeypadInputClusterSendKeyResp } } -CHIPKeypadInputClusterSendKeyResponseCallback::~CHIPKeypadInputClusterSendKeyResponseCallback() +CHIPElectricalMeasurementClusterGetProfileInfoResponseCommandCallback:: + ~CHIPElectricalMeasurementClusterGetProfileInfoResponseCommandCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3517,8 +4131,9 @@ CHIPKeypadInputClusterSendKeyResponseCallback::~CHIPKeypadInputClusterSendKeyRes env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPKeypadInputClusterSendKeyResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType & dataResponse) +void CHIPElectricalMeasurementClusterGetProfileInfoResponseCommandCallback::CallbackFn( + void * context, + const chip::app::Clusters::ElectricalMeasurement::Commands::GetProfileInfoResponseCommand::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -3528,28 +4143,58 @@ void CHIPKeypadInputClusterSendKeyResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; // Java callback is allowed to be null, exit early if this is the case. VerifyOrReturn(javaCallbackRef != nullptr); - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + err = JniReferences::GetInstance().FindMethod( + env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/ArrayList;)V", + &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - jobject Status; - std::string StatusClassName = "java/lang/Integer"; - std::string StatusCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(StatusClassName.c_str(), StatusCtorSignature.c_str(), - static_cast(dataResponse.status), Status); + jobject profileCount; + std::string profileCountClassName = "java/lang/Integer"; + std::string profileCountCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(profileCountClassName.c_str(), profileCountCtorSignature.c_str(), + dataResponse.profileCount, profileCount); + jobject profileIntervalPeriod; + std::string profileIntervalPeriodClassName = "java/lang/Integer"; + std::string profileIntervalPeriodCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(profileIntervalPeriodClassName.c_str(), + profileIntervalPeriodCtorSignature.c_str(), + dataResponse.profileIntervalPeriod, profileIntervalPeriod); + jobject maxNumberOfIntervals; + std::string maxNumberOfIntervalsClassName = "java/lang/Integer"; + std::string maxNumberOfIntervalsCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(maxNumberOfIntervalsClassName.c_str(), + maxNumberOfIntervalsCtorSignature.c_str(), + dataResponse.maxNumberOfIntervals, maxNumberOfIntervals); + jobject listOfAttributes; + chip::JniReferences::GetInstance().CreateArrayList(listOfAttributes); + + auto iter_listOfAttributes_0 = dataResponse.listOfAttributes.begin(); + while (iter_listOfAttributes_0.Next()) + { + auto & entry_0 = iter_listOfAttributes_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Integer"; + std::string newElement_0CtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(listOfAttributes, newElement_0); + } - env->CallVoidMethod(javaCallbackRef, javaMethod, Status); + env->CallVoidMethod(javaCallbackRef, javaMethod, profileCount, profileIntervalPeriod, maxNumberOfIntervals, listOfAttributes); } -CHIPContentLauncherClusterLauncherResponseCallback::CHIPContentLauncherClusterLauncherResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) +CHIPElectricalMeasurementClusterGetMeasurementProfileResponseCommandCallback:: + CHIPElectricalMeasurementClusterGetMeasurementProfileResponseCommandCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3565,7 +4210,8 @@ CHIPContentLauncherClusterLauncherResponseCallback::CHIPContentLauncherClusterLa } } -CHIPContentLauncherClusterLauncherResponseCallback::~CHIPContentLauncherClusterLauncherResponseCallback() +CHIPElectricalMeasurementClusterGetMeasurementProfileResponseCommandCallback:: + ~CHIPElectricalMeasurementClusterGetMeasurementProfileResponseCommandCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3576,8 +4222,9 @@ CHIPContentLauncherClusterLauncherResponseCallback::~CHIPContentLauncherClusterL env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPContentLauncherClusterLauncherResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType & dataResponse) +void CHIPElectricalMeasurementClusterGetMeasurementProfileResponseCommandCallback::CallbackFn( + void * context, + const chip::app::Clusters::ElectricalMeasurement::Commands::GetMeasurementProfileResponseCommand::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -3587,43 +4234,69 @@ void CHIPContentLauncherClusterLauncherResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; // Java callback is allowed to be null, exit early if this is the case. VerifyOrReturn(javaCallbackRef != nullptr); - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/util/Optional;)V", - &javaMethod); + err = JniReferences::GetInstance().FindMethod( + env, javaCallbackRef, "onSuccess", + "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/ArrayList;)V", + &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - jobject Status; - std::string StatusClassName = "java/lang/Integer"; - std::string StatusCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(StatusClassName.c_str(), StatusCtorSignature.c_str(), - static_cast(dataResponse.status), Status); - jobject Data; - if (!dataResponse.data.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, Data); - } - else - { - jobject DataInsideOptional; - DataInsideOptional = - env->NewStringUTF(std::string(dataResponse.data.Value().data(), dataResponse.data.Value().size()).c_str()); - chip::JniReferences::GetInstance().CreateOptional(DataInsideOptional, Data); + jobject startTime; + std::string startTimeClassName = "java/lang/Long"; + std::string startTimeCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(startTimeClassName.c_str(), startTimeCtorSignature.c_str(), + dataResponse.startTime, startTime); + jobject status; + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + jobject profileIntervalPeriod; + std::string profileIntervalPeriodClassName = "java/lang/Integer"; + std::string profileIntervalPeriodCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(profileIntervalPeriodClassName.c_str(), + profileIntervalPeriodCtorSignature.c_str(), + dataResponse.profileIntervalPeriod, profileIntervalPeriod); + jobject numberOfIntervalsDelivered; + std::string numberOfIntervalsDeliveredClassName = "java/lang/Integer"; + std::string numberOfIntervalsDeliveredCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + numberOfIntervalsDeliveredClassName.c_str(), numberOfIntervalsDeliveredCtorSignature.c_str(), + dataResponse.numberOfIntervalsDelivered, numberOfIntervalsDelivered); + jobject attributeId; + std::string attributeIdClassName = "java/lang/Integer"; + std::string attributeIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(attributeIdClassName.c_str(), attributeIdCtorSignature.c_str(), + dataResponse.attributeId, attributeId); + jobject intervals; + chip::JniReferences::GetInstance().CreateArrayList(intervals); + + auto iter_intervals_0 = dataResponse.intervals.begin(); + while (iter_intervals_0.Next()) + { + auto & entry_0 = iter_intervals_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Integer"; + std::string newElement_0CtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(intervals, newElement_0); } - env->CallVoidMethod(javaCallbackRef, javaMethod, Status, Data); + env->CallVoidMethod(javaCallbackRef, javaMethod, startTime, status, profileIntervalPeriod, numberOfIntervalsDelivered, + attributeId, intervals); } -CHIPApplicationLauncherClusterLauncherResponseCallback::CHIPApplicationLauncherClusterLauncherResponseCallback( - jobject javaCallback) : - Callback::Callback(CallbackFn, this) +CHIPUnitTestingClusterTestSpecificResponseCallback::CHIPUnitTestingClusterTestSpecificResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3639,7 +4312,7 @@ CHIPApplicationLauncherClusterLauncherResponseCallback::CHIPApplicationLauncherC } } -CHIPApplicationLauncherClusterLauncherResponseCallback::~CHIPApplicationLauncherClusterLauncherResponseCallback() +CHIPUnitTestingClusterTestSpecificResponseCallback::~CHIPUnitTestingClusterTestSpecificResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3650,8 +4323,8 @@ CHIPApplicationLauncherClusterLauncherResponseCallback::~CHIPApplicationLauncher env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPApplicationLauncherClusterLauncherResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType & dataResponse) +void CHIPUnitTestingClusterTestSpecificResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::UnitTesting::Commands::TestSpecificResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -3661,44 +4334,30 @@ void CHIPApplicationLauncherClusterLauncherResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; // Java callback is allowed to be null, exit early if this is the case. VerifyOrReturn(javaCallbackRef != nullptr); - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/util/Optional;)V", - &javaMethod); + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - jobject Status; - std::string StatusClassName = "java/lang/Integer"; - std::string StatusCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(StatusClassName.c_str(), StatusCtorSignature.c_str(), - static_cast(dataResponse.status), Status); - jobject Data; - if (!dataResponse.data.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, Data); - } - else - { - jobject DataInsideOptional; - jbyteArray DataInsideOptionalByteArray = env->NewByteArray(static_cast(dataResponse.data.Value().size())); - env->SetByteArrayRegion(DataInsideOptionalByteArray, 0, static_cast(dataResponse.data.Value().size()), - reinterpret_cast(dataResponse.data.Value().data())); - DataInsideOptional = DataInsideOptionalByteArray; - chip::JniReferences::GetInstance().CreateOptional(DataInsideOptional, Data); - } + jobject returnValue; + std::string returnValueClassName = "java/lang/Integer"; + std::string returnValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(returnValueClassName.c_str(), returnValueCtorSignature.c_str(), + dataResponse.returnValue, returnValue); - env->CallVoidMethod(javaCallbackRef, javaMethod, Status, Data); + env->CallVoidMethod(javaCallbackRef, javaMethod, returnValue); } -CHIPAccountLoginClusterGetSetupPINResponseCallback::CHIPAccountLoginClusterGetSetupPINResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) +CHIPUnitTestingClusterTestAddArgumentsResponseCallback::CHIPUnitTestingClusterTestAddArgumentsResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3714,7 +4373,7 @@ CHIPAccountLoginClusterGetSetupPINResponseCallback::CHIPAccountLoginClusterGetSe } } -CHIPAccountLoginClusterGetSetupPINResponseCallback::~CHIPAccountLoginClusterGetSetupPINResponseCallback() +CHIPUnitTestingClusterTestAddArgumentsResponseCallback::~CHIPUnitTestingClusterTestAddArgumentsResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3725,8 +4384,8 @@ CHIPAccountLoginClusterGetSetupPINResponseCallback::~CHIPAccountLoginClusterGetS env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPAccountLoginClusterGetSetupPINResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::DecodableType & dataResponse) +void CHIPUnitTestingClusterTestAddArgumentsResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::UnitTesting::Commands::TestAddArgumentsResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -3736,26 +4395,30 @@ void CHIPAccountLoginClusterGetSetupPINResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; // Java callback is allowed to be null, exit early if this is the case. VerifyOrReturn(javaCallbackRef != nullptr); - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/String;)V", &javaMethod); + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - jobject SetupPIN; - SetupPIN = env->NewStringUTF(std::string(dataResponse.setupPIN.data(), dataResponse.setupPIN.size()).c_str()); + jobject returnValue; + std::string returnValueClassName = "java/lang/Integer"; + std::string returnValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(returnValueClassName.c_str(), returnValueCtorSignature.c_str(), + dataResponse.returnValue, returnValue); - env->CallVoidMethod(javaCallbackRef, javaMethod, SetupPIN); + env->CallVoidMethod(javaCallbackRef, javaMethod, returnValue); } -CHIPUnitTestingClusterTestSpecificResponseCallback::CHIPUnitTestingClusterTestSpecificResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) +CHIPUnitTestingClusterTestSimpleArgumentResponseCallback::CHIPUnitTestingClusterTestSimpleArgumentResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3771,7 +4434,7 @@ CHIPUnitTestingClusterTestSpecificResponseCallback::CHIPUnitTestingClusterTestSp } } -CHIPUnitTestingClusterTestSpecificResponseCallback::~CHIPUnitTestingClusterTestSpecificResponseCallback() +CHIPUnitTestingClusterTestSimpleArgumentResponseCallback::~CHIPUnitTestingClusterTestSimpleArgumentResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3782,8 +4445,8 @@ CHIPUnitTestingClusterTestSpecificResponseCallback::~CHIPUnitTestingClusterTestS env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPUnitTestingClusterTestSpecificResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::UnitTesting::Commands::TestSpecificResponse::DecodableType & dataResponse) +void CHIPUnitTestingClusterTestSimpleArgumentResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::UnitTesting::Commands::TestSimpleArgumentResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -3793,30 +4456,30 @@ void CHIPUnitTestingClusterTestSpecificResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; // Java callback is allowed to be null, exit early if this is the case. VerifyOrReturn(javaCallbackRef != nullptr); - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Boolean;)V", &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); jobject returnValue; - std::string returnValueClassName = "java/lang/Integer"; - std::string returnValueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(returnValueClassName.c_str(), returnValueCtorSignature.c_str(), - dataResponse.returnValue, returnValue); + std::string returnValueClassName = "java/lang/Boolean"; + std::string returnValueCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(returnValueClassName.c_str(), returnValueCtorSignature.c_str(), + dataResponse.returnValue, returnValue); env->CallVoidMethod(javaCallbackRef, javaMethod, returnValue); } -CHIPUnitTestingClusterTestAddArgumentsResponseCallback::CHIPUnitTestingClusterTestAddArgumentsResponseCallback( +CHIPUnitTestingClusterTestStructArrayArgumentResponseCallback::CHIPUnitTestingClusterTestStructArrayArgumentResponseCallback( jobject javaCallback) : - Callback::Callback(CallbackFn, this) + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3832,7 +4495,7 @@ CHIPUnitTestingClusterTestAddArgumentsResponseCallback::CHIPUnitTestingClusterTe } } -CHIPUnitTestingClusterTestAddArgumentsResponseCallback::~CHIPUnitTestingClusterTestAddArgumentsResponseCallback() +CHIPUnitTestingClusterTestStructArrayArgumentResponseCallback::~CHIPUnitTestingClusterTestStructArrayArgumentResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3843,8 +4506,8 @@ CHIPUnitTestingClusterTestAddArgumentsResponseCallback::~CHIPUnitTestingClusterT env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPUnitTestingClusterTestAddArgumentsResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::UnitTesting::Commands::TestAddArgumentsResponse::DecodableType & dataResponse) +void CHIPUnitTestingClusterTestStructArrayArgumentResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::UnitTesting::Commands::TestStructArrayArgumentResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -3854,26 +4517,345 @@ void CHIPUnitTestingClusterTestAddArgumentsResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; // Java callback is allowed to be null, exit early if this is the case. VerifyOrReturn(javaCallbackRef != nullptr); - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", + "(Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/util/" + "ArrayList;Ljava/lang/Integer;Ljava/lang/Boolean;)V", + &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - jobject returnValue; - std::string returnValueClassName = "java/lang/Integer"; - std::string returnValueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(returnValueClassName.c_str(), returnValueCtorSignature.c_str(), - dataResponse.returnValue, returnValue); + jobject arg1; + chip::JniReferences::GetInstance().CreateArrayList(arg1); + + auto iter_arg1_0 = dataResponse.arg1.begin(); + while (iter_arg1_0.Next()) + { + auto & entry_0 = iter_arg1_0.GetValue(); + jobject newElement_0; + jobject newElement_0_a; + std::string newElement_0_aClassName = "java/lang/Integer"; + std::string newElement_0_aCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_aClassName.c_str(), newElement_0_aCtorSignature.c_str(), entry_0.a, newElement_0_a); + jobject newElement_0_b; + std::string newElement_0_bClassName = "java/lang/Boolean"; + std::string newElement_0_bCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_bClassName.c_str(), + newElement_0_bCtorSignature.c_str(), entry_0.b, newElement_0_b); + jobject newElement_0_c; + jobject newElement_0_c_a; + std::string newElement_0_c_aClassName = "java/lang/Integer"; + std::string newElement_0_c_aCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_c_aClassName.c_str(), newElement_0_c_aCtorSignature.c_str(), entry_0.c.a, newElement_0_c_a); + jobject newElement_0_c_b; + std::string newElement_0_c_bClassName = "java/lang/Boolean"; + std::string newElement_0_c_bCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_c_bClassName.c_str(), newElement_0_c_bCtorSignature.c_str(), entry_0.c.b, newElement_0_c_b); + jobject newElement_0_c_c; + std::string newElement_0_c_cClassName = "java/lang/Integer"; + std::string newElement_0_c_cCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_c_cClassName.c_str(), + newElement_0_c_cCtorSignature.c_str(), + static_cast(entry_0.c.c), newElement_0_c_c); + jobject newElement_0_c_d; + jbyteArray newElement_0_c_dByteArray = env->NewByteArray(static_cast(entry_0.c.d.size())); + env->SetByteArrayRegion(newElement_0_c_dByteArray, 0, static_cast(entry_0.c.d.size()), + reinterpret_cast(entry_0.c.d.data())); + newElement_0_c_d = newElement_0_c_dByteArray; + jobject newElement_0_c_e; + newElement_0_c_e = env->NewStringUTF(std::string(entry_0.c.e.data(), entry_0.c.e.size()).c_str()); + jobject newElement_0_c_f; + std::string newElement_0_c_fClassName = "java/lang/Integer"; + std::string newElement_0_c_fCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_c_fClassName.c_str(), newElement_0_c_fCtorSignature.c_str(), entry_0.c.f.Raw(), newElement_0_c_f); + jobject newElement_0_c_g; + std::string newElement_0_c_gClassName = "java/lang/Float"; + std::string newElement_0_c_gCtorSignature = "(F)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_c_gClassName.c_str(), newElement_0_c_gCtorSignature.c_str(), entry_0.c.g, newElement_0_c_g); + jobject newElement_0_c_h; + std::string newElement_0_c_hClassName = "java/lang/Double"; + std::string newElement_0_c_hCtorSignature = "(D)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_c_hClassName.c_str(), newElement_0_c_hCtorSignature.c_str(), entry_0.c.h, newElement_0_c_h); + + jclass simpleStructStructClass_2; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); + return; + } + jmethodID simpleStructStructCtor_2 = + env->GetMethodID(simpleStructStructClass_2, "", + "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/" + "Integer;Ljava/lang/Float;Ljava/lang/Double;)V"); + if (simpleStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); + return; + } + + newElement_0_c = env->NewObject(simpleStructStructClass_2, simpleStructStructCtor_2, newElement_0_c_a, newElement_0_c_b, + newElement_0_c_c, newElement_0_c_d, newElement_0_c_e, newElement_0_c_f, newElement_0_c_g, + newElement_0_c_h); + jobject newElement_0_d; + chip::JniReferences::GetInstance().CreateArrayList(newElement_0_d); + + auto iter_newElement_0_d_2 = entry_0.d.begin(); + while (iter_newElement_0_d_2.Next()) + { + auto & entry_2 = iter_newElement_0_d_2.GetValue(); + jobject newElement_2; + jobject newElement_2_a; + std::string newElement_2_aClassName = "java/lang/Integer"; + std::string newElement_2_aCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2_aClassName.c_str(), newElement_2_aCtorSignature.c_str(), entry_2.a, newElement_2_a); + jobject newElement_2_b; + std::string newElement_2_bClassName = "java/lang/Boolean"; + std::string newElement_2_bCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2_bClassName.c_str(), newElement_2_bCtorSignature.c_str(), entry_2.b, newElement_2_b); + jobject newElement_2_c; + std::string newElement_2_cClassName = "java/lang/Integer"; + std::string newElement_2_cCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_2_cClassName.c_str(), + newElement_2_cCtorSignature.c_str(), + static_cast(entry_2.c), newElement_2_c); + jobject newElement_2_d; + jbyteArray newElement_2_dByteArray = env->NewByteArray(static_cast(entry_2.d.size())); + env->SetByteArrayRegion(newElement_2_dByteArray, 0, static_cast(entry_2.d.size()), + reinterpret_cast(entry_2.d.data())); + newElement_2_d = newElement_2_dByteArray; + jobject newElement_2_e; + newElement_2_e = env->NewStringUTF(std::string(entry_2.e.data(), entry_2.e.size()).c_str()); + jobject newElement_2_f; + std::string newElement_2_fClassName = "java/lang/Integer"; + std::string newElement_2_fCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2_fClassName.c_str(), newElement_2_fCtorSignature.c_str(), entry_2.f.Raw(), newElement_2_f); + jobject newElement_2_g; + std::string newElement_2_gClassName = "java/lang/Float"; + std::string newElement_2_gCtorSignature = "(F)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2_gClassName.c_str(), newElement_2_gCtorSignature.c_str(), entry_2.g, newElement_2_g); + jobject newElement_2_h; + std::string newElement_2_hClassName = "java/lang/Double"; + std::string newElement_2_hCtorSignature = "(D)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2_hClassName.c_str(), newElement_2_hCtorSignature.c_str(), entry_2.h, newElement_2_h); + + jclass simpleStructStructClass_3; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); + return; + } + jmethodID simpleStructStructCtor_3 = + env->GetMethodID(simpleStructStructClass_3, "", + "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/" + "Integer;Ljava/lang/Float;Ljava/lang/Double;)V"); + if (simpleStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); + return; + } + + newElement_2 = + env->NewObject(simpleStructStructClass_3, simpleStructStructCtor_3, newElement_2_a, newElement_2_b, newElement_2_c, + newElement_2_d, newElement_2_e, newElement_2_f, newElement_2_g, newElement_2_h); + chip::JniReferences::GetInstance().AddToList(newElement_0_d, newElement_2); + } + jobject newElement_0_e; + chip::JniReferences::GetInstance().CreateArrayList(newElement_0_e); + + auto iter_newElement_0_e_2 = entry_0.e.begin(); + while (iter_newElement_0_e_2.Next()) + { + auto & entry_2 = iter_newElement_0_e_2.GetValue(); + jobject newElement_2; + std::string newElement_2ClassName = "java/lang/Long"; + std::string newElement_2CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2ClassName.c_str(), newElement_2CtorSignature.c_str(), entry_2, newElement_2); + chip::JniReferences::GetInstance().AddToList(newElement_0_e, newElement_2); + } + jobject newElement_0_f; + chip::JniReferences::GetInstance().CreateArrayList(newElement_0_f); + + auto iter_newElement_0_f_2 = entry_0.f.begin(); + while (iter_newElement_0_f_2.Next()) + { + auto & entry_2 = iter_newElement_0_f_2.GetValue(); + jobject newElement_2; + jbyteArray newElement_2ByteArray = env->NewByteArray(static_cast(entry_2.size())); + env->SetByteArrayRegion(newElement_2ByteArray, 0, static_cast(entry_2.size()), + reinterpret_cast(entry_2.data())); + newElement_2 = newElement_2ByteArray; + chip::JniReferences::GetInstance().AddToList(newElement_0_f, newElement_2); + } + jobject newElement_0_g; + chip::JniReferences::GetInstance().CreateArrayList(newElement_0_g); + + auto iter_newElement_0_g_2 = entry_0.g.begin(); + while (iter_newElement_0_g_2.Next()) + { + auto & entry_2 = iter_newElement_0_g_2.GetValue(); + jobject newElement_2; + std::string newElement_2ClassName = "java/lang/Integer"; + std::string newElement_2CtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_2ClassName.c_str(), + newElement_2CtorSignature.c_str(), entry_2, newElement_2); + chip::JniReferences::GetInstance().AddToList(newElement_0_g, newElement_2); + } + + jclass nestedStructListStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterNestedStructList", nestedStructListStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterNestedStructList"); + return; + } + jmethodID nestedStructListStructCtor_1 = env->GetMethodID( + nestedStructListStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Boolean;Lchip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct;Ljava/util/" + "ArrayList;Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/util/ArrayList;)V"); + if (nestedStructListStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterNestedStructList constructor"); + return; + } + + newElement_0 = env->NewObject(nestedStructListStructClass_1, nestedStructListStructCtor_1, newElement_0_a, newElement_0_b, + newElement_0_c, newElement_0_d, newElement_0_e, newElement_0_f, newElement_0_g); + chip::JniReferences::GetInstance().AddToList(arg1, newElement_0); + } + jobject arg2; + chip::JniReferences::GetInstance().CreateArrayList(arg2); + + auto iter_arg2_0 = dataResponse.arg2.begin(); + while (iter_arg2_0.Next()) + { + auto & entry_0 = iter_arg2_0.GetValue(); + jobject newElement_0; + jobject newElement_0_a; + std::string newElement_0_aClassName = "java/lang/Integer"; + std::string newElement_0_aCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_aClassName.c_str(), newElement_0_aCtorSignature.c_str(), entry_0.a, newElement_0_a); + jobject newElement_0_b; + std::string newElement_0_bClassName = "java/lang/Boolean"; + std::string newElement_0_bCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_bClassName.c_str(), + newElement_0_bCtorSignature.c_str(), entry_0.b, newElement_0_b); + jobject newElement_0_c; + std::string newElement_0_cClassName = "java/lang/Integer"; + std::string newElement_0_cCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_cClassName.c_str(), newElement_0_cCtorSignature.c_str(), static_cast(entry_0.c), newElement_0_c); + jobject newElement_0_d; + jbyteArray newElement_0_dByteArray = env->NewByteArray(static_cast(entry_0.d.size())); + env->SetByteArrayRegion(newElement_0_dByteArray, 0, static_cast(entry_0.d.size()), + reinterpret_cast(entry_0.d.data())); + newElement_0_d = newElement_0_dByteArray; + jobject newElement_0_e; + newElement_0_e = env->NewStringUTF(std::string(entry_0.e.data(), entry_0.e.size()).c_str()); + jobject newElement_0_f; + std::string newElement_0_fClassName = "java/lang/Integer"; + std::string newElement_0_fCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_fClassName.c_str(), newElement_0_fCtorSignature.c_str(), entry_0.f.Raw(), newElement_0_f); + jobject newElement_0_g; + std::string newElement_0_gClassName = "java/lang/Float"; + std::string newElement_0_gCtorSignature = "(F)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_gClassName.c_str(), + newElement_0_gCtorSignature.c_str(), entry_0.g, newElement_0_g); + jobject newElement_0_h; + std::string newElement_0_hClassName = "java/lang/Double"; + std::string newElement_0_hCtorSignature = "(D)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_hClassName.c_str(), newElement_0_hCtorSignature.c_str(), entry_0.h, newElement_0_h); + + jclass simpleStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); + return; + } + jmethodID simpleStructStructCtor_1 = + env->GetMethodID(simpleStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/" + "Integer;Ljava/lang/Float;Ljava/lang/Double;)V"); + if (simpleStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); + return; + } + + newElement_0 = + env->NewObject(simpleStructStructClass_1, simpleStructStructCtor_1, newElement_0_a, newElement_0_b, newElement_0_c, + newElement_0_d, newElement_0_e, newElement_0_f, newElement_0_g, newElement_0_h); + chip::JniReferences::GetInstance().AddToList(arg2, newElement_0); + } + jobject arg3; + chip::JniReferences::GetInstance().CreateArrayList(arg3); - env->CallVoidMethod(javaCallbackRef, javaMethod, returnValue); + auto iter_arg3_0 = dataResponse.arg3.begin(); + while (iter_arg3_0.Next()) + { + auto & entry_0 = iter_arg3_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Integer"; + std::string newElement_0CtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), static_cast(entry_0), newElement_0); + chip::JniReferences::GetInstance().AddToList(arg3, newElement_0); + } + jobject arg4; + chip::JniReferences::GetInstance().CreateArrayList(arg4); + + auto iter_arg4_0 = dataResponse.arg4.begin(); + while (iter_arg4_0.Next()) + { + auto & entry_0 = iter_arg4_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Boolean"; + std::string newElement_0CtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), + entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arg4, newElement_0); + } + jobject arg5; + std::string arg5ClassName = "java/lang/Integer"; + std::string arg5CtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(arg5ClassName.c_str(), arg5CtorSignature.c_str(), + static_cast(dataResponse.arg5), arg5); + jobject arg6; + std::string arg6ClassName = "java/lang/Boolean"; + std::string arg6CtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(arg6ClassName.c_str(), arg6CtorSignature.c_str(), dataResponse.arg6, + arg6); + + env->CallVoidMethod(javaCallbackRef, javaMethod, arg1, arg2, arg3, arg4, arg5, arg6); } CHIPUnitTestingClusterTestListInt8UReverseResponseCallback::CHIPUnitTestingClusterTestListInt8UReverseResponseCallback( jobject javaCallback) : @@ -4125,6 +5107,619 @@ void CHIPUnitTestingClusterTestNullableOptionalResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, wasPresent, wasNull, value, originalValue); } +CHIPUnitTestingClusterTestComplexNullableOptionalResponseCallback:: + CHIPUnitTestingClusterTestComplexNullableOptionalResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPUnitTestingClusterTestComplexNullableOptionalResponseCallback:: + ~CHIPUnitTestingClusterTestComplexNullableOptionalResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPUnitTestingClusterTestComplexNullableOptionalResponseCallback::CallbackFn( + void * context, + const chip::app::Clusters::UnitTesting::Commands::TestComplexNullableOptionalResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod( + env, javaCallbackRef, "onSuccess", + "(Ljava/lang/Boolean;Ljava/util/Optional;Ljava/lang/Boolean;Ljava/util/Optional;Ljava/lang/Boolean;Ljava/util/" + "Optional;Ljava/util/Optional;Ljava/lang/Boolean;Ljava/util/Optional;Ljava/lang/Boolean;Ljava/util/Optional;Ljava/lang/" + "Boolean;Ljava/util/Optional;Ljava/util/Optional;Ljava/lang/Boolean;Ljava/util/Optional;Ljava/lang/Boolean;Ljava/util/" + "Optional;Ljava/lang/Boolean;Ljava/util/Optional;Ljava/util/Optional;Ljava/lang/Boolean;Ljava/util/Optional;Ljava/lang/" + "Boolean;Ljava/util/Optional;Ljava/lang/Boolean;Ljava/util/Optional;Ljava/util/Optional;)V", + &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject NullableIntWasNull; + std::string NullableIntWasNullClassName = "java/lang/Boolean"; + std::string NullableIntWasNullCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(NullableIntWasNullClassName.c_str(), + NullableIntWasNullCtorSignature.c_str(), + dataResponse.nullableIntWasNull, NullableIntWasNull); + jobject NullableIntValue; + if (!dataResponse.nullableIntValue.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, NullableIntValue); + } + else + { + jobject NullableIntValueInsideOptional; + std::string NullableIntValueInsideOptionalClassName = "java/lang/Integer"; + std::string NullableIntValueInsideOptionalCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + NullableIntValueInsideOptionalClassName.c_str(), NullableIntValueInsideOptionalCtorSignature.c_str(), + dataResponse.nullableIntValue.Value(), NullableIntValueInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(NullableIntValueInsideOptional, NullableIntValue); + } + jobject OptionalIntWasPresent; + std::string OptionalIntWasPresentClassName = "java/lang/Boolean"; + std::string OptionalIntWasPresentCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(OptionalIntWasPresentClassName.c_str(), + OptionalIntWasPresentCtorSignature.c_str(), + dataResponse.optionalIntWasPresent, OptionalIntWasPresent); + jobject OptionalIntValue; + if (!dataResponse.optionalIntValue.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, OptionalIntValue); + } + else + { + jobject OptionalIntValueInsideOptional; + std::string OptionalIntValueInsideOptionalClassName = "java/lang/Integer"; + std::string OptionalIntValueInsideOptionalCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + OptionalIntValueInsideOptionalClassName.c_str(), OptionalIntValueInsideOptionalCtorSignature.c_str(), + dataResponse.optionalIntValue.Value(), OptionalIntValueInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(OptionalIntValueInsideOptional, OptionalIntValue); + } + jobject NullableOptionalIntWasPresent; + std::string NullableOptionalIntWasPresentClassName = "java/lang/Boolean"; + std::string NullableOptionalIntWasPresentCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + NullableOptionalIntWasPresentClassName.c_str(), NullableOptionalIntWasPresentCtorSignature.c_str(), + dataResponse.nullableOptionalIntWasPresent, NullableOptionalIntWasPresent); + jobject NullableOptionalIntWasNull; + if (!dataResponse.nullableOptionalIntWasNull.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, NullableOptionalIntWasNull); + } + else + { + jobject NullableOptionalIntWasNullInsideOptional; + std::string NullableOptionalIntWasNullInsideOptionalClassName = "java/lang/Boolean"; + std::string NullableOptionalIntWasNullInsideOptionalCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(NullableOptionalIntWasNullInsideOptionalClassName.c_str(), + NullableOptionalIntWasNullInsideOptionalCtorSignature.c_str(), + dataResponse.nullableOptionalIntWasNull.Value(), + NullableOptionalIntWasNullInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(NullableOptionalIntWasNullInsideOptional, NullableOptionalIntWasNull); + } + jobject NullableOptionalIntValue; + if (!dataResponse.nullableOptionalIntValue.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, NullableOptionalIntValue); + } + else + { + jobject NullableOptionalIntValueInsideOptional; + std::string NullableOptionalIntValueInsideOptionalClassName = "java/lang/Integer"; + std::string NullableOptionalIntValueInsideOptionalCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + NullableOptionalIntValueInsideOptionalClassName.c_str(), NullableOptionalIntValueInsideOptionalCtorSignature.c_str(), + dataResponse.nullableOptionalIntValue.Value(), NullableOptionalIntValueInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(NullableOptionalIntValueInsideOptional, NullableOptionalIntValue); + } + jobject NullableStringWasNull; + std::string NullableStringWasNullClassName = "java/lang/Boolean"; + std::string NullableStringWasNullCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(NullableStringWasNullClassName.c_str(), + NullableStringWasNullCtorSignature.c_str(), + dataResponse.nullableStringWasNull, NullableStringWasNull); + jobject NullableStringValue; + if (!dataResponse.nullableStringValue.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, NullableStringValue); + } + else + { + jobject NullableStringValueInsideOptional; + NullableStringValueInsideOptional = env->NewStringUTF( + std::string(dataResponse.nullableStringValue.Value().data(), dataResponse.nullableStringValue.Value().size()).c_str()); + chip::JniReferences::GetInstance().CreateOptional(NullableStringValueInsideOptional, NullableStringValue); + } + jobject OptionalStringWasPresent; + std::string OptionalStringWasPresentClassName = "java/lang/Boolean"; + std::string OptionalStringWasPresentCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(OptionalStringWasPresentClassName.c_str(), + OptionalStringWasPresentCtorSignature.c_str(), + dataResponse.optionalStringWasPresent, OptionalStringWasPresent); + jobject OptionalStringValue; + if (!dataResponse.optionalStringValue.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, OptionalStringValue); + } + else + { + jobject OptionalStringValueInsideOptional; + OptionalStringValueInsideOptional = env->NewStringUTF( + std::string(dataResponse.optionalStringValue.Value().data(), dataResponse.optionalStringValue.Value().size()).c_str()); + chip::JniReferences::GetInstance().CreateOptional(OptionalStringValueInsideOptional, OptionalStringValue); + } + jobject NullableOptionalStringWasPresent; + std::string NullableOptionalStringWasPresentClassName = "java/lang/Boolean"; + std::string NullableOptionalStringWasPresentCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + NullableOptionalStringWasPresentClassName.c_str(), NullableOptionalStringWasPresentCtorSignature.c_str(), + dataResponse.nullableOptionalStringWasPresent, NullableOptionalStringWasPresent); + jobject NullableOptionalStringWasNull; + if (!dataResponse.nullableOptionalStringWasNull.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, NullableOptionalStringWasNull); + } + else + { + jobject NullableOptionalStringWasNullInsideOptional; + std::string NullableOptionalStringWasNullInsideOptionalClassName = "java/lang/Boolean"; + std::string NullableOptionalStringWasNullInsideOptionalCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(NullableOptionalStringWasNullInsideOptionalClassName.c_str(), + NullableOptionalStringWasNullInsideOptionalCtorSignature.c_str(), + dataResponse.nullableOptionalStringWasNull.Value(), + NullableOptionalStringWasNullInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(NullableOptionalStringWasNullInsideOptional, + NullableOptionalStringWasNull); + } + jobject NullableOptionalStringValue; + if (!dataResponse.nullableOptionalStringValue.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, NullableOptionalStringValue); + } + else + { + jobject NullableOptionalStringValueInsideOptional; + NullableOptionalStringValueInsideOptional = + env->NewStringUTF(std::string(dataResponse.nullableOptionalStringValue.Value().data(), + dataResponse.nullableOptionalStringValue.Value().size()) + .c_str()); + chip::JniReferences::GetInstance().CreateOptional(NullableOptionalStringValueInsideOptional, NullableOptionalStringValue); + } + jobject NullableStructWasNull; + std::string NullableStructWasNullClassName = "java/lang/Boolean"; + std::string NullableStructWasNullCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(NullableStructWasNullClassName.c_str(), + NullableStructWasNullCtorSignature.c_str(), + dataResponse.nullableStructWasNull, NullableStructWasNull); + jobject NullableStructValue; + if (!dataResponse.nullableStructValue.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, NullableStructValue); + } + else + { + jobject NullableStructValueInsideOptional; + jobject NullableStructValueInsideOptional_a; + std::string NullableStructValueInsideOptional_aClassName = "java/lang/Integer"; + std::string NullableStructValueInsideOptional_aCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + NullableStructValueInsideOptional_aClassName.c_str(), NullableStructValueInsideOptional_aCtorSignature.c_str(), + dataResponse.nullableStructValue.Value().a, NullableStructValueInsideOptional_a); + jobject NullableStructValueInsideOptional_b; + std::string NullableStructValueInsideOptional_bClassName = "java/lang/Boolean"; + std::string NullableStructValueInsideOptional_bCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + NullableStructValueInsideOptional_bClassName.c_str(), NullableStructValueInsideOptional_bCtorSignature.c_str(), + dataResponse.nullableStructValue.Value().b, NullableStructValueInsideOptional_b); + jobject NullableStructValueInsideOptional_c; + std::string NullableStructValueInsideOptional_cClassName = "java/lang/Integer"; + std::string NullableStructValueInsideOptional_cCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + NullableStructValueInsideOptional_cClassName.c_str(), NullableStructValueInsideOptional_cCtorSignature.c_str(), + static_cast(dataResponse.nullableStructValue.Value().c), NullableStructValueInsideOptional_c); + jobject NullableStructValueInsideOptional_d; + jbyteArray NullableStructValueInsideOptional_dByteArray = + env->NewByteArray(static_cast(dataResponse.nullableStructValue.Value().d.size())); + env->SetByteArrayRegion(NullableStructValueInsideOptional_dByteArray, 0, + static_cast(dataResponse.nullableStructValue.Value().d.size()), + reinterpret_cast(dataResponse.nullableStructValue.Value().d.data())); + NullableStructValueInsideOptional_d = NullableStructValueInsideOptional_dByteArray; + jobject NullableStructValueInsideOptional_e; + NullableStructValueInsideOptional_e = env->NewStringUTF( + std::string(dataResponse.nullableStructValue.Value().e.data(), dataResponse.nullableStructValue.Value().e.size()) + .c_str()); + jobject NullableStructValueInsideOptional_f; + std::string NullableStructValueInsideOptional_fClassName = "java/lang/Integer"; + std::string NullableStructValueInsideOptional_fCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + NullableStructValueInsideOptional_fClassName.c_str(), NullableStructValueInsideOptional_fCtorSignature.c_str(), + dataResponse.nullableStructValue.Value().f.Raw(), NullableStructValueInsideOptional_f); + jobject NullableStructValueInsideOptional_g; + std::string NullableStructValueInsideOptional_gClassName = "java/lang/Float"; + std::string NullableStructValueInsideOptional_gCtorSignature = "(F)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + NullableStructValueInsideOptional_gClassName.c_str(), NullableStructValueInsideOptional_gCtorSignature.c_str(), + dataResponse.nullableStructValue.Value().g, NullableStructValueInsideOptional_g); + jobject NullableStructValueInsideOptional_h; + std::string NullableStructValueInsideOptional_hClassName = "java/lang/Double"; + std::string NullableStructValueInsideOptional_hCtorSignature = "(D)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + NullableStructValueInsideOptional_hClassName.c_str(), NullableStructValueInsideOptional_hCtorSignature.c_str(), + dataResponse.nullableStructValue.Value().h, NullableStructValueInsideOptional_h); + + jclass simpleStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); + return; + } + jmethodID simpleStructStructCtor_1 = + env->GetMethodID(simpleStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/" + "Integer;Ljava/lang/Float;Ljava/lang/Double;)V"); + if (simpleStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); + return; + } + + NullableStructValueInsideOptional = env->NewObject( + simpleStructStructClass_1, simpleStructStructCtor_1, NullableStructValueInsideOptional_a, + NullableStructValueInsideOptional_b, NullableStructValueInsideOptional_c, NullableStructValueInsideOptional_d, + NullableStructValueInsideOptional_e, NullableStructValueInsideOptional_f, NullableStructValueInsideOptional_g, + NullableStructValueInsideOptional_h); + chip::JniReferences::GetInstance().CreateOptional(NullableStructValueInsideOptional, NullableStructValue); + } + jobject OptionalStructWasPresent; + std::string OptionalStructWasPresentClassName = "java/lang/Boolean"; + std::string OptionalStructWasPresentCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(OptionalStructWasPresentClassName.c_str(), + OptionalStructWasPresentCtorSignature.c_str(), + dataResponse.optionalStructWasPresent, OptionalStructWasPresent); + jobject OptionalStructValue; + if (!dataResponse.optionalStructValue.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, OptionalStructValue); + } + else + { + jobject OptionalStructValueInsideOptional; + jobject OptionalStructValueInsideOptional_a; + std::string OptionalStructValueInsideOptional_aClassName = "java/lang/Integer"; + std::string OptionalStructValueInsideOptional_aCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + OptionalStructValueInsideOptional_aClassName.c_str(), OptionalStructValueInsideOptional_aCtorSignature.c_str(), + dataResponse.optionalStructValue.Value().a, OptionalStructValueInsideOptional_a); + jobject OptionalStructValueInsideOptional_b; + std::string OptionalStructValueInsideOptional_bClassName = "java/lang/Boolean"; + std::string OptionalStructValueInsideOptional_bCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + OptionalStructValueInsideOptional_bClassName.c_str(), OptionalStructValueInsideOptional_bCtorSignature.c_str(), + dataResponse.optionalStructValue.Value().b, OptionalStructValueInsideOptional_b); + jobject OptionalStructValueInsideOptional_c; + std::string OptionalStructValueInsideOptional_cClassName = "java/lang/Integer"; + std::string OptionalStructValueInsideOptional_cCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + OptionalStructValueInsideOptional_cClassName.c_str(), OptionalStructValueInsideOptional_cCtorSignature.c_str(), + static_cast(dataResponse.optionalStructValue.Value().c), OptionalStructValueInsideOptional_c); + jobject OptionalStructValueInsideOptional_d; + jbyteArray OptionalStructValueInsideOptional_dByteArray = + env->NewByteArray(static_cast(dataResponse.optionalStructValue.Value().d.size())); + env->SetByteArrayRegion(OptionalStructValueInsideOptional_dByteArray, 0, + static_cast(dataResponse.optionalStructValue.Value().d.size()), + reinterpret_cast(dataResponse.optionalStructValue.Value().d.data())); + OptionalStructValueInsideOptional_d = OptionalStructValueInsideOptional_dByteArray; + jobject OptionalStructValueInsideOptional_e; + OptionalStructValueInsideOptional_e = env->NewStringUTF( + std::string(dataResponse.optionalStructValue.Value().e.data(), dataResponse.optionalStructValue.Value().e.size()) + .c_str()); + jobject OptionalStructValueInsideOptional_f; + std::string OptionalStructValueInsideOptional_fClassName = "java/lang/Integer"; + std::string OptionalStructValueInsideOptional_fCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + OptionalStructValueInsideOptional_fClassName.c_str(), OptionalStructValueInsideOptional_fCtorSignature.c_str(), + dataResponse.optionalStructValue.Value().f.Raw(), OptionalStructValueInsideOptional_f); + jobject OptionalStructValueInsideOptional_g; + std::string OptionalStructValueInsideOptional_gClassName = "java/lang/Float"; + std::string OptionalStructValueInsideOptional_gCtorSignature = "(F)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + OptionalStructValueInsideOptional_gClassName.c_str(), OptionalStructValueInsideOptional_gCtorSignature.c_str(), + dataResponse.optionalStructValue.Value().g, OptionalStructValueInsideOptional_g); + jobject OptionalStructValueInsideOptional_h; + std::string OptionalStructValueInsideOptional_hClassName = "java/lang/Double"; + std::string OptionalStructValueInsideOptional_hCtorSignature = "(D)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + OptionalStructValueInsideOptional_hClassName.c_str(), OptionalStructValueInsideOptional_hCtorSignature.c_str(), + dataResponse.optionalStructValue.Value().h, OptionalStructValueInsideOptional_h); + + jclass simpleStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); + return; + } + jmethodID simpleStructStructCtor_1 = + env->GetMethodID(simpleStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/" + "Integer;Ljava/lang/Float;Ljava/lang/Double;)V"); + if (simpleStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); + return; + } + + OptionalStructValueInsideOptional = env->NewObject( + simpleStructStructClass_1, simpleStructStructCtor_1, OptionalStructValueInsideOptional_a, + OptionalStructValueInsideOptional_b, OptionalStructValueInsideOptional_c, OptionalStructValueInsideOptional_d, + OptionalStructValueInsideOptional_e, OptionalStructValueInsideOptional_f, OptionalStructValueInsideOptional_g, + OptionalStructValueInsideOptional_h); + chip::JniReferences::GetInstance().CreateOptional(OptionalStructValueInsideOptional, OptionalStructValue); + } + jobject NullableOptionalStructWasPresent; + std::string NullableOptionalStructWasPresentClassName = "java/lang/Boolean"; + std::string NullableOptionalStructWasPresentCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + NullableOptionalStructWasPresentClassName.c_str(), NullableOptionalStructWasPresentCtorSignature.c_str(), + dataResponse.nullableOptionalStructWasPresent, NullableOptionalStructWasPresent); + jobject NullableOptionalStructWasNull; + if (!dataResponse.nullableOptionalStructWasNull.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, NullableOptionalStructWasNull); + } + else + { + jobject NullableOptionalStructWasNullInsideOptional; + std::string NullableOptionalStructWasNullInsideOptionalClassName = "java/lang/Boolean"; + std::string NullableOptionalStructWasNullInsideOptionalCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(NullableOptionalStructWasNullInsideOptionalClassName.c_str(), + NullableOptionalStructWasNullInsideOptionalCtorSignature.c_str(), + dataResponse.nullableOptionalStructWasNull.Value(), + NullableOptionalStructWasNullInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(NullableOptionalStructWasNullInsideOptional, + NullableOptionalStructWasNull); + } + jobject NullableOptionalStructValue; + if (!dataResponse.nullableOptionalStructValue.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, NullableOptionalStructValue); + } + else + { + jobject NullableOptionalStructValueInsideOptional; + jobject NullableOptionalStructValueInsideOptional_a; + std::string NullableOptionalStructValueInsideOptional_aClassName = "java/lang/Integer"; + std::string NullableOptionalStructValueInsideOptional_aCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + NullableOptionalStructValueInsideOptional_aClassName.c_str(), + NullableOptionalStructValueInsideOptional_aCtorSignature.c_str(), dataResponse.nullableOptionalStructValue.Value().a, + NullableOptionalStructValueInsideOptional_a); + jobject NullableOptionalStructValueInsideOptional_b; + std::string NullableOptionalStructValueInsideOptional_bClassName = "java/lang/Boolean"; + std::string NullableOptionalStructValueInsideOptional_bCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(NullableOptionalStructValueInsideOptional_bClassName.c_str(), + NullableOptionalStructValueInsideOptional_bCtorSignature.c_str(), + dataResponse.nullableOptionalStructValue.Value().b, + NullableOptionalStructValueInsideOptional_b); + jobject NullableOptionalStructValueInsideOptional_c; + std::string NullableOptionalStructValueInsideOptional_cClassName = "java/lang/Integer"; + std::string NullableOptionalStructValueInsideOptional_cCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + NullableOptionalStructValueInsideOptional_cClassName.c_str(), + NullableOptionalStructValueInsideOptional_cCtorSignature.c_str(), + static_cast(dataResponse.nullableOptionalStructValue.Value().c), NullableOptionalStructValueInsideOptional_c); + jobject NullableOptionalStructValueInsideOptional_d; + jbyteArray NullableOptionalStructValueInsideOptional_dByteArray = + env->NewByteArray(static_cast(dataResponse.nullableOptionalStructValue.Value().d.size())); + env->SetByteArrayRegion(NullableOptionalStructValueInsideOptional_dByteArray, 0, + static_cast(dataResponse.nullableOptionalStructValue.Value().d.size()), + reinterpret_cast(dataResponse.nullableOptionalStructValue.Value().d.data())); + NullableOptionalStructValueInsideOptional_d = NullableOptionalStructValueInsideOptional_dByteArray; + jobject NullableOptionalStructValueInsideOptional_e; + NullableOptionalStructValueInsideOptional_e = + env->NewStringUTF(std::string(dataResponse.nullableOptionalStructValue.Value().e.data(), + dataResponse.nullableOptionalStructValue.Value().e.size()) + .c_str()); + jobject NullableOptionalStructValueInsideOptional_f; + std::string NullableOptionalStructValueInsideOptional_fClassName = "java/lang/Integer"; + std::string NullableOptionalStructValueInsideOptional_fCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + NullableOptionalStructValueInsideOptional_fClassName.c_str(), + NullableOptionalStructValueInsideOptional_fCtorSignature.c_str(), + dataResponse.nullableOptionalStructValue.Value().f.Raw(), NullableOptionalStructValueInsideOptional_f); + jobject NullableOptionalStructValueInsideOptional_g; + std::string NullableOptionalStructValueInsideOptional_gClassName = "java/lang/Float"; + std::string NullableOptionalStructValueInsideOptional_gCtorSignature = "(F)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + NullableOptionalStructValueInsideOptional_gClassName.c_str(), + NullableOptionalStructValueInsideOptional_gCtorSignature.c_str(), dataResponse.nullableOptionalStructValue.Value().g, + NullableOptionalStructValueInsideOptional_g); + jobject NullableOptionalStructValueInsideOptional_h; + std::string NullableOptionalStructValueInsideOptional_hClassName = "java/lang/Double"; + std::string NullableOptionalStructValueInsideOptional_hCtorSignature = "(D)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + NullableOptionalStructValueInsideOptional_hClassName.c_str(), + NullableOptionalStructValueInsideOptional_hCtorSignature.c_str(), dataResponse.nullableOptionalStructValue.Value().h, + NullableOptionalStructValueInsideOptional_h); + + jclass simpleStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); + return; + } + jmethodID simpleStructStructCtor_1 = + env->GetMethodID(simpleStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/" + "Integer;Ljava/lang/Float;Ljava/lang/Double;)V"); + if (simpleStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); + return; + } + + NullableOptionalStructValueInsideOptional = + env->NewObject(simpleStructStructClass_1, simpleStructStructCtor_1, NullableOptionalStructValueInsideOptional_a, + NullableOptionalStructValueInsideOptional_b, NullableOptionalStructValueInsideOptional_c, + NullableOptionalStructValueInsideOptional_d, NullableOptionalStructValueInsideOptional_e, + NullableOptionalStructValueInsideOptional_f, NullableOptionalStructValueInsideOptional_g, + NullableOptionalStructValueInsideOptional_h); + chip::JniReferences::GetInstance().CreateOptional(NullableOptionalStructValueInsideOptional, NullableOptionalStructValue); + } + jobject NullableListWasNull; + std::string NullableListWasNullClassName = "java/lang/Boolean"; + std::string NullableListWasNullCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(NullableListWasNullClassName.c_str(), + NullableListWasNullCtorSignature.c_str(), + dataResponse.nullableListWasNull, NullableListWasNull); + jobject NullableListValue; + if (!dataResponse.nullableListValue.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, NullableListValue); + } + else + { + jobject NullableListValueInsideOptional; + chip::JniReferences::GetInstance().CreateArrayList(NullableListValueInsideOptional); + + auto iter_NullableListValueInsideOptional_1 = dataResponse.nullableListValue.Value().begin(); + while (iter_NullableListValueInsideOptional_1.Next()) + { + auto & entry_1 = iter_NullableListValueInsideOptional_1.GetValue(); + jobject newElement_1; + std::string newElement_1ClassName = "java/lang/Integer"; + std::string newElement_1CtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_1ClassName.c_str(), newElement_1CtorSignature.c_str(), static_cast(entry_1), newElement_1); + chip::JniReferences::GetInstance().AddToList(NullableListValueInsideOptional, newElement_1); + } + chip::JniReferences::GetInstance().CreateOptional(NullableListValueInsideOptional, NullableListValue); + } + jobject OptionalListWasPresent; + std::string OptionalListWasPresentClassName = "java/lang/Boolean"; + std::string OptionalListWasPresentCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(OptionalListWasPresentClassName.c_str(), + OptionalListWasPresentCtorSignature.c_str(), + dataResponse.optionalListWasPresent, OptionalListWasPresent); + jobject OptionalListValue; + if (!dataResponse.optionalListValue.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, OptionalListValue); + } + else + { + jobject OptionalListValueInsideOptional; + chip::JniReferences::GetInstance().CreateArrayList(OptionalListValueInsideOptional); + + auto iter_OptionalListValueInsideOptional_1 = dataResponse.optionalListValue.Value().begin(); + while (iter_OptionalListValueInsideOptional_1.Next()) + { + auto & entry_1 = iter_OptionalListValueInsideOptional_1.GetValue(); + jobject newElement_1; + std::string newElement_1ClassName = "java/lang/Integer"; + std::string newElement_1CtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_1ClassName.c_str(), newElement_1CtorSignature.c_str(), static_cast(entry_1), newElement_1); + chip::JniReferences::GetInstance().AddToList(OptionalListValueInsideOptional, newElement_1); + } + chip::JniReferences::GetInstance().CreateOptional(OptionalListValueInsideOptional, OptionalListValue); + } + jobject NullableOptionalListWasPresent; + std::string NullableOptionalListWasPresentClassName = "java/lang/Boolean"; + std::string NullableOptionalListWasPresentCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + NullableOptionalListWasPresentClassName.c_str(), NullableOptionalListWasPresentCtorSignature.c_str(), + dataResponse.nullableOptionalListWasPresent, NullableOptionalListWasPresent); + jobject NullableOptionalListWasNull; + if (!dataResponse.nullableOptionalListWasNull.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, NullableOptionalListWasNull); + } + else + { + jobject NullableOptionalListWasNullInsideOptional; + std::string NullableOptionalListWasNullInsideOptionalClassName = "java/lang/Boolean"; + std::string NullableOptionalListWasNullInsideOptionalCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(NullableOptionalListWasNullInsideOptionalClassName.c_str(), + NullableOptionalListWasNullInsideOptionalCtorSignature.c_str(), + dataResponse.nullableOptionalListWasNull.Value(), + NullableOptionalListWasNullInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(NullableOptionalListWasNullInsideOptional, NullableOptionalListWasNull); + } + jobject NullableOptionalListValue; + if (!dataResponse.nullableOptionalListValue.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, NullableOptionalListValue); + } + else + { + jobject NullableOptionalListValueInsideOptional; + chip::JniReferences::GetInstance().CreateArrayList(NullableOptionalListValueInsideOptional); + + auto iter_NullableOptionalListValueInsideOptional_1 = dataResponse.nullableOptionalListValue.Value().begin(); + while (iter_NullableOptionalListValueInsideOptional_1.Next()) + { + auto & entry_1 = iter_NullableOptionalListValueInsideOptional_1.GetValue(); + jobject newElement_1; + std::string newElement_1ClassName = "java/lang/Integer"; + std::string newElement_1CtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_1ClassName.c_str(), newElement_1CtorSignature.c_str(), static_cast(entry_1), newElement_1); + chip::JniReferences::GetInstance().AddToList(NullableOptionalListValueInsideOptional, newElement_1); + } + chip::JniReferences::GetInstance().CreateOptional(NullableOptionalListValueInsideOptional, NullableOptionalListValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, NullableIntWasNull, NullableIntValue, OptionalIntWasPresent, OptionalIntValue, + NullableOptionalIntWasPresent, NullableOptionalIntWasNull, NullableOptionalIntValue, NullableStringWasNull, + NullableStringValue, OptionalStringWasPresent, OptionalStringValue, NullableOptionalStringWasPresent, + NullableOptionalStringWasNull, NullableOptionalStringValue, NullableStructWasNull, NullableStructValue, + OptionalStructWasPresent, OptionalStructValue, NullableOptionalStructWasPresent, + NullableOptionalStructWasNull, NullableOptionalStructValue, NullableListWasNull, NullableListValue, + OptionalListWasPresent, OptionalListValue, NullableOptionalListWasPresent, NullableOptionalListWasNull, + NullableOptionalListValue); +} CHIPUnitTestingClusterBooleanResponseCallback::CHIPUnitTestingClusterBooleanResponseCallback(jobject javaCallback) : Callback::Callback(CallbackFn, this) { @@ -4359,4 +5954,67 @@ void CHIPUnitTestingClusterTestEmitTestEventResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, value); } +CHIPUnitTestingClusterTestEmitTestFabricScopedEventResponseCallback:: + CHIPUnitTestingClusterTestEmitTestFabricScopedEventResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPUnitTestingClusterTestEmitTestFabricScopedEventResponseCallback:: + ~CHIPUnitTestingClusterTestEmitTestFabricScopedEventResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPUnitTestingClusterTestEmitTestFabricScopedEventResponseCallback::CallbackFn( + void * context, + const chip::app::Clusters::UnitTesting::Commands::TestEmitTestFabricScopedEventResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Long;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + dataResponse.value, value); + + env->CallVoidMethod(javaCallbackRef, javaMethod, value); +} } // namespace chip diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h index fb3446a16f3935..5a264fb1994368 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h @@ -160,6 +160,49 @@ class CHIPScenesClusterGetSceneMembershipResponseCallback jobject javaCallbackRef; }; +class CHIPScenesClusterEnhancedAddSceneResponseCallback + : public Callback::Callback +{ +public: + CHIPScenesClusterEnhancedAddSceneResponseCallback(jobject javaCallback); + + ~CHIPScenesClusterEnhancedAddSceneResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::Scenes::Commands::EnhancedAddSceneResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPScenesClusterEnhancedViewSceneResponseCallback + : public Callback::Callback +{ +public: + CHIPScenesClusterEnhancedViewSceneResponseCallback(jobject javaCallback); + + ~CHIPScenesClusterEnhancedViewSceneResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::Scenes::Commands::EnhancedViewSceneResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPScenesClusterCopySceneResponseCallback : public Callback::Callback +{ +public: + CHIPScenesClusterCopySceneResponseCallback(jobject javaCallback); + + ~CHIPScenesClusterCopySceneResponseCallback(); + + static void CallbackFn(void * context, const chip::app::Clusters::Scenes::Commands::CopySceneResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + class CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseCallback : public Callback::Callback { @@ -597,6 +640,38 @@ class CHIPAccountLoginClusterGetSetupPINResponseCallback jobject javaCallbackRef; }; +class CHIPElectricalMeasurementClusterGetProfileInfoResponseCommandCallback + : public Callback::Callback +{ +public: + CHIPElectricalMeasurementClusterGetProfileInfoResponseCommandCallback(jobject javaCallback); + + ~CHIPElectricalMeasurementClusterGetProfileInfoResponseCommandCallback(); + + static void + CallbackFn(void * context, + const chip::app::Clusters::ElectricalMeasurement::Commands::GetProfileInfoResponseCommand::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPElectricalMeasurementClusterGetMeasurementProfileResponseCommandCallback + : public Callback::Callback +{ +public: + CHIPElectricalMeasurementClusterGetMeasurementProfileResponseCommandCallback(jobject javaCallback); + + ~CHIPElectricalMeasurementClusterGetMeasurementProfileResponseCommandCallback(); + + static void CallbackFn( + void * context, + const chip::app::Clusters::ElectricalMeasurement::Commands::GetMeasurementProfileResponseCommand::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + class CHIPUnitTestingClusterTestSpecificResponseCallback : public Callback::Callback { @@ -627,6 +702,36 @@ class CHIPUnitTestingClusterTestAddArgumentsResponseCallback jobject javaCallbackRef; }; +class CHIPUnitTestingClusterTestSimpleArgumentResponseCallback + : public Callback::Callback +{ +public: + CHIPUnitTestingClusterTestSimpleArgumentResponseCallback(jobject javaCallback); + + ~CHIPUnitTestingClusterTestSimpleArgumentResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::UnitTesting::Commands::TestSimpleArgumentResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPUnitTestingClusterTestStructArrayArgumentResponseCallback + : public Callback::Callback +{ +public: + CHIPUnitTestingClusterTestStructArrayArgumentResponseCallback(jobject javaCallback); + + ~CHIPUnitTestingClusterTestStructArrayArgumentResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::UnitTesting::Commands::TestStructArrayArgumentResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + class CHIPUnitTestingClusterTestListInt8UReverseResponseCallback : public Callback::Callback { @@ -672,6 +777,22 @@ class CHIPUnitTestingClusterTestNullableOptionalResponseCallback jobject javaCallbackRef; }; +class CHIPUnitTestingClusterTestComplexNullableOptionalResponseCallback + : public Callback::Callback +{ +public: + CHIPUnitTestingClusterTestComplexNullableOptionalResponseCallback(jobject javaCallback); + + ~CHIPUnitTestingClusterTestComplexNullableOptionalResponseCallback(); + + static void + CallbackFn(void * context, + const chip::app::Clusters::UnitTesting::Commands::TestComplexNullableOptionalResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + class CHIPUnitTestingClusterBooleanResponseCallback : public Callback::Callback { public: @@ -715,4 +836,20 @@ class CHIPUnitTestingClusterTestEmitTestEventResponseCallback jobject javaCallbackRef; }; +class CHIPUnitTestingClusterTestEmitTestFabricScopedEventResponseCallback + : public Callback::Callback +{ +public: + CHIPUnitTestingClusterTestEmitTestFabricScopedEventResponseCallback(jobject javaCallback); + + ~CHIPUnitTestingClusterTestEmitTestFabricScopedEventResponseCallback(); + + static void + CallbackFn(void * context, + const chip::app::Clusters::UnitTesting::Commands::TestEmitTestFabricScopedEventResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + } // namespace chip