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 1bb82371970df7..8bc60ce732b015 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 @@ -13,6 +13,12 @@ server cluster AccessControl = 31 { kGroup = 3; } + enum ChangeTypeEnum : ENUM8 { + kChanged = 0; + kAdded = 1; + kRemoved = 2; + } + enum Privilege : ENUM8 { kView = 1; kProxyView = 2; @@ -40,13 +46,29 @@ server cluster AccessControl = 31 { OCTET_STRING data = 1; } - attribute(writable, reportable) AccessControlEntry acl[] = 0; - attribute(writable, reportable) ExtensionEntry extension[] = 1; - attribute(readonly, reportable) int16u clusterRevision = 65533; + info event AccessControlEntryChanged = 0 { + fabric_idx adminFabricIndex = 0; + node_id adminNodeID = 1; + INT16U adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + AccessControlEntry latestValue = 4; + } + + info event AccessControlExtensionChanged = 1 { + fabric_idx adminFabricIndex = 0; + node_id adminNodeID = 1; + INT16U adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + ExtensionEntry latestValue = 4; + } + + attribute(writable) AccessControlEntry acl[] = 0; + attribute(writable) ExtensionEntry extension[] = 1; + attribute(readonly) int16u clusterRevision = 65533; } server cluster AccountLogin = 1294 { - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u clusterRevision = 65533; } server cluster AdministratorCommissioning = 60 { @@ -62,10 +84,10 @@ server cluster AdministratorCommissioning = 60 { kWindowNotOpen = 3; } - attribute(readonly, reportable) int8u windowStatus = 0; - attribute(readonly, reportable) fabric_idx adminFabricIndex = 1; - attribute(readonly, reportable) int16u adminVendorId = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u windowStatus = 0; + attribute(readonly) fabric_idx adminFabricIndex = 1; + attribute(readonly) int16u adminVendorId = 2; + attribute(readonly) int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -93,14 +115,14 @@ server cluster ApplicationBasic = 1293 { kActiveVisibleNotFocus = 3; } - attribute(readonly, reportable) char_string vendorName = 0; - attribute(readonly, reportable) int16u vendorId = 1; - attribute(readonly, reportable) char_string applicationName = 2; - attribute(readonly, reportable) int16u productId = 3; - attribute(readonly, reportable) ApplicationStatusEnum applicationStatus = 5; - attribute(readonly, reportable) char_string applicationVersion = 6; - attribute(readonly, reportable) vendor_id allowedVendorList[] = 7; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) char_string vendorName = 0; + attribute(readonly) int16u vendorId = 1; + attribute(readonly) char_string applicationName = 2; + attribute(readonly) int16u productId = 3; + attribute(readonly) ApplicationStatusEnum applicationStatus = 5; + attribute(readonly) char_string applicationVersion = 6; + attribute(readonly) vendor_id allowedVendorList[] = 7; + attribute(readonly) int16u clusterRevision = 65533; } server cluster ApplicationLauncher = 1292 { @@ -115,8 +137,8 @@ server cluster ApplicationLauncher = 1292 { CHAR_STRING applicationId = 2; } - attribute(readonly, reportable) INT16U applicationLauncherList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) INT16U applicationLauncherList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } server cluster AudioOutput = 1291 { @@ -135,17 +157,17 @@ server cluster AudioOutput = 1291 { CHAR_STRING name = 3; } - attribute(readonly, reportable) OutputInfo audioOutputList[] = 0; - attribute(readonly, reportable) int8u currentAudioOutput = 1; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) OutputInfo audioOutputList[] = 0; + attribute(readonly) int8u currentAudioOutput = 1; + attribute(readonly) int16u clusterRevision = 65533; } server cluster BarrierControl = 259 { - attribute(readonly, reportable) enum8 barrierMovingState = 1; - attribute(readonly, reportable) bitmap16 barrierSafetyStatus = 2; - attribute(readonly, reportable) bitmap8 barrierCapabilities = 3; - attribute(readonly, reportable) int8u barrierPosition = 10; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) enum8 barrierMovingState = 1; + attribute(readonly) bitmap16 barrierSafetyStatus = 2; + attribute(readonly) bitmap8 barrierCapabilities = 3; + attribute(readonly) int8u barrierPosition = 10; + attribute(readonly) int16u clusterRevision = 65533; request struct BarrierControlGoToPercentRequest { INT8U percentOpen = 0; @@ -170,39 +192,39 @@ server cluster Basic = 40 { boolean reachableNewValue = 0; } - attribute(readonly, reportable) int16u interactionModelVersion = 0; - attribute(readonly, reportable) char_string vendorName = 1; - attribute(readonly, reportable) vendor_id vendorID = 2; - attribute(readonly, reportable) char_string productName = 3; - attribute(readonly, reportable) int16u productID = 4; - attribute(writable, reportable) char_string nodeLabel = 5; - attribute(writable, reportable) char_string location = 6; - attribute(readonly, reportable) int16u hardwareVersion = 7; - attribute(readonly, reportable) char_string hardwareVersionString = 8; - attribute(readonly, reportable) int32u softwareVersion = 9; - attribute(readonly, reportable) char_string softwareVersionString = 10; - attribute(readonly, reportable) char_string manufacturingDate = 11; - attribute(readonly, reportable) char_string partNumber = 12; - attribute(readonly, reportable) long_char_string productURL = 13; - attribute(readonly, reportable) char_string productLabel = 14; - attribute(readonly, reportable) char_string serialNumber = 15; - attribute(writable, reportable) boolean localConfigDisabled = 16; - attribute(readonly, reportable) boolean reachable = 17; - attribute(readonly, reportable) char_string uniqueID = 18; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u interactionModelVersion = 0; + attribute(readonly) char_string vendorName = 1; + attribute(readonly) vendor_id vendorID = 2; + attribute(readonly) char_string productName = 3; + attribute(readonly) int16u productID = 4; + attribute(writable) char_string nodeLabel = 5; + attribute(writable) char_string location = 6; + attribute(readonly) int16u hardwareVersion = 7; + attribute(readonly) char_string hardwareVersionString = 8; + attribute(readonly) int32u softwareVersion = 9; + attribute(readonly) char_string softwareVersionString = 10; + attribute(readonly) char_string manufacturingDate = 11; + attribute(readonly) char_string partNumber = 12; + attribute(readonly) long_char_string productURL = 13; + attribute(readonly) char_string productLabel = 14; + attribute(readonly) char_string serialNumber = 15; + attribute(writable) boolean localConfigDisabled = 16; + attribute(readonly) boolean reachable = 17; + attribute(readonly) char_string uniqueID = 18; + attribute(readonly) int16u clusterRevision = 65533; command MfgSpecificPing(): DefaultSuccess = 0; } server cluster BinaryInputBasic = 15 { - attribute(writable, reportable) boolean outOfService = 81; - attribute(writable, reportable) boolean presentValue = 85; - attribute(readonly, reportable) bitmap8 statusFlags = 111; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) boolean outOfService = 81; + attribute(writable) boolean presentValue = 85; + attribute(readonly) bitmap8 statusFlags = 111; + attribute(readonly) int16u clusterRevision = 65533; } server cluster Binding = 30 { - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u clusterRevision = 65533; request struct BindRequest { NODE_ID nodeId = 0; @@ -227,8 +249,8 @@ server cluster BooleanState = 69 { boolean stateValue = 0; } - attribute(readonly, reportable) boolean stateValue = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) boolean stateValue = 0; + attribute(readonly) int16u clusterRevision = 65533; } server cluster BridgedActions = 37 { @@ -289,14 +311,14 @@ server cluster BridgedActions = 37 { ActionErrorEnum error = 3; } - attribute(readonly, reportable) ActionStruct actionList[] = 0; - attribute(readonly, reportable) EndpointListStruct endpointList[] = 1; - attribute(readonly, reportable) long_char_string setupUrl = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) ActionStruct actionList[] = 0; + attribute(readonly) EndpointListStruct endpointList[] = 1; + attribute(readonly) long_char_string setupUrl = 2; + attribute(readonly) int16u clusterRevision = 65533; } server cluster BridgedDeviceBasic = 57 { - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u clusterRevision = 65533; } server cluster Channel = 1284 { @@ -317,8 +339,8 @@ server cluster Channel = 1284 { CHAR_STRING affiliateCallSign = 5; } - attribute(readonly, reportable) ChannelInfo channelList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) ChannelInfo channelList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } server cluster ColorControl = 768 { @@ -368,59 +390,59 @@ server cluster ColorControl = 768 { kDown = 3; } - attribute(readonly, reportable) int8u currentHue = 0; - attribute(readonly, reportable) int8u currentSaturation = 1; - attribute(readonly, reportable) int16u remainingTime = 2; - attribute(readonly, reportable) int16u currentX = 3; - attribute(readonly, reportable) int16u currentY = 4; - attribute(readonly, reportable) enum8 driftCompensation = 5; - attribute(readonly, reportable) char_string compensationText = 6; - attribute(readonly, reportable) int16u colorTemperature = 7; - attribute(readonly, reportable) enum8 colorMode = 8; - attribute(writable, reportable) bitmap8 colorControlOptions = 15; - attribute(readonly, reportable) int8u numberOfPrimaries = 16; - attribute(readonly, reportable) int16u primary1X = 17; - attribute(readonly, reportable) int16u primary1Y = 18; - attribute(readonly, reportable) int8u primary1Intensity = 19; - attribute(readonly, reportable) int16u primary2X = 21; - attribute(readonly, reportable) int16u primary2Y = 22; - attribute(readonly, reportable) int8u primary2Intensity = 23; - attribute(readonly, reportable) int16u primary3X = 25; - attribute(readonly, reportable) int16u primary3Y = 26; - attribute(readonly, reportable) int8u primary3Intensity = 27; - attribute(readonly, reportable) int16u primary4X = 32; - attribute(readonly, reportable) int16u primary4Y = 33; - attribute(readonly, reportable) int8u primary4Intensity = 34; - attribute(readonly, reportable) int16u primary5X = 36; - attribute(readonly, reportable) int16u primary5Y = 37; - attribute(readonly, reportable) int8u primary5Intensity = 38; - attribute(readonly, reportable) int16u primary6X = 40; - attribute(readonly, reportable) int16u primary6Y = 41; - attribute(readonly, reportable) int8u primary6Intensity = 42; - attribute(writable, reportable) int16u whitePointX = 48; - attribute(writable, reportable) int16u whitePointY = 49; - attribute(writable, reportable) int16u colorPointRX = 50; - attribute(writable, reportable) int16u colorPointRY = 51; - attribute(writable, reportable) int8u colorPointRIntensity = 52; - attribute(writable, reportable) int16u colorPointGX = 54; - attribute(writable, reportable) int16u colorPointGY = 55; - attribute(writable, reportable) int8u colorPointGIntensity = 56; - attribute(writable, reportable) int16u colorPointBX = 58; - attribute(writable, reportable) int16u colorPointBY = 59; - attribute(writable, reportable) int8u colorPointBIntensity = 60; - attribute(readonly, reportable) int16u enhancedCurrentHue = 16384; - attribute(readonly, reportable) enum8 enhancedColorMode = 16385; - attribute(readonly, reportable) int8u colorLoopActive = 16386; - attribute(readonly, reportable) int8u colorLoopDirection = 16387; - attribute(readonly, reportable) int16u colorLoopTime = 16388; - attribute(readonly, reportable) int16u colorLoopStartEnhancedHue = 16389; - attribute(readonly, reportable) int16u colorLoopStoredEnhancedHue = 16390; - attribute(readonly, reportable) bitmap16 colorCapabilities = 16394; - attribute(readonly, reportable) int16u colorTempPhysicalMin = 16395; - attribute(readonly, reportable) int16u colorTempPhysicalMax = 16396; - attribute(readonly, reportable) int16u coupleColorTempToLevelMinMireds = 16397; - attribute(writable, reportable) int16u startUpColorTemperatureMireds = 16400; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u currentHue = 0; + attribute(readonly) int8u currentSaturation = 1; + attribute(readonly) int16u remainingTime = 2; + attribute(readonly) int16u currentX = 3; + attribute(readonly) int16u currentY = 4; + attribute(readonly) enum8 driftCompensation = 5; + attribute(readonly) char_string compensationText = 6; + attribute(readonly) int16u colorTemperature = 7; + attribute(readonly) enum8 colorMode = 8; + attribute(writable) bitmap8 colorControlOptions = 15; + attribute(readonly) int8u numberOfPrimaries = 16; + attribute(readonly) int16u primary1X = 17; + attribute(readonly) int16u primary1Y = 18; + attribute(readonly) int8u primary1Intensity = 19; + attribute(readonly) int16u primary2X = 21; + attribute(readonly) int16u primary2Y = 22; + attribute(readonly) int8u primary2Intensity = 23; + attribute(readonly) int16u primary3X = 25; + attribute(readonly) int16u primary3Y = 26; + attribute(readonly) int8u primary3Intensity = 27; + attribute(readonly) int16u primary4X = 32; + attribute(readonly) int16u primary4Y = 33; + attribute(readonly) int8u primary4Intensity = 34; + attribute(readonly) int16u primary5X = 36; + attribute(readonly) int16u primary5Y = 37; + attribute(readonly) int8u primary5Intensity = 38; + attribute(readonly) int16u primary6X = 40; + attribute(readonly) int16u primary6Y = 41; + attribute(readonly) int8u primary6Intensity = 42; + attribute(writable) int16u whitePointX = 48; + attribute(writable) int16u whitePointY = 49; + attribute(writable) int16u colorPointRX = 50; + attribute(writable) int16u colorPointRY = 51; + attribute(writable) int8u colorPointRIntensity = 52; + attribute(writable) int16u colorPointGX = 54; + attribute(writable) int16u colorPointGY = 55; + attribute(writable) int8u colorPointGIntensity = 56; + attribute(writable) int16u colorPointBX = 58; + attribute(writable) int16u colorPointBY = 59; + attribute(writable) int8u colorPointBIntensity = 60; + attribute(readonly) int16u enhancedCurrentHue = 16384; + attribute(readonly) enum8 enhancedColorMode = 16385; + attribute(readonly) int8u colorLoopActive = 16386; + attribute(readonly) int8u colorLoopDirection = 16387; + attribute(readonly) int16u colorLoopTime = 16388; + attribute(readonly) int16u colorLoopStartEnhancedHue = 16389; + attribute(readonly) int16u colorLoopStoredEnhancedHue = 16390; + attribute(readonly) bitmap16 colorCapabilities = 16394; + attribute(readonly) int16u colorTempPhysicalMin = 16395; + attribute(readonly) int16u colorTempPhysicalMax = 16396; + attribute(readonly) int16u coupleColorTempToLevelMinMireds = 16397; + attribute(writable) int16u startUpColorTemperatureMireds = 16400; + attribute(readonly) int16u clusterRevision = 65533; request struct ColorLoopSetRequest { ColorLoopUpdateFlags updateFlags = 0; @@ -655,9 +677,9 @@ server cluster ContentLauncher = 1290 { MetricTypeEnum metric = 3; } - attribute(readonly, reportable) CHAR_STRING acceptHeaderList[] = 0; - attribute(writable, reportable) bitmap32 supportedStreamingProtocols = 1; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) CHAR_STRING acceptHeaderList[] = 0; + attribute(writable) bitmap32 supportedStreamingProtocols = 1; + attribute(readonly) int16u clusterRevision = 65533; } server cluster Descriptor = 29 { @@ -666,11 +688,11 @@ server cluster Descriptor = 29 { INT16U revision = 2; } - attribute(readonly, reportable) DeviceType deviceList[] = 0; - attribute(readonly, reportable) CLUSTER_ID serverList[] = 1; - attribute(readonly, reportable) CLUSTER_ID clientList[] = 2; - attribute(readonly, reportable) ENDPOINT_NO partsList[] = 3; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) DeviceType deviceList[] = 0; + attribute(readonly) CLUSTER_ID serverList[] = 1; + attribute(readonly) CLUSTER_ID clientList[] = 2; + attribute(readonly) ENDPOINT_NO partsList[] = 3; + attribute(readonly) int16u clusterRevision = 65533; } server cluster DiagnosticLogs = 50 { @@ -939,34 +961,34 @@ server cluster DoorLock = 257 { nullable INT16U dataIndex = 6; } - attribute(readonly, reportable) DlLockState lockState = 0; - attribute(readonly, reportable) DlLockType lockType = 1; - attribute(readonly, reportable) boolean actuatorEnabled = 2; - attribute(readonly, reportable) DlDoorState doorState = 3; - attribute(writable, reportable) int32u doorOpenEvents = 4; - attribute(writable, reportable) int32u doorClosedEvents = 5; - attribute(writable, reportable) int16u openPeriod = 6; - attribute(readonly, reportable) int16u numberOfTotalUsersSupported = 17; - attribute(readonly, reportable) int16u numberOfPINUsersSupported = 18; - attribute(readonly, reportable) int16u numberOfWeekDaySchedulesSupportedPerUser = 20; - attribute(readonly, reportable) int16u numberOfYearDaySchedulesSupportedPerUser = 21; - attribute(readonly, reportable) int16u numberOfHolidaySchedulesSupported = 22; - attribute(readonly, reportable) int8u maxPINCodeLength = 23; - attribute(readonly, reportable) int8u minPINCodeLength = 24; - attribute(readonly, reportable) bitmap8 credentialRulesSupport = 27; - attribute(writable, reportable) char_string language = 33; - attribute(writable, reportable) int32u autoRelockTime = 35; - attribute(writable, reportable) int8u soundVolume = 36; - attribute(writable, reportable) DlOperatingMode operatingMode = 37; - attribute(readonly, reportable) bitmap16 supportedOperatingModes = 38; - attribute(readonly, reportable) bitmap16 defaultConfigurationRegister = 39; - attribute(writable, reportable) boolean enableOneTouchLocking = 41; - attribute(writable, reportable) boolean enableInsideStatusLED = 42; - attribute(writable, reportable) boolean enablePrivacyModeButton = 43; - attribute(writable, reportable) int8u wrongCodeEntryLimit = 48; - attribute(writable, reportable) int8u userCodeTemporaryDisableTime = 49; - attribute(writable, reportable) boolean requirePINforRemoteOperation = 51; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) DlLockState lockState = 0; + attribute(readonly) DlLockType lockType = 1; + attribute(readonly) boolean actuatorEnabled = 2; + attribute(readonly) DlDoorState doorState = 3; + attribute(writable) int32u doorOpenEvents = 4; + attribute(writable) int32u doorClosedEvents = 5; + attribute(writable) int16u openPeriod = 6; + attribute(readonly) int16u numberOfTotalUsersSupported = 17; + attribute(readonly) int16u numberOfPINUsersSupported = 18; + attribute(readonly) int16u numberOfWeekDaySchedulesSupportedPerUser = 20; + attribute(readonly) int16u numberOfYearDaySchedulesSupportedPerUser = 21; + attribute(readonly) int16u numberOfHolidaySchedulesSupported = 22; + attribute(readonly) int8u maxPINCodeLength = 23; + attribute(readonly) int8u minPINCodeLength = 24; + attribute(readonly) bitmap8 credentialRulesSupport = 27; + attribute(writable) char_string language = 33; + attribute(writable) int32u autoRelockTime = 35; + attribute(writable) int8u soundVolume = 36; + attribute(writable) DlOperatingMode operatingMode = 37; + attribute(readonly) bitmap16 supportedOperatingModes = 38; + attribute(readonly) bitmap16 defaultConfigurationRegister = 39; + attribute(writable) boolean enableOneTouchLocking = 41; + attribute(writable) boolean enableInsideStatusLED = 42; + attribute(writable) boolean enablePrivacyModeButton = 43; + attribute(writable) int8u wrongCodeEntryLimit = 48; + attribute(writable) int8u userCodeTemporaryDisableTime = 49; + attribute(writable) boolean requirePINforRemoteOperation = 51; + attribute(readonly) int16u clusterRevision = 65533; request struct ClearCredentialRequest { DlCredential credential = 0; @@ -1046,18 +1068,18 @@ server cluster DoorLock = 257 { } server cluster ElectricalMeasurement = 2820 { - attribute(readonly, reportable) bitmap32 measurementType = 0; - attribute(readonly, reportable) int32s totalActivePower = 772; - attribute(readonly, reportable) int16u rmsVoltage = 1285; - attribute(readonly, reportable) int16u rmsVoltageMin = 1286; - attribute(readonly, reportable) int16u rmsVoltageMax = 1287; - attribute(readonly, reportable) int16u rmsCurrent = 1288; - attribute(readonly, reportable) int16u rmsCurrentMin = 1289; - attribute(readonly, reportable) int16u rmsCurrentMax = 1290; - attribute(readonly, reportable) int16s activePower = 1291; - attribute(readonly, reportable) int16s activePowerMin = 1292; - attribute(readonly, reportable) int16s activePowerMax = 1293; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) bitmap32 measurementType = 0; + attribute(readonly) int32s totalActivePower = 772; + attribute(readonly) int16u rmsVoltage = 1285; + attribute(readonly) int16u rmsVoltageMin = 1286; + attribute(readonly) int16u rmsVoltageMax = 1287; + attribute(readonly) int16u rmsCurrent = 1288; + attribute(readonly) int16u rmsCurrentMin = 1289; + attribute(readonly) int16u rmsCurrentMax = 1290; + attribute(readonly) int16s activePower = 1291; + attribute(readonly) int16s activePowerMin = 1292; + attribute(readonly) int16s activePowerMax = 1293; + attribute(readonly) int16u clusterRevision = 65533; } server cluster EthernetNetworkDiagnostics = 55 { @@ -1074,32 +1096,32 @@ server cluster EthernetNetworkDiagnostics = 55 { k400g = 9; } - attribute(readonly, reportable) enum8 PHYRate = 0; - attribute(readonly, reportable) boolean fullDuplex = 1; - attribute(readonly, reportable) int64u packetRxCount = 2; - attribute(readonly, reportable) int64u packetTxCount = 3; - attribute(readonly, reportable) int64u txErrCount = 4; - attribute(readonly, reportable) int64u collisionCount = 5; - attribute(readonly, reportable) int64u overrunCount = 6; - attribute(readonly, reportable) boolean carrierDetect = 7; - attribute(readonly, reportable) int64u timeSinceReset = 8; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) enum8 PHYRate = 0; + attribute(readonly) boolean fullDuplex = 1; + attribute(readonly) int64u packetRxCount = 2; + attribute(readonly) int64u packetTxCount = 3; + attribute(readonly) int64u txErrCount = 4; + attribute(readonly) int64u collisionCount = 5; + attribute(readonly) int64u overrunCount = 6; + attribute(readonly) boolean carrierDetect = 7; + attribute(readonly) int64u timeSinceReset = 8; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; command ResetCounts(): DefaultSuccess = 0; } server cluster FixedLabel = 64 { - attribute(readonly, reportable) LabelStruct labelList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) LabelStruct labelList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } server cluster FlowMeasurement = 1028 { - attribute(readonly, reportable) int16s measuredValue = 0; - attribute(readonly, reportable) int16s minMeasuredValue = 1; - attribute(readonly, reportable) int16s maxMeasuredValue = 2; - attribute(readonly, reportable) int16u tolerance = 3; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16s measuredValue = 0; + attribute(readonly) int16s minMeasuredValue = 1; + attribute(readonly) int16s maxMeasuredValue = 2; + attribute(readonly) int16u tolerance = 3; + attribute(readonly) int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -1120,12 +1142,12 @@ server cluster GeneralCommissioning = 48 { INT32U failSafeExpiryLengthMs = 1; } - attribute(writable, reportable) int64u breadcrumb = 0; - attribute(readonly, reportable) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; - attribute(readonly, reportable) enum8 regulatoryConfig = 2; - attribute(readonly, reportable) enum8 locationCapability = 3; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) int64u breadcrumb = 0; + attribute(readonly) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; + attribute(readonly) enum8 regulatoryConfig = 2; + attribute(readonly) enum8 locationCapability = 3; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -1238,15 +1260,15 @@ server cluster GeneralDiagnostics = 51 { BootReasonType bootReason = 0; } - attribute(readonly, reportable) NetworkInterfaceType networkInterfaces[] = 0; - attribute(readonly, reportable) int16u rebootCount = 1; - attribute(readonly, reportable) int64u upTime = 2; - attribute(readonly, reportable) int32u totalOperationalHours = 3; - attribute(readonly, reportable) enum8 bootReasons = 4; - attribute(readonly, reportable) ENUM8 activeHardwareFaults[] = 5; - attribute(readonly, reportable) ENUM8 activeRadioFaults[] = 6; - attribute(readonly, reportable) ENUM8 activeNetworkFaults[] = 7; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) NetworkInterfaceType networkInterfaces[] = 0; + attribute(readonly) int16u rebootCount = 1; + attribute(readonly) int64u upTime = 2; + attribute(readonly) int32u totalOperationalHours = 3; + attribute(readonly) enum8 bootReasons = 4; + attribute(readonly) ENUM8 activeHardwareFaults[] = 5; + attribute(readonly) ENUM8 activeRadioFaults[] = 6; + attribute(readonly) ENUM8 activeNetworkFaults[] = 7; + attribute(readonly) int16u clusterRevision = 65533; } server cluster GroupKeyManagement = 63 { @@ -1279,11 +1301,11 @@ server cluster GroupKeyManagement = 63 { INT64U epochStartTime2 = 7; } - attribute(readonly, reportable) GroupKey groupKeyMap[] = 0; - attribute(readonly, reportable) GroupInfo groupTable[] = 1; - attribute(readonly, reportable) int16u maxGroupsPerFabric = 2; - attribute(readonly, reportable) int16u maxGroupKeysPerFabric = 3; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) GroupKey groupKeyMap[] = 0; + attribute(readonly) GroupInfo groupTable[] = 1; + attribute(readonly) int16u maxGroupsPerFabric = 2; + attribute(readonly) int16u maxGroupKeysPerFabric = 3; + attribute(readonly) int16u clusterRevision = 65533; request struct KeySetReadRequest { INT16U groupKeySetID = 0; @@ -1316,8 +1338,8 @@ server cluster GroupKeyManagement = 63 { } server cluster Groups = 4 { - attribute(readonly, reportable) bitmap8 nameSupport = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) bitmap8 nameSupport = 0; + attribute(readonly) int16u clusterRevision = 65533; request struct AddGroupRequest { INT16U groupId = 0; @@ -1397,12 +1419,12 @@ server cluster IasZone = 1280 { kInvalidZoneType = 65535; } - attribute(readonly, reportable) enum8 zoneState = 0; - attribute(readonly, reportable) enum16 zoneType = 1; - attribute(readonly, reportable) bitmap16 zoneStatus = 2; - attribute(writable, reportable) node_id iasCieAddress = 16; - attribute(readonly, reportable) int8u zoneId = 17; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) enum8 zoneState = 0; + attribute(readonly) enum16 zoneType = 1; + attribute(readonly) bitmap16 zoneStatus = 2; + attribute(writable) node_id iasCieAddress = 16; + attribute(readonly) int8u zoneId = 17; + attribute(readonly) int16u clusterRevision = 65533; request struct ZoneEnrollRequestRequest { IasZoneType zoneType = 0; @@ -1448,9 +1470,9 @@ server cluster Identify = 3 { kActuator = 5; } - attribute(writable, reportable) int16u identifyTime = 0; - attribute(readonly, reportable) enum8 identifyType = 1; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) int16u identifyTime = 0; + attribute(readonly) enum8 identifyType = 1; + attribute(readonly) int16u clusterRevision = 65533; request struct IdentifyRequest { INT16U identifyTime = 0; @@ -1476,12 +1498,12 @@ server cluster IlluminanceMeasurement = 1024 { kCmos = 1; } - attribute(readonly, reportable) int16u measuredValue = 0; - attribute(readonly, reportable) int16u minMeasuredValue = 1; - attribute(readonly, reportable) int16u maxMeasuredValue = 2; - attribute(readonly, reportable) int16u tolerance = 3; - attribute(readonly, reportable) enum8 lightSensorType = 4; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u measuredValue = 0; + attribute(readonly) int16u minMeasuredValue = 1; + attribute(readonly) int16u maxMeasuredValue = 2; + attribute(readonly) int16u tolerance = 3; + attribute(readonly) enum8 lightSensorType = 4; + attribute(readonly) int16u clusterRevision = 65533; } server cluster KeypadInput = 1289 { @@ -1580,7 +1602,7 @@ server cluster KeypadInput = 1289 { kInvalidKeyInCurrentState = 2; } - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u clusterRevision = 65533; } server cluster LevelControl = 8 { @@ -1594,22 +1616,22 @@ server cluster LevelControl = 8 { kDown = 1; } - attribute(readonly, reportable) int8u currentLevel = 0; - attribute(readonly, reportable) int16u remainingTime = 1; - attribute(readonly, reportable) int8u minLevel = 2; - attribute(readonly, reportable) int8u maxLevel = 3; - attribute(readonly, reportable) int16u currentFrequency = 4; - attribute(readonly, reportable) int16u minFrequency = 5; - attribute(readonly, reportable) int16u maxFrequency = 6; - attribute(writable, reportable) bitmap8 options = 15; - attribute(writable, reportable) int16u onOffTransitionTime = 16; - attribute(writable, reportable) int8u onLevel = 17; - attribute(writable, reportable) int16u onTransitionTime = 18; - attribute(writable, reportable) int16u offTransitionTime = 19; - attribute(writable, reportable) int8u defaultMoveRate = 20; - attribute(writable, reportable) int8u startUpCurrentLevel = 16384; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u currentLevel = 0; + attribute(readonly) int16u remainingTime = 1; + attribute(readonly) int8u minLevel = 2; + attribute(readonly) int8u maxLevel = 3; + attribute(readonly) int16u currentFrequency = 4; + attribute(readonly) int16u minFrequency = 5; + attribute(readonly) int16u maxFrequency = 6; + attribute(writable) bitmap8 options = 15; + attribute(writable) int16u onOffTransitionTime = 16; + attribute(writable) int8u onLevel = 17; + attribute(writable) int16u onTransitionTime = 18; + attribute(writable) int16u offTransitionTime = 19; + attribute(writable) int8u defaultMoveRate = 20; + attribute(writable) int8u startUpCurrentLevel = 16384; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct MoveRequest { MoveMode moveMode = 0; @@ -1665,12 +1687,12 @@ server cluster LevelControl = 8 { } server cluster LocalizationConfiguration = 43 { - attribute(writable, reportable) char_string activeLocale = 1; - attribute(readonly, reportable) CHAR_STRING supportedLocales[] = 2; + attribute(writable) char_string activeLocale = 1; + attribute(readonly) CHAR_STRING supportedLocales[] = 2; } server cluster LowPower = 1288 { - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u clusterRevision = 65533; command Sleep(): DefaultSuccess = 0; } @@ -1698,9 +1720,9 @@ server cluster MediaInput = 1287 { CHAR_STRING description = 4; } - attribute(readonly, reportable) InputInfo mediaInputList[] = 0; - attribute(readonly, reportable) int8u currentMediaInput = 1; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) InputInfo mediaInputList[] = 0; + attribute(readonly) int8u currentMediaInput = 1; + attribute(readonly) int16u clusterRevision = 65533; } server cluster MediaPlayback = 1286 { @@ -1720,13 +1742,13 @@ server cluster MediaPlayback = 1286 { kSeekOutOfRange = 5; } - attribute(readonly, reportable) PlaybackStateEnum playbackState = 0; - attribute(readonly, reportable) epoch_us startTime = 1; - attribute(readonly, reportable) int64u duration = 2; - attribute(readonly, reportable) single playbackSpeed = 4; - attribute(readonly, reportable) int64u seekRangeEnd = 5; - attribute(readonly, reportable) int64u seekRangeStart = 6; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) PlaybackStateEnum playbackState = 0; + attribute(readonly) epoch_us startTime = 1; + attribute(readonly) int64u duration = 2; + attribute(readonly) single playbackSpeed = 4; + attribute(readonly) int64u seekRangeEnd = 5; + attribute(readonly) int64u seekRangeStart = 6; + attribute(readonly) int16u clusterRevision = 65533; } server cluster ModeSelect = 80 { @@ -1736,12 +1758,12 @@ server cluster ModeSelect = 80 { INT32U semanticTag = 3; } - attribute(readonly, reportable) int8u currentMode = 0; - attribute(readonly, reportable) ModeOptionStruct supportedModes[] = 1; - attribute(writable, reportable) int8u onMode = 2; - attribute(readonly, reportable) int8u startUpMode = 3; - attribute(readonly, reportable) char_string description = 4; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u currentMode = 0; + attribute(readonly) ModeOptionStruct supportedModes[] = 1; + attribute(writable) int8u onMode = 2; + attribute(readonly) int8u startUpMode = 3; + attribute(readonly) char_string description = 4; + attribute(readonly) int16u clusterRevision = 65533; request struct ChangeToModeRequest { INT8U newMode = 0; @@ -1800,16 +1822,16 @@ server cluster NetworkCommissioning = 49 { INT8U lqi = 8; } - attribute(readonly, reportable) int8u maxNetworks = 0; - attribute(readonly, reportable) NetworkInfo networks[] = 1; - attribute(readonly, reportable) int8u scanMaxTimeSeconds = 2; - attribute(readonly, reportable) int8u connectMaxTimeSeconds = 3; - attribute(writable, reportable) boolean interfaceEnabled = 4; - attribute(readonly, reportable) NetworkCommissioningStatus lastNetworkingStatus = 5; - attribute(readonly, reportable) octet_string lastNetworkID = 6; - attribute(readonly, reportable) int32u lastConnectErrorValue = 7; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u maxNetworks = 0; + attribute(readonly) NetworkInfo networks[] = 1; + attribute(readonly) int8u scanMaxTimeSeconds = 2; + attribute(readonly) int8u connectMaxTimeSeconds = 3; + attribute(writable) boolean interfaceEnabled = 4; + attribute(readonly) NetworkCommissioningStatus lastNetworkingStatus = 5; + attribute(readonly) octet_string lastNetworkID = 6; + attribute(readonly) int32u lastConnectErrorValue = 7; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -1890,7 +1912,7 @@ client cluster OtaSoftwareUpdateProvider = 41 { kDownloadProtocolNotSupported = 3; } - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u clusterRevision = 65533; request struct ApplyUpdateRequestRequest { OCTET_STRING updateToken = 0; @@ -1975,11 +1997,11 @@ server cluster OtaSoftwareUpdateRequestor = 42 { nullable INT64S platformCode = 3; } - attribute(writable, reportable) ProviderLocation defaultOtaProviders[] = 0; - attribute(readonly, reportable) boolean updatePossible = 1; - attribute(readonly, reportable) OTAUpdateStateEnum updateState = 2; - attribute(readonly, reportable) int8u updateStateProgress = 3; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) ProviderLocation defaultOtaProviders[] = 0; + attribute(readonly) boolean updatePossible = 1; + attribute(readonly) OTAUpdateStateEnum updateState = 2; + attribute(readonly) int8u updateStateProgress = 3; + attribute(readonly) int16u clusterRevision = 65533; request struct AnnounceOtaProviderRequest { node_id providerNodeId = 0; @@ -1993,10 +2015,10 @@ server cluster OtaSoftwareUpdateRequestor = 42 { } server cluster OccupancySensing = 1030 { - attribute(readonly, reportable) bitmap8 occupancy = 0; - attribute(readonly, reportable) enum8 occupancySensorType = 1; - attribute(readonly, reportable) bitmap8 occupancySensorTypeBitmap = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) bitmap8 occupancy = 0; + attribute(readonly) enum8 occupancySensorType = 1; + attribute(readonly) bitmap8 occupancySensorTypeBitmap = 2; + attribute(readonly) int16u clusterRevision = 65533; } server cluster OnOff = 6 { @@ -2015,13 +2037,13 @@ server cluster OnOff = 6 { kDyingLight = 1; } - attribute(readonly, reportable) boolean onOff = 0; - attribute(readonly, reportable) boolean globalSceneControl = 16384; - attribute(writable, reportable) int16u onTime = 16385; - attribute(writable, reportable) int16u offWaitTime = 16386; - attribute(writable, reportable) enum8 startUpOnOff = 16387; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) boolean onOff = 0; + attribute(readonly) boolean globalSceneControl = 16384; + attribute(writable) int16u onTime = 16385; + attribute(writable) int16u offWaitTime = 16386; + attribute(writable) enum8 startUpOnOff = 16387; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct OffWithEffectRequest { OnOffEffectIdentifier effectId = 0; @@ -2043,9 +2065,9 @@ server cluster OnOff = 6 { } server cluster OnOffSwitchConfiguration = 7 { - attribute(readonly, reportable) enum8 switchType = 0; - attribute(writable, reportable) enum8 switchActions = 16; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) enum8 switchType = 0; + attribute(writable) enum8 switchActions = 16; + attribute(readonly) int16u clusterRevision = 65533; } server cluster OperationalCredentials = 62 { @@ -2071,12 +2093,12 @@ server cluster OperationalCredentials = 62 { CHAR_STRING label = 6; } - attribute(readonly, reportable) FabricDescriptor fabricsList[] = 1; - attribute(readonly, reportable) int8u supportedFabrics = 2; - attribute(readonly, reportable) int8u commissionedFabrics = 3; - attribute(readonly, reportable) OCTET_STRING trustedRootCertificates[] = 4; - attribute(readonly, reportable) fabric_idx currentFabricIndex = 5; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) FabricDescriptor fabricsList[] = 1; + attribute(readonly) int8u supportedFabrics = 2; + attribute(readonly) int8u commissionedFabrics = 3; + attribute(readonly) OCTET_STRING trustedRootCertificates[] = 4; + attribute(readonly) fabric_idx currentFabricIndex = 5; + attribute(readonly) int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -2151,29 +2173,29 @@ server cluster OperationalCredentials = 62 { } server cluster PowerSource = 47 { - attribute(readonly, reportable) enum8 status = 0; - attribute(readonly, reportable) int8u order = 1; - attribute(readonly, reportable) char_string description = 2; - attribute(readonly, reportable) int32u batteryVoltage = 11; - attribute(readonly, reportable) int8u batteryPercentRemaining = 12; - attribute(readonly, reportable) int32u batteryTimeRemaining = 13; - attribute(readonly, reportable) enum8 batteryChargeLevel = 14; - attribute(readonly, reportable) ENUM8 activeBatteryFaults[] = 18; - attribute(readonly, reportable) enum8 batteryChargeState = 26; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) enum8 status = 0; + attribute(readonly) int8u order = 1; + attribute(readonly) char_string description = 2; + attribute(readonly) int32u batteryVoltage = 11; + attribute(readonly) int8u batteryPercentRemaining = 12; + attribute(readonly) int32u batteryTimeRemaining = 13; + attribute(readonly) enum8 batteryChargeLevel = 14; + attribute(readonly) ENUM8 activeBatteryFaults[] = 18; + attribute(readonly) enum8 batteryChargeState = 26; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster PowerSourceConfiguration = 46 { - attribute(readonly, reportable) INT8U sources[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) INT8U sources[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } server cluster PressureMeasurement = 1027 { - attribute(readonly, reportable) int16s measuredValue = 0; - attribute(readonly, reportable) int16s minMeasuredValue = 1; - attribute(readonly, reportable) int16s maxMeasuredValue = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16s measuredValue = 0; + attribute(readonly) int16s minMeasuredValue = 1; + attribute(readonly) int16s maxMeasuredValue = 2; + attribute(readonly) int16u clusterRevision = 65533; } server cluster PumpConfigurationAndControl = 512 { @@ -2244,40 +2266,40 @@ server cluster PumpConfigurationAndControl = 512 { info event TurbineOperation = 16 { } - attribute(readonly, reportable) int16s maxPressure = 0; - attribute(readonly, reportable) int16u maxSpeed = 1; - attribute(readonly, reportable) int16u maxFlow = 2; - attribute(readonly, reportable) int16s minConstPressure = 3; - attribute(readonly, reportable) int16s maxConstPressure = 4; - attribute(readonly, reportable) int16s minCompPressure = 5; - attribute(readonly, reportable) int16s maxCompPressure = 6; - attribute(readonly, reportable) int16u minConstSpeed = 7; - attribute(readonly, reportable) int16u maxConstSpeed = 8; - attribute(readonly, reportable) int16u minConstFlow = 9; - attribute(readonly, reportable) int16u maxConstFlow = 10; - attribute(readonly, reportable) int16s minConstTemp = 11; - attribute(readonly, reportable) int16s maxConstTemp = 12; - attribute(readonly, reportable) bitmap16 pumpStatus = 16; - attribute(readonly, reportable) enum8 effectiveOperationMode = 17; - attribute(readonly, reportable) enum8 effectiveControlMode = 18; - attribute(readonly, reportable) int16s capacity = 19; - attribute(readonly, reportable) int16u speed = 20; - attribute(writable, reportable) int24u lifetimeRunningHours = 21; - attribute(readonly, reportable) int24u power = 22; - attribute(writable, reportable) int32u lifetimeEnergyConsumed = 23; - attribute(writable, reportable) enum8 operationMode = 32; - attribute(writable, reportable) enum8 controlMode = 33; - attribute(readonly, reportable) bitmap16 alarmMask = 34; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16s maxPressure = 0; + attribute(readonly) int16u maxSpeed = 1; + attribute(readonly) int16u maxFlow = 2; + attribute(readonly) int16s minConstPressure = 3; + attribute(readonly) int16s maxConstPressure = 4; + attribute(readonly) int16s minCompPressure = 5; + attribute(readonly) int16s maxCompPressure = 6; + attribute(readonly) int16u minConstSpeed = 7; + attribute(readonly) int16u maxConstSpeed = 8; + attribute(readonly) int16u minConstFlow = 9; + attribute(readonly) int16u maxConstFlow = 10; + attribute(readonly) int16s minConstTemp = 11; + attribute(readonly) int16s maxConstTemp = 12; + attribute(readonly) bitmap16 pumpStatus = 16; + attribute(readonly) enum8 effectiveOperationMode = 17; + attribute(readonly) enum8 effectiveControlMode = 18; + attribute(readonly) int16s capacity = 19; + attribute(readonly) int16u speed = 20; + attribute(writable) int24u lifetimeRunningHours = 21; + attribute(readonly) int24u power = 22; + attribute(writable) int32u lifetimeEnergyConsumed = 23; + attribute(writable) enum8 operationMode = 32; + attribute(writable) enum8 controlMode = 33; + attribute(readonly) bitmap16 alarmMask = 34; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster RelativeHumidityMeasurement = 1029 { - attribute(readonly, reportable) int16u measuredValue = 0; - attribute(readonly, reportable) int16u minMeasuredValue = 1; - attribute(readonly, reportable) int16u maxMeasuredValue = 2; - attribute(readonly, reportable) int16u tolerance = 3; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u measuredValue = 0; + attribute(readonly) int16u minMeasuredValue = 1; + attribute(readonly) int16u maxMeasuredValue = 2; + attribute(readonly) int16u tolerance = 3; + attribute(readonly) int16u clusterRevision = 65533; } server cluster Scenes = 5 { @@ -2287,12 +2309,12 @@ server cluster Scenes = 5 { INT8U value = 3; } - attribute(readonly, reportable) int8u sceneCount = 0; - attribute(readonly, reportable) int8u currentScene = 1; - attribute(readonly, reportable) int16u currentGroup = 2; - attribute(readonly, reportable) boolean sceneValid = 3; - attribute(readonly, reportable) bitmap8 nameSupport = 4; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u sceneCount = 0; + attribute(readonly) int8u currentScene = 1; + attribute(readonly) int16u currentGroup = 2; + attribute(readonly) boolean sceneValid = 3; + attribute(readonly) bitmap8 nameSupport = 4; + attribute(readonly) int16u clusterRevision = 65533; request struct AddSceneRequest { INT16U groupId = 0; @@ -2393,12 +2415,12 @@ server cluster SoftwareDiagnostics = 52 { SoftwareFault softwareFault = 0; } - attribute(readonly, reportable) ThreadMetrics threadMetrics[] = 0; - attribute(readonly, reportable) int64u currentHeapFree = 1; - attribute(readonly, reportable) int64u currentHeapUsed = 2; - attribute(readonly, reportable) int64u currentHeapHighWatermark = 3; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) ThreadMetrics threadMetrics[] = 0; + attribute(readonly) int64u currentHeapFree = 1; + attribute(readonly) int64u currentHeapUsed = 2; + attribute(readonly) int64u currentHeapHighWatermark = 3; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; command ResetWatermarks(): DefaultSuccess = 0; } @@ -2434,11 +2456,11 @@ server cluster Switch = 59 { INT8U totalNumberOfPressesCounted = 1; } - attribute(readonly, reportable) int8u numberOfPositions = 0; - attribute(readonly, reportable) int8u currentPosition = 1; - attribute(readonly, reportable) int8u multiPressMax = 2; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u numberOfPositions = 0; + attribute(readonly) int8u currentPosition = 1; + attribute(readonly) int8u multiPressMax = 2; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster TargetNavigator = 1285 { @@ -2453,17 +2475,17 @@ server cluster TargetNavigator = 1285 { CHAR_STRING name = 2; } - attribute(readonly, reportable) TargetInfo targetNavigatorList[] = 0; - attribute(readonly, reportable) int8u currentNavigatorTarget = 1; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) TargetInfo targetNavigatorList[] = 0; + attribute(readonly) int8u currentNavigatorTarget = 1; + attribute(readonly) int16u clusterRevision = 65533; } server cluster TemperatureMeasurement = 1026 { - attribute(readonly, reportable) int16s measuredValue = 0; - attribute(readonly, reportable) int16s minMeasuredValue = 1; - attribute(readonly, reportable) int16s maxMeasuredValue = 2; - attribute(readonly, reportable) int16u tolerance = 3; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16s measuredValue = 0; + attribute(readonly) int16s minMeasuredValue = 1; + attribute(readonly) int16s maxMeasuredValue = 2; + attribute(readonly) int16u tolerance = 3; + attribute(readonly) int16u clusterRevision = 65533; } server cluster TestCluster = 1295 { @@ -2530,84 +2552,84 @@ server cluster TestCluster = 1295 { SimpleEnum arg6[] = 6; } - attribute(writable, reportable) boolean boolean = 0; - attribute(writable, reportable) bitmap8 bitmap8 = 1; - attribute(writable, reportable) bitmap16 bitmap16 = 2; - attribute(writable, reportable) bitmap32 bitmap32 = 3; - attribute(writable, reportable) bitmap64 bitmap64 = 4; - attribute(writable, reportable) int8u int8u = 5; - attribute(writable, reportable) int16u int16u = 6; - attribute(writable, reportable) int24u int24u = 7; - attribute(writable, reportable) int32u int32u = 8; - attribute(writable, reportable) int40u int40u = 9; - attribute(writable, reportable) int48u int48u = 10; - attribute(writable, reportable) int56u int56u = 11; - attribute(writable, reportable) int64u int64u = 12; - attribute(writable, reportable) int8s int8s = 13; - attribute(writable, reportable) int16s int16s = 14; - attribute(writable, reportable) int24s int24s = 15; - attribute(writable, reportable) int32s int32s = 16; - attribute(writable, reportable) int40s int40s = 17; - attribute(writable, reportable) int48s int48s = 18; - attribute(writable, reportable) int56s int56s = 19; - attribute(writable, reportable) int64s int64s = 20; - attribute(writable, reportable) enum8 enum8 = 21; - attribute(writable, reportable) enum16 enum16 = 22; - attribute(writable, reportable) single floatSingle = 23; - attribute(writable, reportable) double floatDouble = 24; - attribute(writable, reportable) octet_string octetString = 25; - attribute(writable, reportable) INT8U listInt8u[] = 26; - attribute(writable, reportable) OCTET_STRING listOctetString[] = 27; - attribute(writable, reportable) TestListStructOctet listStructOctetString[] = 28; - attribute(writable, reportable) long_octet_string longOctetString = 29; - attribute(writable, reportable) char_string charString = 30; - attribute(writable, reportable) long_char_string longCharString = 31; - attribute(writable, reportable) epoch_us epochUs = 32; - attribute(writable, reportable) epoch_s epochS = 33; - attribute(writable, reportable) vendor_id vendorId = 34; - attribute(writable, reportable) NullablesAndOptionalsStruct listNullablesAndOptionalsStruct[] = 35; - attribute(writable, reportable) SimpleEnum enumAttr = 36; - attribute(writable, reportable) SimpleStruct structAttr = 37; - attribute(writable, reportable) int8u rangeRestrictedInt8u = 38; - attribute(writable, reportable) int8s rangeRestrictedInt8s = 39; - attribute(writable, reportable) int16u rangeRestrictedInt16u = 40; - attribute(writable, reportable) int16s rangeRestrictedInt16s = 41; - attribute(readonly, reportable) LONG_OCTET_STRING listLongOctetString[] = 42; - attribute(writable, reportable) boolean timedWriteBoolean = 48; - attribute(writable, reportable) boolean nullableBoolean = 32768; - attribute(writable, reportable) bitmap8 nullableBitmap8 = 32769; - attribute(writable, reportable) bitmap16 nullableBitmap16 = 32770; - attribute(writable, reportable) bitmap32 nullableBitmap32 = 32771; - attribute(writable, reportable) bitmap64 nullableBitmap64 = 32772; - attribute(writable, reportable) int8u nullableInt8u = 32773; - attribute(writable, reportable) int16u nullableInt16u = 32774; - attribute(writable, reportable) int24u nullableInt24u = 32775; - attribute(writable, reportable) int32u nullableInt32u = 32776; - attribute(writable, reportable) int40u nullableInt40u = 32777; - attribute(writable, reportable) int48u nullableInt48u = 32778; - attribute(writable, reportable) int56u nullableInt56u = 32779; - attribute(writable, reportable) int64u nullableInt64u = 32780; - attribute(writable, reportable) int8s nullableInt8s = 32781; - attribute(writable, reportable) int16s nullableInt16s = 32782; - attribute(writable, reportable) int24s nullableInt24s = 32783; - attribute(writable, reportable) int32s nullableInt32s = 32784; - attribute(writable, reportable) int40s nullableInt40s = 32785; - attribute(writable, reportable) int48s nullableInt48s = 32786; - attribute(writable, reportable) int56s nullableInt56s = 32787; - attribute(writable, reportable) int64s nullableInt64s = 32788; - attribute(writable, reportable) enum8 nullableEnum8 = 32789; - attribute(writable, reportable) enum16 nullableEnum16 = 32790; - attribute(writable, reportable) single nullableFloatSingle = 32791; - attribute(writable, reportable) double nullableFloatDouble = 32792; - attribute(writable, reportable) octet_string nullableOctetString = 32793; - attribute(writable, reportable) char_string nullableCharString = 32798; - attribute(writable, reportable) SimpleEnum nullableEnumAttr = 32804; - attribute(writable, reportable) SimpleStruct nullableStruct = 32805; - attribute(writable, reportable) int8u nullableRangeRestrictedInt8u = 32806; - attribute(writable, reportable) int8s nullableRangeRestrictedInt8s = 32807; - attribute(writable, reportable) int16u nullableRangeRestrictedInt16u = 32808; - attribute(writable, reportable) int16s nullableRangeRestrictedInt16s = 32809; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) boolean boolean = 0; + attribute(writable) bitmap8 bitmap8 = 1; + attribute(writable) bitmap16 bitmap16 = 2; + attribute(writable) bitmap32 bitmap32 = 3; + attribute(writable) bitmap64 bitmap64 = 4; + attribute(writable) int8u int8u = 5; + attribute(writable) int16u int16u = 6; + attribute(writable) int24u int24u = 7; + attribute(writable) int32u int32u = 8; + attribute(writable) int40u int40u = 9; + attribute(writable) int48u int48u = 10; + attribute(writable) int56u int56u = 11; + attribute(writable) int64u int64u = 12; + attribute(writable) int8s int8s = 13; + attribute(writable) int16s int16s = 14; + attribute(writable) int24s int24s = 15; + attribute(writable) int32s int32s = 16; + attribute(writable) int40s int40s = 17; + attribute(writable) int48s int48s = 18; + attribute(writable) int56s int56s = 19; + attribute(writable) int64s int64s = 20; + attribute(writable) enum8 enum8 = 21; + attribute(writable) enum16 enum16 = 22; + attribute(writable) single floatSingle = 23; + attribute(writable) double floatDouble = 24; + attribute(writable) octet_string octetString = 25; + attribute(writable) INT8U listInt8u[] = 26; + attribute(writable) OCTET_STRING listOctetString[] = 27; + attribute(writable) TestListStructOctet listStructOctetString[] = 28; + attribute(writable) long_octet_string longOctetString = 29; + attribute(writable) char_string charString = 30; + attribute(writable) long_char_string longCharString = 31; + attribute(writable) epoch_us epochUs = 32; + attribute(writable) epoch_s epochS = 33; + attribute(writable) vendor_id vendorId = 34; + attribute(writable) NullablesAndOptionalsStruct listNullablesAndOptionalsStruct[] = 35; + attribute(writable) SimpleEnum enumAttr = 36; + attribute(writable) SimpleStruct structAttr = 37; + attribute(writable) int8u rangeRestrictedInt8u = 38; + attribute(writable) int8s rangeRestrictedInt8s = 39; + attribute(writable) int16u rangeRestrictedInt16u = 40; + attribute(writable) int16s rangeRestrictedInt16s = 41; + attribute(readonly) LONG_OCTET_STRING listLongOctetString[] = 42; + attribute(writable) boolean timedWriteBoolean = 48; + attribute(writable) boolean nullableBoolean = 32768; + attribute(writable) bitmap8 nullableBitmap8 = 32769; + attribute(writable) bitmap16 nullableBitmap16 = 32770; + attribute(writable) bitmap32 nullableBitmap32 = 32771; + attribute(writable) bitmap64 nullableBitmap64 = 32772; + attribute(writable) int8u nullableInt8u = 32773; + attribute(writable) int16u nullableInt16u = 32774; + attribute(writable) int24u nullableInt24u = 32775; + attribute(writable) int32u nullableInt32u = 32776; + attribute(writable) int40u nullableInt40u = 32777; + attribute(writable) int48u nullableInt48u = 32778; + attribute(writable) int56u nullableInt56u = 32779; + attribute(writable) int64u nullableInt64u = 32780; + attribute(writable) int8s nullableInt8s = 32781; + attribute(writable) int16s nullableInt16s = 32782; + attribute(writable) int24s nullableInt24s = 32783; + attribute(writable) int32s nullableInt32s = 32784; + attribute(writable) int40s nullableInt40s = 32785; + attribute(writable) int48s nullableInt48s = 32786; + attribute(writable) int56s nullableInt56s = 32787; + attribute(writable) int64s nullableInt64s = 32788; + attribute(writable) enum8 nullableEnum8 = 32789; + attribute(writable) enum16 nullableEnum16 = 32790; + attribute(writable) single nullableFloatSingle = 32791; + attribute(writable) double nullableFloatDouble = 32792; + attribute(writable) octet_string nullableOctetString = 32793; + attribute(writable) char_string nullableCharString = 32798; + attribute(writable) SimpleEnum nullableEnumAttr = 32804; + attribute(writable) SimpleStruct nullableStruct = 32805; + attribute(writable) int8u nullableRangeRestrictedInt8u = 32806; + attribute(writable) int8s nullableRangeRestrictedInt8s = 32807; + attribute(writable) int16u nullableRangeRestrictedInt16u = 32808; + attribute(writable) int16s nullableRangeRestrictedInt16s = 32809; + attribute(readonly) int16u clusterRevision = 65533; request struct SimpleStructEchoRequestRequest { SimpleStruct arg1 = 0; @@ -2723,32 +2745,32 @@ server cluster Thermostat = 513 { kHeatAndCoolSetpoints = 2; } - attribute(readonly, reportable) int16s localTemperature = 0; - attribute(readonly, reportable) int16s absMinHeatSetpointLimit = 3; - attribute(readonly, reportable) int16s absMaxHeatSetpointLimit = 4; - attribute(readonly, reportable) int16s absMinCoolSetpointLimit = 5; - attribute(readonly, reportable) int16s absMaxCoolSetpointLimit = 6; - attribute(writable, reportable) int16s occupiedCoolingSetpoint = 17; - attribute(writable, reportable) int16s occupiedHeatingSetpoint = 18; - attribute(writable, reportable) int16s minHeatSetpointLimit = 21; - attribute(writable, reportable) int16s maxHeatSetpointLimit = 22; - attribute(writable, reportable) int16s minCoolSetpointLimit = 23; - attribute(writable, reportable) int16s maxCoolSetpointLimit = 24; - attribute(writable, reportable) int8s minSetpointDeadBand = 25; - attribute(writable, reportable) enum8 controlSequenceOfOperation = 27; - attribute(writable, reportable) enum8 systemMode = 28; - attribute(readonly, reportable) enum8 startOfWeek = 32; - attribute(readonly, reportable) int8u numberOfWeeklyTransitions = 33; - attribute(readonly, reportable) int8u numberOfDailyTransitions = 34; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16s localTemperature = 0; + attribute(readonly) int16s absMinHeatSetpointLimit = 3; + attribute(readonly) int16s absMaxHeatSetpointLimit = 4; + attribute(readonly) int16s absMinCoolSetpointLimit = 5; + attribute(readonly) int16s absMaxCoolSetpointLimit = 6; + attribute(writable) int16s occupiedCoolingSetpoint = 17; + attribute(writable) int16s occupiedHeatingSetpoint = 18; + attribute(writable) int16s minHeatSetpointLimit = 21; + attribute(writable) int16s maxHeatSetpointLimit = 22; + attribute(writable) int16s minCoolSetpointLimit = 23; + attribute(writable) int16s maxCoolSetpointLimit = 24; + attribute(writable) int8s minSetpointDeadBand = 25; + attribute(writable) enum8 controlSequenceOfOperation = 27; + attribute(writable) enum8 systemMode = 28; + attribute(readonly) enum8 startOfWeek = 32; + attribute(readonly) int8u numberOfWeeklyTransitions = 33; + attribute(readonly) int8u numberOfDailyTransitions = 34; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster ThermostatUserInterfaceConfiguration = 516 { - attribute(writable, reportable) enum8 temperatureDisplayMode = 0; - attribute(writable, reportable) enum8 keypadLockout = 1; - attribute(writable, reportable) enum8 scheduleProgrammingVisibility = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) enum8 temperatureDisplayMode = 0; + attribute(writable) enum8 keypadLockout = 1; + attribute(writable) enum8 scheduleProgrammingVisibility = 2; + attribute(readonly) int16u clusterRevision = 65533; } server cluster ThreadNetworkDiagnostics = 53 { @@ -2828,83 +2850,83 @@ server cluster ThreadNetworkDiagnostics = 53 { ThreadConnectionStatus connectionStatus = 0; } - attribute(readonly, reportable) int16u channel = 0; - attribute(readonly, reportable) enum8 routingRole = 1; - attribute(readonly, reportable) octet_string networkName = 2; - attribute(readonly, reportable) int16u panId = 3; - attribute(readonly, reportable) int64u extendedPanId = 4; - attribute(readonly, reportable) octet_string meshLocalPrefix = 5; - attribute(readonly, reportable) int64u overrunCount = 6; - attribute(readonly, reportable) NeighborTable neighborTableList[] = 7; - attribute(readonly, reportable) RouteTable routeTableList[] = 8; - attribute(readonly, reportable) int32u partitionId = 9; - attribute(readonly, reportable) int8u weighting = 10; - attribute(readonly, reportable) int8u dataVersion = 11; - attribute(readonly, reportable) int8u stableDataVersion = 12; - attribute(readonly, reportable) int8u leaderRouterId = 13; - attribute(readonly, reportable) int16u detachedRoleCount = 14; - attribute(readonly, reportable) int16u childRoleCount = 15; - attribute(readonly, reportable) int16u routerRoleCount = 16; - attribute(readonly, reportable) int16u leaderRoleCount = 17; - attribute(readonly, reportable) int16u attachAttemptCount = 18; - attribute(readonly, reportable) int16u partitionIdChangeCount = 19; - attribute(readonly, reportable) int16u betterPartitionAttachAttemptCount = 20; - attribute(readonly, reportable) int16u parentChangeCount = 21; - attribute(readonly, reportable) int32u txTotalCount = 22; - attribute(readonly, reportable) int32u txUnicastCount = 23; - attribute(readonly, reportable) int32u txBroadcastCount = 24; - attribute(readonly, reportable) int32u txAckRequestedCount = 25; - attribute(readonly, reportable) int32u txAckedCount = 26; - attribute(readonly, reportable) int32u txNoAckRequestedCount = 27; - attribute(readonly, reportable) int32u txDataCount = 28; - attribute(readonly, reportable) int32u txDataPollCount = 29; - attribute(readonly, reportable) int32u txBeaconCount = 30; - attribute(readonly, reportable) int32u txBeaconRequestCount = 31; - attribute(readonly, reportable) int32u txOtherCount = 32; - attribute(readonly, reportable) int32u txRetryCount = 33; - attribute(readonly, reportable) int32u txDirectMaxRetryExpiryCount = 34; - attribute(readonly, reportable) int32u txIndirectMaxRetryExpiryCount = 35; - attribute(readonly, reportable) int32u txErrCcaCount = 36; - attribute(readonly, reportable) int32u txErrAbortCount = 37; - attribute(readonly, reportable) int32u txErrBusyChannelCount = 38; - attribute(readonly, reportable) int32u rxTotalCount = 39; - attribute(readonly, reportable) int32u rxUnicastCount = 40; - attribute(readonly, reportable) int32u rxBroadcastCount = 41; - attribute(readonly, reportable) int32u rxDataCount = 42; - attribute(readonly, reportable) int32u rxDataPollCount = 43; - attribute(readonly, reportable) int32u rxBeaconCount = 44; - attribute(readonly, reportable) int32u rxBeaconRequestCount = 45; - attribute(readonly, reportable) int32u rxOtherCount = 46; - attribute(readonly, reportable) int32u rxAddressFilteredCount = 47; - attribute(readonly, reportable) int32u rxDestAddrFilteredCount = 48; - attribute(readonly, reportable) int32u rxDuplicatedCount = 49; - attribute(readonly, reportable) int32u rxErrNoFrameCount = 50; - attribute(readonly, reportable) int32u rxErrUnknownNeighborCount = 51; - attribute(readonly, reportable) int32u rxErrInvalidSrcAddrCount = 52; - attribute(readonly, reportable) int32u rxErrSecCount = 53; - attribute(readonly, reportable) int32u rxErrFcsCount = 54; - attribute(readonly, reportable) int32u rxErrOtherCount = 55; - attribute(readonly, reportable) int64u activeTimestamp = 56; - attribute(readonly, reportable) int64u pendingTimestamp = 57; - attribute(readonly, reportable) int32u delay = 58; - attribute(readonly, reportable) SecurityPolicy securityPolicy[] = 59; - attribute(readonly, reportable) octet_string channelMask = 60; - attribute(readonly, reportable) OperationalDatasetComponents operationalDatasetComponents[] = 61; - attribute(readonly, reportable) NetworkFault activeNetworkFaultsList[] = 62; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u channel = 0; + attribute(readonly) enum8 routingRole = 1; + attribute(readonly) octet_string networkName = 2; + attribute(readonly) int16u panId = 3; + attribute(readonly) int64u extendedPanId = 4; + attribute(readonly) octet_string meshLocalPrefix = 5; + attribute(readonly) int64u overrunCount = 6; + attribute(readonly) NeighborTable neighborTableList[] = 7; + attribute(readonly) RouteTable routeTableList[] = 8; + attribute(readonly) int32u partitionId = 9; + attribute(readonly) int8u weighting = 10; + attribute(readonly) int8u dataVersion = 11; + attribute(readonly) int8u stableDataVersion = 12; + attribute(readonly) int8u leaderRouterId = 13; + attribute(readonly) int16u detachedRoleCount = 14; + attribute(readonly) int16u childRoleCount = 15; + attribute(readonly) int16u routerRoleCount = 16; + attribute(readonly) int16u leaderRoleCount = 17; + attribute(readonly) int16u attachAttemptCount = 18; + attribute(readonly) int16u partitionIdChangeCount = 19; + attribute(readonly) int16u betterPartitionAttachAttemptCount = 20; + attribute(readonly) int16u parentChangeCount = 21; + attribute(readonly) int32u txTotalCount = 22; + attribute(readonly) int32u txUnicastCount = 23; + attribute(readonly) int32u txBroadcastCount = 24; + attribute(readonly) int32u txAckRequestedCount = 25; + attribute(readonly) int32u txAckedCount = 26; + attribute(readonly) int32u txNoAckRequestedCount = 27; + attribute(readonly) int32u txDataCount = 28; + attribute(readonly) int32u txDataPollCount = 29; + attribute(readonly) int32u txBeaconCount = 30; + attribute(readonly) int32u txBeaconRequestCount = 31; + attribute(readonly) int32u txOtherCount = 32; + attribute(readonly) int32u txRetryCount = 33; + attribute(readonly) int32u txDirectMaxRetryExpiryCount = 34; + attribute(readonly) int32u txIndirectMaxRetryExpiryCount = 35; + attribute(readonly) int32u txErrCcaCount = 36; + attribute(readonly) int32u txErrAbortCount = 37; + attribute(readonly) int32u txErrBusyChannelCount = 38; + attribute(readonly) int32u rxTotalCount = 39; + attribute(readonly) int32u rxUnicastCount = 40; + attribute(readonly) int32u rxBroadcastCount = 41; + attribute(readonly) int32u rxDataCount = 42; + attribute(readonly) int32u rxDataPollCount = 43; + attribute(readonly) int32u rxBeaconCount = 44; + attribute(readonly) int32u rxBeaconRequestCount = 45; + attribute(readonly) int32u rxOtherCount = 46; + attribute(readonly) int32u rxAddressFilteredCount = 47; + attribute(readonly) int32u rxDestAddrFilteredCount = 48; + attribute(readonly) int32u rxDuplicatedCount = 49; + attribute(readonly) int32u rxErrNoFrameCount = 50; + attribute(readonly) int32u rxErrUnknownNeighborCount = 51; + attribute(readonly) int32u rxErrInvalidSrcAddrCount = 52; + attribute(readonly) int32u rxErrSecCount = 53; + attribute(readonly) int32u rxErrFcsCount = 54; + attribute(readonly) int32u rxErrOtherCount = 55; + attribute(readonly) int64u activeTimestamp = 56; + attribute(readonly) int64u pendingTimestamp = 57; + attribute(readonly) int32u delay = 58; + attribute(readonly) SecurityPolicy securityPolicy[] = 59; + attribute(readonly) octet_string channelMask = 60; + attribute(readonly) OperationalDatasetComponents operationalDatasetComponents[] = 61; + attribute(readonly) NetworkFault activeNetworkFaultsList[] = 62; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; command ResetCounts(): DefaultSuccess = 0; } server cluster UserLabel = 65 { - attribute(writable, reportable) LabelStruct labelList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) LabelStruct labelList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } server cluster WakeOnLan = 1283 { - attribute(readonly, reportable) char_string wakeOnLanMacAddress = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) char_string wakeOnLanMacAddress = 0; + attribute(readonly) int16u clusterRevision = 65533; } server cluster WiFiNetworkDiagnostics = 54 { @@ -2951,46 +2973,46 @@ server cluster WiFiNetworkDiagnostics = 54 { WiFiConnectionStatus connectionStatus = 0; } - attribute(readonly, reportable) octet_string bssid = 0; - attribute(readonly, reportable) enum8 securityType = 1; - attribute(readonly, reportable) enum8 wiFiVersion = 2; - attribute(readonly, reportable) int16u channelNumber = 3; - attribute(readonly, reportable) int8s rssi = 4; - attribute(readonly, reportable) int32u beaconLostCount = 5; - attribute(readonly, reportable) int32u beaconRxCount = 6; - attribute(readonly, reportable) int32u packetMulticastRxCount = 7; - attribute(readonly, reportable) int32u packetMulticastTxCount = 8; - attribute(readonly, reportable) int32u packetUnicastRxCount = 9; - attribute(readonly, reportable) int32u packetUnicastTxCount = 10; - attribute(readonly, reportable) int64u currentMaxRate = 11; - attribute(readonly, reportable) int64u overrunCount = 12; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) octet_string bssid = 0; + attribute(readonly) enum8 securityType = 1; + attribute(readonly) enum8 wiFiVersion = 2; + attribute(readonly) int16u channelNumber = 3; + attribute(readonly) int8s rssi = 4; + attribute(readonly) int32u beaconLostCount = 5; + attribute(readonly) int32u beaconRxCount = 6; + attribute(readonly) int32u packetMulticastRxCount = 7; + attribute(readonly) int32u packetMulticastTxCount = 8; + attribute(readonly) int32u packetUnicastRxCount = 9; + attribute(readonly) int32u packetUnicastTxCount = 10; + attribute(readonly) int64u currentMaxRate = 11; + attribute(readonly) int64u overrunCount = 12; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; command ResetCounts(): DefaultSuccess = 0; } server cluster WindowCovering = 258 { - attribute(readonly, reportable) enum8 type = 0; - attribute(readonly, reportable) int16u currentPositionLift = 3; - attribute(readonly, reportable) int16u currentPositionTilt = 4; - attribute(readonly, reportable) bitmap8 configStatus = 7; - attribute(readonly, reportable) Percent currentPositionLiftPercentage = 8; - attribute(readonly, reportable) Percent currentPositionTiltPercentage = 9; - attribute(readonly, reportable) bitmap8 operationalStatus = 10; - attribute(readonly, reportable) Percent100ths targetPositionLiftPercent100ths = 11; - attribute(readonly, reportable) Percent100ths targetPositionTiltPercent100ths = 12; - attribute(readonly, reportable) enum8 endProductType = 13; - attribute(readonly, reportable) Percent100ths currentPositionLiftPercent100ths = 14; - attribute(readonly, reportable) Percent100ths currentPositionTiltPercent100ths = 15; - attribute(readonly, reportable) int16u installedOpenLimitLift = 16; - attribute(readonly, reportable) int16u installedClosedLimitLift = 17; - attribute(readonly, reportable) int16u installedOpenLimitTilt = 18; - attribute(readonly, reportable) int16u installedClosedLimitTilt = 19; - attribute(writable, reportable) bitmap8 mode = 23; - attribute(readonly, reportable) bitmap16 safetyStatus = 26; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) enum8 type = 0; + attribute(readonly) int16u currentPositionLift = 3; + attribute(readonly) int16u currentPositionTilt = 4; + attribute(readonly) bitmap8 configStatus = 7; + attribute(readonly) Percent currentPositionLiftPercentage = 8; + attribute(readonly) Percent currentPositionTiltPercentage = 9; + attribute(readonly) bitmap8 operationalStatus = 10; + attribute(readonly) Percent100ths targetPositionLiftPercent100ths = 11; + attribute(readonly) Percent100ths targetPositionTiltPercent100ths = 12; + attribute(readonly) enum8 endProductType = 13; + attribute(readonly) Percent100ths currentPositionLiftPercent100ths = 14; + attribute(readonly) Percent100ths currentPositionTiltPercent100ths = 15; + attribute(readonly) int16u installedOpenLimitLift = 16; + attribute(readonly) int16u installedClosedLimitLift = 17; + attribute(readonly) int16u installedOpenLimitTilt = 18; + attribute(readonly) int16u installedClosedLimitTilt = 19; + attribute(writable) bitmap8 mode = 23; + attribute(readonly) bitmap16 safetyStatus = 26; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; command DownOrClose(): DefaultSuccess = 1; command StopMotion(): DefaultSuccess = 2; diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index ed8d4ed2abed62..5b96c72fc46520 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -19,10 +19,10 @@ server cluster AdministratorCommissioning = 60 { kWindowNotOpen = 3; } - attribute(readonly, reportable) int8u windowStatus = 0; - attribute(readonly, reportable) fabric_idx adminFabricIndex = 1; - attribute(readonly, reportable) int16u adminVendorId = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u windowStatus = 0; + attribute(readonly) fabric_idx adminFabricIndex = 1; + attribute(readonly) int16u adminVendorId = 2; + attribute(readonly) int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -57,18 +57,18 @@ server cluster Basic = 40 { boolean reachableNewValue = 0; } - attribute(readonly, reportable) int16u interactionModelVersion = 0; - attribute(readonly, reportable) char_string vendorName = 1; - attribute(readonly, reportable) vendor_id vendorID = 2; - attribute(readonly, reportable) char_string productName = 3; - attribute(readonly, reportable) int16u productID = 4; - attribute(writable, reportable) char_string nodeLabel = 5; - attribute(writable, reportable) char_string location = 6; - attribute(readonly, reportable) int16u hardwareVersion = 7; - attribute(readonly, reportable) char_string hardwareVersionString = 8; - attribute(readonly, reportable) int32u softwareVersion = 9; - attribute(readonly, reportable) char_string softwareVersionString = 10; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u interactionModelVersion = 0; + attribute(readonly) char_string vendorName = 1; + attribute(readonly) vendor_id vendorID = 2; + attribute(readonly) char_string productName = 3; + attribute(readonly) int16u productID = 4; + attribute(writable) char_string nodeLabel = 5; + attribute(writable) char_string location = 6; + attribute(readonly) int16u hardwareVersion = 7; + attribute(readonly) char_string hardwareVersionString = 8; + attribute(readonly) int32u softwareVersion = 9; + attribute(readonly) char_string softwareVersionString = 10; + attribute(readonly) int16u clusterRevision = 65533; } server cluster Descriptor = 29 { @@ -77,11 +77,11 @@ server cluster Descriptor = 29 { INT16U revision = 2; } - attribute(readonly, reportable) DeviceType deviceList[] = 0; - attribute(readonly, reportable) CLUSTER_ID serverList[] = 1; - attribute(readonly, reportable) CLUSTER_ID clientList[] = 2; - attribute(readonly, reportable) ENDPOINT_NO partsList[] = 3; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) DeviceType deviceList[] = 0; + attribute(readonly) CLUSTER_ID serverList[] = 1; + attribute(readonly) CLUSTER_ID clientList[] = 2; + attribute(readonly) ENDPOINT_NO partsList[] = 3; + attribute(readonly) int16u clusterRevision = 65533; } server cluster DiagnosticLogs = 50 { @@ -128,22 +128,22 @@ server cluster EthernetNetworkDiagnostics = 55 { k400g = 9; } - attribute(readonly, reportable) enum8 PHYRate = 0; - attribute(readonly, reportable) boolean fullDuplex = 1; - attribute(readonly, reportable) int64u packetRxCount = 2; - attribute(readonly, reportable) int64u packetTxCount = 3; - attribute(readonly, reportable) int64u txErrCount = 4; - attribute(readonly, reportable) int64u collisionCount = 5; - attribute(readonly, reportable) int64u overrunCount = 6; - attribute(readonly, reportable) boolean carrierDetect = 7; - attribute(readonly, reportable) int64u timeSinceReset = 8; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) enum8 PHYRate = 0; + attribute(readonly) boolean fullDuplex = 1; + attribute(readonly) int64u packetRxCount = 2; + attribute(readonly) int64u packetTxCount = 3; + attribute(readonly) int64u txErrCount = 4; + attribute(readonly) int64u collisionCount = 5; + attribute(readonly) int64u overrunCount = 6; + attribute(readonly) boolean carrierDetect = 7; + attribute(readonly) int64u timeSinceReset = 8; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster FixedLabel = 64 { - attribute(readonly, reportable) LabelStruct labelList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) LabelStruct labelList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -164,12 +164,12 @@ server cluster GeneralCommissioning = 48 { INT32U failSafeExpiryLengthMs = 1; } - attribute(writable, reportable) int64u breadcrumb = 0; - attribute(readonly, reportable) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; - attribute(readonly, reportable) enum8 regulatoryConfig = 2; - attribute(readonly, reportable) enum8 locationCapability = 3; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) int64u breadcrumb = 0; + attribute(readonly) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; + attribute(readonly) enum8 regulatoryConfig = 2; + attribute(readonly) enum8 locationCapability = 3; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -282,15 +282,15 @@ server cluster GeneralDiagnostics = 51 { BootReasonType bootReason = 0; } - attribute(readonly, reportable) NetworkInterfaceType networkInterfaces[] = 0; - attribute(readonly, reportable) int16u rebootCount = 1; - attribute(readonly, reportable) int64u upTime = 2; - attribute(readonly, reportable) int32u totalOperationalHours = 3; - attribute(readonly, reportable) enum8 bootReasons = 4; - attribute(readonly, reportable) ENUM8 activeHardwareFaults[] = 5; - attribute(readonly, reportable) ENUM8 activeRadioFaults[] = 6; - attribute(readonly, reportable) ENUM8 activeNetworkFaults[] = 7; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) NetworkInterfaceType networkInterfaces[] = 0; + attribute(readonly) int16u rebootCount = 1; + attribute(readonly) int64u upTime = 2; + attribute(readonly) int32u totalOperationalHours = 3; + attribute(readonly) enum8 bootReasons = 4; + attribute(readonly) ENUM8 activeHardwareFaults[] = 5; + attribute(readonly) ENUM8 activeRadioFaults[] = 6; + attribute(readonly) ENUM8 activeNetworkFaults[] = 7; + attribute(readonly) int16u clusterRevision = 65533; } server cluster LevelControl = 8 { @@ -304,22 +304,22 @@ server cluster LevelControl = 8 { kDown = 1; } - attribute(readonly, reportable) int8u currentLevel = 0; - attribute(readonly, reportable) int16u remainingTime = 1; - attribute(readonly, reportable) int8u minLevel = 2; - attribute(readonly, reportable) int8u maxLevel = 3; - attribute(readonly, reportable) int16u currentFrequency = 4; - attribute(readonly, reportable) int16u minFrequency = 5; - attribute(readonly, reportable) int16u maxFrequency = 6; - attribute(writable, reportable) bitmap8 options = 15; - attribute(writable, reportable) int16u onOffTransitionTime = 16; - attribute(writable, reportable) int8u onLevel = 17; - attribute(writable, reportable) int16u onTransitionTime = 18; - attribute(writable, reportable) int16u offTransitionTime = 19; - attribute(writable, reportable) int8u defaultMoveRate = 20; - attribute(writable, reportable) int8u startUpCurrentLevel = 16384; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u currentLevel = 0; + attribute(readonly) int16u remainingTime = 1; + attribute(readonly) int8u minLevel = 2; + attribute(readonly) int8u maxLevel = 3; + attribute(readonly) int16u currentFrequency = 4; + attribute(readonly) int16u minFrequency = 5; + attribute(readonly) int16u maxFrequency = 6; + attribute(writable) bitmap8 options = 15; + attribute(writable) int16u onOffTransitionTime = 16; + attribute(writable) int8u onLevel = 17; + attribute(writable) int16u onTransitionTime = 18; + attribute(writable) int16u offTransitionTime = 19; + attribute(writable) int8u defaultMoveRate = 20; + attribute(writable) int8u startUpCurrentLevel = 16384; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct MoveRequest { MoveMode moveMode = 0; @@ -375,8 +375,8 @@ server cluster LevelControl = 8 { } server cluster LocalizationConfiguration = 43 { - attribute(writable, reportable) char_string activeLocale = 1; - attribute(readonly, reportable) CHAR_STRING supportedLocales[] = 2; + attribute(writable) char_string activeLocale = 1; + attribute(readonly) CHAR_STRING supportedLocales[] = 2; } server cluster NetworkCommissioning = 49 { @@ -429,16 +429,16 @@ server cluster NetworkCommissioning = 49 { INT8U lqi = 8; } - attribute(readonly, reportable) int8u maxNetworks = 0; - attribute(readonly, reportable) NetworkInfo networks[] = 1; - attribute(readonly, reportable) int8u scanMaxTimeSeconds = 2; - attribute(readonly, reportable) int8u connectMaxTimeSeconds = 3; - attribute(writable, reportable) boolean interfaceEnabled = 4; - attribute(readonly, reportable) NetworkCommissioningStatus lastNetworkingStatus = 5; - attribute(readonly, reportable) octet_string lastNetworkID = 6; - attribute(readonly, reportable) int32u lastConnectErrorValue = 7; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u maxNetworks = 0; + attribute(readonly) NetworkInfo networks[] = 1; + attribute(readonly) int8u scanMaxTimeSeconds = 2; + attribute(readonly) int8u connectMaxTimeSeconds = 3; + attribute(writable) boolean interfaceEnabled = 4; + attribute(readonly) NetworkCommissioningStatus lastNetworkingStatus = 5; + attribute(readonly) octet_string lastNetworkID = 6; + attribute(readonly) int32u lastConnectErrorValue = 7; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -514,8 +514,8 @@ server cluster OnOff = 6 { kDyingLight = 1; } - attribute(readonly, reportable) boolean onOff = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) boolean onOff = 0; + attribute(readonly) int16u clusterRevision = 65533; command Off(): DefaultSuccess = 0; command On(): DefaultSuccess = 1; @@ -545,12 +545,12 @@ server cluster OperationalCredentials = 62 { CHAR_STRING label = 6; } - attribute(readonly, reportable) FabricDescriptor fabricsList[] = 1; - attribute(readonly, reportable) int8u supportedFabrics = 2; - attribute(readonly, reportable) int8u commissionedFabrics = 3; - attribute(readonly, reportable) OCTET_STRING trustedRootCertificates[] = 4; - attribute(readonly, reportable) fabric_idx currentFabricIndex = 5; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) FabricDescriptor fabricsList[] = 1; + attribute(readonly) int8u supportedFabrics = 2; + attribute(readonly) int8u commissionedFabrics = 3; + attribute(readonly) OCTET_STRING trustedRootCertificates[] = 4; + attribute(readonly) fabric_idx currentFabricIndex = 5; + attribute(readonly) int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -637,12 +637,12 @@ server cluster SoftwareDiagnostics = 52 { SoftwareFault softwareFault = 0; } - attribute(readonly, reportable) ThreadMetrics threadMetrics[] = 0; - attribute(readonly, reportable) int64u currentHeapFree = 1; - attribute(readonly, reportable) int64u currentHeapUsed = 2; - attribute(readonly, reportable) int64u currentHeapHighWatermark = 3; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) ThreadMetrics threadMetrics[] = 0; + attribute(readonly) int64u currentHeapFree = 1; + attribute(readonly) int64u currentHeapUsed = 2; + attribute(readonly) int64u currentHeapHighWatermark = 3; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster Switch = 59 { @@ -676,11 +676,11 @@ server cluster Switch = 59 { INT8U totalNumberOfPressesCounted = 1; } - attribute(readonly, reportable) int8u numberOfPositions = 0; - attribute(readonly, reportable) int8u currentPosition = 1; - attribute(readonly, reportable) int8u multiPressMax = 2; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u numberOfPositions = 0; + attribute(readonly) int8u currentPosition = 1; + attribute(readonly) int8u multiPressMax = 2; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster ThreadNetworkDiagnostics = 53 { @@ -760,76 +760,76 @@ server cluster ThreadNetworkDiagnostics = 53 { ThreadConnectionStatus connectionStatus = 0; } - attribute(readonly, reportable) int16u channel = 0; - attribute(readonly, reportable) enum8 routingRole = 1; - attribute(readonly, reportable) octet_string networkName = 2; - attribute(readonly, reportable) int16u panId = 3; - attribute(readonly, reportable) int64u extendedPanId = 4; - attribute(readonly, reportable) octet_string meshLocalPrefix = 5; - attribute(readonly, reportable) int64u overrunCount = 6; - attribute(readonly, reportable) NeighborTable neighborTableList[] = 7; - attribute(readonly, reportable) RouteTable routeTableList[] = 8; - attribute(readonly, reportable) int32u partitionId = 9; - attribute(readonly, reportable) int8u weighting = 10; - attribute(readonly, reportable) int8u dataVersion = 11; - attribute(readonly, reportable) int8u stableDataVersion = 12; - attribute(readonly, reportable) int8u leaderRouterId = 13; - attribute(readonly, reportable) int16u detachedRoleCount = 14; - attribute(readonly, reportable) int16u childRoleCount = 15; - attribute(readonly, reportable) int16u routerRoleCount = 16; - attribute(readonly, reportable) int16u leaderRoleCount = 17; - attribute(readonly, reportable) int16u attachAttemptCount = 18; - attribute(readonly, reportable) int16u partitionIdChangeCount = 19; - attribute(readonly, reportable) int16u betterPartitionAttachAttemptCount = 20; - attribute(readonly, reportable) int16u parentChangeCount = 21; - attribute(readonly, reportable) int32u txTotalCount = 22; - attribute(readonly, reportable) int32u txUnicastCount = 23; - attribute(readonly, reportable) int32u txBroadcastCount = 24; - attribute(readonly, reportable) int32u txAckRequestedCount = 25; - attribute(readonly, reportable) int32u txAckedCount = 26; - attribute(readonly, reportable) int32u txNoAckRequestedCount = 27; - attribute(readonly, reportable) int32u txDataCount = 28; - attribute(readonly, reportable) int32u txDataPollCount = 29; - attribute(readonly, reportable) int32u txBeaconCount = 30; - attribute(readonly, reportable) int32u txBeaconRequestCount = 31; - attribute(readonly, reportable) int32u txOtherCount = 32; - attribute(readonly, reportable) int32u txRetryCount = 33; - attribute(readonly, reportable) int32u txDirectMaxRetryExpiryCount = 34; - attribute(readonly, reportable) int32u txIndirectMaxRetryExpiryCount = 35; - attribute(readonly, reportable) int32u txErrCcaCount = 36; - attribute(readonly, reportable) int32u txErrAbortCount = 37; - attribute(readonly, reportable) int32u txErrBusyChannelCount = 38; - attribute(readonly, reportable) int32u rxTotalCount = 39; - attribute(readonly, reportable) int32u rxUnicastCount = 40; - attribute(readonly, reportable) int32u rxBroadcastCount = 41; - attribute(readonly, reportable) int32u rxDataCount = 42; - attribute(readonly, reportable) int32u rxDataPollCount = 43; - attribute(readonly, reportable) int32u rxBeaconCount = 44; - attribute(readonly, reportable) int32u rxBeaconRequestCount = 45; - attribute(readonly, reportable) int32u rxOtherCount = 46; - attribute(readonly, reportable) int32u rxAddressFilteredCount = 47; - attribute(readonly, reportable) int32u rxDestAddrFilteredCount = 48; - attribute(readonly, reportable) int32u rxDuplicatedCount = 49; - attribute(readonly, reportable) int32u rxErrNoFrameCount = 50; - attribute(readonly, reportable) int32u rxErrUnknownNeighborCount = 51; - attribute(readonly, reportable) int32u rxErrInvalidSrcAddrCount = 52; - attribute(readonly, reportable) int32u rxErrSecCount = 53; - attribute(readonly, reportable) int32u rxErrFcsCount = 54; - attribute(readonly, reportable) int32u rxErrOtherCount = 55; - attribute(readonly, reportable) int64u activeTimestamp = 56; - attribute(readonly, reportable) int64u pendingTimestamp = 57; - attribute(readonly, reportable) int32u delay = 58; - attribute(readonly, reportable) SecurityPolicy securityPolicy[] = 59; - attribute(readonly, reportable) octet_string channelMask = 60; - attribute(readonly, reportable) OperationalDatasetComponents operationalDatasetComponents[] = 61; - attribute(readonly, reportable) NetworkFault activeNetworkFaultsList[] = 62; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u channel = 0; + attribute(readonly) enum8 routingRole = 1; + attribute(readonly) octet_string networkName = 2; + attribute(readonly) int16u panId = 3; + attribute(readonly) int64u extendedPanId = 4; + attribute(readonly) octet_string meshLocalPrefix = 5; + attribute(readonly) int64u overrunCount = 6; + attribute(readonly) NeighborTable neighborTableList[] = 7; + attribute(readonly) RouteTable routeTableList[] = 8; + attribute(readonly) int32u partitionId = 9; + attribute(readonly) int8u weighting = 10; + attribute(readonly) int8u dataVersion = 11; + attribute(readonly) int8u stableDataVersion = 12; + attribute(readonly) int8u leaderRouterId = 13; + attribute(readonly) int16u detachedRoleCount = 14; + attribute(readonly) int16u childRoleCount = 15; + attribute(readonly) int16u routerRoleCount = 16; + attribute(readonly) int16u leaderRoleCount = 17; + attribute(readonly) int16u attachAttemptCount = 18; + attribute(readonly) int16u partitionIdChangeCount = 19; + attribute(readonly) int16u betterPartitionAttachAttemptCount = 20; + attribute(readonly) int16u parentChangeCount = 21; + attribute(readonly) int32u txTotalCount = 22; + attribute(readonly) int32u txUnicastCount = 23; + attribute(readonly) int32u txBroadcastCount = 24; + attribute(readonly) int32u txAckRequestedCount = 25; + attribute(readonly) int32u txAckedCount = 26; + attribute(readonly) int32u txNoAckRequestedCount = 27; + attribute(readonly) int32u txDataCount = 28; + attribute(readonly) int32u txDataPollCount = 29; + attribute(readonly) int32u txBeaconCount = 30; + attribute(readonly) int32u txBeaconRequestCount = 31; + attribute(readonly) int32u txOtherCount = 32; + attribute(readonly) int32u txRetryCount = 33; + attribute(readonly) int32u txDirectMaxRetryExpiryCount = 34; + attribute(readonly) int32u txIndirectMaxRetryExpiryCount = 35; + attribute(readonly) int32u txErrCcaCount = 36; + attribute(readonly) int32u txErrAbortCount = 37; + attribute(readonly) int32u txErrBusyChannelCount = 38; + attribute(readonly) int32u rxTotalCount = 39; + attribute(readonly) int32u rxUnicastCount = 40; + attribute(readonly) int32u rxBroadcastCount = 41; + attribute(readonly) int32u rxDataCount = 42; + attribute(readonly) int32u rxDataPollCount = 43; + attribute(readonly) int32u rxBeaconCount = 44; + attribute(readonly) int32u rxBeaconRequestCount = 45; + attribute(readonly) int32u rxOtherCount = 46; + attribute(readonly) int32u rxAddressFilteredCount = 47; + attribute(readonly) int32u rxDestAddrFilteredCount = 48; + attribute(readonly) int32u rxDuplicatedCount = 49; + attribute(readonly) int32u rxErrNoFrameCount = 50; + attribute(readonly) int32u rxErrUnknownNeighborCount = 51; + attribute(readonly) int32u rxErrInvalidSrcAddrCount = 52; + attribute(readonly) int32u rxErrSecCount = 53; + attribute(readonly) int32u rxErrFcsCount = 54; + attribute(readonly) int32u rxErrOtherCount = 55; + attribute(readonly) int64u activeTimestamp = 56; + attribute(readonly) int64u pendingTimestamp = 57; + attribute(readonly) int32u delay = 58; + attribute(readonly) SecurityPolicy securityPolicy[] = 59; + attribute(readonly) octet_string channelMask = 60; + attribute(readonly) OperationalDatasetComponents operationalDatasetComponents[] = 61; + attribute(readonly) NetworkFault activeNetworkFaultsList[] = 62; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster UserLabel = 65 { - attribute(writable, reportable) LabelStruct labelList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) LabelStruct labelList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } server cluster WiFiNetworkDiagnostics = 54 { @@ -876,21 +876,21 @@ server cluster WiFiNetworkDiagnostics = 54 { WiFiConnectionStatus connectionStatus = 0; } - attribute(readonly, reportable) octet_string bssid = 0; - attribute(readonly, reportable) enum8 securityType = 1; - attribute(readonly, reportable) enum8 wiFiVersion = 2; - attribute(readonly, reportable) int16u channelNumber = 3; - attribute(readonly, reportable) int8s rssi = 4; - attribute(readonly, reportable) int32u beaconLostCount = 5; - attribute(readonly, reportable) int32u beaconRxCount = 6; - attribute(readonly, reportable) int32u packetMulticastRxCount = 7; - attribute(readonly, reportable) int32u packetMulticastTxCount = 8; - attribute(readonly, reportable) int32u packetUnicastRxCount = 9; - attribute(readonly, reportable) int32u packetUnicastTxCount = 10; - attribute(readonly, reportable) int64u currentMaxRate = 11; - attribute(readonly, reportable) int64u overrunCount = 12; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) octet_string bssid = 0; + attribute(readonly) enum8 securityType = 1; + attribute(readonly) enum8 wiFiVersion = 2; + attribute(readonly) int16u channelNumber = 3; + attribute(readonly) int8s rssi = 4; + attribute(readonly) int32u beaconLostCount = 5; + attribute(readonly) int32u beaconRxCount = 6; + attribute(readonly) int32u packetMulticastRxCount = 7; + attribute(readonly) int32u packetMulticastTxCount = 8; + attribute(readonly) int32u packetUnicastRxCount = 9; + attribute(readonly) int32u packetUnicastTxCount = 10; + attribute(readonly) int64u currentMaxRate = 11; + attribute(readonly) int64u overrunCount = 12; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } diff --git a/examples/common/tracing/TraceHandlers.cpp b/examples/common/tracing/TraceHandlers.cpp index 5842b3dc87305a..fb131dd6d46fab 100644 --- a/examples/common/tracing/TraceHandlers.cpp +++ b/examples/common/tracing/TraceHandlers.cpp @@ -24,8 +24,13 @@ #include "pw_trace/trace.h" #include "pw_trace_chip/trace_chip.h" #include "transport/TraceMessage.h" +#include +#include #include +// For `s` std::string literal suffix +using namespace std::string_literals; + namespace chip { namespace trace { @@ -50,21 +55,30 @@ class TraceOutput void DeleteStream() { SetStream(nullptr); } - void Stream(const std::string & tag, const std::string & data) + void StartEvent(const std::string & label) + { + std::lock_guard guard(mLock); + if (mStream) + { + mStream->StartEvent(label); + } + } + + void AddField(const std::string & tag, const std::string & data) { std::lock_guard guard(mLock); if (mStream) { - mStream->Stream(tag, data); + mStream->AddField(tag, data); } } - void Handler(const std::string & label) + void FinishEvent() { std::lock_guard guard(mLock); if (mStream) { - mStream->Handler(label); + mStream->FinishEvent(); } } @@ -73,42 +87,228 @@ class TraceOutput TraceStream * mStream = nullptr; }; -TraceOutput output; +struct TraceHandlerContext +{ + TraceOutput * sink; +}; + +TraceOutput gTraceOutput; +TraceHandlerContext gTraceHandlerContext = { .sink = &gTraceOutput }; -// TODO: Framework this into a registry of handlers for different message types. -bool TraceDefaultHandler(const TraceEventFields & trace) +std::string AsJsonKey(const std::string & key, const std::string & value, bool prepend_comma) +{ + return (prepend_comma ? ", "s : ""s) + "\""s + key + "\": " + value; +} + +std::string AsFirstJsonKey(const std::string & key, const std::string & value) +{ + return AsJsonKey(key, value, /* prepend_comma = */ false); +} + +std::string AsNextJsonKey(const std::string & key, const std::string & value) +{ + return AsJsonKey(key, value, /* prepend_comma = */ true); +} + +std::string AsJsonString(const std::string & value) +{ + return "\""s + value + "\""s; +} + +std::string AsJsonString(const Transport::PeerAddress * peerAddress) +{ + char convBuf[Transport::PeerAddress::kMaxToStringSize] = { 0 }; + + peerAddress->ToString(convBuf); + return AsJsonString(convBuf); +} + +std::string AsJsonBool(bool isTrue) +{ + return isTrue ? "true"s : "false"s; +} + +std::string AsJsonHexString(const uint8_t * buf, size_t bufLen) +{ + // Fill a string long enough for the hex conversion, that will be overwritten + std::string hexBuf(2 * bufLen, '0'); + + CHIP_ERROR status = Encoding::BytesToLowercaseHexBuffer(buf, bufLen, hexBuf.data(), hexBuf.size()); + + // Static conditions exist that should ensure never failing. Catch failure in an assert. + VerifyOrDie(status == CHIP_NO_ERROR); + + return AsJsonString(hexBuf); +} + +std::string PacketHeaderToJson(const PacketHeader * packetHeader) +{ + std::string jsonBody; + + uint32_t messageCounter = packetHeader->GetMessageCounter(); + jsonBody += AsFirstJsonKey("msg_counter", std::to_string(messageCounter)); + + const Optional & sourceNodeId = packetHeader->GetSourceNodeId(); + if (sourceNodeId.HasValue()) + { + jsonBody += AsNextJsonKey("source_node_id", std::to_string(sourceNodeId.Value())); + } + + uint16_t sessionId = packetHeader->GetSessionId(); + const Optional & groupId = packetHeader->GetDestinationGroupId(); + const Optional & destNodeId = packetHeader->GetDestinationNodeId(); + if (packetHeader->IsValidGroupMsg()) + { + if (groupId.HasValue()) + { + jsonBody += AsNextJsonKey("group_id", std::to_string(groupId.Value())); + } + + jsonBody += AsNextJsonKey("group_key_hash", std::to_string(sessionId)); + } + else if (destNodeId.HasValue()) + { + jsonBody += AsNextJsonKey("dest_node_id", std::to_string(destNodeId.Value())); + } + + jsonBody += AsNextJsonKey("session_id", std::to_string(sessionId)); + + uint8_t messageFlags = packetHeader->GetMessageFlags(); + jsonBody += AsNextJsonKey("msg_flags", std::to_string(messageFlags)); + + uint8_t securityFlags = packetHeader->GetSecurityFlags(); + jsonBody += AsNextJsonKey("security_flags", std::to_string(securityFlags)); + + return jsonBody; +} + +std::string PayloadHeaderToJson(const PayloadHeader * payloadHeader) +{ + + std::string jsonBody; + + uint8_t exchangeFlags = payloadHeader->GetExhangeFlags(); + jsonBody += AsFirstJsonKey("exchange_flags", std::to_string(exchangeFlags)); + + uint16_t exchangeId = payloadHeader->GetExchangeID(); + jsonBody += AsNextJsonKey("exchange_id", std::to_string(exchangeId)); + + uint32_t protocolId = payloadHeader->GetProtocolID().ToFullyQualifiedSpecForm(); + jsonBody += AsNextJsonKey("protocol_id", std::to_string(protocolId)); + + uint8_t protocolOpcode = payloadHeader->GetMessageType(); + jsonBody += AsNextJsonKey("protocol_opcode", std::to_string(protocolOpcode)); + + bool isInitiator = payloadHeader->IsInitiator(); + jsonBody += AsNextJsonKey("is_initiator", AsJsonBool(isInitiator)); + + bool needsAck = payloadHeader->NeedsAck(); + jsonBody += AsNextJsonKey("is_ack_requested", AsJsonBool(needsAck)); + + const Optional & acknowledgedMessageCounter = payloadHeader->GetAckMessageCounter(); + if (acknowledgedMessageCounter.HasValue()) + { + jsonBody += AsNextJsonKey("acknowledged_msg_counter", std::to_string(acknowledgedMessageCounter.Value())); + } + + return jsonBody; +} + +bool SecureMessageSentHandler(const TraceEventFields & eventFields, TraceHandlerContext * context) +{ + if (eventFields.dataSize != sizeof(TraceSecureMessageSentData)) + { + return false; + } + + const auto * eventData = reinterpret_cast(eventFields.dataBuffer); + std::string jsonBody = "{"; + jsonBody += PacketHeaderToJson(eventData->packetHeader); + jsonBody += ", "; + jsonBody += PayloadHeaderToJson(eventData->payloadHeader); + jsonBody += ", "; + jsonBody += AsFirstJsonKey("payload_size", std::to_string(eventData->packetSize)); + jsonBody += ", "; + jsonBody += AsFirstJsonKey("payload_hex", AsJsonHexString(eventData->packetPayload, eventData->packetSize)); + jsonBody += "}"; + + TraceOutput * sink = context->sink; + sink->StartEvent(std::string{ kTraceMessageEvent } + "." + kTraceMessageSentDataFormat); + sink->AddField("json", jsonBody); + sink->FinishEvent(); + + return true; +} + +bool SecureMessageReceivedHandler(const TraceEventFields & eventFields, TraceHandlerContext * context) { - if (strcmp(trace.dataFormat, kTraceSecureMessageDataFormat) != 0 || trace.dataSize != sizeof(TraceSecureMessageData)) + if (eventFields.dataSize != sizeof(TraceSecureMessageReceivedData)) { return false; } - const TraceSecureMessageData * msg = reinterpret_cast(trace.dataBuffer); - output.Handler("Default"); - output.Stream("ExchangeId", std::to_string(msg->payloadHeader->GetExchangeID())); - output.Stream("MsgType", std::to_string(msg->payloadHeader->GetMessageType())); - output.Stream("MessageCounter", std::to_string(msg->packetHeader->GetMessageCounter())); - output.Stream("PacketSize", std::to_string(msg->packetSize)); + const auto * eventData = reinterpret_cast(eventFields.dataBuffer); + + std::string jsonBody = "{"; + jsonBody += AsFirstJsonKey("peer_address", AsJsonString(eventData->peerAddress)); + jsonBody += ", "; + jsonBody += PacketHeaderToJson(eventData->packetHeader); + jsonBody += ", "; + jsonBody += PayloadHeaderToJson(eventData->payloadHeader); + jsonBody += ", "; + jsonBody += AsFirstJsonKey("payload_size", std::to_string(eventData->packetSize)); + jsonBody += ", "; + jsonBody += AsFirstJsonKey("payload_hex", AsJsonHexString(eventData->packetPayload, eventData->packetSize)); + jsonBody += "}"; + + TraceOutput * sink = context->sink; + sink->StartEvent(std::string{ kTraceMessageEvent } + "." + kTraceMessageReceivedDataFormat); + sink->AddField("json", jsonBody); + sink->FinishEvent(); + + // Note that `eventData->session` is currently ignored. return true; } +// TODO: Framework this into a registry of handlers for different message types. +bool TraceDefaultHandler(const TraceEventFields & eventFields, void * context) +{ + TraceHandlerContext * ourContext = reinterpret_cast(context); + if (ourContext == nullptr) + { + return false; + } + + if (std::string{ eventFields.dataFormat } == kTraceMessageSentDataFormat) + { + return SecureMessageSentHandler(eventFields, ourContext); + } + else if (std::string{ eventFields.dataFormat } == kTraceMessageReceivedDataFormat) + { + return SecureMessageReceivedHandler(eventFields, ourContext); + } + + return false; +} + } // namespace void SetTraceStream(TraceStream * stream) { - output.SetStream(stream); + gTraceOutput.SetStream(stream); } void InitTrace() { - RegisterTraceHandler(TraceDefaultHandler); + void * context = &gTraceHandlerContext; + RegisterTraceHandler(TraceDefaultHandler, context); } void DeInitTrace() { UnregisterAllTraceHandlers(); - output.DeleteStream(); + gTraceOutput.DeleteStream(); } } // namespace trace diff --git a/examples/common/tracing/TraceHandlers.h b/examples/common/tracing/TraceHandlers.h index 434f253b62a014..fb60e3e4db316d 100644 --- a/examples/common/tracing/TraceHandlers.h +++ b/examples/common/tracing/TraceHandlers.h @@ -28,19 +28,32 @@ namespace trace { class TraceStream { public: - virtual ~TraceStream() = default; - virtual void Stream(const std::string & tag, const std::string & data) = 0; - virtual void Handler(const std::string & label) = 0; + virtual ~TraceStream() = default; + virtual void StartEvent(const std::string & label) = 0; + virtual void AddField(const std::string & tag, const std::string & data) = 0; + virtual void FinishEvent() = 0; }; class TraceStreamLog : public TraceStream { public: - void Stream(const std::string & tag, const std::string & data) override + void StartEvent(const std::string & label) override { - ChipLogAutomation(" %s: %s", tag.data(), data.data()); + mStreamLine = ">>>" + label + "<<<\t"; + mIsFirstField = true; } - void Handler(const std::string & label) override { ChipLogAutomation("%s", label.data()); } + + void AddField(const std::string & tag, const std::string & data) override + { + mStreamLine += (mIsFirstField ? "" : "\t") + tag + "|" + data; + mIsFirstField = false; + } + + void FinishEvent() override { ChipLogAutomation("TraceStream:%s", mStreamLine.c_str()); } + +protected: + std::string mStreamLine; + bool mIsFirstField = true; }; class TraceStreamFile : public TraceStream @@ -49,25 +62,28 @@ class TraceStreamFile : public TraceStream TraceStreamFile(const char * fileName) { mFile.open(fileName); } ~TraceStreamFile() { mFile.close(); } - void Stream(const std::string & tag, const std::string & data) override + void AddField(const std::string & tag, const std::string & data) override { if (mFile.is_open()) { - mFile << " " << tag.data() << ": " << data.data() << "\n"; + mFile << " " << tag.data() << "\t" << data.data() << "\n"; mFile.flush(); } } - void Handler(const std::string & label) override + + void StartEvent(const std::string & label) override { if (mFile.is_open()) { struct timeval tv; gettimeofday(&tv, nullptr); - mFile << label << " [" << tv.tv_sec << "." << tv.tv_usec << "]\n"; + mFile << "\f[" << tv.tv_sec << "." << tv.tv_usec << "]\t" << label << "\n"; mFile.flush(); } } + void FinishEvent() override {} + private: std::ofstream mFile; }; diff --git a/examples/door-lock-app/door-lock-common/door-lock-app.matter b/examples/door-lock-app/door-lock-common/door-lock-app.matter index dc8dc6fc8c4c2a..16b9b8c2c6ae9c 100644 --- a/examples/door-lock-app/door-lock-common/door-lock-app.matter +++ b/examples/door-lock-app/door-lock-common/door-lock-app.matter @@ -19,10 +19,10 @@ server cluster AdministratorCommissioning = 60 { kWindowNotOpen = 3; } - attribute(readonly, reportable) int8u windowStatus = 0; - attribute(readonly, reportable) fabric_idx adminFabricIndex = 1; - attribute(readonly, reportable) int16u adminVendorId = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u windowStatus = 0; + attribute(readonly) fabric_idx adminFabricIndex = 1; + attribute(readonly) int16u adminVendorId = 2; + attribute(readonly) int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -57,18 +57,18 @@ server cluster Basic = 40 { boolean reachableNewValue = 0; } - attribute(readonly, reportable) int16u interactionModelVersion = 0; - attribute(readonly, reportable) char_string vendorName = 1; - attribute(readonly, reportable) vendor_id vendorID = 2; - attribute(readonly, reportable) char_string productName = 3; - attribute(readonly, reportable) int16u productID = 4; - attribute(writable, reportable) char_string nodeLabel = 5; - attribute(writable, reportable) char_string location = 6; - attribute(readonly, reportable) int16u hardwareVersion = 7; - attribute(readonly, reportable) char_string hardwareVersionString = 8; - attribute(readonly, reportable) int32u softwareVersion = 9; - attribute(readonly, reportable) char_string softwareVersionString = 10; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u interactionModelVersion = 0; + attribute(readonly) char_string vendorName = 1; + attribute(readonly) vendor_id vendorID = 2; + attribute(readonly) char_string productName = 3; + attribute(readonly) int16u productID = 4; + attribute(writable) char_string nodeLabel = 5; + attribute(writable) char_string location = 6; + attribute(readonly) int16u hardwareVersion = 7; + attribute(readonly) char_string hardwareVersionString = 8; + attribute(readonly) int32u softwareVersion = 9; + attribute(readonly) char_string softwareVersionString = 10; + attribute(readonly) int16u clusterRevision = 65533; } server cluster Descriptor = 29 { @@ -77,11 +77,11 @@ server cluster Descriptor = 29 { INT16U revision = 2; } - attribute(readonly, reportable) DeviceType deviceList[] = 0; - attribute(readonly, reportable) CLUSTER_ID serverList[] = 1; - attribute(readonly, reportable) CLUSTER_ID clientList[] = 2; - attribute(readonly, reportable) ENDPOINT_NO partsList[] = 3; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) DeviceType deviceList[] = 0; + attribute(readonly) CLUSTER_ID serverList[] = 1; + attribute(readonly) CLUSTER_ID clientList[] = 2; + attribute(readonly) ENDPOINT_NO partsList[] = 3; + attribute(readonly) int16u clusterRevision = 65533; } server cluster DiagnosticLogs = 50 { @@ -350,25 +350,25 @@ server cluster DoorLock = 257 { nullable INT16U dataIndex = 6; } - attribute(readonly, reportable) DlLockState lockState = 0; - attribute(readonly, reportable) DlLockType lockType = 1; - attribute(readonly, reportable) boolean actuatorEnabled = 2; - attribute(readonly, reportable) DlDoorState doorState = 3; - attribute(readonly, reportable) int16u numberOfTotalUsersSupported = 17; - attribute(readonly, reportable) int16u numberOfPINUsersSupported = 18; - attribute(readonly, reportable) int8u maxPINCodeLength = 23; - attribute(readonly, reportable) int8u minPINCodeLength = 24; - attribute(readonly, reportable) bitmap8 credentialRulesSupport = 27; - attribute(writable, reportable) char_string language = 33; - attribute(writable, reportable) int32u autoRelockTime = 35; - attribute(writable, reportable) int8u soundVolume = 36; - attribute(writable, reportable) DlOperatingMode operatingMode = 37; - attribute(readonly, reportable) bitmap16 supportedOperatingModes = 38; - attribute(writable, reportable) boolean enableOneTouchLocking = 41; - attribute(writable, reportable) boolean enablePrivacyModeButton = 43; - attribute(writable, reportable) int8u wrongCodeEntryLimit = 48; - attribute(writable, reportable) int8u userCodeTemporaryDisableTime = 49; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) DlLockState lockState = 0; + attribute(readonly) DlLockType lockType = 1; + attribute(readonly) boolean actuatorEnabled = 2; + attribute(readonly) DlDoorState doorState = 3; + attribute(readonly) int16u numberOfTotalUsersSupported = 17; + attribute(readonly) int16u numberOfPINUsersSupported = 18; + attribute(readonly) int8u maxPINCodeLength = 23; + attribute(readonly) int8u minPINCodeLength = 24; + attribute(readonly) bitmap8 credentialRulesSupport = 27; + attribute(writable) char_string language = 33; + attribute(writable) int32u autoRelockTime = 35; + attribute(writable) int8u soundVolume = 36; + attribute(writable) DlOperatingMode operatingMode = 37; + attribute(readonly) bitmap16 supportedOperatingModes = 38; + attribute(writable) boolean enableOneTouchLocking = 41; + attribute(writable) boolean enablePrivacyModeButton = 43; + attribute(writable) int8u wrongCodeEntryLimit = 48; + attribute(writable) int8u userCodeTemporaryDisableTime = 49; + attribute(readonly) int16u clusterRevision = 65533; request struct ClearCredentialRequest { DlCredential credential = 0; @@ -461,22 +461,22 @@ server cluster EthernetNetworkDiagnostics = 55 { k400g = 9; } - attribute(readonly, reportable) enum8 PHYRate = 0; - attribute(readonly, reportable) boolean fullDuplex = 1; - attribute(readonly, reportable) int64u packetRxCount = 2; - attribute(readonly, reportable) int64u packetTxCount = 3; - attribute(readonly, reportable) int64u txErrCount = 4; - attribute(readonly, reportable) int64u collisionCount = 5; - attribute(readonly, reportable) int64u overrunCount = 6; - attribute(readonly, reportable) boolean carrierDetect = 7; - attribute(readonly, reportable) int64u timeSinceReset = 8; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) enum8 PHYRate = 0; + attribute(readonly) boolean fullDuplex = 1; + attribute(readonly) int64u packetRxCount = 2; + attribute(readonly) int64u packetTxCount = 3; + attribute(readonly) int64u txErrCount = 4; + attribute(readonly) int64u collisionCount = 5; + attribute(readonly) int64u overrunCount = 6; + attribute(readonly) boolean carrierDetect = 7; + attribute(readonly) int64u timeSinceReset = 8; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster FixedLabel = 64 { - attribute(readonly, reportable) LabelStruct labelList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) LabelStruct labelList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -497,12 +497,12 @@ server cluster GeneralCommissioning = 48 { INT32U failSafeExpiryLengthMs = 1; } - attribute(writable, reportable) int64u breadcrumb = 0; - attribute(readonly, reportable) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; - attribute(readonly, reportable) enum8 regulatoryConfig = 2; - attribute(readonly, reportable) enum8 locationCapability = 3; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) int64u breadcrumb = 0; + attribute(readonly) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; + attribute(readonly) enum8 regulatoryConfig = 2; + attribute(readonly) enum8 locationCapability = 3; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -615,20 +615,20 @@ server cluster GeneralDiagnostics = 51 { BootReasonType bootReason = 0; } - attribute(readonly, reportable) NetworkInterfaceType networkInterfaces[] = 0; - attribute(readonly, reportable) int16u rebootCount = 1; - attribute(readonly, reportable) int64u upTime = 2; - attribute(readonly, reportable) int32u totalOperationalHours = 3; - attribute(readonly, reportable) enum8 bootReasons = 4; - attribute(readonly, reportable) ENUM8 activeHardwareFaults[] = 5; - attribute(readonly, reportable) ENUM8 activeRadioFaults[] = 6; - attribute(readonly, reportable) ENUM8 activeNetworkFaults[] = 7; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) NetworkInterfaceType networkInterfaces[] = 0; + attribute(readonly) int16u rebootCount = 1; + attribute(readonly) int64u upTime = 2; + attribute(readonly) int32u totalOperationalHours = 3; + attribute(readonly) enum8 bootReasons = 4; + attribute(readonly) ENUM8 activeHardwareFaults[] = 5; + attribute(readonly) ENUM8 activeRadioFaults[] = 6; + attribute(readonly) ENUM8 activeNetworkFaults[] = 7; + attribute(readonly) int16u clusterRevision = 65533; } server cluster LocalizationConfiguration = 43 { - attribute(writable, reportable) char_string activeLocale = 1; - attribute(readonly, reportable) CHAR_STRING supportedLocales[] = 2; + attribute(writable) char_string activeLocale = 1; + attribute(readonly) CHAR_STRING supportedLocales[] = 2; } server cluster NetworkCommissioning = 49 { @@ -681,16 +681,16 @@ server cluster NetworkCommissioning = 49 { INT8U lqi = 8; } - attribute(readonly, reportable) int8u maxNetworks = 0; - attribute(readonly, reportable) NetworkInfo networks[] = 1; - attribute(readonly, reportable) int8u scanMaxTimeSeconds = 2; - attribute(readonly, reportable) int8u connectMaxTimeSeconds = 3; - attribute(writable, reportable) boolean interfaceEnabled = 4; - attribute(readonly, reportable) NetworkCommissioningStatus lastNetworkingStatus = 5; - attribute(readonly, reportable) octet_string lastNetworkID = 6; - attribute(readonly, reportable) int32u lastConnectErrorValue = 7; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u maxNetworks = 0; + attribute(readonly) NetworkInfo networks[] = 1; + attribute(readonly) int8u scanMaxTimeSeconds = 2; + attribute(readonly) int8u connectMaxTimeSeconds = 3; + attribute(writable) boolean interfaceEnabled = 4; + attribute(readonly) NetworkCommissioningStatus lastNetworkingStatus = 5; + attribute(readonly) octet_string lastNetworkID = 6; + attribute(readonly) int32u lastConnectErrorValue = 7; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -773,12 +773,12 @@ server cluster OperationalCredentials = 62 { CHAR_STRING label = 6; } - attribute(readonly, reportable) FabricDescriptor fabricsList[] = 1; - attribute(readonly, reportable) int8u supportedFabrics = 2; - attribute(readonly, reportable) int8u commissionedFabrics = 3; - attribute(readonly, reportable) OCTET_STRING trustedRootCertificates[] = 4; - attribute(readonly, reportable) fabric_idx currentFabricIndex = 5; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) FabricDescriptor fabricsList[] = 1; + attribute(readonly) int8u supportedFabrics = 2; + attribute(readonly) int8u commissionedFabrics = 3; + attribute(readonly) OCTET_STRING trustedRootCertificates[] = 4; + attribute(readonly) fabric_idx currentFabricIndex = 5; + attribute(readonly) int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -853,21 +853,21 @@ server cluster OperationalCredentials = 62 { } server cluster PowerSource = 47 { - attribute(readonly, reportable) enum8 status = 0; - attribute(readonly, reportable) int8u order = 1; - attribute(readonly, reportable) char_string description = 2; - attribute(readonly, reportable) int32u wiredAssessedCurrent = 6; - attribute(readonly, reportable) enum8 batteryChargeLevel = 14; - attribute(readonly, reportable) boolean batteryReplacementNeeded = 15; - attribute(readonly, reportable) enum8 batteryReplaceability = 16; - attribute(readonly, reportable) char_string batteryReplacementDescription = 19; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) enum8 status = 0; + attribute(readonly) int8u order = 1; + attribute(readonly) char_string description = 2; + attribute(readonly) int32u wiredAssessedCurrent = 6; + attribute(readonly) enum8 batteryChargeLevel = 14; + attribute(readonly) boolean batteryReplacementNeeded = 15; + attribute(readonly) enum8 batteryReplaceability = 16; + attribute(readonly) char_string batteryReplacementDescription = 19; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster PowerSourceConfiguration = 46 { - attribute(readonly, reportable) INT8U sources[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) INT8U sources[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } server cluster SoftwareDiagnostics = 52 { @@ -883,12 +883,12 @@ server cluster SoftwareDiagnostics = 52 { SoftwareFault softwareFault = 0; } - attribute(readonly, reportable) ThreadMetrics threadMetrics[] = 0; - attribute(readonly, reportable) int64u currentHeapFree = 1; - attribute(readonly, reportable) int64u currentHeapUsed = 2; - attribute(readonly, reportable) int64u currentHeapHighWatermark = 3; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) ThreadMetrics threadMetrics[] = 0; + attribute(readonly) int64u currentHeapFree = 1; + attribute(readonly) int64u currentHeapUsed = 2; + attribute(readonly) int64u currentHeapHighWatermark = 3; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster ThreadNetworkDiagnostics = 53 { @@ -968,76 +968,76 @@ server cluster ThreadNetworkDiagnostics = 53 { ThreadConnectionStatus connectionStatus = 0; } - attribute(readonly, reportable) int16u channel = 0; - attribute(readonly, reportable) enum8 routingRole = 1; - attribute(readonly, reportable) octet_string networkName = 2; - attribute(readonly, reportable) int16u panId = 3; - attribute(readonly, reportable) int64u extendedPanId = 4; - attribute(readonly, reportable) octet_string meshLocalPrefix = 5; - attribute(readonly, reportable) int64u overrunCount = 6; - attribute(readonly, reportable) NeighborTable neighborTableList[] = 7; - attribute(readonly, reportable) RouteTable routeTableList[] = 8; - attribute(readonly, reportable) int32u partitionId = 9; - attribute(readonly, reportable) int8u weighting = 10; - attribute(readonly, reportable) int8u dataVersion = 11; - attribute(readonly, reportable) int8u stableDataVersion = 12; - attribute(readonly, reportable) int8u leaderRouterId = 13; - attribute(readonly, reportable) int16u detachedRoleCount = 14; - attribute(readonly, reportable) int16u childRoleCount = 15; - attribute(readonly, reportable) int16u routerRoleCount = 16; - attribute(readonly, reportable) int16u leaderRoleCount = 17; - attribute(readonly, reportable) int16u attachAttemptCount = 18; - attribute(readonly, reportable) int16u partitionIdChangeCount = 19; - attribute(readonly, reportable) int16u betterPartitionAttachAttemptCount = 20; - attribute(readonly, reportable) int16u parentChangeCount = 21; - attribute(readonly, reportable) int32u txTotalCount = 22; - attribute(readonly, reportable) int32u txUnicastCount = 23; - attribute(readonly, reportable) int32u txBroadcastCount = 24; - attribute(readonly, reportable) int32u txAckRequestedCount = 25; - attribute(readonly, reportable) int32u txAckedCount = 26; - attribute(readonly, reportable) int32u txNoAckRequestedCount = 27; - attribute(readonly, reportable) int32u txDataCount = 28; - attribute(readonly, reportable) int32u txDataPollCount = 29; - attribute(readonly, reportable) int32u txBeaconCount = 30; - attribute(readonly, reportable) int32u txBeaconRequestCount = 31; - attribute(readonly, reportable) int32u txOtherCount = 32; - attribute(readonly, reportable) int32u txRetryCount = 33; - attribute(readonly, reportable) int32u txDirectMaxRetryExpiryCount = 34; - attribute(readonly, reportable) int32u txIndirectMaxRetryExpiryCount = 35; - attribute(readonly, reportable) int32u txErrCcaCount = 36; - attribute(readonly, reportable) int32u txErrAbortCount = 37; - attribute(readonly, reportable) int32u txErrBusyChannelCount = 38; - attribute(readonly, reportable) int32u rxTotalCount = 39; - attribute(readonly, reportable) int32u rxUnicastCount = 40; - attribute(readonly, reportable) int32u rxBroadcastCount = 41; - attribute(readonly, reportable) int32u rxDataCount = 42; - attribute(readonly, reportable) int32u rxDataPollCount = 43; - attribute(readonly, reportable) int32u rxBeaconCount = 44; - attribute(readonly, reportable) int32u rxBeaconRequestCount = 45; - attribute(readonly, reportable) int32u rxOtherCount = 46; - attribute(readonly, reportable) int32u rxAddressFilteredCount = 47; - attribute(readonly, reportable) int32u rxDestAddrFilteredCount = 48; - attribute(readonly, reportable) int32u rxDuplicatedCount = 49; - attribute(readonly, reportable) int32u rxErrNoFrameCount = 50; - attribute(readonly, reportable) int32u rxErrUnknownNeighborCount = 51; - attribute(readonly, reportable) int32u rxErrInvalidSrcAddrCount = 52; - attribute(readonly, reportable) int32u rxErrSecCount = 53; - attribute(readonly, reportable) int32u rxErrFcsCount = 54; - attribute(readonly, reportable) int32u rxErrOtherCount = 55; - attribute(readonly, reportable) int64u activeTimestamp = 56; - attribute(readonly, reportable) int64u pendingTimestamp = 57; - attribute(readonly, reportable) int32u delay = 58; - attribute(readonly, reportable) SecurityPolicy securityPolicy[] = 59; - attribute(readonly, reportable) octet_string channelMask = 60; - attribute(readonly, reportable) OperationalDatasetComponents operationalDatasetComponents[] = 61; - attribute(readonly, reportable) NetworkFault activeNetworkFaultsList[] = 62; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u channel = 0; + attribute(readonly) enum8 routingRole = 1; + attribute(readonly) octet_string networkName = 2; + attribute(readonly) int16u panId = 3; + attribute(readonly) int64u extendedPanId = 4; + attribute(readonly) octet_string meshLocalPrefix = 5; + attribute(readonly) int64u overrunCount = 6; + attribute(readonly) NeighborTable neighborTableList[] = 7; + attribute(readonly) RouteTable routeTableList[] = 8; + attribute(readonly) int32u partitionId = 9; + attribute(readonly) int8u weighting = 10; + attribute(readonly) int8u dataVersion = 11; + attribute(readonly) int8u stableDataVersion = 12; + attribute(readonly) int8u leaderRouterId = 13; + attribute(readonly) int16u detachedRoleCount = 14; + attribute(readonly) int16u childRoleCount = 15; + attribute(readonly) int16u routerRoleCount = 16; + attribute(readonly) int16u leaderRoleCount = 17; + attribute(readonly) int16u attachAttemptCount = 18; + attribute(readonly) int16u partitionIdChangeCount = 19; + attribute(readonly) int16u betterPartitionAttachAttemptCount = 20; + attribute(readonly) int16u parentChangeCount = 21; + attribute(readonly) int32u txTotalCount = 22; + attribute(readonly) int32u txUnicastCount = 23; + attribute(readonly) int32u txBroadcastCount = 24; + attribute(readonly) int32u txAckRequestedCount = 25; + attribute(readonly) int32u txAckedCount = 26; + attribute(readonly) int32u txNoAckRequestedCount = 27; + attribute(readonly) int32u txDataCount = 28; + attribute(readonly) int32u txDataPollCount = 29; + attribute(readonly) int32u txBeaconCount = 30; + attribute(readonly) int32u txBeaconRequestCount = 31; + attribute(readonly) int32u txOtherCount = 32; + attribute(readonly) int32u txRetryCount = 33; + attribute(readonly) int32u txDirectMaxRetryExpiryCount = 34; + attribute(readonly) int32u txIndirectMaxRetryExpiryCount = 35; + attribute(readonly) int32u txErrCcaCount = 36; + attribute(readonly) int32u txErrAbortCount = 37; + attribute(readonly) int32u txErrBusyChannelCount = 38; + attribute(readonly) int32u rxTotalCount = 39; + attribute(readonly) int32u rxUnicastCount = 40; + attribute(readonly) int32u rxBroadcastCount = 41; + attribute(readonly) int32u rxDataCount = 42; + attribute(readonly) int32u rxDataPollCount = 43; + attribute(readonly) int32u rxBeaconCount = 44; + attribute(readonly) int32u rxBeaconRequestCount = 45; + attribute(readonly) int32u rxOtherCount = 46; + attribute(readonly) int32u rxAddressFilteredCount = 47; + attribute(readonly) int32u rxDestAddrFilteredCount = 48; + attribute(readonly) int32u rxDuplicatedCount = 49; + attribute(readonly) int32u rxErrNoFrameCount = 50; + attribute(readonly) int32u rxErrUnknownNeighborCount = 51; + attribute(readonly) int32u rxErrInvalidSrcAddrCount = 52; + attribute(readonly) int32u rxErrSecCount = 53; + attribute(readonly) int32u rxErrFcsCount = 54; + attribute(readonly) int32u rxErrOtherCount = 55; + attribute(readonly) int64u activeTimestamp = 56; + attribute(readonly) int64u pendingTimestamp = 57; + attribute(readonly) int32u delay = 58; + attribute(readonly) SecurityPolicy securityPolicy[] = 59; + attribute(readonly) octet_string channelMask = 60; + attribute(readonly) OperationalDatasetComponents operationalDatasetComponents[] = 61; + attribute(readonly) NetworkFault activeNetworkFaultsList[] = 62; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster UserLabel = 65 { - attribute(writable, reportable) LabelStruct labelList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) LabelStruct labelList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } server cluster WiFiNetworkDiagnostics = 54 { @@ -1084,21 +1084,21 @@ server cluster WiFiNetworkDiagnostics = 54 { WiFiConnectionStatus connectionStatus = 0; } - attribute(readonly, reportable) octet_string bssid = 0; - attribute(readonly, reportable) enum8 securityType = 1; - attribute(readonly, reportable) enum8 wiFiVersion = 2; - attribute(readonly, reportable) int16u channelNumber = 3; - attribute(readonly, reportable) int8s rssi = 4; - attribute(readonly, reportable) int32u beaconLostCount = 5; - attribute(readonly, reportable) int32u beaconRxCount = 6; - attribute(readonly, reportable) int32u packetMulticastRxCount = 7; - attribute(readonly, reportable) int32u packetMulticastTxCount = 8; - attribute(readonly, reportable) int32u packetUnicastRxCount = 9; - attribute(readonly, reportable) int32u packetUnicastTxCount = 10; - attribute(readonly, reportable) int64u currentMaxRate = 11; - attribute(readonly, reportable) int64u overrunCount = 12; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) octet_string bssid = 0; + attribute(readonly) enum8 securityType = 1; + attribute(readonly) enum8 wiFiVersion = 2; + attribute(readonly) int16u channelNumber = 3; + attribute(readonly) int8s rssi = 4; + attribute(readonly) int32u beaconLostCount = 5; + attribute(readonly) int32u beaconRxCount = 6; + attribute(readonly) int32u packetMulticastRxCount = 7; + attribute(readonly) int32u packetMulticastTxCount = 8; + attribute(readonly) int32u packetUnicastRxCount = 9; + attribute(readonly) int32u packetUnicastTxCount = 10; + attribute(readonly) int64u currentMaxRate = 11; + attribute(readonly) int64u overrunCount = 12; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index 33f5a3abd88192..256b639135c43c 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -19,10 +19,10 @@ server cluster AdministratorCommissioning = 60 { kWindowNotOpen = 3; } - attribute(readonly, reportable) int8u windowStatus = 0; - attribute(readonly, reportable) fabric_idx adminFabricIndex = 1; - attribute(readonly, reportable) int16u adminVendorId = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u windowStatus = 0; + attribute(readonly) fabric_idx adminFabricIndex = 1; + attribute(readonly) int16u adminVendorId = 2; + attribute(readonly) int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -57,26 +57,26 @@ server cluster Basic = 40 { boolean reachableNewValue = 0; } - attribute(readonly, reportable) int16u interactionModelVersion = 0; - attribute(readonly, reportable) char_string vendorName = 1; - attribute(readonly, reportable) vendor_id vendorID = 2; - attribute(readonly, reportable) char_string productName = 3; - attribute(readonly, reportable) int16u productID = 4; - attribute(writable, reportable) char_string nodeLabel = 5; - attribute(writable, reportable) char_string location = 6; - attribute(readonly, reportable) int16u hardwareVersion = 7; - attribute(readonly, reportable) char_string hardwareVersionString = 8; - attribute(readonly, reportable) int32u softwareVersion = 9; - attribute(readonly, reportable) char_string softwareVersionString = 10; - attribute(readonly, reportable) char_string manufacturingDate = 11; - attribute(readonly, reportable) char_string partNumber = 12; - attribute(readonly, reportable) long_char_string productURL = 13; - attribute(readonly, reportable) char_string productLabel = 14; - attribute(readonly, reportable) char_string serialNumber = 15; - attribute(writable, reportable) boolean localConfigDisabled = 16; - attribute(readonly, reportable) boolean reachable = 17; - attribute(readonly, reportable) char_string uniqueID = 18; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u interactionModelVersion = 0; + attribute(readonly) char_string vendorName = 1; + attribute(readonly) vendor_id vendorID = 2; + attribute(readonly) char_string productName = 3; + attribute(readonly) int16u productID = 4; + attribute(writable) char_string nodeLabel = 5; + attribute(writable) char_string location = 6; + attribute(readonly) int16u hardwareVersion = 7; + attribute(readonly) char_string hardwareVersionString = 8; + attribute(readonly) int32u softwareVersion = 9; + attribute(readonly) char_string softwareVersionString = 10; + attribute(readonly) char_string manufacturingDate = 11; + attribute(readonly) char_string partNumber = 12; + attribute(readonly) long_char_string productURL = 13; + attribute(readonly) char_string productLabel = 14; + attribute(readonly) char_string serialNumber = 15; + attribute(writable) boolean localConfigDisabled = 16; + attribute(readonly) boolean reachable = 17; + attribute(readonly) char_string uniqueID = 18; + attribute(readonly) int16u clusterRevision = 65533; } server cluster ColorControl = 768 { @@ -126,28 +126,28 @@ server cluster ColorControl = 768 { kDown = 3; } - attribute(readonly, reportable) int8u currentHue = 0; - attribute(readonly, reportable) int8u currentSaturation = 1; - attribute(readonly, reportable) int16u remainingTime = 2; - attribute(readonly, reportable) int16u currentX = 3; - attribute(readonly, reportable) int16u currentY = 4; - attribute(readonly, reportable) int16u colorTemperature = 7; - attribute(readonly, reportable) enum8 colorMode = 8; - attribute(writable, reportable) bitmap8 colorControlOptions = 15; - attribute(readonly, reportable) int8u numberOfPrimaries = 16; - attribute(readonly, reportable) int16u enhancedCurrentHue = 16384; - attribute(readonly, reportable) enum8 enhancedColorMode = 16385; - attribute(readonly, reportable) int8u colorLoopActive = 16386; - attribute(readonly, reportable) int8u colorLoopDirection = 16387; - attribute(readonly, reportable) int16u colorLoopTime = 16388; - attribute(readonly, reportable) int16u colorLoopStartEnhancedHue = 16389; - attribute(readonly, reportable) int16u colorLoopStoredEnhancedHue = 16390; - attribute(readonly, reportable) bitmap16 colorCapabilities = 16394; - attribute(readonly, reportable) int16u colorTempPhysicalMin = 16395; - attribute(readonly, reportable) int16u colorTempPhysicalMax = 16396; - attribute(readonly, reportable) int16u coupleColorTempToLevelMinMireds = 16397; - attribute(writable, reportable) int16u startUpColorTemperatureMireds = 16400; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u currentHue = 0; + attribute(readonly) int8u currentSaturation = 1; + attribute(readonly) int16u remainingTime = 2; + attribute(readonly) int16u currentX = 3; + attribute(readonly) int16u currentY = 4; + attribute(readonly) int16u colorTemperature = 7; + attribute(readonly) enum8 colorMode = 8; + attribute(writable) bitmap8 colorControlOptions = 15; + attribute(readonly) int8u numberOfPrimaries = 16; + attribute(readonly) int16u enhancedCurrentHue = 16384; + attribute(readonly) enum8 enhancedColorMode = 16385; + attribute(readonly) int8u colorLoopActive = 16386; + attribute(readonly) int8u colorLoopDirection = 16387; + attribute(readonly) int16u colorLoopTime = 16388; + attribute(readonly) int16u colorLoopStartEnhancedHue = 16389; + attribute(readonly) int16u colorLoopStoredEnhancedHue = 16390; + attribute(readonly) bitmap16 colorCapabilities = 16394; + attribute(readonly) int16u colorTempPhysicalMin = 16395; + attribute(readonly) int16u colorTempPhysicalMax = 16396; + attribute(readonly) int16u coupleColorTempToLevelMinMireds = 16397; + attribute(writable) int16u startUpColorTemperatureMireds = 16400; + attribute(readonly) int16u clusterRevision = 65533; request struct ColorLoopSetRequest { ColorLoopUpdateFlags updateFlags = 0; @@ -324,11 +324,11 @@ server cluster Descriptor = 29 { INT16U revision = 2; } - attribute(readonly, reportable) DeviceType deviceList[] = 0; - attribute(readonly, reportable) CLUSTER_ID serverList[] = 1; - attribute(readonly, reportable) CLUSTER_ID clientList[] = 2; - attribute(readonly, reportable) ENDPOINT_NO partsList[] = 3; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) DeviceType deviceList[] = 0; + attribute(readonly) CLUSTER_ID serverList[] = 1; + attribute(readonly) CLUSTER_ID clientList[] = 2; + attribute(readonly) ENDPOINT_NO partsList[] = 3; + attribute(readonly) int16u clusterRevision = 65533; } server cluster DiagnosticLogs = 50 { @@ -375,24 +375,24 @@ server cluster EthernetNetworkDiagnostics = 55 { k400g = 9; } - attribute(readonly, reportable) enum8 PHYRate = 0; - attribute(readonly, reportable) boolean fullDuplex = 1; - attribute(readonly, reportable) int64u packetRxCount = 2; - attribute(readonly, reportable) int64u packetTxCount = 3; - attribute(readonly, reportable) int64u txErrCount = 4; - attribute(readonly, reportable) int64u collisionCount = 5; - attribute(readonly, reportable) int64u overrunCount = 6; - attribute(readonly, reportable) boolean carrierDetect = 7; - attribute(readonly, reportable) int64u timeSinceReset = 8; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) enum8 PHYRate = 0; + attribute(readonly) boolean fullDuplex = 1; + attribute(readonly) int64u packetRxCount = 2; + attribute(readonly) int64u packetTxCount = 3; + attribute(readonly) int64u txErrCount = 4; + attribute(readonly) int64u collisionCount = 5; + attribute(readonly) int64u overrunCount = 6; + attribute(readonly) boolean carrierDetect = 7; + attribute(readonly) int64u timeSinceReset = 8; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; command ResetCounts(): DefaultSuccess = 0; } server cluster FixedLabel = 64 { - attribute(readonly, reportable) LabelStruct labelList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) LabelStruct labelList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -413,12 +413,12 @@ server cluster GeneralCommissioning = 48 { INT32U failSafeExpiryLengthMs = 1; } - attribute(writable, reportable) int64u breadcrumb = 0; - attribute(readonly, reportable) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; - attribute(readonly, reportable) enum8 regulatoryConfig = 2; - attribute(readonly, reportable) enum8 locationCapability = 3; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) int64u breadcrumb = 0; + attribute(readonly) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; + attribute(readonly) enum8 regulatoryConfig = 2; + attribute(readonly) enum8 locationCapability = 3; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -531,15 +531,15 @@ server cluster GeneralDiagnostics = 51 { BootReasonType bootReason = 0; } - attribute(readonly, reportable) NetworkInterfaceType networkInterfaces[] = 0; - attribute(readonly, reportable) int16u rebootCount = 1; - attribute(readonly, reportable) int64u upTime = 2; - attribute(readonly, reportable) int32u totalOperationalHours = 3; - attribute(readonly, reportable) enum8 bootReasons = 4; - attribute(readonly, reportable) ENUM8 activeHardwareFaults[] = 5; - attribute(readonly, reportable) ENUM8 activeRadioFaults[] = 6; - attribute(readonly, reportable) ENUM8 activeNetworkFaults[] = 7; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) NetworkInterfaceType networkInterfaces[] = 0; + attribute(readonly) int16u rebootCount = 1; + attribute(readonly) int64u upTime = 2; + attribute(readonly) int32u totalOperationalHours = 3; + attribute(readonly) enum8 bootReasons = 4; + attribute(readonly) ENUM8 activeHardwareFaults[] = 5; + attribute(readonly) ENUM8 activeRadioFaults[] = 6; + attribute(readonly) ENUM8 activeNetworkFaults[] = 7; + attribute(readonly) int16u clusterRevision = 65533; } server cluster Identify = 3 { @@ -565,9 +565,9 @@ server cluster Identify = 3 { kActuator = 5; } - attribute(writable, reportable) int16u identifyTime = 0; - attribute(readonly, reportable) enum8 identifyType = 1; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) int16u identifyTime = 0; + attribute(readonly) enum8 identifyType = 1; + attribute(readonly) int16u clusterRevision = 65533; request struct IdentifyRequest { INT16U identifyTime = 0; @@ -598,22 +598,22 @@ server cluster LevelControl = 8 { kDown = 1; } - attribute(readonly, reportable) int8u currentLevel = 0; - attribute(readonly, reportable) int16u remainingTime = 1; - attribute(readonly, reportable) int8u minLevel = 2; - attribute(readonly, reportable) int8u maxLevel = 3; - attribute(readonly, reportable) int16u currentFrequency = 4; - attribute(readonly, reportable) int16u minFrequency = 5; - attribute(readonly, reportable) int16u maxFrequency = 6; - attribute(writable, reportable) bitmap8 options = 15; - attribute(writable, reportable) int16u onOffTransitionTime = 16; - attribute(writable, reportable) int8u onLevel = 17; - attribute(writable, reportable) int16u onTransitionTime = 18; - attribute(writable, reportable) int16u offTransitionTime = 19; - attribute(writable, reportable) int8u defaultMoveRate = 20; - attribute(writable, reportable) int8u startUpCurrentLevel = 16384; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u currentLevel = 0; + attribute(readonly) int16u remainingTime = 1; + attribute(readonly) int8u minLevel = 2; + attribute(readonly) int8u maxLevel = 3; + attribute(readonly) int16u currentFrequency = 4; + attribute(readonly) int16u minFrequency = 5; + attribute(readonly) int16u maxFrequency = 6; + attribute(writable) bitmap8 options = 15; + attribute(writable) int16u onOffTransitionTime = 16; + attribute(writable) int8u onLevel = 17; + attribute(writable) int16u onTransitionTime = 18; + attribute(writable) int16u offTransitionTime = 19; + attribute(writable) int8u defaultMoveRate = 20; + attribute(writable) int8u startUpCurrentLevel = 16384; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct MoveRequest { MoveMode moveMode = 0; @@ -669,8 +669,8 @@ server cluster LevelControl = 8 { } server cluster LocalizationConfiguration = 43 { - attribute(writable, reportable) char_string activeLocale = 1; - attribute(readonly, reportable) CHAR_STRING supportedLocales[] = 2; + attribute(writable) char_string activeLocale = 1; + attribute(readonly) CHAR_STRING supportedLocales[] = 2; } server cluster NetworkCommissioning = 49 { @@ -723,16 +723,16 @@ server cluster NetworkCommissioning = 49 { INT8U lqi = 8; } - attribute(readonly, reportable) int8u maxNetworks = 0; - attribute(readonly, reportable) NetworkInfo networks[] = 1; - attribute(readonly, reportable) int8u scanMaxTimeSeconds = 2; - attribute(readonly, reportable) int8u connectMaxTimeSeconds = 3; - attribute(writable, reportable) boolean interfaceEnabled = 4; - attribute(readonly, reportable) NetworkCommissioningStatus lastNetworkingStatus = 5; - attribute(readonly, reportable) octet_string lastNetworkID = 6; - attribute(readonly, reportable) int32u lastConnectErrorValue = 7; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u maxNetworks = 0; + attribute(readonly) NetworkInfo networks[] = 1; + attribute(readonly) int8u scanMaxTimeSeconds = 2; + attribute(readonly) int8u connectMaxTimeSeconds = 3; + attribute(writable) boolean interfaceEnabled = 4; + attribute(readonly) NetworkCommissioningStatus lastNetworkingStatus = 5; + attribute(readonly) octet_string lastNetworkID = 6; + attribute(readonly) int32u lastConnectErrorValue = 7; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -813,7 +813,7 @@ client cluster OtaSoftwareUpdateProvider = 41 { kDownloadProtocolNotSupported = 3; } - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u clusterRevision = 65533; request struct ApplyUpdateRequestRequest { OCTET_STRING updateToken = 0; @@ -909,11 +909,11 @@ server cluster OtaSoftwareUpdateRequestor = 42 { nullable INT64S platformCode = 3; } - attribute(writable, reportable) ProviderLocation defaultOtaProviders[] = 0; - attribute(readonly, reportable) boolean updatePossible = 1; - attribute(readonly, reportable) OTAUpdateStateEnum updateState = 2; - attribute(readonly, reportable) int8u updateStateProgress = 3; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) ProviderLocation defaultOtaProviders[] = 0; + attribute(readonly) boolean updatePossible = 1; + attribute(readonly) OTAUpdateStateEnum updateState = 2; + attribute(readonly) int8u updateStateProgress = 3; + attribute(readonly) int16u clusterRevision = 65533; request struct AnnounceOtaProviderRequest { node_id providerNodeId = 0; @@ -927,10 +927,10 @@ server cluster OtaSoftwareUpdateRequestor = 42 { } server cluster OccupancySensing = 1030 { - attribute(readonly, reportable) bitmap8 occupancy = 0; - attribute(readonly, reportable) enum8 occupancySensorType = 1; - attribute(readonly, reportable) bitmap8 occupancySensorTypeBitmap = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) bitmap8 occupancy = 0; + attribute(readonly) enum8 occupancySensorType = 1; + attribute(readonly) bitmap8 occupancySensorTypeBitmap = 2; + attribute(readonly) int16u clusterRevision = 65533; } client cluster OnOff = 6 { @@ -949,13 +949,13 @@ client cluster OnOff = 6 { kDyingLight = 1; } - attribute(readonly, reportable) boolean onOff = 0; - attribute(readonly, reportable) boolean globalSceneControl = 16384; - attribute(writable, reportable) int16u onTime = 16385; - attribute(writable, reportable) int16u offWaitTime = 16386; - attribute(writable, reportable) enum8 startUpOnOff = 16387; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) boolean onOff = 0; + attribute(readonly) boolean globalSceneControl = 16384; + attribute(writable) int16u onTime = 16385; + attribute(writable) int16u offWaitTime = 16386; + attribute(writable) enum8 startUpOnOff = 16387; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster OnOff = 6 { @@ -974,13 +974,13 @@ server cluster OnOff = 6 { kDyingLight = 1; } - attribute(readonly, reportable) boolean onOff = 0; - attribute(readonly, reportable) boolean globalSceneControl = 16384; - attribute(writable, reportable) int16u onTime = 16385; - attribute(writable, reportable) int16u offWaitTime = 16386; - attribute(writable, reportable) enum8 startUpOnOff = 16387; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) boolean onOff = 0; + attribute(readonly) boolean globalSceneControl = 16384; + attribute(writable) int16u onTime = 16385; + attribute(writable) int16u offWaitTime = 16386; + attribute(writable) enum8 startUpOnOff = 16387; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct OffWithEffectRequest { OnOffEffectIdentifier effectId = 0; @@ -1002,9 +1002,9 @@ server cluster OnOff = 6 { } server cluster OnOffSwitchConfiguration = 7 { - attribute(readonly, reportable) enum8 switchType = 0; - attribute(writable, reportable) enum8 switchActions = 16; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) enum8 switchType = 0; + attribute(writable) enum8 switchActions = 16; + attribute(readonly) int16u clusterRevision = 65533; } server cluster OperationalCredentials = 62 { @@ -1030,12 +1030,12 @@ server cluster OperationalCredentials = 62 { CHAR_STRING label = 6; } - attribute(readonly, reportable) FabricDescriptor fabricsList[] = 1; - attribute(readonly, reportable) int8u supportedFabrics = 2; - attribute(readonly, reportable) int8u commissionedFabrics = 3; - attribute(readonly, reportable) OCTET_STRING trustedRootCertificates[] = 4; - attribute(readonly, reportable) fabric_idx currentFabricIndex = 5; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) FabricDescriptor fabricsList[] = 1; + attribute(readonly) int8u supportedFabrics = 2; + attribute(readonly) int8u commissionedFabrics = 3; + attribute(readonly) OCTET_STRING trustedRootCertificates[] = 4; + attribute(readonly) fabric_idx currentFabricIndex = 5; + attribute(readonly) int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -1122,12 +1122,12 @@ server cluster SoftwareDiagnostics = 52 { SoftwareFault softwareFault = 0; } - attribute(readonly, reportable) ThreadMetrics threadMetrics[] = 0; - attribute(readonly, reportable) int64u currentHeapFree = 1; - attribute(readonly, reportable) int64u currentHeapUsed = 2; - attribute(readonly, reportable) int64u currentHeapHighWatermark = 3; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) ThreadMetrics threadMetrics[] = 0; + attribute(readonly) int64u currentHeapFree = 1; + attribute(readonly) int64u currentHeapUsed = 2; + attribute(readonly) int64u currentHeapHighWatermark = 3; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; command ResetWatermarks(): DefaultSuccess = 0; } @@ -1242,78 +1242,78 @@ server cluster ThreadNetworkDiagnostics = 53 { ThreadConnectionStatus connectionStatus = 0; } - attribute(readonly, reportable) int16u channel = 0; - attribute(readonly, reportable) enum8 routingRole = 1; - attribute(readonly, reportable) octet_string networkName = 2; - attribute(readonly, reportable) int16u panId = 3; - attribute(readonly, reportable) int64u extendedPanId = 4; - attribute(readonly, reportable) octet_string meshLocalPrefix = 5; - attribute(readonly, reportable) int64u overrunCount = 6; - attribute(readonly, reportable) NeighborTable neighborTableList[] = 7; - attribute(readonly, reportable) RouteTable routeTableList[] = 8; - attribute(readonly, reportable) int32u partitionId = 9; - attribute(readonly, reportable) int8u weighting = 10; - attribute(readonly, reportable) int8u dataVersion = 11; - attribute(readonly, reportable) int8u stableDataVersion = 12; - attribute(readonly, reportable) int8u leaderRouterId = 13; - attribute(readonly, reportable) int16u detachedRoleCount = 14; - attribute(readonly, reportable) int16u childRoleCount = 15; - attribute(readonly, reportable) int16u routerRoleCount = 16; - attribute(readonly, reportable) int16u leaderRoleCount = 17; - attribute(readonly, reportable) int16u attachAttemptCount = 18; - attribute(readonly, reportable) int16u partitionIdChangeCount = 19; - attribute(readonly, reportable) int16u betterPartitionAttachAttemptCount = 20; - attribute(readonly, reportable) int16u parentChangeCount = 21; - attribute(readonly, reportable) int32u txTotalCount = 22; - attribute(readonly, reportable) int32u txUnicastCount = 23; - attribute(readonly, reportable) int32u txBroadcastCount = 24; - attribute(readonly, reportable) int32u txAckRequestedCount = 25; - attribute(readonly, reportable) int32u txAckedCount = 26; - attribute(readonly, reportable) int32u txNoAckRequestedCount = 27; - attribute(readonly, reportable) int32u txDataCount = 28; - attribute(readonly, reportable) int32u txDataPollCount = 29; - attribute(readonly, reportable) int32u txBeaconCount = 30; - attribute(readonly, reportable) int32u txBeaconRequestCount = 31; - attribute(readonly, reportable) int32u txOtherCount = 32; - attribute(readonly, reportable) int32u txRetryCount = 33; - attribute(readonly, reportable) int32u txDirectMaxRetryExpiryCount = 34; - attribute(readonly, reportable) int32u txIndirectMaxRetryExpiryCount = 35; - attribute(readonly, reportable) int32u txErrCcaCount = 36; - attribute(readonly, reportable) int32u txErrAbortCount = 37; - attribute(readonly, reportable) int32u txErrBusyChannelCount = 38; - attribute(readonly, reportable) int32u rxTotalCount = 39; - attribute(readonly, reportable) int32u rxUnicastCount = 40; - attribute(readonly, reportable) int32u rxBroadcastCount = 41; - attribute(readonly, reportable) int32u rxDataCount = 42; - attribute(readonly, reportable) int32u rxDataPollCount = 43; - attribute(readonly, reportable) int32u rxBeaconCount = 44; - attribute(readonly, reportable) int32u rxBeaconRequestCount = 45; - attribute(readonly, reportable) int32u rxOtherCount = 46; - attribute(readonly, reportable) int32u rxAddressFilteredCount = 47; - attribute(readonly, reportable) int32u rxDestAddrFilteredCount = 48; - attribute(readonly, reportable) int32u rxDuplicatedCount = 49; - attribute(readonly, reportable) int32u rxErrNoFrameCount = 50; - attribute(readonly, reportable) int32u rxErrUnknownNeighborCount = 51; - attribute(readonly, reportable) int32u rxErrInvalidSrcAddrCount = 52; - attribute(readonly, reportable) int32u rxErrSecCount = 53; - attribute(readonly, reportable) int32u rxErrFcsCount = 54; - attribute(readonly, reportable) int32u rxErrOtherCount = 55; - attribute(readonly, reportable) int64u activeTimestamp = 56; - attribute(readonly, reportable) int64u pendingTimestamp = 57; - attribute(readonly, reportable) int32u delay = 58; - attribute(readonly, reportable) SecurityPolicy securityPolicy[] = 59; - attribute(readonly, reportable) octet_string channelMask = 60; - attribute(readonly, reportable) OperationalDatasetComponents operationalDatasetComponents[] = 61; - attribute(readonly, reportable) NetworkFault activeNetworkFaultsList[] = 62; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u channel = 0; + attribute(readonly) enum8 routingRole = 1; + attribute(readonly) octet_string networkName = 2; + attribute(readonly) int16u panId = 3; + attribute(readonly) int64u extendedPanId = 4; + attribute(readonly) octet_string meshLocalPrefix = 5; + attribute(readonly) int64u overrunCount = 6; + attribute(readonly) NeighborTable neighborTableList[] = 7; + attribute(readonly) RouteTable routeTableList[] = 8; + attribute(readonly) int32u partitionId = 9; + attribute(readonly) int8u weighting = 10; + attribute(readonly) int8u dataVersion = 11; + attribute(readonly) int8u stableDataVersion = 12; + attribute(readonly) int8u leaderRouterId = 13; + attribute(readonly) int16u detachedRoleCount = 14; + attribute(readonly) int16u childRoleCount = 15; + attribute(readonly) int16u routerRoleCount = 16; + attribute(readonly) int16u leaderRoleCount = 17; + attribute(readonly) int16u attachAttemptCount = 18; + attribute(readonly) int16u partitionIdChangeCount = 19; + attribute(readonly) int16u betterPartitionAttachAttemptCount = 20; + attribute(readonly) int16u parentChangeCount = 21; + attribute(readonly) int32u txTotalCount = 22; + attribute(readonly) int32u txUnicastCount = 23; + attribute(readonly) int32u txBroadcastCount = 24; + attribute(readonly) int32u txAckRequestedCount = 25; + attribute(readonly) int32u txAckedCount = 26; + attribute(readonly) int32u txNoAckRequestedCount = 27; + attribute(readonly) int32u txDataCount = 28; + attribute(readonly) int32u txDataPollCount = 29; + attribute(readonly) int32u txBeaconCount = 30; + attribute(readonly) int32u txBeaconRequestCount = 31; + attribute(readonly) int32u txOtherCount = 32; + attribute(readonly) int32u txRetryCount = 33; + attribute(readonly) int32u txDirectMaxRetryExpiryCount = 34; + attribute(readonly) int32u txIndirectMaxRetryExpiryCount = 35; + attribute(readonly) int32u txErrCcaCount = 36; + attribute(readonly) int32u txErrAbortCount = 37; + attribute(readonly) int32u txErrBusyChannelCount = 38; + attribute(readonly) int32u rxTotalCount = 39; + attribute(readonly) int32u rxUnicastCount = 40; + attribute(readonly) int32u rxBroadcastCount = 41; + attribute(readonly) int32u rxDataCount = 42; + attribute(readonly) int32u rxDataPollCount = 43; + attribute(readonly) int32u rxBeaconCount = 44; + attribute(readonly) int32u rxBeaconRequestCount = 45; + attribute(readonly) int32u rxOtherCount = 46; + attribute(readonly) int32u rxAddressFilteredCount = 47; + attribute(readonly) int32u rxDestAddrFilteredCount = 48; + attribute(readonly) int32u rxDuplicatedCount = 49; + attribute(readonly) int32u rxErrNoFrameCount = 50; + attribute(readonly) int32u rxErrUnknownNeighborCount = 51; + attribute(readonly) int32u rxErrInvalidSrcAddrCount = 52; + attribute(readonly) int32u rxErrSecCount = 53; + attribute(readonly) int32u rxErrFcsCount = 54; + attribute(readonly) int32u rxErrOtherCount = 55; + attribute(readonly) int64u activeTimestamp = 56; + attribute(readonly) int64u pendingTimestamp = 57; + attribute(readonly) int32u delay = 58; + attribute(readonly) SecurityPolicy securityPolicy[] = 59; + attribute(readonly) octet_string channelMask = 60; + attribute(readonly) OperationalDatasetComponents operationalDatasetComponents[] = 61; + attribute(readonly) NetworkFault activeNetworkFaultsList[] = 62; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; command ResetCounts(): DefaultSuccess = 0; } server cluster UserLabel = 65 { - attribute(writable, reportable) LabelStruct labelList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) LabelStruct labelList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } server cluster WiFiNetworkDiagnostics = 54 { @@ -1360,21 +1360,21 @@ server cluster WiFiNetworkDiagnostics = 54 { WiFiConnectionStatus connectionStatus = 0; } - attribute(readonly, reportable) octet_string bssid = 0; - attribute(readonly, reportable) enum8 securityType = 1; - attribute(readonly, reportable) enum8 wiFiVersion = 2; - attribute(readonly, reportable) int16u channelNumber = 3; - attribute(readonly, reportable) int8s rssi = 4; - attribute(readonly, reportable) int32u beaconLostCount = 5; - attribute(readonly, reportable) int32u beaconRxCount = 6; - attribute(readonly, reportable) int32u packetMulticastRxCount = 7; - attribute(readonly, reportable) int32u packetMulticastTxCount = 8; - attribute(readonly, reportable) int32u packetUnicastRxCount = 9; - attribute(readonly, reportable) int32u packetUnicastTxCount = 10; - attribute(readonly, reportable) int64u currentMaxRate = 11; - attribute(readonly, reportable) int64u overrunCount = 12; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) octet_string bssid = 0; + attribute(readonly) enum8 securityType = 1; + attribute(readonly) enum8 wiFiVersion = 2; + attribute(readonly) int16u channelNumber = 3; + attribute(readonly) int8s rssi = 4; + attribute(readonly) int32u beaconLostCount = 5; + attribute(readonly) int32u beaconRxCount = 6; + attribute(readonly) int32u packetMulticastRxCount = 7; + attribute(readonly) int32u packetMulticastTxCount = 8; + attribute(readonly) int32u packetUnicastRxCount = 9; + attribute(readonly) int32u packetUnicastTxCount = 10; + attribute(readonly) int64u currentMaxRate = 11; + attribute(readonly) int64u overrunCount = 12; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; command ResetCounts(): DefaultSuccess = 0; } diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index eb969ba4c25e09..f1a12df7a4f63c 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -19,10 +19,10 @@ server cluster AdministratorCommissioning = 60 { kWindowNotOpen = 3; } - attribute(readonly, reportable) int8u windowStatus = 0; - attribute(readonly, reportable) fabric_idx adminFabricIndex = 1; - attribute(readonly, reportable) int16u adminVendorId = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u windowStatus = 0; + attribute(readonly) fabric_idx adminFabricIndex = 1; + attribute(readonly) int16u adminVendorId = 2; + attribute(readonly) int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -57,18 +57,18 @@ server cluster Basic = 40 { boolean reachableNewValue = 0; } - attribute(readonly, reportable) int16u interactionModelVersion = 0; - attribute(readonly, reportable) char_string vendorName = 1; - attribute(readonly, reportable) vendor_id vendorID = 2; - attribute(readonly, reportable) char_string productName = 3; - attribute(readonly, reportable) int16u productID = 4; - attribute(writable, reportable) char_string nodeLabel = 5; - attribute(writable, reportable) char_string location = 6; - attribute(readonly, reportable) int16u hardwareVersion = 7; - attribute(readonly, reportable) char_string hardwareVersionString = 8; - attribute(readonly, reportable) int32u softwareVersion = 9; - attribute(readonly, reportable) char_string softwareVersionString = 10; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u interactionModelVersion = 0; + attribute(readonly) char_string vendorName = 1; + attribute(readonly) vendor_id vendorID = 2; + attribute(readonly) char_string productName = 3; + attribute(readonly) int16u productID = 4; + attribute(writable) char_string nodeLabel = 5; + attribute(writable) char_string location = 6; + attribute(readonly) int16u hardwareVersion = 7; + attribute(readonly) char_string hardwareVersionString = 8; + attribute(readonly) int32u softwareVersion = 9; + attribute(readonly) char_string softwareVersionString = 10; + attribute(readonly) int16u clusterRevision = 65533; } server cluster Descriptor = 29 { @@ -77,11 +77,11 @@ server cluster Descriptor = 29 { INT16U revision = 2; } - attribute(readonly, reportable) DeviceType deviceList[] = 0; - attribute(readonly, reportable) CLUSTER_ID serverList[] = 1; - attribute(readonly, reportable) CLUSTER_ID clientList[] = 2; - attribute(readonly, reportable) ENDPOINT_NO partsList[] = 3; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) DeviceType deviceList[] = 0; + attribute(readonly) CLUSTER_ID serverList[] = 1; + attribute(readonly) CLUSTER_ID clientList[] = 2; + attribute(readonly) ENDPOINT_NO partsList[] = 3; + attribute(readonly) int16u clusterRevision = 65533; } server cluster DiagnosticLogs = 50 { @@ -128,22 +128,22 @@ server cluster EthernetNetworkDiagnostics = 55 { k400g = 9; } - attribute(readonly, reportable) enum8 PHYRate = 0; - attribute(readonly, reportable) boolean fullDuplex = 1; - attribute(readonly, reportable) int64u packetRxCount = 2; - attribute(readonly, reportable) int64u packetTxCount = 3; - attribute(readonly, reportable) int64u txErrCount = 4; - attribute(readonly, reportable) int64u collisionCount = 5; - attribute(readonly, reportable) int64u overrunCount = 6; - attribute(readonly, reportable) boolean carrierDetect = 7; - attribute(readonly, reportable) int64u timeSinceReset = 8; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) enum8 PHYRate = 0; + attribute(readonly) boolean fullDuplex = 1; + attribute(readonly) int64u packetRxCount = 2; + attribute(readonly) int64u packetTxCount = 3; + attribute(readonly) int64u txErrCount = 4; + attribute(readonly) int64u collisionCount = 5; + attribute(readonly) int64u overrunCount = 6; + attribute(readonly) boolean carrierDetect = 7; + attribute(readonly) int64u timeSinceReset = 8; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster FixedLabel = 64 { - attribute(readonly, reportable) LabelStruct labelList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) LabelStruct labelList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -164,12 +164,12 @@ server cluster GeneralCommissioning = 48 { INT32U failSafeExpiryLengthMs = 1; } - attribute(writable, reportable) int64u breadcrumb = 0; - attribute(readonly, reportable) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; - attribute(readonly, reportable) enum8 regulatoryConfig = 2; - attribute(readonly, reportable) enum8 locationCapability = 3; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) int64u breadcrumb = 0; + attribute(readonly) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; + attribute(readonly) enum8 regulatoryConfig = 2; + attribute(readonly) enum8 locationCapability = 3; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -282,20 +282,20 @@ server cluster GeneralDiagnostics = 51 { BootReasonType bootReason = 0; } - attribute(readonly, reportable) NetworkInterfaceType networkInterfaces[] = 0; - attribute(readonly, reportable) int16u rebootCount = 1; - attribute(readonly, reportable) int64u upTime = 2; - attribute(readonly, reportable) int32u totalOperationalHours = 3; - attribute(readonly, reportable) enum8 bootReasons = 4; - attribute(readonly, reportable) ENUM8 activeHardwareFaults[] = 5; - attribute(readonly, reportable) ENUM8 activeRadioFaults[] = 6; - attribute(readonly, reportable) ENUM8 activeNetworkFaults[] = 7; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) NetworkInterfaceType networkInterfaces[] = 0; + attribute(readonly) int16u rebootCount = 1; + attribute(readonly) int64u upTime = 2; + attribute(readonly) int32u totalOperationalHours = 3; + attribute(readonly) enum8 bootReasons = 4; + attribute(readonly) ENUM8 activeHardwareFaults[] = 5; + attribute(readonly) ENUM8 activeRadioFaults[] = 6; + attribute(readonly) ENUM8 activeNetworkFaults[] = 7; + attribute(readonly) int16u clusterRevision = 65533; } server cluster LocalizationConfiguration = 43 { - attribute(writable, reportable) char_string activeLocale = 1; - attribute(readonly, reportable) CHAR_STRING supportedLocales[] = 2; + attribute(writable) char_string activeLocale = 1; + attribute(readonly) CHAR_STRING supportedLocales[] = 2; } server cluster NetworkCommissioning = 49 { @@ -348,16 +348,16 @@ server cluster NetworkCommissioning = 49 { INT8U lqi = 8; } - attribute(readonly, reportable) int8u maxNetworks = 0; - attribute(readonly, reportable) NetworkInfo networks[] = 1; - attribute(readonly, reportable) int8u scanMaxTimeSeconds = 2; - attribute(readonly, reportable) int8u connectMaxTimeSeconds = 3; - attribute(writable, reportable) boolean interfaceEnabled = 4; - attribute(readonly, reportable) NetworkCommissioningStatus lastNetworkingStatus = 5; - attribute(readonly, reportable) octet_string lastNetworkID = 6; - attribute(readonly, reportable) int32u lastConnectErrorValue = 7; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u maxNetworks = 0; + attribute(readonly) NetworkInfo networks[] = 1; + attribute(readonly) int8u scanMaxTimeSeconds = 2; + attribute(readonly) int8u connectMaxTimeSeconds = 3; + attribute(writable) boolean interfaceEnabled = 4; + attribute(readonly) NetworkCommissioningStatus lastNetworkingStatus = 5; + attribute(readonly) octet_string lastNetworkID = 6; + attribute(readonly) int32u lastConnectErrorValue = 7; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -433,13 +433,13 @@ server cluster OnOff = 6 { kDyingLight = 1; } - attribute(readonly, reportable) boolean onOff = 0; - attribute(readonly, reportable) boolean globalSceneControl = 16384; - attribute(writable, reportable) int16u onTime = 16385; - attribute(writable, reportable) int16u offWaitTime = 16386; - attribute(writable, reportable) enum8 startUpOnOff = 16387; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) boolean onOff = 0; + attribute(readonly) boolean globalSceneControl = 16384; + attribute(writable) int16u onTime = 16385; + attribute(writable) int16u offWaitTime = 16386; + attribute(writable) enum8 startUpOnOff = 16387; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; command Off(): DefaultSuccess = 0; command On(): DefaultSuccess = 1; @@ -469,12 +469,12 @@ server cluster OperationalCredentials = 62 { CHAR_STRING label = 6; } - attribute(readonly, reportable) FabricDescriptor fabricsList[] = 1; - attribute(readonly, reportable) int8u supportedFabrics = 2; - attribute(readonly, reportable) int8u commissionedFabrics = 3; - attribute(readonly, reportable) OCTET_STRING trustedRootCertificates[] = 4; - attribute(readonly, reportable) fabric_idx currentFabricIndex = 5; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) FabricDescriptor fabricsList[] = 1; + attribute(readonly) int8u supportedFabrics = 2; + attribute(readonly) int8u commissionedFabrics = 3; + attribute(readonly) OCTET_STRING trustedRootCertificates[] = 4; + attribute(readonly) fabric_idx currentFabricIndex = 5; + attribute(readonly) int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -549,21 +549,21 @@ server cluster OperationalCredentials = 62 { } server cluster PowerSource = 47 { - attribute(readonly, reportable) enum8 status = 0; - attribute(readonly, reportable) int8u order = 1; - attribute(readonly, reportable) char_string description = 2; - attribute(readonly, reportable) int32u wiredAssessedCurrent = 6; - attribute(readonly, reportable) enum8 batteryChargeLevel = 14; - attribute(readonly, reportable) boolean batteryReplacementNeeded = 15; - attribute(readonly, reportable) enum8 batteryReplaceability = 16; - attribute(readonly, reportable) char_string batteryReplacementDescription = 19; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) enum8 status = 0; + attribute(readonly) int8u order = 1; + attribute(readonly) char_string description = 2; + attribute(readonly) int32u wiredAssessedCurrent = 6; + attribute(readonly) enum8 batteryChargeLevel = 14; + attribute(readonly) boolean batteryReplacementNeeded = 15; + attribute(readonly) enum8 batteryReplaceability = 16; + attribute(readonly) char_string batteryReplacementDescription = 19; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster PowerSourceConfiguration = 46 { - attribute(readonly, reportable) INT8U sources[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) INT8U sources[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } server cluster SoftwareDiagnostics = 52 { @@ -579,12 +579,12 @@ server cluster SoftwareDiagnostics = 52 { SoftwareFault softwareFault = 0; } - attribute(readonly, reportable) ThreadMetrics threadMetrics[] = 0; - attribute(readonly, reportable) int64u currentHeapFree = 1; - attribute(readonly, reportable) int64u currentHeapUsed = 2; - attribute(readonly, reportable) int64u currentHeapHighWatermark = 3; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) ThreadMetrics threadMetrics[] = 0; + attribute(readonly) int64u currentHeapFree = 1; + attribute(readonly) int64u currentHeapUsed = 2; + attribute(readonly) int64u currentHeapHighWatermark = 3; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster ThreadNetworkDiagnostics = 53 { @@ -664,76 +664,76 @@ server cluster ThreadNetworkDiagnostics = 53 { ThreadConnectionStatus connectionStatus = 0; } - attribute(readonly, reportable) int16u channel = 0; - attribute(readonly, reportable) enum8 routingRole = 1; - attribute(readonly, reportable) octet_string networkName = 2; - attribute(readonly, reportable) int16u panId = 3; - attribute(readonly, reportable) int64u extendedPanId = 4; - attribute(readonly, reportable) octet_string meshLocalPrefix = 5; - attribute(readonly, reportable) int64u overrunCount = 6; - attribute(readonly, reportable) NeighborTable neighborTableList[] = 7; - attribute(readonly, reportable) RouteTable routeTableList[] = 8; - attribute(readonly, reportable) int32u partitionId = 9; - attribute(readonly, reportable) int8u weighting = 10; - attribute(readonly, reportable) int8u dataVersion = 11; - attribute(readonly, reportable) int8u stableDataVersion = 12; - attribute(readonly, reportable) int8u leaderRouterId = 13; - attribute(readonly, reportable) int16u detachedRoleCount = 14; - attribute(readonly, reportable) int16u childRoleCount = 15; - attribute(readonly, reportable) int16u routerRoleCount = 16; - attribute(readonly, reportable) int16u leaderRoleCount = 17; - attribute(readonly, reportable) int16u attachAttemptCount = 18; - attribute(readonly, reportable) int16u partitionIdChangeCount = 19; - attribute(readonly, reportable) int16u betterPartitionAttachAttemptCount = 20; - attribute(readonly, reportable) int16u parentChangeCount = 21; - attribute(readonly, reportable) int32u txTotalCount = 22; - attribute(readonly, reportable) int32u txUnicastCount = 23; - attribute(readonly, reportable) int32u txBroadcastCount = 24; - attribute(readonly, reportable) int32u txAckRequestedCount = 25; - attribute(readonly, reportable) int32u txAckedCount = 26; - attribute(readonly, reportable) int32u txNoAckRequestedCount = 27; - attribute(readonly, reportable) int32u txDataCount = 28; - attribute(readonly, reportable) int32u txDataPollCount = 29; - attribute(readonly, reportable) int32u txBeaconCount = 30; - attribute(readonly, reportable) int32u txBeaconRequestCount = 31; - attribute(readonly, reportable) int32u txOtherCount = 32; - attribute(readonly, reportable) int32u txRetryCount = 33; - attribute(readonly, reportable) int32u txDirectMaxRetryExpiryCount = 34; - attribute(readonly, reportable) int32u txIndirectMaxRetryExpiryCount = 35; - attribute(readonly, reportable) int32u txErrCcaCount = 36; - attribute(readonly, reportable) int32u txErrAbortCount = 37; - attribute(readonly, reportable) int32u txErrBusyChannelCount = 38; - attribute(readonly, reportable) int32u rxTotalCount = 39; - attribute(readonly, reportable) int32u rxUnicastCount = 40; - attribute(readonly, reportable) int32u rxBroadcastCount = 41; - attribute(readonly, reportable) int32u rxDataCount = 42; - attribute(readonly, reportable) int32u rxDataPollCount = 43; - attribute(readonly, reportable) int32u rxBeaconCount = 44; - attribute(readonly, reportable) int32u rxBeaconRequestCount = 45; - attribute(readonly, reportable) int32u rxOtherCount = 46; - attribute(readonly, reportable) int32u rxAddressFilteredCount = 47; - attribute(readonly, reportable) int32u rxDestAddrFilteredCount = 48; - attribute(readonly, reportable) int32u rxDuplicatedCount = 49; - attribute(readonly, reportable) int32u rxErrNoFrameCount = 50; - attribute(readonly, reportable) int32u rxErrUnknownNeighborCount = 51; - attribute(readonly, reportable) int32u rxErrInvalidSrcAddrCount = 52; - attribute(readonly, reportable) int32u rxErrSecCount = 53; - attribute(readonly, reportable) int32u rxErrFcsCount = 54; - attribute(readonly, reportable) int32u rxErrOtherCount = 55; - attribute(readonly, reportable) int64u activeTimestamp = 56; - attribute(readonly, reportable) int64u pendingTimestamp = 57; - attribute(readonly, reportable) int32u delay = 58; - attribute(readonly, reportable) SecurityPolicy securityPolicy[] = 59; - attribute(readonly, reportable) octet_string channelMask = 60; - attribute(readonly, reportable) OperationalDatasetComponents operationalDatasetComponents[] = 61; - attribute(readonly, reportable) NetworkFault activeNetworkFaultsList[] = 62; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u channel = 0; + attribute(readonly) enum8 routingRole = 1; + attribute(readonly) octet_string networkName = 2; + attribute(readonly) int16u panId = 3; + attribute(readonly) int64u extendedPanId = 4; + attribute(readonly) octet_string meshLocalPrefix = 5; + attribute(readonly) int64u overrunCount = 6; + attribute(readonly) NeighborTable neighborTableList[] = 7; + attribute(readonly) RouteTable routeTableList[] = 8; + attribute(readonly) int32u partitionId = 9; + attribute(readonly) int8u weighting = 10; + attribute(readonly) int8u dataVersion = 11; + attribute(readonly) int8u stableDataVersion = 12; + attribute(readonly) int8u leaderRouterId = 13; + attribute(readonly) int16u detachedRoleCount = 14; + attribute(readonly) int16u childRoleCount = 15; + attribute(readonly) int16u routerRoleCount = 16; + attribute(readonly) int16u leaderRoleCount = 17; + attribute(readonly) int16u attachAttemptCount = 18; + attribute(readonly) int16u partitionIdChangeCount = 19; + attribute(readonly) int16u betterPartitionAttachAttemptCount = 20; + attribute(readonly) int16u parentChangeCount = 21; + attribute(readonly) int32u txTotalCount = 22; + attribute(readonly) int32u txUnicastCount = 23; + attribute(readonly) int32u txBroadcastCount = 24; + attribute(readonly) int32u txAckRequestedCount = 25; + attribute(readonly) int32u txAckedCount = 26; + attribute(readonly) int32u txNoAckRequestedCount = 27; + attribute(readonly) int32u txDataCount = 28; + attribute(readonly) int32u txDataPollCount = 29; + attribute(readonly) int32u txBeaconCount = 30; + attribute(readonly) int32u txBeaconRequestCount = 31; + attribute(readonly) int32u txOtherCount = 32; + attribute(readonly) int32u txRetryCount = 33; + attribute(readonly) int32u txDirectMaxRetryExpiryCount = 34; + attribute(readonly) int32u txIndirectMaxRetryExpiryCount = 35; + attribute(readonly) int32u txErrCcaCount = 36; + attribute(readonly) int32u txErrAbortCount = 37; + attribute(readonly) int32u txErrBusyChannelCount = 38; + attribute(readonly) int32u rxTotalCount = 39; + attribute(readonly) int32u rxUnicastCount = 40; + attribute(readonly) int32u rxBroadcastCount = 41; + attribute(readonly) int32u rxDataCount = 42; + attribute(readonly) int32u rxDataPollCount = 43; + attribute(readonly) int32u rxBeaconCount = 44; + attribute(readonly) int32u rxBeaconRequestCount = 45; + attribute(readonly) int32u rxOtherCount = 46; + attribute(readonly) int32u rxAddressFilteredCount = 47; + attribute(readonly) int32u rxDestAddrFilteredCount = 48; + attribute(readonly) int32u rxDuplicatedCount = 49; + attribute(readonly) int32u rxErrNoFrameCount = 50; + attribute(readonly) int32u rxErrUnknownNeighborCount = 51; + attribute(readonly) int32u rxErrInvalidSrcAddrCount = 52; + attribute(readonly) int32u rxErrSecCount = 53; + attribute(readonly) int32u rxErrFcsCount = 54; + attribute(readonly) int32u rxErrOtherCount = 55; + attribute(readonly) int64u activeTimestamp = 56; + attribute(readonly) int64u pendingTimestamp = 57; + attribute(readonly) int32u delay = 58; + attribute(readonly) SecurityPolicy securityPolicy[] = 59; + attribute(readonly) octet_string channelMask = 60; + attribute(readonly) OperationalDatasetComponents operationalDatasetComponents[] = 61; + attribute(readonly) NetworkFault activeNetworkFaultsList[] = 62; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster UserLabel = 65 { - attribute(writable, reportable) LabelStruct labelList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) LabelStruct labelList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } server cluster WiFiNetworkDiagnostics = 54 { @@ -780,21 +780,21 @@ server cluster WiFiNetworkDiagnostics = 54 { WiFiConnectionStatus connectionStatus = 0; } - attribute(readonly, reportable) octet_string bssid = 0; - attribute(readonly, reportable) enum8 securityType = 1; - attribute(readonly, reportable) enum8 wiFiVersion = 2; - attribute(readonly, reportable) int16u channelNumber = 3; - attribute(readonly, reportable) int8s rssi = 4; - attribute(readonly, reportable) int32u beaconLostCount = 5; - attribute(readonly, reportable) int32u beaconRxCount = 6; - attribute(readonly, reportable) int32u packetMulticastRxCount = 7; - attribute(readonly, reportable) int32u packetMulticastTxCount = 8; - attribute(readonly, reportable) int32u packetUnicastRxCount = 9; - attribute(readonly, reportable) int32u packetUnicastTxCount = 10; - attribute(readonly, reportable) int64u currentMaxRate = 11; - attribute(readonly, reportable) int64u overrunCount = 12; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) octet_string bssid = 0; + attribute(readonly) enum8 securityType = 1; + attribute(readonly) enum8 wiFiVersion = 2; + attribute(readonly) int16u channelNumber = 3; + attribute(readonly) int8s rssi = 4; + attribute(readonly) int32u beaconLostCount = 5; + attribute(readonly) int32u beaconRxCount = 6; + attribute(readonly) int32u packetMulticastRxCount = 7; + attribute(readonly) int32u packetMulticastTxCount = 8; + attribute(readonly) int32u packetUnicastRxCount = 9; + attribute(readonly) int32u packetUnicastTxCount = 10; + attribute(readonly) int64u currentMaxRate = 11; + attribute(readonly) int64u overrunCount = 12; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } 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 ce9793213b65be..3f3fd8dbb038a9 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 @@ -78,9 +78,9 @@ server cluster GeneralCommissioning = 48 { INT32U failSafeExpiryLengthMs = 1; } - attribute(writable, reportable) int64u breadcrumb = 0; - attribute(readonly, reportable) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) int64u breadcrumb = 0; + attribute(readonly) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; + attribute(readonly) int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -160,7 +160,7 @@ server cluster NetworkCommissioning = 49 { INT8U lqi = 8; } - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -243,11 +243,11 @@ server cluster OperationalCredentials = 62 { CHAR_STRING label = 6; } - attribute(readonly, reportable) FabricDescriptor fabricsList[] = 1; - attribute(readonly, reportable) int8u supportedFabrics = 2; - attribute(readonly, reportable) int8u commissionedFabrics = 3; - attribute(readonly, reportable) OCTET_STRING trustedRootCertificates[] = 4; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) FabricDescriptor fabricsList[] = 1; + attribute(readonly) int8u supportedFabrics = 2; + attribute(readonly) int8u commissionedFabrics = 3; + attribute(readonly) OCTET_STRING trustedRootCertificates[] = 4; + attribute(readonly) int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; diff --git a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter index b64cb874bd3611..163b3d30469b86 100644 --- a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter +++ b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter @@ -7,8 +7,8 @@ struct LabelStruct { } server cluster FixedLabel = 64 { - attribute(readonly, reportable) LabelStruct labelList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) LabelStruct labelList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -29,12 +29,12 @@ server cluster GeneralCommissioning = 48 { INT32U failSafeExpiryLengthMs = 1; } - attribute(writable, reportable) int64u breadcrumb = 0; - attribute(readonly, reportable) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; - attribute(readonly, reportable) enum8 regulatoryConfig = 2; - attribute(readonly, reportable) enum8 locationCapability = 3; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) int64u breadcrumb = 0; + attribute(readonly) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; + attribute(readonly) enum8 regulatoryConfig = 2; + attribute(readonly) enum8 locationCapability = 3; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -70,8 +70,8 @@ server cluster GeneralCommissioning = 48 { } server cluster LocalizationConfiguration = 43 { - attribute(writable, reportable) char_string activeLocale = 1; - attribute(readonly, reportable) CHAR_STRING supportedLocales[] = 2; + attribute(writable) char_string activeLocale = 1; + attribute(readonly) CHAR_STRING supportedLocales[] = 2; } server cluster NetworkCommissioning = 49 { @@ -124,16 +124,16 @@ server cluster NetworkCommissioning = 49 { INT8U lqi = 8; } - attribute(readonly, reportable) int8u maxNetworks = 0; - attribute(readonly, reportable) NetworkInfo networks[] = 1; - attribute(readonly, reportable) int8u scanMaxTimeSeconds = 2; - attribute(readonly, reportable) int8u connectMaxTimeSeconds = 3; - attribute(writable, reportable) boolean interfaceEnabled = 4; - attribute(readonly, reportable) NetworkCommissioningStatus lastNetworkingStatus = 5; - attribute(readonly, reportable) octet_string lastNetworkID = 6; - attribute(readonly, reportable) int32u lastConnectErrorValue = 7; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u maxNetworks = 0; + attribute(readonly) NetworkInfo networks[] = 1; + attribute(readonly) int8u scanMaxTimeSeconds = 2; + attribute(readonly) int8u connectMaxTimeSeconds = 3; + attribute(writable) boolean interfaceEnabled = 4; + attribute(readonly) NetworkCommissioningStatus lastNetworkingStatus = 5; + attribute(readonly) octet_string lastNetworkID = 6; + attribute(readonly) int32u lastConnectErrorValue = 7; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -214,7 +214,7 @@ server cluster OtaSoftwareUpdateProvider = 41 { kDownloadProtocolNotSupported = 3; } - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u clusterRevision = 65533; request struct ApplyUpdateRequestRequest { OCTET_STRING updateToken = 0; @@ -281,12 +281,12 @@ server cluster OperationalCredentials = 62 { CHAR_STRING label = 6; } - attribute(readonly, reportable) FabricDescriptor fabricsList[] = 1; - attribute(readonly, reportable) int8u supportedFabrics = 2; - attribute(readonly, reportable) int8u commissionedFabrics = 3; - attribute(readonly, reportable) OCTET_STRING trustedRootCertificates[] = 4; - attribute(readonly, reportable) fabric_idx currentFabricIndex = 5; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) FabricDescriptor fabricsList[] = 1; + attribute(readonly) int8u supportedFabrics = 2; + attribute(readonly) int8u commissionedFabrics = 3; + attribute(readonly) OCTET_STRING trustedRootCertificates[] = 4; + attribute(readonly) fabric_idx currentFabricIndex = 5; + attribute(readonly) int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -350,8 +350,8 @@ server cluster OperationalCredentials = 62 { } server cluster UserLabel = 65 { - attribute(writable, reportable) LabelStruct labelList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) LabelStruct labelList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } 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 0b5547614e50af..b7e711ba8ba50c 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 @@ -21,25 +21,25 @@ server cluster Basic = 40 { boolean reachableNewValue = 0; } - attribute(readonly, reportable) int16u interactionModelVersion = 0; - attribute(readonly, reportable) char_string vendorName = 1; - attribute(readonly, reportable) vendor_id vendorID = 2; - attribute(readonly, reportable) char_string productName = 3; - attribute(readonly, reportable) int16u productID = 4; - attribute(writable, reportable) char_string nodeLabel = 5; - attribute(writable, reportable) char_string location = 6; - attribute(readonly, reportable) int16u hardwareVersion = 7; - attribute(readonly, reportable) char_string hardwareVersionString = 8; - attribute(readonly, reportable) int32u softwareVersion = 9; - attribute(readonly, reportable) char_string softwareVersionString = 10; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u interactionModelVersion = 0; + attribute(readonly) char_string vendorName = 1; + attribute(readonly) vendor_id vendorID = 2; + attribute(readonly) char_string productName = 3; + attribute(readonly) int16u productID = 4; + attribute(writable) char_string nodeLabel = 5; + attribute(writable) char_string location = 6; + attribute(readonly) int16u hardwareVersion = 7; + attribute(readonly) char_string hardwareVersionString = 8; + attribute(readonly) int32u softwareVersion = 9; + attribute(readonly) char_string softwareVersionString = 10; + attribute(readonly) int16u clusterRevision = 65533; command MfgSpecificPing(): DefaultSuccess = 0; } server cluster FixedLabel = 64 { - attribute(readonly, reportable) LabelStruct labelList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) LabelStruct labelList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -60,12 +60,12 @@ server cluster GeneralCommissioning = 48 { INT32U failSafeExpiryLengthMs = 1; } - attribute(writable, reportable) int64u breadcrumb = 0; - attribute(readonly, reportable) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; - attribute(readonly, reportable) enum8 regulatoryConfig = 2; - attribute(readonly, reportable) enum8 locationCapability = 3; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) int64u breadcrumb = 0; + attribute(readonly) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; + attribute(readonly) enum8 regulatoryConfig = 2; + attribute(readonly) enum8 locationCapability = 3; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -101,8 +101,8 @@ server cluster GeneralCommissioning = 48 { } server cluster LocalizationConfiguration = 43 { - attribute(writable, reportable) char_string activeLocale = 1; - attribute(readonly, reportable) CHAR_STRING supportedLocales[] = 2; + attribute(writable) char_string activeLocale = 1; + attribute(readonly) CHAR_STRING supportedLocales[] = 2; } server cluster NetworkCommissioning = 49 { @@ -155,16 +155,16 @@ server cluster NetworkCommissioning = 49 { INT8U lqi = 8; } - attribute(readonly, reportable) int8u maxNetworks = 0; - attribute(readonly, reportable) NetworkInfo networks[] = 1; - attribute(readonly, reportable) int8u scanMaxTimeSeconds = 2; - attribute(readonly, reportable) int8u connectMaxTimeSeconds = 3; - attribute(writable, reportable) boolean interfaceEnabled = 4; - attribute(readonly, reportable) NetworkCommissioningStatus lastNetworkingStatus = 5; - attribute(readonly, reportable) octet_string lastNetworkID = 6; - attribute(readonly, reportable) int32u lastConnectErrorValue = 7; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u maxNetworks = 0; + attribute(readonly) NetworkInfo networks[] = 1; + attribute(readonly) int8u scanMaxTimeSeconds = 2; + attribute(readonly) int8u connectMaxTimeSeconds = 3; + attribute(writable) boolean interfaceEnabled = 4; + attribute(readonly) NetworkCommissioningStatus lastNetworkingStatus = 5; + attribute(readonly) octet_string lastNetworkID = 6; + attribute(readonly) int32u lastConnectErrorValue = 7; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -245,7 +245,7 @@ client cluster OtaSoftwareUpdateProvider = 41 { kDownloadProtocolNotSupported = 3; } - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u clusterRevision = 65533; request struct ApplyUpdateRequestRequest { OCTET_STRING updateToken = 0; @@ -341,11 +341,11 @@ server cluster OtaSoftwareUpdateRequestor = 42 { nullable INT64S platformCode = 3; } - attribute(writable, reportable) ProviderLocation defaultOtaProviders[] = 0; - attribute(readonly, reportable) boolean updatePossible = 1; - attribute(readonly, reportable) OTAUpdateStateEnum updateState = 2; - attribute(readonly, reportable) int8u updateStateProgress = 3; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) ProviderLocation defaultOtaProviders[] = 0; + attribute(readonly) boolean updatePossible = 1; + attribute(readonly) OTAUpdateStateEnum updateState = 2; + attribute(readonly) int8u updateStateProgress = 3; + attribute(readonly) int16u clusterRevision = 65533; request struct AnnounceOtaProviderRequest { node_id providerNodeId = 0; @@ -381,12 +381,12 @@ server cluster OperationalCredentials = 62 { CHAR_STRING label = 6; } - attribute(readonly, reportable) FabricDescriptor fabricsList[] = 1; - attribute(readonly, reportable) int8u supportedFabrics = 2; - attribute(readonly, reportable) int8u commissionedFabrics = 3; - attribute(readonly, reportable) OCTET_STRING trustedRootCertificates[] = 4; - attribute(readonly, reportable) fabric_idx currentFabricIndex = 5; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) FabricDescriptor fabricsList[] = 1; + attribute(readonly) int8u supportedFabrics = 2; + attribute(readonly) int8u commissionedFabrics = 3; + attribute(readonly) OCTET_STRING trustedRootCertificates[] = 4; + attribute(readonly) fabric_idx currentFabricIndex = 5; + attribute(readonly) int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -461,8 +461,8 @@ server cluster OperationalCredentials = 62 { } server cluster UserLabel = 65 { - attribute(writable, reportable) LabelStruct labelList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) LabelStruct labelList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index df6b3eb1b8442e..4be14a2d022122 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -16,26 +16,26 @@ server cluster Basic = 40 { boolean reachableNewValue = 0; } - attribute(readonly, reportable) int16u interactionModelVersion = 0; - attribute(readonly, reportable) char_string vendorName = 1; - attribute(readonly, reportable) vendor_id vendorID = 2; - attribute(readonly, reportable) char_string productName = 3; - attribute(readonly, reportable) int16u productID = 4; - attribute(writable, reportable) char_string nodeLabel = 5; - attribute(writable, reportable) char_string location = 6; - attribute(readonly, reportable) int16u hardwareVersion = 7; - attribute(readonly, reportable) char_string hardwareVersionString = 8; - attribute(readonly, reportable) int32u softwareVersion = 9; - attribute(readonly, reportable) char_string softwareVersionString = 10; - attribute(readonly, reportable) char_string manufacturingDate = 11; - attribute(readonly, reportable) char_string partNumber = 12; - attribute(readonly, reportable) long_char_string productURL = 13; - attribute(readonly, reportable) char_string productLabel = 14; - attribute(readonly, reportable) char_string serialNumber = 15; - attribute(writable, reportable) boolean localConfigDisabled = 16; - attribute(readonly, reportable) boolean reachable = 17; - attribute(readonly, reportable) char_string uniqueID = 18; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u interactionModelVersion = 0; + attribute(readonly) char_string vendorName = 1; + attribute(readonly) vendor_id vendorID = 2; + attribute(readonly) char_string productName = 3; + attribute(readonly) int16u productID = 4; + attribute(writable) char_string nodeLabel = 5; + attribute(writable) char_string location = 6; + attribute(readonly) int16u hardwareVersion = 7; + attribute(readonly) char_string hardwareVersionString = 8; + attribute(readonly) int32u softwareVersion = 9; + attribute(readonly) char_string softwareVersionString = 10; + attribute(readonly) char_string manufacturingDate = 11; + attribute(readonly) char_string partNumber = 12; + attribute(readonly) long_char_string productURL = 13; + attribute(readonly) char_string productLabel = 14; + attribute(readonly) char_string serialNumber = 15; + attribute(writable) boolean localConfigDisabled = 16; + attribute(readonly) boolean reachable = 17; + attribute(readonly) char_string uniqueID = 18; + attribute(readonly) int16u clusterRevision = 65533; } server cluster ColorControl = 768 { @@ -85,12 +85,12 @@ server cluster ColorControl = 768 { kDown = 3; } - attribute(readonly, reportable) int16u currentX = 3; - attribute(readonly, reportable) int16u currentY = 4; - attribute(writable, reportable) bitmap8 colorControlOptions = 15; - attribute(readonly, reportable) int16u coupleColorTempToLevelMinMireds = 16397; - attribute(writable, reportable) int16u startUpColorTemperatureMireds = 16400; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u currentX = 3; + attribute(readonly) int16u currentY = 4; + attribute(writable) bitmap8 colorControlOptions = 15; + attribute(readonly) int16u coupleColorTempToLevelMinMireds = 16397; + attribute(writable) int16u startUpColorTemperatureMireds = 16400; + attribute(readonly) int16u clusterRevision = 65533; request struct MoveColorRequest { INT16S rateX = 0; @@ -126,11 +126,11 @@ server cluster Descriptor = 29 { INT16U revision = 2; } - attribute(readonly, reportable) DeviceType deviceList[] = 0; - attribute(readonly, reportable) CLUSTER_ID serverList[] = 1; - attribute(readonly, reportable) CLUSTER_ID clientList[] = 2; - attribute(readonly, reportable) ENDPOINT_NO partsList[] = 3; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) DeviceType deviceList[] = 0; + attribute(readonly) CLUSTER_ID serverList[] = 1; + attribute(readonly) CLUSTER_ID clientList[] = 2; + attribute(readonly) ENDPOINT_NO partsList[] = 3; + attribute(readonly) int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -151,9 +151,9 @@ server cluster GeneralCommissioning = 48 { INT32U failSafeExpiryLengthMs = 1; } - attribute(writable, reportable) int64u breadcrumb = 0; - attribute(readonly, reportable) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) int64u breadcrumb = 0; + attribute(readonly) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; + attribute(readonly) int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -189,8 +189,8 @@ server cluster GeneralCommissioning = 48 { } server cluster Groups = 4 { - attribute(readonly, reportable) bitmap8 nameSupport = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) bitmap8 nameSupport = 0; + attribute(readonly) int16u clusterRevision = 65533; request struct AddGroupRequest { INT16U groupId = 0; @@ -266,9 +266,9 @@ server cluster Identify = 3 { kActuator = 5; } - attribute(writable, reportable) int16u identifyTime = 0; - attribute(readonly, reportable) enum8 identifyType = 1; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) int16u identifyTime = 0; + attribute(readonly) enum8 identifyType = 1; + attribute(readonly) int16u clusterRevision = 65533; request struct IdentifyRequest { INT16U identifyTime = 0; @@ -293,8 +293,8 @@ server cluster LevelControl = 8 { kDown = 1; } - attribute(readonly, reportable) int8u currentLevel = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u currentLevel = 0; + attribute(readonly) int16u clusterRevision = 65533; request struct MoveRequest { MoveMode moveMode = 0; @@ -399,16 +399,16 @@ server cluster NetworkCommissioning = 49 { INT8U lqi = 8; } - attribute(readonly, reportable) int8u maxNetworks = 0; - attribute(readonly, reportable) NetworkInfo networks[] = 1; - attribute(readonly, reportable) int8u scanMaxTimeSeconds = 2; - attribute(readonly, reportable) int8u connectMaxTimeSeconds = 3; - attribute(writable, reportable) boolean interfaceEnabled = 4; - attribute(readonly, reportable) NetworkCommissioningStatus lastNetworkingStatus = 5; - attribute(readonly, reportable) octet_string lastNetworkID = 6; - attribute(readonly, reportable) int32u lastConnectErrorValue = 7; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u maxNetworks = 0; + attribute(readonly) NetworkInfo networks[] = 1; + attribute(readonly) int8u scanMaxTimeSeconds = 2; + attribute(readonly) int8u connectMaxTimeSeconds = 3; + attribute(writable) boolean interfaceEnabled = 4; + attribute(readonly) NetworkCommissioningStatus lastNetworkingStatus = 5; + attribute(readonly) octet_string lastNetworkID = 6; + attribute(readonly) int32u lastConnectErrorValue = 7; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -484,8 +484,8 @@ server cluster OnOff = 6 { kDyingLight = 1; } - attribute(readonly, reportable) boolean onOff = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) boolean onOff = 0; + attribute(readonly) int16u clusterRevision = 65533; command Off(): DefaultSuccess = 0; command On(): DefaultSuccess = 1; @@ -515,12 +515,12 @@ server cluster OperationalCredentials = 62 { CHAR_STRING label = 6; } - attribute(readonly, reportable) FabricDescriptor fabricsList[] = 1; - attribute(readonly, reportable) int8u supportedFabrics = 2; - attribute(readonly, reportable) int8u commissionedFabrics = 3; - attribute(readonly, reportable) OCTET_STRING trustedRootCertificates[] = 4; - attribute(readonly, reportable) fabric_idx currentFabricIndex = 5; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) FabricDescriptor fabricsList[] = 1; + attribute(readonly) int8u supportedFabrics = 2; + attribute(readonly) int8u commissionedFabrics = 3; + attribute(readonly) OCTET_STRING trustedRootCertificates[] = 4; + attribute(readonly) fabric_idx currentFabricIndex = 5; + attribute(readonly) int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -601,12 +601,12 @@ server cluster Scenes = 5 { INT8U value = 3; } - attribute(readonly, reportable) int8u sceneCount = 0; - attribute(readonly, reportable) int8u currentScene = 1; - attribute(readonly, reportable) int16u currentGroup = 2; - attribute(readonly, reportable) boolean sceneValid = 3; - attribute(readonly, reportable) bitmap8 nameSupport = 4; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u sceneCount = 0; + attribute(readonly) int8u currentScene = 1; + attribute(readonly) int16u currentGroup = 2; + attribute(readonly) boolean sceneValid = 3; + attribute(readonly) bitmap8 nameSupport = 4; + attribute(readonly) int16u clusterRevision = 65533; request struct AddSceneRequest { INT16U groupId = 0; @@ -695,17 +695,17 @@ server cluster Scenes = 5 { } client cluster TemperatureMeasurement = 1026 { - attribute(readonly, reportable) int16s measuredValue = 0; - attribute(readonly, reportable) int16s minMeasuredValue = 1; - attribute(readonly, reportable) int16s maxMeasuredValue = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16s measuredValue = 0; + attribute(readonly) int16s minMeasuredValue = 1; + attribute(readonly) int16s maxMeasuredValue = 2; + attribute(readonly) int16u clusterRevision = 65533; } server cluster TemperatureMeasurement = 1026 { - attribute(readonly, reportable) int16s measuredValue = 0; - attribute(readonly, reportable) int16s minMeasuredValue = 1; - attribute(readonly, reportable) int16s maxMeasuredValue = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16s measuredValue = 0; + attribute(readonly) int16s minMeasuredValue = 1; + attribute(readonly) int16s maxMeasuredValue = 2; + attribute(readonly) int16u clusterRevision = 65533; } diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index df6b3eb1b8442e..4be14a2d022122 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -16,26 +16,26 @@ server cluster Basic = 40 { boolean reachableNewValue = 0; } - attribute(readonly, reportable) int16u interactionModelVersion = 0; - attribute(readonly, reportable) char_string vendorName = 1; - attribute(readonly, reportable) vendor_id vendorID = 2; - attribute(readonly, reportable) char_string productName = 3; - attribute(readonly, reportable) int16u productID = 4; - attribute(writable, reportable) char_string nodeLabel = 5; - attribute(writable, reportable) char_string location = 6; - attribute(readonly, reportable) int16u hardwareVersion = 7; - attribute(readonly, reportable) char_string hardwareVersionString = 8; - attribute(readonly, reportable) int32u softwareVersion = 9; - attribute(readonly, reportable) char_string softwareVersionString = 10; - attribute(readonly, reportable) char_string manufacturingDate = 11; - attribute(readonly, reportable) char_string partNumber = 12; - attribute(readonly, reportable) long_char_string productURL = 13; - attribute(readonly, reportable) char_string productLabel = 14; - attribute(readonly, reportable) char_string serialNumber = 15; - attribute(writable, reportable) boolean localConfigDisabled = 16; - attribute(readonly, reportable) boolean reachable = 17; - attribute(readonly, reportable) char_string uniqueID = 18; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u interactionModelVersion = 0; + attribute(readonly) char_string vendorName = 1; + attribute(readonly) vendor_id vendorID = 2; + attribute(readonly) char_string productName = 3; + attribute(readonly) int16u productID = 4; + attribute(writable) char_string nodeLabel = 5; + attribute(writable) char_string location = 6; + attribute(readonly) int16u hardwareVersion = 7; + attribute(readonly) char_string hardwareVersionString = 8; + attribute(readonly) int32u softwareVersion = 9; + attribute(readonly) char_string softwareVersionString = 10; + attribute(readonly) char_string manufacturingDate = 11; + attribute(readonly) char_string partNumber = 12; + attribute(readonly) long_char_string productURL = 13; + attribute(readonly) char_string productLabel = 14; + attribute(readonly) char_string serialNumber = 15; + attribute(writable) boolean localConfigDisabled = 16; + attribute(readonly) boolean reachable = 17; + attribute(readonly) char_string uniqueID = 18; + attribute(readonly) int16u clusterRevision = 65533; } server cluster ColorControl = 768 { @@ -85,12 +85,12 @@ server cluster ColorControl = 768 { kDown = 3; } - attribute(readonly, reportable) int16u currentX = 3; - attribute(readonly, reportable) int16u currentY = 4; - attribute(writable, reportable) bitmap8 colorControlOptions = 15; - attribute(readonly, reportable) int16u coupleColorTempToLevelMinMireds = 16397; - attribute(writable, reportable) int16u startUpColorTemperatureMireds = 16400; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u currentX = 3; + attribute(readonly) int16u currentY = 4; + attribute(writable) bitmap8 colorControlOptions = 15; + attribute(readonly) int16u coupleColorTempToLevelMinMireds = 16397; + attribute(writable) int16u startUpColorTemperatureMireds = 16400; + attribute(readonly) int16u clusterRevision = 65533; request struct MoveColorRequest { INT16S rateX = 0; @@ -126,11 +126,11 @@ server cluster Descriptor = 29 { INT16U revision = 2; } - attribute(readonly, reportable) DeviceType deviceList[] = 0; - attribute(readonly, reportable) CLUSTER_ID serverList[] = 1; - attribute(readonly, reportable) CLUSTER_ID clientList[] = 2; - attribute(readonly, reportable) ENDPOINT_NO partsList[] = 3; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) DeviceType deviceList[] = 0; + attribute(readonly) CLUSTER_ID serverList[] = 1; + attribute(readonly) CLUSTER_ID clientList[] = 2; + attribute(readonly) ENDPOINT_NO partsList[] = 3; + attribute(readonly) int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -151,9 +151,9 @@ server cluster GeneralCommissioning = 48 { INT32U failSafeExpiryLengthMs = 1; } - attribute(writable, reportable) int64u breadcrumb = 0; - attribute(readonly, reportable) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) int64u breadcrumb = 0; + attribute(readonly) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; + attribute(readonly) int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -189,8 +189,8 @@ server cluster GeneralCommissioning = 48 { } server cluster Groups = 4 { - attribute(readonly, reportable) bitmap8 nameSupport = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) bitmap8 nameSupport = 0; + attribute(readonly) int16u clusterRevision = 65533; request struct AddGroupRequest { INT16U groupId = 0; @@ -266,9 +266,9 @@ server cluster Identify = 3 { kActuator = 5; } - attribute(writable, reportable) int16u identifyTime = 0; - attribute(readonly, reportable) enum8 identifyType = 1; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) int16u identifyTime = 0; + attribute(readonly) enum8 identifyType = 1; + attribute(readonly) int16u clusterRevision = 65533; request struct IdentifyRequest { INT16U identifyTime = 0; @@ -293,8 +293,8 @@ server cluster LevelControl = 8 { kDown = 1; } - attribute(readonly, reportable) int8u currentLevel = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u currentLevel = 0; + attribute(readonly) int16u clusterRevision = 65533; request struct MoveRequest { MoveMode moveMode = 0; @@ -399,16 +399,16 @@ server cluster NetworkCommissioning = 49 { INT8U lqi = 8; } - attribute(readonly, reportable) int8u maxNetworks = 0; - attribute(readonly, reportable) NetworkInfo networks[] = 1; - attribute(readonly, reportable) int8u scanMaxTimeSeconds = 2; - attribute(readonly, reportable) int8u connectMaxTimeSeconds = 3; - attribute(writable, reportable) boolean interfaceEnabled = 4; - attribute(readonly, reportable) NetworkCommissioningStatus lastNetworkingStatus = 5; - attribute(readonly, reportable) octet_string lastNetworkID = 6; - attribute(readonly, reportable) int32u lastConnectErrorValue = 7; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u maxNetworks = 0; + attribute(readonly) NetworkInfo networks[] = 1; + attribute(readonly) int8u scanMaxTimeSeconds = 2; + attribute(readonly) int8u connectMaxTimeSeconds = 3; + attribute(writable) boolean interfaceEnabled = 4; + attribute(readonly) NetworkCommissioningStatus lastNetworkingStatus = 5; + attribute(readonly) octet_string lastNetworkID = 6; + attribute(readonly) int32u lastConnectErrorValue = 7; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -484,8 +484,8 @@ server cluster OnOff = 6 { kDyingLight = 1; } - attribute(readonly, reportable) boolean onOff = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) boolean onOff = 0; + attribute(readonly) int16u clusterRevision = 65533; command Off(): DefaultSuccess = 0; command On(): DefaultSuccess = 1; @@ -515,12 +515,12 @@ server cluster OperationalCredentials = 62 { CHAR_STRING label = 6; } - attribute(readonly, reportable) FabricDescriptor fabricsList[] = 1; - attribute(readonly, reportable) int8u supportedFabrics = 2; - attribute(readonly, reportable) int8u commissionedFabrics = 3; - attribute(readonly, reportable) OCTET_STRING trustedRootCertificates[] = 4; - attribute(readonly, reportable) fabric_idx currentFabricIndex = 5; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) FabricDescriptor fabricsList[] = 1; + attribute(readonly) int8u supportedFabrics = 2; + attribute(readonly) int8u commissionedFabrics = 3; + attribute(readonly) OCTET_STRING trustedRootCertificates[] = 4; + attribute(readonly) fabric_idx currentFabricIndex = 5; + attribute(readonly) int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -601,12 +601,12 @@ server cluster Scenes = 5 { INT8U value = 3; } - attribute(readonly, reportable) int8u sceneCount = 0; - attribute(readonly, reportable) int8u currentScene = 1; - attribute(readonly, reportable) int16u currentGroup = 2; - attribute(readonly, reportable) boolean sceneValid = 3; - attribute(readonly, reportable) bitmap8 nameSupport = 4; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u sceneCount = 0; + attribute(readonly) int8u currentScene = 1; + attribute(readonly) int16u currentGroup = 2; + attribute(readonly) boolean sceneValid = 3; + attribute(readonly) bitmap8 nameSupport = 4; + attribute(readonly) int16u clusterRevision = 65533; request struct AddSceneRequest { INT16U groupId = 0; @@ -695,17 +695,17 @@ server cluster Scenes = 5 { } client cluster TemperatureMeasurement = 1026 { - attribute(readonly, reportable) int16s measuredValue = 0; - attribute(readonly, reportable) int16s minMeasuredValue = 1; - attribute(readonly, reportable) int16s maxMeasuredValue = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16s measuredValue = 0; + attribute(readonly) int16s minMeasuredValue = 1; + attribute(readonly) int16s maxMeasuredValue = 2; + attribute(readonly) int16u clusterRevision = 65533; } server cluster TemperatureMeasurement = 1026 { - attribute(readonly, reportable) int16s measuredValue = 0; - attribute(readonly, reportable) int16s minMeasuredValue = 1; - attribute(readonly, reportable) int16s maxMeasuredValue = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16s measuredValue = 0; + attribute(readonly) int16s minMeasuredValue = 1; + attribute(readonly) int16s maxMeasuredValue = 2; + attribute(readonly) int16u clusterRevision = 65533; } diff --git a/examples/platform/linux/pw_trace_chip/public/pw_trace_chip/trace_chip.h b/examples/platform/linux/pw_trace_chip/public/pw_trace_chip/trace_chip.h index 3eca6335360c6f..c65899c29b0e0e 100644 --- a/examples/platform/linux/pw_trace_chip/public/pw_trace_chip/trace_chip.h +++ b/examples/platform/linux/pw_trace_chip/public/pw_trace_chip/trace_chip.h @@ -69,10 +69,10 @@ struct TraceEventFields size_t dataSize; }; -typedef bool (*TraceHandlerCallback)(const TraceEventFields & trace); +typedef bool (*TraceHandlerCallback)(const TraceEventFields & eventFields, void * context); -// Register a trace handler which gets called for all data trace events. -void RegisterTraceHandler(TraceHandlerCallback callback); +// Register an additional trace handler which gets called for all data trace events with the given context +void RegisterTraceHandler(TraceHandlerCallback callback, void * context); void UnregisterAllTraceHandlers(); // These are what the facade actually calls. diff --git a/examples/platform/linux/pw_trace_chip/trace.cc b/examples/platform/linux/pw_trace_chip/trace.cc index 427f22d3f5e80d..bf005c518933fd 100644 --- a/examples/platform/linux/pw_trace_chip/trace.cc +++ b/examples/platform/linux/pw_trace_chip/trace.cc @@ -25,31 +25,40 @@ namespace chip { namespace trace { + namespace { +struct TraceHandlerEntry +{ + // Handler callback that will receive the event + TraceHandlerCallback callback; + // Registration-time context provided for the given handler + void * context; +}; + std::mutex handlerLock; -std::vector traceHandlers; +std::vector traceHandlers; } // namespace void TraceEvent(const char * module, const char * label, TraceEventType eventType, const char * group, uint32_t traceId, uint8_t flags, const char * dataFormat, const void * dataBuffer, size_t dataSize) { - TraceEventFields fields = { module, label, eventType, group, traceId, flags, dataFormat, dataBuffer, dataSize }; + TraceEventFields eventFields = { module, label, eventType, group, traceId, flags, dataFormat, dataBuffer, dataSize }; std::lock_guard guard(handlerLock); for (const auto & handler : traceHandlers) { - if (handler(fields)) + if (handler.callback(eventFields, handler.context)) { return; } } } -void RegisterTraceHandler(TraceHandlerCallback callback) +void RegisterTraceHandler(TraceHandlerCallback callback, void * context) { std::lock_guard guard(handlerLock); - traceHandlers.push_back(callback); + traceHandlers.push_back(TraceHandlerEntry{ callback, context }); } void UnregisterAllTraceHandlers() diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter index a18736d4c2c9ef..ff9570cb327ba0 100644 --- a/examples/pump-app/pump-common/pump-app.matter +++ b/examples/pump-app/pump-common/pump-app.matter @@ -19,10 +19,10 @@ server cluster AdministratorCommissioning = 60 { kWindowNotOpen = 3; } - attribute(readonly, reportable) int8u windowStatus = 0; - attribute(readonly, reportable) fabric_idx adminFabricIndex = 1; - attribute(readonly, reportable) int16u adminVendorId = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u windowStatus = 0; + attribute(readonly) fabric_idx adminFabricIndex = 1; + attribute(readonly) int16u adminVendorId = 2; + attribute(readonly) int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -57,18 +57,18 @@ server cluster Basic = 40 { boolean reachableNewValue = 0; } - attribute(readonly, reportable) int16u interactionModelVersion = 0; - attribute(readonly, reportable) char_string vendorName = 1; - attribute(readonly, reportable) vendor_id vendorID = 2; - attribute(readonly, reportable) char_string productName = 3; - attribute(readonly, reportable) int16u productID = 4; - attribute(writable, reportable) char_string nodeLabel = 5; - attribute(writable, reportable) char_string location = 6; - attribute(readonly, reportable) int16u hardwareVersion = 7; - attribute(readonly, reportable) char_string hardwareVersionString = 8; - attribute(readonly, reportable) int32u softwareVersion = 9; - attribute(readonly, reportable) char_string softwareVersionString = 10; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u interactionModelVersion = 0; + attribute(readonly) char_string vendorName = 1; + attribute(readonly) vendor_id vendorID = 2; + attribute(readonly) char_string productName = 3; + attribute(readonly) int16u productID = 4; + attribute(writable) char_string nodeLabel = 5; + attribute(writable) char_string location = 6; + attribute(readonly) int16u hardwareVersion = 7; + attribute(readonly) char_string hardwareVersionString = 8; + attribute(readonly) int32u softwareVersion = 9; + attribute(readonly) char_string softwareVersionString = 10; + attribute(readonly) int16u clusterRevision = 65533; command MfgSpecificPing(): DefaultSuccess = 0; } @@ -79,11 +79,11 @@ server cluster Descriptor = 29 { INT16U revision = 2; } - attribute(readonly, reportable) DeviceType deviceList[] = 0; - attribute(readonly, reportable) CLUSTER_ID serverList[] = 1; - attribute(readonly, reportable) CLUSTER_ID clientList[] = 2; - attribute(readonly, reportable) ENDPOINT_NO partsList[] = 3; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) DeviceType deviceList[] = 0; + attribute(readonly) CLUSTER_ID serverList[] = 1; + attribute(readonly) CLUSTER_ID clientList[] = 2; + attribute(readonly) ENDPOINT_NO partsList[] = 3; + attribute(readonly) int16u clusterRevision = 65533; } server cluster DiagnosticLogs = 50 { @@ -117,22 +117,22 @@ server cluster DiagnosticLogs = 50 { } server cluster FixedLabel = 64 { - attribute(readonly, reportable) LabelStruct labelList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) LabelStruct labelList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } client cluster FlowMeasurement = 1028 { - attribute(readonly, reportable) int16s measuredValue = 0; - attribute(readonly, reportable) int16s minMeasuredValue = 1; - attribute(readonly, reportable) int16s maxMeasuredValue = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16s measuredValue = 0; + attribute(readonly) int16s minMeasuredValue = 1; + attribute(readonly) int16s maxMeasuredValue = 2; + attribute(readonly) int16u clusterRevision = 65533; } server cluster FlowMeasurement = 1028 { - attribute(readonly, reportable) int16s measuredValue = 0; - attribute(readonly, reportable) int16s minMeasuredValue = 1; - attribute(readonly, reportable) int16s maxMeasuredValue = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16s measuredValue = 0; + attribute(readonly) int16s minMeasuredValue = 1; + attribute(readonly) int16s maxMeasuredValue = 2; + attribute(readonly) int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -153,12 +153,12 @@ server cluster GeneralCommissioning = 48 { INT32U failSafeExpiryLengthMs = 1; } - attribute(writable, reportable) int64u breadcrumb = 0; - attribute(readonly, reportable) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; - attribute(readonly, reportable) enum8 regulatoryConfig = 2; - attribute(readonly, reportable) enum8 locationCapability = 3; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) int64u breadcrumb = 0; + attribute(readonly) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; + attribute(readonly) enum8 regulatoryConfig = 2; + attribute(readonly) enum8 locationCapability = 3; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -271,15 +271,15 @@ server cluster GeneralDiagnostics = 51 { BootReasonType bootReason = 0; } - attribute(readonly, reportable) NetworkInterfaceType networkInterfaces[] = 0; - attribute(readonly, reportable) int16u rebootCount = 1; - attribute(readonly, reportable) int64u upTime = 2; - attribute(readonly, reportable) int32u totalOperationalHours = 3; - attribute(readonly, reportable) enum8 bootReasons = 4; - attribute(readonly, reportable) ENUM8 activeHardwareFaults[] = 5; - attribute(readonly, reportable) ENUM8 activeRadioFaults[] = 6; - attribute(readonly, reportable) ENUM8 activeNetworkFaults[] = 7; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) NetworkInterfaceType networkInterfaces[] = 0; + attribute(readonly) int16u rebootCount = 1; + attribute(readonly) int64u upTime = 2; + attribute(readonly) int32u totalOperationalHours = 3; + attribute(readonly) enum8 bootReasons = 4; + attribute(readonly) ENUM8 activeHardwareFaults[] = 5; + attribute(readonly) ENUM8 activeRadioFaults[] = 6; + attribute(readonly) ENUM8 activeNetworkFaults[] = 7; + attribute(readonly) int16u clusterRevision = 65533; } server cluster LevelControl = 8 { @@ -293,8 +293,8 @@ server cluster LevelControl = 8 { kDown = 1; } - attribute(readonly, reportable) int8u currentLevel = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u currentLevel = 0; + attribute(readonly) int16u clusterRevision = 65533; request struct MoveRequest { MoveMode moveMode = 0; @@ -350,8 +350,8 @@ server cluster LevelControl = 8 { } server cluster LocalizationConfiguration = 43 { - attribute(writable, reportable) char_string activeLocale = 1; - attribute(readonly, reportable) CHAR_STRING supportedLocales[] = 2; + attribute(writable) char_string activeLocale = 1; + attribute(readonly) CHAR_STRING supportedLocales[] = 2; } server cluster NetworkCommissioning = 49 { @@ -404,16 +404,16 @@ server cluster NetworkCommissioning = 49 { INT8U lqi = 8; } - attribute(readonly, reportable) int8u maxNetworks = 0; - attribute(readonly, reportable) NetworkInfo networks[] = 1; - attribute(readonly, reportable) int8u scanMaxTimeSeconds = 2; - attribute(readonly, reportable) int8u connectMaxTimeSeconds = 3; - attribute(writable, reportable) boolean interfaceEnabled = 4; - attribute(readonly, reportable) NetworkCommissioningStatus lastNetworkingStatus = 5; - attribute(readonly, reportable) octet_string lastNetworkID = 6; - attribute(readonly, reportable) int32u lastConnectErrorValue = 7; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u maxNetworks = 0; + attribute(readonly) NetworkInfo networks[] = 1; + attribute(readonly) int8u scanMaxTimeSeconds = 2; + attribute(readonly) int8u connectMaxTimeSeconds = 3; + attribute(writable) boolean interfaceEnabled = 4; + attribute(readonly) NetworkCommissioningStatus lastNetworkingStatus = 5; + attribute(readonly) octet_string lastNetworkID = 6; + attribute(readonly) int32u lastConnectErrorValue = 7; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -489,8 +489,8 @@ server cluster OnOff = 6 { kDyingLight = 1; } - attribute(readonly, reportable) boolean onOff = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) boolean onOff = 0; + attribute(readonly) int16u clusterRevision = 65533; command Off(): DefaultSuccess = 0; command On(): DefaultSuccess = 1; @@ -520,12 +520,12 @@ server cluster OperationalCredentials = 62 { CHAR_STRING label = 6; } - attribute(readonly, reportable) FabricDescriptor fabricsList[] = 1; - attribute(readonly, reportable) int8u supportedFabrics = 2; - attribute(readonly, reportable) int8u commissionedFabrics = 3; - attribute(readonly, reportable) OCTET_STRING trustedRootCertificates[] = 4; - attribute(readonly, reportable) fabric_idx currentFabricIndex = 5; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) FabricDescriptor fabricsList[] = 1; + attribute(readonly) int8u supportedFabrics = 2; + attribute(readonly) int8u commissionedFabrics = 3; + attribute(readonly) OCTET_STRING trustedRootCertificates[] = 4; + attribute(readonly) fabric_idx currentFabricIndex = 5; + attribute(readonly) int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -600,17 +600,17 @@ server cluster OperationalCredentials = 62 { } client cluster PressureMeasurement = 1027 { - attribute(readonly, reportable) int16s measuredValue = 0; - attribute(readonly, reportable) int16s minMeasuredValue = 1; - attribute(readonly, reportable) int16s maxMeasuredValue = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16s measuredValue = 0; + attribute(readonly) int16s minMeasuredValue = 1; + attribute(readonly) int16s maxMeasuredValue = 2; + attribute(readonly) int16u clusterRevision = 65533; } server cluster PressureMeasurement = 1027 { - attribute(readonly, reportable) int16s measuredValue = 0; - attribute(readonly, reportable) int16s minMeasuredValue = 1; - attribute(readonly, reportable) int16s maxMeasuredValue = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16s measuredValue = 0; + attribute(readonly) int16s minMeasuredValue = 1; + attribute(readonly) int16s maxMeasuredValue = 2; + attribute(readonly) int16u clusterRevision = 65533; } server cluster PumpConfigurationAndControl = 512 { @@ -681,32 +681,32 @@ server cluster PumpConfigurationAndControl = 512 { info event TurbineOperation = 16 { } - attribute(readonly, reportable) int16s maxPressure = 0; - attribute(readonly, reportable) int16u maxSpeed = 1; - attribute(readonly, reportable) int16u maxFlow = 2; - attribute(readonly, reportable) int16s minConstPressure = 3; - attribute(readonly, reportable) int16s maxConstPressure = 4; - attribute(readonly, reportable) int16s minCompPressure = 5; - attribute(readonly, reportable) int16s maxCompPressure = 6; - attribute(readonly, reportable) int16u minConstSpeed = 7; - attribute(readonly, reportable) int16u maxConstSpeed = 8; - attribute(readonly, reportable) int16u minConstFlow = 9; - attribute(readonly, reportable) int16u maxConstFlow = 10; - attribute(readonly, reportable) int16s minConstTemp = 11; - attribute(readonly, reportable) int16s maxConstTemp = 12; - attribute(readonly, reportable) bitmap16 pumpStatus = 16; - attribute(readonly, reportable) enum8 effectiveOperationMode = 17; - attribute(readonly, reportable) enum8 effectiveControlMode = 18; - attribute(readonly, reportable) int16s capacity = 19; - attribute(readonly, reportable) int16u speed = 20; - attribute(writable, reportable) int24u lifetimeRunningHours = 21; - attribute(readonly, reportable) int24u power = 22; - attribute(writable, reportable) int32u lifetimeEnergyConsumed = 23; - attribute(writable, reportable) enum8 operationMode = 32; - attribute(writable, reportable) enum8 controlMode = 33; - attribute(readonly, reportable) bitmap16 alarmMask = 34; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16s maxPressure = 0; + attribute(readonly) int16u maxSpeed = 1; + attribute(readonly) int16u maxFlow = 2; + attribute(readonly) int16s minConstPressure = 3; + attribute(readonly) int16s maxConstPressure = 4; + attribute(readonly) int16s minCompPressure = 5; + attribute(readonly) int16s maxCompPressure = 6; + attribute(readonly) int16u minConstSpeed = 7; + attribute(readonly) int16u maxConstSpeed = 8; + attribute(readonly) int16u minConstFlow = 9; + attribute(readonly) int16u maxConstFlow = 10; + attribute(readonly) int16s minConstTemp = 11; + attribute(readonly) int16s maxConstTemp = 12; + attribute(readonly) bitmap16 pumpStatus = 16; + attribute(readonly) enum8 effectiveOperationMode = 17; + attribute(readonly) enum8 effectiveControlMode = 18; + attribute(readonly) int16s capacity = 19; + attribute(readonly) int16u speed = 20; + attribute(writable) int24u lifetimeRunningHours = 21; + attribute(readonly) int24u power = 22; + attribute(writable) int32u lifetimeEnergyConsumed = 23; + attribute(writable) enum8 operationMode = 32; + attribute(writable) enum8 controlMode = 33; + attribute(readonly) bitmap16 alarmMask = 34; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster SoftwareDiagnostics = 52 { @@ -722,26 +722,26 @@ server cluster SoftwareDiagnostics = 52 { SoftwareFault softwareFault = 0; } - attribute(readonly, reportable) ThreadMetrics threadMetrics[] = 0; - attribute(readonly, reportable) int64u currentHeapFree = 1; - attribute(readonly, reportable) int64u currentHeapUsed = 2; - attribute(readonly, reportable) int64u currentHeapHighWatermark = 3; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) ThreadMetrics threadMetrics[] = 0; + attribute(readonly) int64u currentHeapFree = 1; + attribute(readonly) int64u currentHeapUsed = 2; + attribute(readonly) int64u currentHeapHighWatermark = 3; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } client cluster TemperatureMeasurement = 1026 { - attribute(readonly, reportable) int16s measuredValue = 0; - attribute(readonly, reportable) int16s minMeasuredValue = 1; - attribute(readonly, reportable) int16s maxMeasuredValue = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16s measuredValue = 0; + attribute(readonly) int16s minMeasuredValue = 1; + attribute(readonly) int16s maxMeasuredValue = 2; + attribute(readonly) int16u clusterRevision = 65533; } server cluster TemperatureMeasurement = 1026 { - attribute(readonly, reportable) int16s measuredValue = 0; - attribute(readonly, reportable) int16s minMeasuredValue = 1; - attribute(readonly, reportable) int16s maxMeasuredValue = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16s measuredValue = 0; + attribute(readonly) int16s minMeasuredValue = 1; + attribute(readonly) int16s maxMeasuredValue = 2; + attribute(readonly) int16u clusterRevision = 65533; } server cluster ThreadNetworkDiagnostics = 53 { @@ -821,76 +821,76 @@ server cluster ThreadNetworkDiagnostics = 53 { ThreadConnectionStatus connectionStatus = 0; } - attribute(readonly, reportable) int16u channel = 0; - attribute(readonly, reportable) enum8 routingRole = 1; - attribute(readonly, reportable) octet_string networkName = 2; - attribute(readonly, reportable) int16u panId = 3; - attribute(readonly, reportable) int64u extendedPanId = 4; - attribute(readonly, reportable) octet_string meshLocalPrefix = 5; - attribute(readonly, reportable) int64u overrunCount = 6; - attribute(readonly, reportable) NeighborTable neighborTableList[] = 7; - attribute(readonly, reportable) RouteTable routeTableList[] = 8; - attribute(readonly, reportable) int32u partitionId = 9; - attribute(readonly, reportable) int8u weighting = 10; - attribute(readonly, reportable) int8u dataVersion = 11; - attribute(readonly, reportable) int8u stableDataVersion = 12; - attribute(readonly, reportable) int8u leaderRouterId = 13; - attribute(readonly, reportable) int16u detachedRoleCount = 14; - attribute(readonly, reportable) int16u childRoleCount = 15; - attribute(readonly, reportable) int16u routerRoleCount = 16; - attribute(readonly, reportable) int16u leaderRoleCount = 17; - attribute(readonly, reportable) int16u attachAttemptCount = 18; - attribute(readonly, reportable) int16u partitionIdChangeCount = 19; - attribute(readonly, reportable) int16u betterPartitionAttachAttemptCount = 20; - attribute(readonly, reportable) int16u parentChangeCount = 21; - attribute(readonly, reportable) int32u txTotalCount = 22; - attribute(readonly, reportable) int32u txUnicastCount = 23; - attribute(readonly, reportable) int32u txBroadcastCount = 24; - attribute(readonly, reportable) int32u txAckRequestedCount = 25; - attribute(readonly, reportable) int32u txAckedCount = 26; - attribute(readonly, reportable) int32u txNoAckRequestedCount = 27; - attribute(readonly, reportable) int32u txDataCount = 28; - attribute(readonly, reportable) int32u txDataPollCount = 29; - attribute(readonly, reportable) int32u txBeaconCount = 30; - attribute(readonly, reportable) int32u txBeaconRequestCount = 31; - attribute(readonly, reportable) int32u txOtherCount = 32; - attribute(readonly, reportable) int32u txRetryCount = 33; - attribute(readonly, reportable) int32u txDirectMaxRetryExpiryCount = 34; - attribute(readonly, reportable) int32u txIndirectMaxRetryExpiryCount = 35; - attribute(readonly, reportable) int32u txErrCcaCount = 36; - attribute(readonly, reportable) int32u txErrAbortCount = 37; - attribute(readonly, reportable) int32u txErrBusyChannelCount = 38; - attribute(readonly, reportable) int32u rxTotalCount = 39; - attribute(readonly, reportable) int32u rxUnicastCount = 40; - attribute(readonly, reportable) int32u rxBroadcastCount = 41; - attribute(readonly, reportable) int32u rxDataCount = 42; - attribute(readonly, reportable) int32u rxDataPollCount = 43; - attribute(readonly, reportable) int32u rxBeaconCount = 44; - attribute(readonly, reportable) int32u rxBeaconRequestCount = 45; - attribute(readonly, reportable) int32u rxOtherCount = 46; - attribute(readonly, reportable) int32u rxAddressFilteredCount = 47; - attribute(readonly, reportable) int32u rxDestAddrFilteredCount = 48; - attribute(readonly, reportable) int32u rxDuplicatedCount = 49; - attribute(readonly, reportable) int32u rxErrNoFrameCount = 50; - attribute(readonly, reportable) int32u rxErrUnknownNeighborCount = 51; - attribute(readonly, reportable) int32u rxErrInvalidSrcAddrCount = 52; - attribute(readonly, reportable) int32u rxErrSecCount = 53; - attribute(readonly, reportable) int32u rxErrFcsCount = 54; - attribute(readonly, reportable) int32u rxErrOtherCount = 55; - attribute(readonly, reportable) int64u activeTimestamp = 56; - attribute(readonly, reportable) int64u pendingTimestamp = 57; - attribute(readonly, reportable) int32u delay = 58; - attribute(readonly, reportable) SecurityPolicy securityPolicy[] = 59; - attribute(readonly, reportable) octet_string channelMask = 60; - attribute(readonly, reportable) OperationalDatasetComponents operationalDatasetComponents[] = 61; - attribute(readonly, reportable) NetworkFault activeNetworkFaultsList[] = 62; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u channel = 0; + attribute(readonly) enum8 routingRole = 1; + attribute(readonly) octet_string networkName = 2; + attribute(readonly) int16u panId = 3; + attribute(readonly) int64u extendedPanId = 4; + attribute(readonly) octet_string meshLocalPrefix = 5; + attribute(readonly) int64u overrunCount = 6; + attribute(readonly) NeighborTable neighborTableList[] = 7; + attribute(readonly) RouteTable routeTableList[] = 8; + attribute(readonly) int32u partitionId = 9; + attribute(readonly) int8u weighting = 10; + attribute(readonly) int8u dataVersion = 11; + attribute(readonly) int8u stableDataVersion = 12; + attribute(readonly) int8u leaderRouterId = 13; + attribute(readonly) int16u detachedRoleCount = 14; + attribute(readonly) int16u childRoleCount = 15; + attribute(readonly) int16u routerRoleCount = 16; + attribute(readonly) int16u leaderRoleCount = 17; + attribute(readonly) int16u attachAttemptCount = 18; + attribute(readonly) int16u partitionIdChangeCount = 19; + attribute(readonly) int16u betterPartitionAttachAttemptCount = 20; + attribute(readonly) int16u parentChangeCount = 21; + attribute(readonly) int32u txTotalCount = 22; + attribute(readonly) int32u txUnicastCount = 23; + attribute(readonly) int32u txBroadcastCount = 24; + attribute(readonly) int32u txAckRequestedCount = 25; + attribute(readonly) int32u txAckedCount = 26; + attribute(readonly) int32u txNoAckRequestedCount = 27; + attribute(readonly) int32u txDataCount = 28; + attribute(readonly) int32u txDataPollCount = 29; + attribute(readonly) int32u txBeaconCount = 30; + attribute(readonly) int32u txBeaconRequestCount = 31; + attribute(readonly) int32u txOtherCount = 32; + attribute(readonly) int32u txRetryCount = 33; + attribute(readonly) int32u txDirectMaxRetryExpiryCount = 34; + attribute(readonly) int32u txIndirectMaxRetryExpiryCount = 35; + attribute(readonly) int32u txErrCcaCount = 36; + attribute(readonly) int32u txErrAbortCount = 37; + attribute(readonly) int32u txErrBusyChannelCount = 38; + attribute(readonly) int32u rxTotalCount = 39; + attribute(readonly) int32u rxUnicastCount = 40; + attribute(readonly) int32u rxBroadcastCount = 41; + attribute(readonly) int32u rxDataCount = 42; + attribute(readonly) int32u rxDataPollCount = 43; + attribute(readonly) int32u rxBeaconCount = 44; + attribute(readonly) int32u rxBeaconRequestCount = 45; + attribute(readonly) int32u rxOtherCount = 46; + attribute(readonly) int32u rxAddressFilteredCount = 47; + attribute(readonly) int32u rxDestAddrFilteredCount = 48; + attribute(readonly) int32u rxDuplicatedCount = 49; + attribute(readonly) int32u rxErrNoFrameCount = 50; + attribute(readonly) int32u rxErrUnknownNeighborCount = 51; + attribute(readonly) int32u rxErrInvalidSrcAddrCount = 52; + attribute(readonly) int32u rxErrSecCount = 53; + attribute(readonly) int32u rxErrFcsCount = 54; + attribute(readonly) int32u rxErrOtherCount = 55; + attribute(readonly) int64u activeTimestamp = 56; + attribute(readonly) int64u pendingTimestamp = 57; + attribute(readonly) int32u delay = 58; + attribute(readonly) SecurityPolicy securityPolicy[] = 59; + attribute(readonly) octet_string channelMask = 60; + attribute(readonly) OperationalDatasetComponents operationalDatasetComponents[] = 61; + attribute(readonly) NetworkFault activeNetworkFaultsList[] = 62; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster UserLabel = 65 { - attribute(writable, reportable) LabelStruct labelList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) LabelStruct labelList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } 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 2e2303bfd2ec0e..04088538aedf2a 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 @@ -19,10 +19,10 @@ server cluster AdministratorCommissioning = 60 { kWindowNotOpen = 3; } - attribute(readonly, reportable) int8u windowStatus = 0; - attribute(readonly, reportable) fabric_idx adminFabricIndex = 1; - attribute(readonly, reportable) int16u adminVendorId = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u windowStatus = 0; + attribute(readonly) fabric_idx adminFabricIndex = 1; + attribute(readonly) int16u adminVendorId = 2; + attribute(readonly) int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -57,18 +57,18 @@ server cluster Basic = 40 { boolean reachableNewValue = 0; } - attribute(readonly, reportable) int16u interactionModelVersion = 0; - attribute(readonly, reportable) char_string vendorName = 1; - attribute(readonly, reportable) vendor_id vendorID = 2; - attribute(readonly, reportable) char_string productName = 3; - attribute(readonly, reportable) int16u productID = 4; - attribute(writable, reportable) char_string nodeLabel = 5; - attribute(writable, reportable) char_string location = 6; - attribute(readonly, reportable) int16u hardwareVersion = 7; - attribute(readonly, reportable) char_string hardwareVersionString = 8; - attribute(readonly, reportable) int32u softwareVersion = 9; - attribute(readonly, reportable) char_string softwareVersionString = 10; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u interactionModelVersion = 0; + attribute(readonly) char_string vendorName = 1; + attribute(readonly) vendor_id vendorID = 2; + attribute(readonly) char_string productName = 3; + attribute(readonly) int16u productID = 4; + attribute(writable) char_string nodeLabel = 5; + attribute(writable) char_string location = 6; + attribute(readonly) int16u hardwareVersion = 7; + attribute(readonly) char_string hardwareVersionString = 8; + attribute(readonly) int32u softwareVersion = 9; + attribute(readonly) char_string softwareVersionString = 10; + attribute(readonly) int16u clusterRevision = 65533; command MfgSpecificPing(): DefaultSuccess = 0; } @@ -79,11 +79,11 @@ server cluster Descriptor = 29 { INT16U revision = 2; } - attribute(readonly, reportable) DeviceType deviceList[] = 0; - attribute(readonly, reportable) CLUSTER_ID serverList[] = 1; - attribute(readonly, reportable) CLUSTER_ID clientList[] = 2; - attribute(readonly, reportable) ENDPOINT_NO partsList[] = 3; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) DeviceType deviceList[] = 0; + attribute(readonly) CLUSTER_ID serverList[] = 1; + attribute(readonly) CLUSTER_ID clientList[] = 2; + attribute(readonly) ENDPOINT_NO partsList[] = 3; + attribute(readonly) int16u clusterRevision = 65533; } server cluster DiagnosticLogs = 50 { @@ -130,29 +130,29 @@ server cluster EthernetNetworkDiagnostics = 55 { k400g = 9; } - attribute(readonly, reportable) enum8 PHYRate = 0; - attribute(readonly, reportable) boolean fullDuplex = 1; - attribute(readonly, reportable) int64u packetRxCount = 2; - attribute(readonly, reportable) int64u packetTxCount = 3; - attribute(readonly, reportable) int64u txErrCount = 4; - attribute(readonly, reportable) int64u collisionCount = 5; - attribute(readonly, reportable) int64u overrunCount = 6; - attribute(readonly, reportable) boolean carrierDetect = 7; - attribute(readonly, reportable) int64u timeSinceReset = 8; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) enum8 PHYRate = 0; + attribute(readonly) boolean fullDuplex = 1; + attribute(readonly) int64u packetRxCount = 2; + attribute(readonly) int64u packetTxCount = 3; + attribute(readonly) int64u txErrCount = 4; + attribute(readonly) int64u collisionCount = 5; + attribute(readonly) int64u overrunCount = 6; + attribute(readonly) boolean carrierDetect = 7; + attribute(readonly) int64u timeSinceReset = 8; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster FixedLabel = 64 { - attribute(readonly, reportable) LabelStruct labelList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) LabelStruct labelList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } client cluster FlowMeasurement = 1028 { - attribute(readonly, reportable) int16s measuredValue = 0; - attribute(readonly, reportable) int16s minMeasuredValue = 1; - attribute(readonly, reportable) int16s maxMeasuredValue = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16s measuredValue = 0; + attribute(readonly) int16s minMeasuredValue = 1; + attribute(readonly) int16s maxMeasuredValue = 2; + attribute(readonly) int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -173,12 +173,12 @@ server cluster GeneralCommissioning = 48 { INT32U failSafeExpiryLengthMs = 1; } - attribute(writable, reportable) int64u breadcrumb = 0; - attribute(readonly, reportable) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; - attribute(readonly, reportable) enum8 regulatoryConfig = 2; - attribute(readonly, reportable) enum8 locationCapability = 3; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) int64u breadcrumb = 0; + attribute(readonly) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; + attribute(readonly) enum8 regulatoryConfig = 2; + attribute(readonly) enum8 locationCapability = 3; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -291,15 +291,15 @@ server cluster GeneralDiagnostics = 51 { BootReasonType bootReason = 0; } - attribute(readonly, reportable) NetworkInterfaceType networkInterfaces[] = 0; - attribute(readonly, reportable) int16u rebootCount = 1; - attribute(readonly, reportable) int64u upTime = 2; - attribute(readonly, reportable) int32u totalOperationalHours = 3; - attribute(readonly, reportable) enum8 bootReasons = 4; - attribute(readonly, reportable) ENUM8 activeHardwareFaults[] = 5; - attribute(readonly, reportable) ENUM8 activeRadioFaults[] = 6; - attribute(readonly, reportable) ENUM8 activeNetworkFaults[] = 7; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) NetworkInterfaceType networkInterfaces[] = 0; + attribute(readonly) int16u rebootCount = 1; + attribute(readonly) int64u upTime = 2; + attribute(readonly) int32u totalOperationalHours = 3; + attribute(readonly) enum8 bootReasons = 4; + attribute(readonly) ENUM8 activeHardwareFaults[] = 5; + attribute(readonly) ENUM8 activeRadioFaults[] = 6; + attribute(readonly) ENUM8 activeNetworkFaults[] = 7; + attribute(readonly) int16u clusterRevision = 65533; } client cluster LevelControl = 8 { @@ -313,8 +313,8 @@ client cluster LevelControl = 8 { kDown = 1; } - attribute(readonly, reportable) int8u currentLevel = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u currentLevel = 0; + attribute(readonly) int16u clusterRevision = 65533; request struct MoveRequest { MoveMode moveMode = 0; @@ -370,8 +370,8 @@ client cluster LevelControl = 8 { } server cluster LocalizationConfiguration = 43 { - attribute(writable, reportable) char_string activeLocale = 1; - attribute(readonly, reportable) CHAR_STRING supportedLocales[] = 2; + attribute(writable) char_string activeLocale = 1; + attribute(readonly) CHAR_STRING supportedLocales[] = 2; } server cluster NetworkCommissioning = 49 { @@ -424,16 +424,16 @@ server cluster NetworkCommissioning = 49 { INT8U lqi = 8; } - attribute(readonly, reportable) int8u maxNetworks = 0; - attribute(readonly, reportable) NetworkInfo networks[] = 1; - attribute(readonly, reportable) int8u scanMaxTimeSeconds = 2; - attribute(readonly, reportable) int8u connectMaxTimeSeconds = 3; - attribute(writable, reportable) boolean interfaceEnabled = 4; - attribute(readonly, reportable) NetworkCommissioningStatus lastNetworkingStatus = 5; - attribute(readonly, reportable) octet_string lastNetworkID = 6; - attribute(readonly, reportable) int32u lastConnectErrorValue = 7; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u maxNetworks = 0; + attribute(readonly) NetworkInfo networks[] = 1; + attribute(readonly) int8u scanMaxTimeSeconds = 2; + attribute(readonly) int8u connectMaxTimeSeconds = 3; + attribute(writable) boolean interfaceEnabled = 4; + attribute(readonly) NetworkCommissioningStatus lastNetworkingStatus = 5; + attribute(readonly) octet_string lastNetworkID = 6; + attribute(readonly) int32u lastConnectErrorValue = 7; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -509,8 +509,8 @@ client cluster OnOff = 6 { kDyingLight = 1; } - attribute(readonly, reportable) boolean onOff = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) boolean onOff = 0; + attribute(readonly) int16u clusterRevision = 65533; command Off(): DefaultSuccess = 0; command On(): DefaultSuccess = 1; @@ -540,12 +540,12 @@ server cluster OperationalCredentials = 62 { CHAR_STRING label = 6; } - attribute(readonly, reportable) FabricDescriptor fabricsList[] = 1; - attribute(readonly, reportable) int8u supportedFabrics = 2; - attribute(readonly, reportable) int8u commissionedFabrics = 3; - attribute(readonly, reportable) OCTET_STRING trustedRootCertificates[] = 4; - attribute(readonly, reportable) fabric_idx currentFabricIndex = 5; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) FabricDescriptor fabricsList[] = 1; + attribute(readonly) int8u supportedFabrics = 2; + attribute(readonly) int8u commissionedFabrics = 3; + attribute(readonly) OCTET_STRING trustedRootCertificates[] = 4; + attribute(readonly) fabric_idx currentFabricIndex = 5; + attribute(readonly) int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -620,10 +620,10 @@ server cluster OperationalCredentials = 62 { } client cluster PressureMeasurement = 1027 { - attribute(readonly, reportable) int16s measuredValue = 0; - attribute(readonly, reportable) int16s minMeasuredValue = 1; - attribute(readonly, reportable) int16s maxMeasuredValue = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16s measuredValue = 0; + attribute(readonly) int16s minMeasuredValue = 1; + attribute(readonly) int16s maxMeasuredValue = 2; + attribute(readonly) int16u clusterRevision = 65533; } client cluster PumpConfigurationAndControl = 512 { @@ -694,14 +694,14 @@ client cluster PumpConfigurationAndControl = 512 { info event TurbineOperation = 16 { } - attribute(readonly, reportable) int16s maxPressure = 0; - attribute(readonly, reportable) int16u maxSpeed = 1; - attribute(readonly, reportable) int16u maxFlow = 2; - attribute(readonly, reportable) enum8 effectiveOperationMode = 17; - attribute(readonly, reportable) enum8 effectiveControlMode = 18; - attribute(readonly, reportable) int16s capacity = 19; - attribute(writable, reportable) enum8 operationMode = 32; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16s maxPressure = 0; + attribute(readonly) int16u maxSpeed = 1; + attribute(readonly) int16u maxFlow = 2; + attribute(readonly) enum8 effectiveOperationMode = 17; + attribute(readonly) enum8 effectiveControlMode = 18; + attribute(readonly) int16s capacity = 19; + attribute(writable) enum8 operationMode = 32; + attribute(readonly) int16u clusterRevision = 65533; } server cluster SoftwareDiagnostics = 52 { @@ -717,19 +717,19 @@ server cluster SoftwareDiagnostics = 52 { SoftwareFault softwareFault = 0; } - attribute(readonly, reportable) ThreadMetrics threadMetrics[] = 0; - attribute(readonly, reportable) int64u currentHeapFree = 1; - attribute(readonly, reportable) int64u currentHeapUsed = 2; - attribute(readonly, reportable) int64u currentHeapHighWatermark = 3; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) ThreadMetrics threadMetrics[] = 0; + attribute(readonly) int64u currentHeapFree = 1; + attribute(readonly) int64u currentHeapUsed = 2; + attribute(readonly) int64u currentHeapHighWatermark = 3; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } client cluster TemperatureMeasurement = 1026 { - attribute(readonly, reportable) int16s measuredValue = 0; - attribute(readonly, reportable) int16s minMeasuredValue = 1; - attribute(readonly, reportable) int16s maxMeasuredValue = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16s measuredValue = 0; + attribute(readonly) int16s minMeasuredValue = 1; + attribute(readonly) int16s maxMeasuredValue = 2; + attribute(readonly) int16u clusterRevision = 65533; } server cluster ThreadNetworkDiagnostics = 53 { @@ -809,76 +809,76 @@ server cluster ThreadNetworkDiagnostics = 53 { ThreadConnectionStatus connectionStatus = 0; } - attribute(readonly, reportable) int16u channel = 0; - attribute(readonly, reportable) enum8 routingRole = 1; - attribute(readonly, reportable) octet_string networkName = 2; - attribute(readonly, reportable) int16u panId = 3; - attribute(readonly, reportable) int64u extendedPanId = 4; - attribute(readonly, reportable) octet_string meshLocalPrefix = 5; - attribute(readonly, reportable) int64u overrunCount = 6; - attribute(readonly, reportable) NeighborTable neighborTableList[] = 7; - attribute(readonly, reportable) RouteTable routeTableList[] = 8; - attribute(readonly, reportable) int32u partitionId = 9; - attribute(readonly, reportable) int8u weighting = 10; - attribute(readonly, reportable) int8u dataVersion = 11; - attribute(readonly, reportable) int8u stableDataVersion = 12; - attribute(readonly, reportable) int8u leaderRouterId = 13; - attribute(readonly, reportable) int16u detachedRoleCount = 14; - attribute(readonly, reportable) int16u childRoleCount = 15; - attribute(readonly, reportable) int16u routerRoleCount = 16; - attribute(readonly, reportable) int16u leaderRoleCount = 17; - attribute(readonly, reportable) int16u attachAttemptCount = 18; - attribute(readonly, reportable) int16u partitionIdChangeCount = 19; - attribute(readonly, reportable) int16u betterPartitionAttachAttemptCount = 20; - attribute(readonly, reportable) int16u parentChangeCount = 21; - attribute(readonly, reportable) int32u txTotalCount = 22; - attribute(readonly, reportable) int32u txUnicastCount = 23; - attribute(readonly, reportable) int32u txBroadcastCount = 24; - attribute(readonly, reportable) int32u txAckRequestedCount = 25; - attribute(readonly, reportable) int32u txAckedCount = 26; - attribute(readonly, reportable) int32u txNoAckRequestedCount = 27; - attribute(readonly, reportable) int32u txDataCount = 28; - attribute(readonly, reportable) int32u txDataPollCount = 29; - attribute(readonly, reportable) int32u txBeaconCount = 30; - attribute(readonly, reportable) int32u txBeaconRequestCount = 31; - attribute(readonly, reportable) int32u txOtherCount = 32; - attribute(readonly, reportable) int32u txRetryCount = 33; - attribute(readonly, reportable) int32u txDirectMaxRetryExpiryCount = 34; - attribute(readonly, reportable) int32u txIndirectMaxRetryExpiryCount = 35; - attribute(readonly, reportable) int32u txErrCcaCount = 36; - attribute(readonly, reportable) int32u txErrAbortCount = 37; - attribute(readonly, reportable) int32u txErrBusyChannelCount = 38; - attribute(readonly, reportable) int32u rxTotalCount = 39; - attribute(readonly, reportable) int32u rxUnicastCount = 40; - attribute(readonly, reportable) int32u rxBroadcastCount = 41; - attribute(readonly, reportable) int32u rxDataCount = 42; - attribute(readonly, reportable) int32u rxDataPollCount = 43; - attribute(readonly, reportable) int32u rxBeaconCount = 44; - attribute(readonly, reportable) int32u rxBeaconRequestCount = 45; - attribute(readonly, reportable) int32u rxOtherCount = 46; - attribute(readonly, reportable) int32u rxAddressFilteredCount = 47; - attribute(readonly, reportable) int32u rxDestAddrFilteredCount = 48; - attribute(readonly, reportable) int32u rxDuplicatedCount = 49; - attribute(readonly, reportable) int32u rxErrNoFrameCount = 50; - attribute(readonly, reportable) int32u rxErrUnknownNeighborCount = 51; - attribute(readonly, reportable) int32u rxErrInvalidSrcAddrCount = 52; - attribute(readonly, reportable) int32u rxErrSecCount = 53; - attribute(readonly, reportable) int32u rxErrFcsCount = 54; - attribute(readonly, reportable) int32u rxErrOtherCount = 55; - attribute(readonly, reportable) int64u activeTimestamp = 56; - attribute(readonly, reportable) int64u pendingTimestamp = 57; - attribute(readonly, reportable) int32u delay = 58; - attribute(readonly, reportable) SecurityPolicy securityPolicy[] = 59; - attribute(readonly, reportable) octet_string channelMask = 60; - attribute(readonly, reportable) OperationalDatasetComponents operationalDatasetComponents[] = 61; - attribute(readonly, reportable) NetworkFault activeNetworkFaultsList[] = 62; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u channel = 0; + attribute(readonly) enum8 routingRole = 1; + attribute(readonly) octet_string networkName = 2; + attribute(readonly) int16u panId = 3; + attribute(readonly) int64u extendedPanId = 4; + attribute(readonly) octet_string meshLocalPrefix = 5; + attribute(readonly) int64u overrunCount = 6; + attribute(readonly) NeighborTable neighborTableList[] = 7; + attribute(readonly) RouteTable routeTableList[] = 8; + attribute(readonly) int32u partitionId = 9; + attribute(readonly) int8u weighting = 10; + attribute(readonly) int8u dataVersion = 11; + attribute(readonly) int8u stableDataVersion = 12; + attribute(readonly) int8u leaderRouterId = 13; + attribute(readonly) int16u detachedRoleCount = 14; + attribute(readonly) int16u childRoleCount = 15; + attribute(readonly) int16u routerRoleCount = 16; + attribute(readonly) int16u leaderRoleCount = 17; + attribute(readonly) int16u attachAttemptCount = 18; + attribute(readonly) int16u partitionIdChangeCount = 19; + attribute(readonly) int16u betterPartitionAttachAttemptCount = 20; + attribute(readonly) int16u parentChangeCount = 21; + attribute(readonly) int32u txTotalCount = 22; + attribute(readonly) int32u txUnicastCount = 23; + attribute(readonly) int32u txBroadcastCount = 24; + attribute(readonly) int32u txAckRequestedCount = 25; + attribute(readonly) int32u txAckedCount = 26; + attribute(readonly) int32u txNoAckRequestedCount = 27; + attribute(readonly) int32u txDataCount = 28; + attribute(readonly) int32u txDataPollCount = 29; + attribute(readonly) int32u txBeaconCount = 30; + attribute(readonly) int32u txBeaconRequestCount = 31; + attribute(readonly) int32u txOtherCount = 32; + attribute(readonly) int32u txRetryCount = 33; + attribute(readonly) int32u txDirectMaxRetryExpiryCount = 34; + attribute(readonly) int32u txIndirectMaxRetryExpiryCount = 35; + attribute(readonly) int32u txErrCcaCount = 36; + attribute(readonly) int32u txErrAbortCount = 37; + attribute(readonly) int32u txErrBusyChannelCount = 38; + attribute(readonly) int32u rxTotalCount = 39; + attribute(readonly) int32u rxUnicastCount = 40; + attribute(readonly) int32u rxBroadcastCount = 41; + attribute(readonly) int32u rxDataCount = 42; + attribute(readonly) int32u rxDataPollCount = 43; + attribute(readonly) int32u rxBeaconCount = 44; + attribute(readonly) int32u rxBeaconRequestCount = 45; + attribute(readonly) int32u rxOtherCount = 46; + attribute(readonly) int32u rxAddressFilteredCount = 47; + attribute(readonly) int32u rxDestAddrFilteredCount = 48; + attribute(readonly) int32u rxDuplicatedCount = 49; + attribute(readonly) int32u rxErrNoFrameCount = 50; + attribute(readonly) int32u rxErrUnknownNeighborCount = 51; + attribute(readonly) int32u rxErrInvalidSrcAddrCount = 52; + attribute(readonly) int32u rxErrSecCount = 53; + attribute(readonly) int32u rxErrFcsCount = 54; + attribute(readonly) int32u rxErrOtherCount = 55; + attribute(readonly) int64u activeTimestamp = 56; + attribute(readonly) int64u pendingTimestamp = 57; + attribute(readonly) int32u delay = 58; + attribute(readonly) SecurityPolicy securityPolicy[] = 59; + attribute(readonly) octet_string channelMask = 60; + attribute(readonly) OperationalDatasetComponents operationalDatasetComponents[] = 61; + attribute(readonly) NetworkFault activeNetworkFaultsList[] = 62; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster UserLabel = 65 { - attribute(writable, reportable) LabelStruct labelList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) LabelStruct labelList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } server cluster WiFiNetworkDiagnostics = 54 { @@ -925,21 +925,21 @@ server cluster WiFiNetworkDiagnostics = 54 { WiFiConnectionStatus connectionStatus = 0; } - attribute(readonly, reportable) octet_string bssid = 0; - attribute(readonly, reportable) enum8 securityType = 1; - attribute(readonly, reportable) enum8 wiFiVersion = 2; - attribute(readonly, reportable) int16u channelNumber = 3; - attribute(readonly, reportable) int8s rssi = 4; - attribute(readonly, reportable) int32u beaconLostCount = 5; - attribute(readonly, reportable) int32u beaconRxCount = 6; - attribute(readonly, reportable) int32u packetMulticastRxCount = 7; - attribute(readonly, reportable) int32u packetMulticastTxCount = 8; - attribute(readonly, reportable) int32u packetUnicastRxCount = 9; - attribute(readonly, reportable) int32u packetUnicastTxCount = 10; - attribute(readonly, reportable) int64u currentMaxRate = 11; - attribute(readonly, reportable) int64u overrunCount = 12; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) octet_string bssid = 0; + attribute(readonly) enum8 securityType = 1; + attribute(readonly) enum8 wiFiVersion = 2; + attribute(readonly) int16u channelNumber = 3; + attribute(readonly) int8s rssi = 4; + attribute(readonly) int32u beaconLostCount = 5; + attribute(readonly) int32u beaconRxCount = 6; + attribute(readonly) int32u packetMulticastRxCount = 7; + attribute(readonly) int32u packetMulticastTxCount = 8; + attribute(readonly) int32u packetUnicastRxCount = 9; + attribute(readonly) int32u packetUnicastTxCount = 10; + attribute(readonly) int64u currentMaxRate = 11; + attribute(readonly) int64u overrunCount = 12; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } diff --git a/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter b/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter index 12fbfc1c2337a5..42d02bcdea1886 100644 --- a/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter +++ b/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter @@ -19,10 +19,10 @@ server cluster AdministratorCommissioning = 60 { kWindowNotOpen = 3; } - attribute(readonly, reportable) int8u windowStatus = 0; - attribute(readonly, reportable) fabric_idx adminFabricIndex = 1; - attribute(readonly, reportable) int16u adminVendorId = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u windowStatus = 0; + attribute(readonly) fabric_idx adminFabricIndex = 1; + attribute(readonly) int16u adminVendorId = 2; + attribute(readonly) int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -57,18 +57,18 @@ server cluster Basic = 40 { boolean reachableNewValue = 0; } - attribute(readonly, reportable) int16u interactionModelVersion = 0; - attribute(readonly, reportable) char_string vendorName = 1; - attribute(readonly, reportable) vendor_id vendorID = 2; - attribute(readonly, reportable) char_string productName = 3; - attribute(readonly, reportable) int16u productID = 4; - attribute(writable, reportable) char_string nodeLabel = 5; - attribute(writable, reportable) char_string location = 6; - attribute(readonly, reportable) int16u hardwareVersion = 7; - attribute(readonly, reportable) char_string hardwareVersionString = 8; - attribute(readonly, reportable) int32u softwareVersion = 9; - attribute(readonly, reportable) char_string softwareVersionString = 10; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u interactionModelVersion = 0; + attribute(readonly) char_string vendorName = 1; + attribute(readonly) vendor_id vendorID = 2; + attribute(readonly) char_string productName = 3; + attribute(readonly) int16u productID = 4; + attribute(writable) char_string nodeLabel = 5; + attribute(writable) char_string location = 6; + attribute(readonly) int16u hardwareVersion = 7; + attribute(readonly) char_string hardwareVersionString = 8; + attribute(readonly) int32u softwareVersion = 9; + attribute(readonly) char_string softwareVersionString = 10; + attribute(readonly) int16u clusterRevision = 65533; } server cluster Descriptor = 29 { @@ -77,11 +77,11 @@ server cluster Descriptor = 29 { INT16U revision = 2; } - attribute(readonly, reportable) DeviceType deviceList[] = 0; - attribute(readonly, reportable) CLUSTER_ID serverList[] = 1; - attribute(readonly, reportable) CLUSTER_ID clientList[] = 2; - attribute(readonly, reportable) ENDPOINT_NO partsList[] = 3; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) DeviceType deviceList[] = 0; + attribute(readonly) CLUSTER_ID serverList[] = 1; + attribute(readonly) CLUSTER_ID clientList[] = 2; + attribute(readonly) ENDPOINT_NO partsList[] = 3; + attribute(readonly) int16u clusterRevision = 65533; } server cluster DiagnosticLogs = 50 { @@ -128,22 +128,22 @@ server cluster EthernetNetworkDiagnostics = 55 { k400g = 9; } - attribute(readonly, reportable) enum8 PHYRate = 0; - attribute(readonly, reportable) boolean fullDuplex = 1; - attribute(readonly, reportable) int64u packetRxCount = 2; - attribute(readonly, reportable) int64u packetTxCount = 3; - attribute(readonly, reportable) int64u txErrCount = 4; - attribute(readonly, reportable) int64u collisionCount = 5; - attribute(readonly, reportable) int64u overrunCount = 6; - attribute(readonly, reportable) boolean carrierDetect = 7; - attribute(readonly, reportable) int64u timeSinceReset = 8; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) enum8 PHYRate = 0; + attribute(readonly) boolean fullDuplex = 1; + attribute(readonly) int64u packetRxCount = 2; + attribute(readonly) int64u packetTxCount = 3; + attribute(readonly) int64u txErrCount = 4; + attribute(readonly) int64u collisionCount = 5; + attribute(readonly) int64u overrunCount = 6; + attribute(readonly) boolean carrierDetect = 7; + attribute(readonly) int64u timeSinceReset = 8; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster FixedLabel = 64 { - attribute(readonly, reportable) LabelStruct labelList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) LabelStruct labelList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -164,12 +164,12 @@ server cluster GeneralCommissioning = 48 { INT32U failSafeExpiryLengthMs = 1; } - attribute(writable, reportable) int64u breadcrumb = 0; - attribute(readonly, reportable) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; - attribute(readonly, reportable) enum8 regulatoryConfig = 2; - attribute(readonly, reportable) enum8 locationCapability = 3; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) int64u breadcrumb = 0; + attribute(readonly) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; + attribute(readonly) enum8 regulatoryConfig = 2; + attribute(readonly) enum8 locationCapability = 3; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -282,20 +282,20 @@ server cluster GeneralDiagnostics = 51 { BootReasonType bootReason = 0; } - attribute(readonly, reportable) NetworkInterfaceType networkInterfaces[] = 0; - attribute(readonly, reportable) int16u rebootCount = 1; - attribute(readonly, reportable) int64u upTime = 2; - attribute(readonly, reportable) int32u totalOperationalHours = 3; - attribute(readonly, reportable) enum8 bootReasons = 4; - attribute(readonly, reportable) ENUM8 activeHardwareFaults[] = 5; - attribute(readonly, reportable) ENUM8 activeRadioFaults[] = 6; - attribute(readonly, reportable) ENUM8 activeNetworkFaults[] = 7; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) NetworkInterfaceType networkInterfaces[] = 0; + attribute(readonly) int16u rebootCount = 1; + attribute(readonly) int64u upTime = 2; + attribute(readonly) int32u totalOperationalHours = 3; + attribute(readonly) enum8 bootReasons = 4; + attribute(readonly) ENUM8 activeHardwareFaults[] = 5; + attribute(readonly) ENUM8 activeRadioFaults[] = 6; + attribute(readonly) ENUM8 activeNetworkFaults[] = 7; + attribute(readonly) int16u clusterRevision = 65533; } server cluster LocalizationConfiguration = 43 { - attribute(writable, reportable) char_string activeLocale = 1; - attribute(readonly, reportable) CHAR_STRING supportedLocales[] = 2; + attribute(writable) char_string activeLocale = 1; + attribute(readonly) CHAR_STRING supportedLocales[] = 2; } server cluster NetworkCommissioning = 49 { @@ -348,16 +348,16 @@ server cluster NetworkCommissioning = 49 { INT8U lqi = 8; } - attribute(readonly, reportable) int8u maxNetworks = 0; - attribute(readonly, reportable) NetworkInfo networks[] = 1; - attribute(readonly, reportable) int8u scanMaxTimeSeconds = 2; - attribute(readonly, reportable) int8u connectMaxTimeSeconds = 3; - attribute(writable, reportable) boolean interfaceEnabled = 4; - attribute(readonly, reportable) NetworkCommissioningStatus lastNetworkingStatus = 5; - attribute(readonly, reportable) octet_string lastNetworkID = 6; - attribute(readonly, reportable) int32u lastConnectErrorValue = 7; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u maxNetworks = 0; + attribute(readonly) NetworkInfo networks[] = 1; + attribute(readonly) int8u scanMaxTimeSeconds = 2; + attribute(readonly) int8u connectMaxTimeSeconds = 3; + attribute(writable) boolean interfaceEnabled = 4; + attribute(readonly) NetworkCommissioningStatus lastNetworkingStatus = 5; + attribute(readonly) octet_string lastNetworkID = 6; + attribute(readonly) int32u lastConnectErrorValue = 7; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct AddOrUpdateWiFiNetworkRequest { OCTET_STRING ssid = 0; @@ -434,12 +434,12 @@ server cluster OperationalCredentials = 62 { CHAR_STRING label = 6; } - attribute(readonly, reportable) FabricDescriptor fabricsList[] = 1; - attribute(readonly, reportable) int8u supportedFabrics = 2; - attribute(readonly, reportable) int8u commissionedFabrics = 3; - attribute(readonly, reportable) OCTET_STRING trustedRootCertificates[] = 4; - attribute(readonly, reportable) fabric_idx currentFabricIndex = 5; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) FabricDescriptor fabricsList[] = 1; + attribute(readonly) int8u supportedFabrics = 2; + attribute(readonly) int8u commissionedFabrics = 3; + attribute(readonly) OCTET_STRING trustedRootCertificates[] = 4; + attribute(readonly) fabric_idx currentFabricIndex = 5; + attribute(readonly) int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -518,21 +518,21 @@ server cluster SoftwareDiagnostics = 52 { SoftwareFault softwareFault = 0; } - attribute(readonly, reportable) int64u currentHeapHighWatermark = 3; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int64u currentHeapHighWatermark = 3; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster TemperatureMeasurement = 1026 { - attribute(readonly, reportable) int16s measuredValue = 0; - attribute(readonly, reportable) int16s minMeasuredValue = 1; - attribute(readonly, reportable) int16s maxMeasuredValue = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16s measuredValue = 0; + attribute(readonly) int16s minMeasuredValue = 1; + attribute(readonly) int16s maxMeasuredValue = 2; + attribute(readonly) int16u clusterRevision = 65533; } server cluster UserLabel = 65 { - attribute(writable, reportable) LabelStruct labelList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) LabelStruct labelList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } server cluster WiFiNetworkDiagnostics = 54 { @@ -579,21 +579,21 @@ server cluster WiFiNetworkDiagnostics = 54 { WiFiConnectionStatus connectionStatus = 0; } - attribute(readonly, reportable) octet_string bssid = 0; - attribute(readonly, reportable) enum8 securityType = 1; - attribute(readonly, reportable) enum8 wiFiVersion = 2; - attribute(readonly, reportable) int16u channelNumber = 3; - attribute(readonly, reportable) int8s rssi = 4; - attribute(readonly, reportable) int32u beaconLostCount = 5; - attribute(readonly, reportable) int32u beaconRxCount = 6; - attribute(readonly, reportable) int32u packetMulticastRxCount = 7; - attribute(readonly, reportable) int32u packetMulticastTxCount = 8; - attribute(readonly, reportable) int32u packetUnicastRxCount = 9; - attribute(readonly, reportable) int32u packetUnicastTxCount = 10; - attribute(readonly, reportable) int64u currentMaxRate = 11; - attribute(readonly, reportable) int64u overrunCount = 12; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) octet_string bssid = 0; + attribute(readonly) enum8 securityType = 1; + attribute(readonly) enum8 wiFiVersion = 2; + attribute(readonly) int16u channelNumber = 3; + attribute(readonly) int8s rssi = 4; + attribute(readonly) int32u beaconLostCount = 5; + attribute(readonly) int32u beaconRxCount = 6; + attribute(readonly) int32u packetMulticastRxCount = 7; + attribute(readonly) int32u packetMulticastTxCount = 8; + attribute(readonly) int32u packetUnicastRxCount = 9; + attribute(readonly) int32u packetUnicastTxCount = 10; + attribute(readonly) int64u currentMaxRate = 11; + attribute(readonly) int64u overrunCount = 12; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index ca99688932e6ea..d18513da56a02b 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -19,10 +19,10 @@ server cluster AdministratorCommissioning = 60 { kWindowNotOpen = 3; } - attribute(readonly, reportable) int8u windowStatus = 0; - attribute(readonly, reportable) fabric_idx adminFabricIndex = 1; - attribute(readonly, reportable) int16u adminVendorId = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u windowStatus = 0; + attribute(readonly) fabric_idx adminFabricIndex = 1; + attribute(readonly) int16u adminVendorId = 2; + attribute(readonly) int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -57,32 +57,32 @@ server cluster Basic = 40 { boolean reachableNewValue = 0; } - attribute(readonly, reportable) int16u interactionModelVersion = 0; - attribute(readonly, reportable) char_string vendorName = 1; - attribute(readonly, reportable) vendor_id vendorID = 2; - attribute(readonly, reportable) char_string productName = 3; - attribute(readonly, reportable) int16u productID = 4; - attribute(writable, reportable) char_string nodeLabel = 5; - attribute(writable, reportable) char_string location = 6; - attribute(readonly, reportable) int16u hardwareVersion = 7; - attribute(readonly, reportable) char_string hardwareVersionString = 8; - attribute(readonly, reportable) int32u softwareVersion = 9; - attribute(readonly, reportable) char_string softwareVersionString = 10; - attribute(readonly, reportable) char_string manufacturingDate = 11; - attribute(readonly, reportable) char_string partNumber = 12; - attribute(readonly, reportable) long_char_string productURL = 13; - attribute(readonly, reportable) char_string productLabel = 14; - attribute(readonly, reportable) char_string serialNumber = 15; - attribute(writable, reportable) boolean localConfigDisabled = 16; - attribute(readonly, reportable) boolean reachable = 17; - attribute(readonly, reportable) char_string uniqueID = 18; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u interactionModelVersion = 0; + attribute(readonly) char_string vendorName = 1; + attribute(readonly) vendor_id vendorID = 2; + attribute(readonly) char_string productName = 3; + attribute(readonly) int16u productID = 4; + attribute(writable) char_string nodeLabel = 5; + attribute(writable) char_string location = 6; + attribute(readonly) int16u hardwareVersion = 7; + attribute(readonly) char_string hardwareVersionString = 8; + attribute(readonly) int32u softwareVersion = 9; + attribute(readonly) char_string softwareVersionString = 10; + attribute(readonly) char_string manufacturingDate = 11; + attribute(readonly) char_string partNumber = 12; + attribute(readonly) long_char_string productURL = 13; + attribute(readonly) char_string productLabel = 14; + attribute(readonly) char_string serialNumber = 15; + attribute(writable) boolean localConfigDisabled = 16; + attribute(readonly) boolean reachable = 17; + attribute(readonly) char_string uniqueID = 18; + attribute(readonly) int16u clusterRevision = 65533; command MfgSpecificPing(): DefaultSuccess = 0; } server cluster Binding = 30 { - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u clusterRevision = 65533; request struct BindRequest { NODE_ID nodeId = 0; @@ -108,11 +108,11 @@ server cluster Descriptor = 29 { INT16U revision = 2; } - attribute(readonly, reportable) DeviceType deviceList[] = 0; - attribute(readonly, reportable) CLUSTER_ID serverList[] = 1; - attribute(readonly, reportable) CLUSTER_ID clientList[] = 2; - attribute(readonly, reportable) ENDPOINT_NO partsList[] = 3; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) DeviceType deviceList[] = 0; + attribute(readonly) CLUSTER_ID serverList[] = 1; + attribute(readonly) CLUSTER_ID clientList[] = 2; + attribute(readonly) ENDPOINT_NO partsList[] = 3; + attribute(readonly) int16u clusterRevision = 65533; } server cluster DiagnosticLogs = 50 { @@ -159,22 +159,22 @@ server cluster EthernetNetworkDiagnostics = 55 { k400g = 9; } - attribute(readonly, reportable) enum8 PHYRate = 0; - attribute(readonly, reportable) boolean fullDuplex = 1; - attribute(readonly, reportable) int64u packetRxCount = 2; - attribute(readonly, reportable) int64u packetTxCount = 3; - attribute(readonly, reportable) int64u txErrCount = 4; - attribute(readonly, reportable) int64u collisionCount = 5; - attribute(readonly, reportable) int64u overrunCount = 6; - attribute(readonly, reportable) boolean carrierDetect = 7; - attribute(readonly, reportable) int64u timeSinceReset = 8; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) enum8 PHYRate = 0; + attribute(readonly) boolean fullDuplex = 1; + attribute(readonly) int64u packetRxCount = 2; + attribute(readonly) int64u packetTxCount = 3; + attribute(readonly) int64u txErrCount = 4; + attribute(readonly) int64u collisionCount = 5; + attribute(readonly) int64u overrunCount = 6; + attribute(readonly) boolean carrierDetect = 7; + attribute(readonly) int64u timeSinceReset = 8; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster FixedLabel = 64 { - attribute(readonly, reportable) LabelStruct labelList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) LabelStruct labelList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -195,12 +195,12 @@ server cluster GeneralCommissioning = 48 { INT32U failSafeExpiryLengthMs = 1; } - attribute(writable, reportable) int64u breadcrumb = 0; - attribute(readonly, reportable) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; - attribute(readonly, reportable) enum8 regulatoryConfig = 2; - attribute(readonly, reportable) enum8 locationCapability = 3; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) int64u breadcrumb = 0; + attribute(readonly) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; + attribute(readonly) enum8 regulatoryConfig = 2; + attribute(readonly) enum8 locationCapability = 3; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -313,15 +313,15 @@ server cluster GeneralDiagnostics = 51 { BootReasonType bootReason = 0; } - attribute(readonly, reportable) NetworkInterfaceType networkInterfaces[] = 0; - attribute(readonly, reportable) int16u rebootCount = 1; - attribute(readonly, reportable) int64u upTime = 2; - attribute(readonly, reportable) int32u totalOperationalHours = 3; - attribute(readonly, reportable) enum8 bootReasons = 4; - attribute(readonly, reportable) ENUM8 activeHardwareFaults[] = 5; - attribute(readonly, reportable) ENUM8 activeRadioFaults[] = 6; - attribute(readonly, reportable) ENUM8 activeNetworkFaults[] = 7; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) NetworkInterfaceType networkInterfaces[] = 0; + attribute(readonly) int16u rebootCount = 1; + attribute(readonly) int64u upTime = 2; + attribute(readonly) int32u totalOperationalHours = 3; + attribute(readonly) enum8 bootReasons = 4; + attribute(readonly) ENUM8 activeHardwareFaults[] = 5; + attribute(readonly) ENUM8 activeRadioFaults[] = 6; + attribute(readonly) ENUM8 activeNetworkFaults[] = 7; + attribute(readonly) int16u clusterRevision = 65533; } server cluster GroupKeyManagement = 63 { @@ -343,14 +343,14 @@ server cluster GroupKeyManagement = 63 { CHAR_STRING groupName = 3; } - attribute(readonly, reportable) GroupKey groupKeyMap[] = 0; - attribute(readonly, reportable) GroupInfo groupTable[] = 1; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) GroupKey groupKeyMap[] = 0; + attribute(readonly) GroupInfo groupTable[] = 1; + attribute(readonly) int16u clusterRevision = 65533; } server cluster Groups = 4 { - attribute(readonly, reportable) bitmap8 nameSupport = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) bitmap8 nameSupport = 0; + attribute(readonly) int16u clusterRevision = 65533; request struct AddGroupRequest { INT16U groupId = 0; @@ -426,9 +426,9 @@ client cluster Identify = 3 { kActuator = 5; } - attribute(writable, reportable) int16u identifyTime = 0; - attribute(readonly, reportable) enum8 identifyType = 1; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) int16u identifyTime = 0; + attribute(readonly) enum8 identifyType = 1; + attribute(readonly) int16u clusterRevision = 65533; request struct IdentifyRequest { INT16U identifyTime = 0; @@ -465,9 +465,9 @@ server cluster Identify = 3 { kActuator = 5; } - attribute(writable, reportable) int16u identifyTime = 0; - attribute(readonly, reportable) enum8 identifyType = 1; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) int16u identifyTime = 0; + attribute(readonly) enum8 identifyType = 1; + attribute(readonly) int16u clusterRevision = 65533; request struct IdentifyRequest { INT16U identifyTime = 0; @@ -482,8 +482,8 @@ server cluster Identify = 3 { } server cluster LocalizationConfiguration = 43 { - attribute(writable, reportable) char_string activeLocale = 1; - attribute(readonly, reportable) CHAR_STRING supportedLocales[] = 2; + attribute(writable) char_string activeLocale = 1; + attribute(readonly) CHAR_STRING supportedLocales[] = 2; } server cluster NetworkCommissioning = 49 { @@ -536,16 +536,16 @@ server cluster NetworkCommissioning = 49 { INT8U lqi = 8; } - attribute(readonly, reportable) int8u maxNetworks = 0; - attribute(readonly, reportable) NetworkInfo networks[] = 1; - attribute(readonly, reportable) int8u scanMaxTimeSeconds = 2; - attribute(readonly, reportable) int8u connectMaxTimeSeconds = 3; - attribute(writable, reportable) boolean interfaceEnabled = 4; - attribute(readonly, reportable) NetworkCommissioningStatus lastNetworkingStatus = 5; - attribute(readonly, reportable) octet_string lastNetworkID = 6; - attribute(readonly, reportable) int32u lastConnectErrorValue = 7; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u maxNetworks = 0; + attribute(readonly) NetworkInfo networks[] = 1; + attribute(readonly) int8u scanMaxTimeSeconds = 2; + attribute(readonly) int8u connectMaxTimeSeconds = 3; + attribute(writable) boolean interfaceEnabled = 4; + attribute(readonly) NetworkCommissioningStatus lastNetworkingStatus = 5; + attribute(readonly) octet_string lastNetworkID = 6; + attribute(readonly) int32u lastConnectErrorValue = 7; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -626,7 +626,7 @@ server cluster OtaSoftwareUpdateProvider = 41 { kDownloadProtocolNotSupported = 3; } - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u clusterRevision = 65533; request struct ApplyUpdateRequestRequest { OCTET_STRING updateToken = 0; @@ -693,12 +693,12 @@ server cluster OperationalCredentials = 62 { CHAR_STRING label = 6; } - attribute(readonly, reportable) FabricDescriptor fabricsList[] = 1; - attribute(readonly, reportable) int8u supportedFabrics = 2; - attribute(readonly, reportable) int8u commissionedFabrics = 3; - attribute(readonly, reportable) OCTET_STRING trustedRootCertificates[] = 4; - attribute(readonly, reportable) fabric_idx currentFabricIndex = 5; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) FabricDescriptor fabricsList[] = 1; + attribute(readonly) int8u supportedFabrics = 2; + attribute(readonly) int8u commissionedFabrics = 3; + attribute(readonly) OCTET_STRING trustedRootCertificates[] = 4; + attribute(readonly) fabric_idx currentFabricIndex = 5; + attribute(readonly) int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -779,12 +779,12 @@ server cluster Scenes = 5 { INT8U value = 3; } - attribute(readonly, reportable) int8u sceneCount = 0; - attribute(readonly, reportable) int8u currentScene = 1; - attribute(readonly, reportable) int16u currentGroup = 2; - attribute(readonly, reportable) boolean sceneValid = 3; - attribute(readonly, reportable) bitmap8 nameSupport = 4; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u sceneCount = 0; + attribute(readonly) int8u currentScene = 1; + attribute(readonly) int16u currentGroup = 2; + attribute(readonly) boolean sceneValid = 3; + attribute(readonly) bitmap8 nameSupport = 4; + attribute(readonly) int16u clusterRevision = 65533; request struct AddSceneRequest { INT16U groupId = 0; @@ -885,12 +885,12 @@ server cluster SoftwareDiagnostics = 52 { SoftwareFault softwareFault = 0; } - attribute(readonly, reportable) ThreadMetrics threadMetrics[] = 0; - attribute(readonly, reportable) int64u currentHeapFree = 1; - attribute(readonly, reportable) int64u currentHeapUsed = 2; - attribute(readonly, reportable) int64u currentHeapHighWatermark = 3; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) ThreadMetrics threadMetrics[] = 0; + attribute(readonly) int64u currentHeapFree = 1; + attribute(readonly) int64u currentHeapUsed = 2; + attribute(readonly) int64u currentHeapHighWatermark = 3; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster Thermostat = 513 { @@ -900,25 +900,25 @@ server cluster Thermostat = 513 { kHeatAndCoolSetpoints = 2; } - attribute(readonly, reportable) int16s localTemperature = 0; - attribute(readonly, reportable) int16s absMinHeatSetpointLimit = 3; - attribute(readonly, reportable) int16s absMaxHeatSetpointLimit = 4; - attribute(readonly, reportable) int16s absMinCoolSetpointLimit = 5; - attribute(readonly, reportable) int16s absMaxCoolSetpointLimit = 6; - attribute(writable, reportable) int16s occupiedCoolingSetpoint = 17; - attribute(writable, reportable) int16s occupiedHeatingSetpoint = 18; - attribute(writable, reportable) int16s minHeatSetpointLimit = 21; - attribute(writable, reportable) int16s maxHeatSetpointLimit = 22; - attribute(writable, reportable) int16s minCoolSetpointLimit = 23; - attribute(writable, reportable) int16s maxCoolSetpointLimit = 24; - attribute(writable, reportable) int8s minSetpointDeadBand = 25; - attribute(writable, reportable) enum8 controlSequenceOfOperation = 27; - attribute(writable, reportable) enum8 systemMode = 28; - attribute(readonly, reportable) enum8 startOfWeek = 32; - attribute(readonly, reportable) int8u numberOfWeeklyTransitions = 33; - attribute(readonly, reportable) int8u numberOfDailyTransitions = 34; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16s localTemperature = 0; + attribute(readonly) int16s absMinHeatSetpointLimit = 3; + attribute(readonly) int16s absMaxHeatSetpointLimit = 4; + attribute(readonly) int16s absMinCoolSetpointLimit = 5; + attribute(readonly) int16s absMaxCoolSetpointLimit = 6; + attribute(writable) int16s occupiedCoolingSetpoint = 17; + attribute(writable) int16s occupiedHeatingSetpoint = 18; + attribute(writable) int16s minHeatSetpointLimit = 21; + attribute(writable) int16s maxHeatSetpointLimit = 22; + attribute(writable) int16s minCoolSetpointLimit = 23; + attribute(writable) int16s maxCoolSetpointLimit = 24; + attribute(writable) int8s minSetpointDeadBand = 25; + attribute(writable) enum8 controlSequenceOfOperation = 27; + attribute(writable) enum8 systemMode = 28; + attribute(readonly) enum8 startOfWeek = 32; + attribute(readonly) int8u numberOfWeeklyTransitions = 33; + attribute(readonly) int8u numberOfDailyTransitions = 34; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct GetWeeklyScheduleRequest { DayOfWeek daysToReturn = 0; @@ -1037,76 +1037,76 @@ server cluster ThreadNetworkDiagnostics = 53 { ThreadConnectionStatus connectionStatus = 0; } - attribute(readonly, reportable) int16u channel = 0; - attribute(readonly, reportable) enum8 routingRole = 1; - attribute(readonly, reportable) octet_string networkName = 2; - attribute(readonly, reportable) int16u panId = 3; - attribute(readonly, reportable) int64u extendedPanId = 4; - attribute(readonly, reportable) octet_string meshLocalPrefix = 5; - attribute(readonly, reportable) int64u overrunCount = 6; - attribute(readonly, reportable) NeighborTable neighborTableList[] = 7; - attribute(readonly, reportable) RouteTable routeTableList[] = 8; - attribute(readonly, reportable) int32u partitionId = 9; - attribute(readonly, reportable) int8u weighting = 10; - attribute(readonly, reportable) int8u dataVersion = 11; - attribute(readonly, reportable) int8u stableDataVersion = 12; - attribute(readonly, reportable) int8u leaderRouterId = 13; - attribute(readonly, reportable) int16u detachedRoleCount = 14; - attribute(readonly, reportable) int16u childRoleCount = 15; - attribute(readonly, reportable) int16u routerRoleCount = 16; - attribute(readonly, reportable) int16u leaderRoleCount = 17; - attribute(readonly, reportable) int16u attachAttemptCount = 18; - attribute(readonly, reportable) int16u partitionIdChangeCount = 19; - attribute(readonly, reportable) int16u betterPartitionAttachAttemptCount = 20; - attribute(readonly, reportable) int16u parentChangeCount = 21; - attribute(readonly, reportable) int32u txTotalCount = 22; - attribute(readonly, reportable) int32u txUnicastCount = 23; - attribute(readonly, reportable) int32u txBroadcastCount = 24; - attribute(readonly, reportable) int32u txAckRequestedCount = 25; - attribute(readonly, reportable) int32u txAckedCount = 26; - attribute(readonly, reportable) int32u txNoAckRequestedCount = 27; - attribute(readonly, reportable) int32u txDataCount = 28; - attribute(readonly, reportable) int32u txDataPollCount = 29; - attribute(readonly, reportable) int32u txBeaconCount = 30; - attribute(readonly, reportable) int32u txBeaconRequestCount = 31; - attribute(readonly, reportable) int32u txOtherCount = 32; - attribute(readonly, reportable) int32u txRetryCount = 33; - attribute(readonly, reportable) int32u txDirectMaxRetryExpiryCount = 34; - attribute(readonly, reportable) int32u txIndirectMaxRetryExpiryCount = 35; - attribute(readonly, reportable) int32u txErrCcaCount = 36; - attribute(readonly, reportable) int32u txErrAbortCount = 37; - attribute(readonly, reportable) int32u txErrBusyChannelCount = 38; - attribute(readonly, reportable) int32u rxTotalCount = 39; - attribute(readonly, reportable) int32u rxUnicastCount = 40; - attribute(readonly, reportable) int32u rxBroadcastCount = 41; - attribute(readonly, reportable) int32u rxDataCount = 42; - attribute(readonly, reportable) int32u rxDataPollCount = 43; - attribute(readonly, reportable) int32u rxBeaconCount = 44; - attribute(readonly, reportable) int32u rxBeaconRequestCount = 45; - attribute(readonly, reportable) int32u rxOtherCount = 46; - attribute(readonly, reportable) int32u rxAddressFilteredCount = 47; - attribute(readonly, reportable) int32u rxDestAddrFilteredCount = 48; - attribute(readonly, reportable) int32u rxDuplicatedCount = 49; - attribute(readonly, reportable) int32u rxErrNoFrameCount = 50; - attribute(readonly, reportable) int32u rxErrUnknownNeighborCount = 51; - attribute(readonly, reportable) int32u rxErrInvalidSrcAddrCount = 52; - attribute(readonly, reportable) int32u rxErrSecCount = 53; - attribute(readonly, reportable) int32u rxErrFcsCount = 54; - attribute(readonly, reportable) int32u rxErrOtherCount = 55; - attribute(readonly, reportable) int64u activeTimestamp = 56; - attribute(readonly, reportable) int64u pendingTimestamp = 57; - attribute(readonly, reportable) int32u delay = 58; - attribute(readonly, reportable) SecurityPolicy securityPolicy[] = 59; - attribute(readonly, reportable) octet_string channelMask = 60; - attribute(readonly, reportable) OperationalDatasetComponents operationalDatasetComponents[] = 61; - attribute(readonly, reportable) NetworkFault activeNetworkFaultsList[] = 62; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u channel = 0; + attribute(readonly) enum8 routingRole = 1; + attribute(readonly) octet_string networkName = 2; + attribute(readonly) int16u panId = 3; + attribute(readonly) int64u extendedPanId = 4; + attribute(readonly) octet_string meshLocalPrefix = 5; + attribute(readonly) int64u overrunCount = 6; + attribute(readonly) NeighborTable neighborTableList[] = 7; + attribute(readonly) RouteTable routeTableList[] = 8; + attribute(readonly) int32u partitionId = 9; + attribute(readonly) int8u weighting = 10; + attribute(readonly) int8u dataVersion = 11; + attribute(readonly) int8u stableDataVersion = 12; + attribute(readonly) int8u leaderRouterId = 13; + attribute(readonly) int16u detachedRoleCount = 14; + attribute(readonly) int16u childRoleCount = 15; + attribute(readonly) int16u routerRoleCount = 16; + attribute(readonly) int16u leaderRoleCount = 17; + attribute(readonly) int16u attachAttemptCount = 18; + attribute(readonly) int16u partitionIdChangeCount = 19; + attribute(readonly) int16u betterPartitionAttachAttemptCount = 20; + attribute(readonly) int16u parentChangeCount = 21; + attribute(readonly) int32u txTotalCount = 22; + attribute(readonly) int32u txUnicastCount = 23; + attribute(readonly) int32u txBroadcastCount = 24; + attribute(readonly) int32u txAckRequestedCount = 25; + attribute(readonly) int32u txAckedCount = 26; + attribute(readonly) int32u txNoAckRequestedCount = 27; + attribute(readonly) int32u txDataCount = 28; + attribute(readonly) int32u txDataPollCount = 29; + attribute(readonly) int32u txBeaconCount = 30; + attribute(readonly) int32u txBeaconRequestCount = 31; + attribute(readonly) int32u txOtherCount = 32; + attribute(readonly) int32u txRetryCount = 33; + attribute(readonly) int32u txDirectMaxRetryExpiryCount = 34; + attribute(readonly) int32u txIndirectMaxRetryExpiryCount = 35; + attribute(readonly) int32u txErrCcaCount = 36; + attribute(readonly) int32u txErrAbortCount = 37; + attribute(readonly) int32u txErrBusyChannelCount = 38; + attribute(readonly) int32u rxTotalCount = 39; + attribute(readonly) int32u rxUnicastCount = 40; + attribute(readonly) int32u rxBroadcastCount = 41; + attribute(readonly) int32u rxDataCount = 42; + attribute(readonly) int32u rxDataPollCount = 43; + attribute(readonly) int32u rxBeaconCount = 44; + attribute(readonly) int32u rxBeaconRequestCount = 45; + attribute(readonly) int32u rxOtherCount = 46; + attribute(readonly) int32u rxAddressFilteredCount = 47; + attribute(readonly) int32u rxDestAddrFilteredCount = 48; + attribute(readonly) int32u rxDuplicatedCount = 49; + attribute(readonly) int32u rxErrNoFrameCount = 50; + attribute(readonly) int32u rxErrUnknownNeighborCount = 51; + attribute(readonly) int32u rxErrInvalidSrcAddrCount = 52; + attribute(readonly) int32u rxErrSecCount = 53; + attribute(readonly) int32u rxErrFcsCount = 54; + attribute(readonly) int32u rxErrOtherCount = 55; + attribute(readonly) int64u activeTimestamp = 56; + attribute(readonly) int64u pendingTimestamp = 57; + attribute(readonly) int32u delay = 58; + attribute(readonly) SecurityPolicy securityPolicy[] = 59; + attribute(readonly) octet_string channelMask = 60; + attribute(readonly) OperationalDatasetComponents operationalDatasetComponents[] = 61; + attribute(readonly) NetworkFault activeNetworkFaultsList[] = 62; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster UserLabel = 65 { - attribute(writable, reportable) LabelStruct labelList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) LabelStruct labelList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } server cluster WiFiNetworkDiagnostics = 54 { @@ -1153,21 +1153,21 @@ server cluster WiFiNetworkDiagnostics = 54 { WiFiConnectionStatus connectionStatus = 0; } - attribute(readonly, reportable) octet_string bssid = 0; - attribute(readonly, reportable) enum8 securityType = 1; - attribute(readonly, reportable) enum8 wiFiVersion = 2; - attribute(readonly, reportable) int16u channelNumber = 3; - attribute(readonly, reportable) int8s rssi = 4; - attribute(readonly, reportable) int32u beaconLostCount = 5; - attribute(readonly, reportable) int32u beaconRxCount = 6; - attribute(readonly, reportable) int32u packetMulticastRxCount = 7; - attribute(readonly, reportable) int32u packetMulticastTxCount = 8; - attribute(readonly, reportable) int32u packetUnicastRxCount = 9; - attribute(readonly, reportable) int32u packetUnicastTxCount = 10; - attribute(readonly, reportable) int64u currentMaxRate = 11; - attribute(readonly, reportable) int64u overrunCount = 12; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) octet_string bssid = 0; + attribute(readonly) enum8 securityType = 1; + attribute(readonly) enum8 wiFiVersion = 2; + attribute(readonly) int16u channelNumber = 3; + attribute(readonly) int8s rssi = 4; + attribute(readonly) int32u beaconLostCount = 5; + attribute(readonly) int32u beaconRxCount = 6; + attribute(readonly) int32u packetMulticastRxCount = 7; + attribute(readonly) int32u packetMulticastTxCount = 8; + attribute(readonly) int32u packetUnicastRxCount = 9; + attribute(readonly) int32u packetUnicastTxCount = 10; + attribute(readonly) int64u currentMaxRate = 11; + attribute(readonly) int64u overrunCount = 12; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index 33413202a9d4b4..0881c0bcb7573e 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -7,7 +7,7 @@ struct LabelStruct { } server cluster AccountLogin = 1294 { - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u clusterRevision = 65533; request struct GetSetupPINRequestRequest { CHAR_STRING tempAccountIdentifier = 0; @@ -40,10 +40,10 @@ server cluster AdministratorCommissioning = 60 { kWindowNotOpen = 3; } - attribute(readonly, reportable) int8u windowStatus = 0; - attribute(readonly, reportable) fabric_idx adminFabricIndex = 1; - attribute(readonly, reportable) int16u adminVendorId = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u windowStatus = 0; + attribute(readonly) fabric_idx adminFabricIndex = 1; + attribute(readonly) int16u adminVendorId = 2; + attribute(readonly) int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -76,15 +76,15 @@ server cluster ApplicationBasic = 1293 { CHAR_STRING applicationId = 2; } - attribute(readonly, reportable) char_string vendorName = 0; - attribute(readonly, reportable) int16u vendorId = 1; - attribute(readonly, reportable) char_string applicationName = 2; - attribute(readonly, reportable) int16u productId = 3; - attribute(writable, reportable) ApplicationBasicApplication applicationApp = 4; - attribute(readonly, reportable) ApplicationStatusEnum applicationStatus = 5; - attribute(readonly, reportable) char_string applicationVersion = 6; - attribute(readonly, reportable) vendor_id allowedVendorList[] = 7; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) char_string vendorName = 0; + attribute(readonly) int16u vendorId = 1; + attribute(readonly) char_string applicationName = 2; + attribute(readonly) int16u productId = 3; + attribute(writable) ApplicationBasicApplication applicationApp = 4; + attribute(readonly) ApplicationStatusEnum applicationStatus = 5; + attribute(readonly) char_string applicationVersion = 6; + attribute(readonly) vendor_id allowedVendorList[] = 7; + attribute(readonly) int16u clusterRevision = 65533; } server cluster ApplicationLauncher = 1292 { @@ -104,9 +104,9 @@ server cluster ApplicationLauncher = 1292 { CHAR_STRING applicationId = 2; } - attribute(readonly, reportable) INT16U applicationLauncherList[] = 0; - attribute(writable, reportable) ApplicationEP applicationLauncherApp = 1; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) INT16U applicationLauncherList[] = 0; + attribute(writable) ApplicationEP applicationLauncherApp = 1; + attribute(readonly) int16u clusterRevision = 65533; request struct HideAppRequestRequest { ApplicationLauncherApplication application = 0; @@ -147,9 +147,9 @@ server cluster AudioOutput = 1291 { CHAR_STRING name = 3; } - attribute(readonly, reportable) OutputInfo audioOutputList[] = 0; - attribute(readonly, reportable) int8u currentAudioOutput = 1; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) OutputInfo audioOutputList[] = 0; + attribute(readonly) int8u currentAudioOutput = 1; + attribute(readonly) int16u clusterRevision = 65533; request struct RenameOutputRequestRequest { INT8U index = 0; @@ -179,31 +179,31 @@ server cluster Basic = 40 { boolean reachableNewValue = 0; } - attribute(readonly, reportable) int16u interactionModelVersion = 0; - attribute(readonly, reportable) char_string vendorName = 1; - attribute(readonly, reportable) vendor_id vendorID = 2; - attribute(readonly, reportable) char_string productName = 3; - attribute(readonly, reportable) int16u productID = 4; - attribute(writable, reportable) char_string nodeLabel = 5; - attribute(writable, reportable) char_string location = 6; - attribute(readonly, reportable) int16u hardwareVersion = 7; - attribute(readonly, reportable) char_string hardwareVersionString = 8; - attribute(readonly, reportable) int32u softwareVersion = 9; - attribute(readonly, reportable) char_string softwareVersionString = 10; - attribute(readonly, reportable) char_string manufacturingDate = 11; - attribute(readonly, reportable) char_string partNumber = 12; - attribute(readonly, reportable) long_char_string productURL = 13; - attribute(readonly, reportable) char_string productLabel = 14; - attribute(readonly, reportable) char_string serialNumber = 15; - attribute(writable, reportable) boolean localConfigDisabled = 16; - attribute(readonly, reportable) char_string uniqueID = 18; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u interactionModelVersion = 0; + attribute(readonly) char_string vendorName = 1; + attribute(readonly) vendor_id vendorID = 2; + attribute(readonly) char_string productName = 3; + attribute(readonly) int16u productID = 4; + attribute(writable) char_string nodeLabel = 5; + attribute(writable) char_string location = 6; + attribute(readonly) int16u hardwareVersion = 7; + attribute(readonly) char_string hardwareVersionString = 8; + attribute(readonly) int32u softwareVersion = 9; + attribute(readonly) char_string softwareVersionString = 10; + attribute(readonly) char_string manufacturingDate = 11; + attribute(readonly) char_string partNumber = 12; + attribute(readonly) long_char_string productURL = 13; + attribute(readonly) char_string productLabel = 14; + attribute(readonly) char_string serialNumber = 15; + attribute(writable) boolean localConfigDisabled = 16; + attribute(readonly) char_string uniqueID = 18; + attribute(readonly) int16u clusterRevision = 65533; command MfgSpecificPing(): DefaultSuccess = 0; } client cluster Binding = 30 { - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u clusterRevision = 65533; request struct BindRequest { NODE_ID nodeId = 0; @@ -224,7 +224,7 @@ client cluster Binding = 30 { } server cluster Binding = 30 { - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u clusterRevision = 65533; request struct BindRequest { NODE_ID nodeId = 0; @@ -269,10 +269,10 @@ server cluster Channel = 1284 { LineupInfoTypeEnum lineupInfoType = 4; } - attribute(readonly, reportable) ChannelInfo channelList[] = 0; - attribute(writable, reportable) LineupInfo channelLineup = 1; - attribute(writable, reportable) ChannelInfo currentChannel = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) ChannelInfo channelList[] = 0; + attribute(writable) LineupInfo channelLineup = 1; + attribute(writable) ChannelInfo currentChannel = 2; + attribute(readonly) int16u clusterRevision = 65533; request struct ChangeChannelByNumberRequestRequest { INT16U majorNumber = 0; @@ -361,9 +361,9 @@ server cluster ContentLauncher = 1290 { MetricTypeEnum metric = 3; } - attribute(readonly, reportable) CHAR_STRING acceptHeaderList[] = 0; - attribute(writable, reportable) bitmap32 supportedStreamingProtocols = 1; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) CHAR_STRING acceptHeaderList[] = 0; + attribute(writable) bitmap32 supportedStreamingProtocols = 1; + attribute(readonly) int16u clusterRevision = 65533; request struct LaunchContentRequestRequest { BOOLEAN autoPlay = 0; @@ -392,11 +392,11 @@ server cluster Descriptor = 29 { INT16U revision = 2; } - attribute(readonly, reportable) DeviceType deviceList[] = 0; - attribute(readonly, reportable) CLUSTER_ID serverList[] = 1; - attribute(readonly, reportable) CLUSTER_ID clientList[] = 2; - attribute(readonly, reportable) ENDPOINT_NO partsList[] = 3; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) DeviceType deviceList[] = 0; + attribute(readonly) CLUSTER_ID serverList[] = 1; + attribute(readonly) CLUSTER_ID clientList[] = 2; + attribute(readonly) ENDPOINT_NO partsList[] = 3; + attribute(readonly) int16u clusterRevision = 65533; } server cluster DiagnosticLogs = 50 { @@ -443,22 +443,22 @@ server cluster EthernetNetworkDiagnostics = 55 { k400g = 9; } - attribute(readonly, reportable) enum8 PHYRate = 0; - attribute(readonly, reportable) boolean fullDuplex = 1; - attribute(readonly, reportable) int64u packetRxCount = 2; - attribute(readonly, reportable) int64u packetTxCount = 3; - attribute(readonly, reportable) int64u txErrCount = 4; - attribute(readonly, reportable) int64u collisionCount = 5; - attribute(readonly, reportable) int64u overrunCount = 6; - attribute(readonly, reportable) boolean carrierDetect = 7; - attribute(readonly, reportable) int64u timeSinceReset = 8; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) enum8 PHYRate = 0; + attribute(readonly) boolean fullDuplex = 1; + attribute(readonly) int64u packetRxCount = 2; + attribute(readonly) int64u packetTxCount = 3; + attribute(readonly) int64u txErrCount = 4; + attribute(readonly) int64u collisionCount = 5; + attribute(readonly) int64u overrunCount = 6; + attribute(readonly) boolean carrierDetect = 7; + attribute(readonly) int64u timeSinceReset = 8; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster FixedLabel = 64 { - attribute(readonly, reportable) LabelStruct labelList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) LabelStruct labelList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } client cluster GeneralCommissioning = 48 { @@ -479,12 +479,12 @@ client cluster GeneralCommissioning = 48 { INT32U failSafeExpiryLengthMs = 1; } - attribute(writable, reportable) int64u breadcrumb = 0; - attribute(readonly, reportable) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; - attribute(readonly, reportable) enum8 regulatoryConfig = 2; - attribute(readonly, reportable) enum8 locationCapability = 3; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) int64u breadcrumb = 0; + attribute(readonly) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; + attribute(readonly) enum8 regulatoryConfig = 2; + attribute(readonly) enum8 locationCapability = 3; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -537,12 +537,12 @@ server cluster GeneralCommissioning = 48 { INT32U failSafeExpiryLengthMs = 1; } - attribute(writable, reportable) int64u breadcrumb = 0; - attribute(readonly, reportable) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; - attribute(readonly, reportable) enum8 regulatoryConfig = 2; - attribute(readonly, reportable) enum8 locationCapability = 3; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) int64u breadcrumb = 0; + attribute(readonly) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; + attribute(readonly) enum8 regulatoryConfig = 2; + attribute(readonly) enum8 locationCapability = 3; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -655,15 +655,15 @@ server cluster GeneralDiagnostics = 51 { BootReasonType bootReason = 0; } - attribute(readonly, reportable) NetworkInterfaceType networkInterfaces[] = 0; - attribute(readonly, reportable) int16u rebootCount = 1; - attribute(readonly, reportable) int64u upTime = 2; - attribute(readonly, reportable) int32u totalOperationalHours = 3; - attribute(readonly, reportable) enum8 bootReasons = 4; - attribute(readonly, reportable) ENUM8 activeHardwareFaults[] = 5; - attribute(readonly, reportable) ENUM8 activeRadioFaults[] = 6; - attribute(readonly, reportable) ENUM8 activeNetworkFaults[] = 7; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) NetworkInterfaceType networkInterfaces[] = 0; + attribute(readonly) int16u rebootCount = 1; + attribute(readonly) int64u upTime = 2; + attribute(readonly) int32u totalOperationalHours = 3; + attribute(readonly) enum8 bootReasons = 4; + attribute(readonly) ENUM8 activeHardwareFaults[] = 5; + attribute(readonly) ENUM8 activeRadioFaults[] = 6; + attribute(readonly) ENUM8 activeNetworkFaults[] = 7; + attribute(readonly) int16u clusterRevision = 65533; } server cluster GroupKeyManagement = 63 { @@ -685,9 +685,9 @@ server cluster GroupKeyManagement = 63 { CHAR_STRING groupName = 3; } - attribute(readonly, reportable) GroupKey groupKeyMap[] = 0; - attribute(readonly, reportable) GroupInfo groupTable[] = 1; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) GroupKey groupKeyMap[] = 0; + attribute(readonly) GroupInfo groupTable[] = 1; + attribute(readonly) int16u clusterRevision = 65533; } server cluster KeypadInput = 1289 { @@ -786,7 +786,7 @@ server cluster KeypadInput = 1289 { kInvalidKeyInCurrentState = 2; } - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u clusterRevision = 65533; request struct SendKeyRequestRequest { CecKeyCode keyCode = 0; @@ -806,22 +806,22 @@ server cluster LevelControl = 8 { kDown = 1; } - attribute(readonly, reportable) int8u currentLevel = 0; - attribute(readonly, reportable) int16u remainingTime = 1; - attribute(readonly, reportable) int8u minLevel = 2; - attribute(readonly, reportable) int8u maxLevel = 3; - attribute(readonly, reportable) int16u currentFrequency = 4; - attribute(readonly, reportable) int16u minFrequency = 5; - attribute(readonly, reportable) int16u maxFrequency = 6; - attribute(writable, reportable) bitmap8 options = 15; - attribute(writable, reportable) int16u onOffTransitionTime = 16; - attribute(writable, reportable) int8u onLevel = 17; - attribute(writable, reportable) int16u onTransitionTime = 18; - attribute(writable, reportable) int16u offTransitionTime = 19; - attribute(writable, reportable) int8u defaultMoveRate = 20; - attribute(writable, reportable) int8u startUpCurrentLevel = 16384; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u currentLevel = 0; + attribute(readonly) int16u remainingTime = 1; + attribute(readonly) int8u minLevel = 2; + attribute(readonly) int8u maxLevel = 3; + attribute(readonly) int16u currentFrequency = 4; + attribute(readonly) int16u minFrequency = 5; + attribute(readonly) int16u maxFrequency = 6; + attribute(writable) bitmap8 options = 15; + attribute(writable) int16u onOffTransitionTime = 16; + attribute(writable) int8u onLevel = 17; + attribute(writable) int16u onTransitionTime = 18; + attribute(writable) int16u offTransitionTime = 19; + attribute(writable) int8u defaultMoveRate = 20; + attribute(writable) int8u startUpCurrentLevel = 16384; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct MoveRequest { MoveMode moveMode = 0; @@ -877,12 +877,12 @@ server cluster LevelControl = 8 { } server cluster LocalizationConfiguration = 43 { - attribute(writable, reportable) char_string activeLocale = 1; - attribute(readonly, reportable) CHAR_STRING supportedLocales[] = 2; + attribute(writable) char_string activeLocale = 1; + attribute(readonly) CHAR_STRING supportedLocales[] = 2; } server cluster LowPower = 1288 { - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u clusterRevision = 65533; command Sleep(): DefaultSuccess = 0; } @@ -910,9 +910,9 @@ server cluster MediaInput = 1287 { CHAR_STRING description = 4; } - attribute(readonly, reportable) InputInfo mediaInputList[] = 0; - attribute(readonly, reportable) int8u currentMediaInput = 1; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) InputInfo mediaInputList[] = 0; + attribute(readonly) int8u currentMediaInput = 1; + attribute(readonly) int16u clusterRevision = 65533; request struct RenameInputRequestRequest { INT8U index = 0; @@ -951,14 +951,14 @@ server cluster MediaPlayback = 1286 { INT64U position = 2; } - attribute(readonly, reportable) PlaybackStateEnum playbackState = 0; - attribute(readonly, reportable) epoch_us startTime = 1; - attribute(readonly, reportable) int64u duration = 2; - attribute(writable, reportable) PlaybackPosition position = 3; - attribute(readonly, reportable) single playbackSpeed = 4; - attribute(readonly, reportable) int64u seekRangeEnd = 5; - attribute(readonly, reportable) int64u seekRangeStart = 6; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) PlaybackStateEnum playbackState = 0; + attribute(readonly) epoch_us startTime = 1; + attribute(readonly) int64u duration = 2; + attribute(writable) PlaybackPosition position = 3; + attribute(readonly) single playbackSpeed = 4; + attribute(readonly) int64u seekRangeEnd = 5; + attribute(readonly) int64u seekRangeStart = 6; + attribute(readonly) int16u clusterRevision = 65533; request struct SeekRequestRequest { INT64U position = 0; @@ -1039,16 +1039,16 @@ client cluster NetworkCommissioning = 49 { INT8U lqi = 8; } - attribute(readonly, reportable) int8u maxNetworks = 0; - attribute(readonly, reportable) NetworkInfo networks[] = 1; - attribute(readonly, reportable) int8u scanMaxTimeSeconds = 2; - attribute(readonly, reportable) int8u connectMaxTimeSeconds = 3; - attribute(writable, reportable) boolean interfaceEnabled = 4; - attribute(readonly, reportable) NetworkCommissioningStatus lastNetworkingStatus = 5; - attribute(readonly, reportable) octet_string lastNetworkID = 6; - attribute(readonly, reportable) int32u lastConnectErrorValue = 7; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u maxNetworks = 0; + attribute(readonly) NetworkInfo networks[] = 1; + attribute(readonly) int8u scanMaxTimeSeconds = 2; + attribute(readonly) int8u connectMaxTimeSeconds = 3; + attribute(writable) boolean interfaceEnabled = 4; + attribute(readonly) NetworkCommissioningStatus lastNetworkingStatus = 5; + attribute(readonly) octet_string lastNetworkID = 6; + attribute(readonly) int32u lastConnectErrorValue = 7; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -1158,16 +1158,16 @@ server cluster NetworkCommissioning = 49 { INT8U lqi = 8; } - attribute(readonly, reportable) int8u maxNetworks = 0; - attribute(readonly, reportable) NetworkInfo networks[] = 1; - attribute(readonly, reportable) int8u scanMaxTimeSeconds = 2; - attribute(readonly, reportable) int8u connectMaxTimeSeconds = 3; - attribute(writable, reportable) boolean interfaceEnabled = 4; - attribute(readonly, reportable) NetworkCommissioningStatus lastNetworkingStatus = 5; - attribute(readonly, reportable) octet_string lastNetworkID = 6; - attribute(readonly, reportable) int32u lastConnectErrorValue = 7; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u maxNetworks = 0; + attribute(readonly) NetworkInfo networks[] = 1; + attribute(readonly) int8u scanMaxTimeSeconds = 2; + attribute(readonly) int8u connectMaxTimeSeconds = 3; + attribute(writable) boolean interfaceEnabled = 4; + attribute(readonly) NetworkCommissioningStatus lastNetworkingStatus = 5; + attribute(readonly) octet_string lastNetworkID = 6; + attribute(readonly) int32u lastConnectErrorValue = 7; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -1248,7 +1248,7 @@ server cluster OtaSoftwareUpdateProvider = 41 { kDownloadProtocolNotSupported = 3; } - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u clusterRevision = 65533; request struct ApplyUpdateRequestRequest { OCTET_STRING updateToken = 0; @@ -1308,8 +1308,8 @@ server cluster OnOff = 6 { kDyingLight = 1; } - attribute(readonly, reportable) boolean onOff = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) boolean onOff = 0; + attribute(readonly) int16u clusterRevision = 65533; command Off(): DefaultSuccess = 0; command On(): DefaultSuccess = 1; @@ -1339,12 +1339,12 @@ client cluster OperationalCredentials = 62 { CHAR_STRING label = 6; } - attribute(readonly, reportable) FabricDescriptor fabricsList[] = 1; - attribute(readonly, reportable) int8u supportedFabrics = 2; - attribute(readonly, reportable) int8u commissionedFabrics = 3; - attribute(readonly, reportable) OCTET_STRING trustedRootCertificates[] = 4; - attribute(readonly, reportable) fabric_idx currentFabricIndex = 5; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) FabricDescriptor fabricsList[] = 1; + attribute(readonly) int8u supportedFabrics = 2; + attribute(readonly) int8u commissionedFabrics = 3; + attribute(readonly) OCTET_STRING trustedRootCertificates[] = 4; + attribute(readonly) fabric_idx currentFabricIndex = 5; + attribute(readonly) int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -1430,12 +1430,12 @@ server cluster OperationalCredentials = 62 { CHAR_STRING label = 6; } - attribute(readonly, reportable) FabricDescriptor fabricsList[] = 1; - attribute(readonly, reportable) int8u supportedFabrics = 2; - attribute(readonly, reportable) int8u commissionedFabrics = 3; - attribute(readonly, reportable) OCTET_STRING trustedRootCertificates[] = 4; - attribute(readonly, reportable) fabric_idx currentFabricIndex = 5; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) FabricDescriptor fabricsList[] = 1; + attribute(readonly) int8u supportedFabrics = 2; + attribute(readonly) int8u commissionedFabrics = 3; + attribute(readonly) OCTET_STRING trustedRootCertificates[] = 4; + attribute(readonly) fabric_idx currentFabricIndex = 5; + attribute(readonly) int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -1510,10 +1510,10 @@ server cluster OperationalCredentials = 62 { } server cluster RelativeHumidityMeasurement = 1029 { - attribute(readonly, reportable) int16u measuredValue = 0; - attribute(readonly, reportable) int16u minMeasuredValue = 1; - attribute(readonly, reportable) int16u maxMeasuredValue = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u measuredValue = 0; + attribute(readonly) int16u minMeasuredValue = 1; + attribute(readonly) int16u maxMeasuredValue = 2; + attribute(readonly) int16u clusterRevision = 65533; } server cluster SoftwareDiagnostics = 52 { @@ -1529,12 +1529,12 @@ server cluster SoftwareDiagnostics = 52 { SoftwareFault softwareFault = 0; } - attribute(readonly, reportable) ThreadMetrics threadMetrics[] = 0; - attribute(readonly, reportable) int64u currentHeapFree = 1; - attribute(readonly, reportable) int64u currentHeapUsed = 2; - attribute(readonly, reportable) int64u currentHeapHighWatermark = 3; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) ThreadMetrics threadMetrics[] = 0; + attribute(readonly) int64u currentHeapFree = 1; + attribute(readonly) int64u currentHeapUsed = 2; + attribute(readonly) int64u currentHeapHighWatermark = 3; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster TargetNavigator = 1285 { @@ -1549,9 +1549,9 @@ server cluster TargetNavigator = 1285 { CHAR_STRING name = 2; } - attribute(readonly, reportable) TargetInfo targetNavigatorList[] = 0; - attribute(readonly, reportable) int8u currentNavigatorTarget = 1; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) TargetInfo targetNavigatorList[] = 0; + attribute(readonly) int8u currentNavigatorTarget = 1; + attribute(readonly) int16u clusterRevision = 65533; request struct NavigateTargetRequestRequest { INT8U target = 0; @@ -1643,81 +1643,81 @@ server cluster ThreadNetworkDiagnostics = 53 { ThreadConnectionStatus connectionStatus = 0; } - attribute(readonly, reportable) int16u channel = 0; - attribute(readonly, reportable) enum8 routingRole = 1; - attribute(readonly, reportable) octet_string networkName = 2; - attribute(readonly, reportable) int16u panId = 3; - attribute(readonly, reportable) int64u extendedPanId = 4; - attribute(readonly, reportable) octet_string meshLocalPrefix = 5; - attribute(readonly, reportable) int64u overrunCount = 6; - attribute(readonly, reportable) NeighborTable neighborTableList[] = 7; - attribute(readonly, reportable) RouteTable routeTableList[] = 8; - attribute(readonly, reportable) int32u partitionId = 9; - attribute(readonly, reportable) int8u weighting = 10; - attribute(readonly, reportable) int8u dataVersion = 11; - attribute(readonly, reportable) int8u stableDataVersion = 12; - attribute(readonly, reportable) int8u leaderRouterId = 13; - attribute(readonly, reportable) int16u detachedRoleCount = 14; - attribute(readonly, reportable) int16u childRoleCount = 15; - attribute(readonly, reportable) int16u routerRoleCount = 16; - attribute(readonly, reportable) int16u leaderRoleCount = 17; - attribute(readonly, reportable) int16u attachAttemptCount = 18; - attribute(readonly, reportable) int16u partitionIdChangeCount = 19; - attribute(readonly, reportable) int16u betterPartitionAttachAttemptCount = 20; - attribute(readonly, reportable) int16u parentChangeCount = 21; - attribute(readonly, reportable) int32u txTotalCount = 22; - attribute(readonly, reportable) int32u txUnicastCount = 23; - attribute(readonly, reportable) int32u txBroadcastCount = 24; - attribute(readonly, reportable) int32u txAckRequestedCount = 25; - attribute(readonly, reportable) int32u txAckedCount = 26; - attribute(readonly, reportable) int32u txNoAckRequestedCount = 27; - attribute(readonly, reportable) int32u txDataCount = 28; - attribute(readonly, reportable) int32u txDataPollCount = 29; - attribute(readonly, reportable) int32u txBeaconCount = 30; - attribute(readonly, reportable) int32u txBeaconRequestCount = 31; - attribute(readonly, reportable) int32u txOtherCount = 32; - attribute(readonly, reportable) int32u txRetryCount = 33; - attribute(readonly, reportable) int32u txDirectMaxRetryExpiryCount = 34; - attribute(readonly, reportable) int32u txIndirectMaxRetryExpiryCount = 35; - attribute(readonly, reportable) int32u txErrCcaCount = 36; - attribute(readonly, reportable) int32u txErrAbortCount = 37; - attribute(readonly, reportable) int32u txErrBusyChannelCount = 38; - attribute(readonly, reportable) int32u rxTotalCount = 39; - attribute(readonly, reportable) int32u rxUnicastCount = 40; - attribute(readonly, reportable) int32u rxBroadcastCount = 41; - attribute(readonly, reportable) int32u rxDataCount = 42; - attribute(readonly, reportable) int32u rxDataPollCount = 43; - attribute(readonly, reportable) int32u rxBeaconCount = 44; - attribute(readonly, reportable) int32u rxBeaconRequestCount = 45; - attribute(readonly, reportable) int32u rxOtherCount = 46; - attribute(readonly, reportable) int32u rxAddressFilteredCount = 47; - attribute(readonly, reportable) int32u rxDestAddrFilteredCount = 48; - attribute(readonly, reportable) int32u rxDuplicatedCount = 49; - attribute(readonly, reportable) int32u rxErrNoFrameCount = 50; - attribute(readonly, reportable) int32u rxErrUnknownNeighborCount = 51; - attribute(readonly, reportable) int32u rxErrInvalidSrcAddrCount = 52; - attribute(readonly, reportable) int32u rxErrSecCount = 53; - attribute(readonly, reportable) int32u rxErrFcsCount = 54; - attribute(readonly, reportable) int32u rxErrOtherCount = 55; - attribute(readonly, reportable) int64u activeTimestamp = 56; - attribute(readonly, reportable) int64u pendingTimestamp = 57; - attribute(readonly, reportable) int32u delay = 58; - attribute(readonly, reportable) SecurityPolicy securityPolicy[] = 59; - attribute(readonly, reportable) octet_string channelMask = 60; - attribute(readonly, reportable) OperationalDatasetComponents operationalDatasetComponents[] = 61; - attribute(readonly, reportable) NetworkFault activeNetworkFaultsList[] = 62; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u channel = 0; + attribute(readonly) enum8 routingRole = 1; + attribute(readonly) octet_string networkName = 2; + attribute(readonly) int16u panId = 3; + attribute(readonly) int64u extendedPanId = 4; + attribute(readonly) octet_string meshLocalPrefix = 5; + attribute(readonly) int64u overrunCount = 6; + attribute(readonly) NeighborTable neighborTableList[] = 7; + attribute(readonly) RouteTable routeTableList[] = 8; + attribute(readonly) int32u partitionId = 9; + attribute(readonly) int8u weighting = 10; + attribute(readonly) int8u dataVersion = 11; + attribute(readonly) int8u stableDataVersion = 12; + attribute(readonly) int8u leaderRouterId = 13; + attribute(readonly) int16u detachedRoleCount = 14; + attribute(readonly) int16u childRoleCount = 15; + attribute(readonly) int16u routerRoleCount = 16; + attribute(readonly) int16u leaderRoleCount = 17; + attribute(readonly) int16u attachAttemptCount = 18; + attribute(readonly) int16u partitionIdChangeCount = 19; + attribute(readonly) int16u betterPartitionAttachAttemptCount = 20; + attribute(readonly) int16u parentChangeCount = 21; + attribute(readonly) int32u txTotalCount = 22; + attribute(readonly) int32u txUnicastCount = 23; + attribute(readonly) int32u txBroadcastCount = 24; + attribute(readonly) int32u txAckRequestedCount = 25; + attribute(readonly) int32u txAckedCount = 26; + attribute(readonly) int32u txNoAckRequestedCount = 27; + attribute(readonly) int32u txDataCount = 28; + attribute(readonly) int32u txDataPollCount = 29; + attribute(readonly) int32u txBeaconCount = 30; + attribute(readonly) int32u txBeaconRequestCount = 31; + attribute(readonly) int32u txOtherCount = 32; + attribute(readonly) int32u txRetryCount = 33; + attribute(readonly) int32u txDirectMaxRetryExpiryCount = 34; + attribute(readonly) int32u txIndirectMaxRetryExpiryCount = 35; + attribute(readonly) int32u txErrCcaCount = 36; + attribute(readonly) int32u txErrAbortCount = 37; + attribute(readonly) int32u txErrBusyChannelCount = 38; + attribute(readonly) int32u rxTotalCount = 39; + attribute(readonly) int32u rxUnicastCount = 40; + attribute(readonly) int32u rxBroadcastCount = 41; + attribute(readonly) int32u rxDataCount = 42; + attribute(readonly) int32u rxDataPollCount = 43; + attribute(readonly) int32u rxBeaconCount = 44; + attribute(readonly) int32u rxBeaconRequestCount = 45; + attribute(readonly) int32u rxOtherCount = 46; + attribute(readonly) int32u rxAddressFilteredCount = 47; + attribute(readonly) int32u rxDestAddrFilteredCount = 48; + attribute(readonly) int32u rxDuplicatedCount = 49; + attribute(readonly) int32u rxErrNoFrameCount = 50; + attribute(readonly) int32u rxErrUnknownNeighborCount = 51; + attribute(readonly) int32u rxErrInvalidSrcAddrCount = 52; + attribute(readonly) int32u rxErrSecCount = 53; + attribute(readonly) int32u rxErrFcsCount = 54; + attribute(readonly) int32u rxErrOtherCount = 55; + attribute(readonly) int64u activeTimestamp = 56; + attribute(readonly) int64u pendingTimestamp = 57; + attribute(readonly) int32u delay = 58; + attribute(readonly) SecurityPolicy securityPolicy[] = 59; + attribute(readonly) octet_string channelMask = 60; + attribute(readonly) OperationalDatasetComponents operationalDatasetComponents[] = 61; + attribute(readonly) NetworkFault activeNetworkFaultsList[] = 62; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster UserLabel = 65 { - attribute(writable, reportable) LabelStruct labelList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) LabelStruct labelList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } server cluster WakeOnLan = 1283 { - attribute(readonly, reportable) char_string wakeOnLanMacAddress = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) char_string wakeOnLanMacAddress = 0; + attribute(readonly) int16u clusterRevision = 65533; } server cluster WiFiNetworkDiagnostics = 54 { @@ -1764,21 +1764,21 @@ server cluster WiFiNetworkDiagnostics = 54 { WiFiConnectionStatus connectionStatus = 0; } - attribute(readonly, reportable) octet_string bssid = 0; - attribute(readonly, reportable) enum8 securityType = 1; - attribute(readonly, reportable) enum8 wiFiVersion = 2; - attribute(readonly, reportable) int16u channelNumber = 3; - attribute(readonly, reportable) int8s rssi = 4; - attribute(readonly, reportable) int32u beaconLostCount = 5; - attribute(readonly, reportable) int32u beaconRxCount = 6; - attribute(readonly, reportable) int32u packetMulticastRxCount = 7; - attribute(readonly, reportable) int32u packetMulticastTxCount = 8; - attribute(readonly, reportable) int32u packetUnicastRxCount = 9; - attribute(readonly, reportable) int32u packetUnicastTxCount = 10; - attribute(readonly, reportable) int64u currentMaxRate = 11; - attribute(readonly, reportable) int64u overrunCount = 12; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) octet_string bssid = 0; + attribute(readonly) enum8 securityType = 1; + attribute(readonly) enum8 wiFiVersion = 2; + attribute(readonly) int16u channelNumber = 3; + attribute(readonly) int8s rssi = 4; + attribute(readonly) int32u beaconLostCount = 5; + attribute(readonly) int32u beaconRxCount = 6; + attribute(readonly) int32u packetMulticastRxCount = 7; + attribute(readonly) int32u packetMulticastTxCount = 8; + attribute(readonly) int32u packetUnicastRxCount = 9; + attribute(readonly) int32u packetUnicastTxCount = 10; + attribute(readonly) int64u currentMaxRate = 11; + attribute(readonly) int64u overrunCount = 12; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } 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 665e20470def72..d79822852c6e06 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 @@ -7,7 +7,7 @@ struct LabelStruct { } client cluster AccountLogin = 1294 { - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u clusterRevision = 65533; request struct GetSetupPINRequestRequest { CHAR_STRING tempAccountIdentifier = 0; @@ -36,10 +36,10 @@ server cluster AdministratorCommissioning = 60 { kWindowNotOpen = 3; } - attribute(readonly, reportable) int8u windowStatus = 0; - attribute(readonly, reportable) fabric_idx adminFabricIndex = 1; - attribute(readonly, reportable) int16u adminVendorId = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u windowStatus = 0; + attribute(readonly) fabric_idx adminFabricIndex = 1; + attribute(readonly) int16u adminVendorId = 2; + attribute(readonly) int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -67,13 +67,13 @@ client cluster ApplicationBasic = 1293 { kActiveVisibleNotFocus = 3; } - attribute(readonly, reportable) char_string vendorName = 0; - attribute(readonly, reportable) int16u vendorId = 1; - attribute(readonly, reportable) char_string applicationName = 2; - attribute(readonly, reportable) int16u productId = 3; - attribute(readonly, reportable) ApplicationStatusEnum applicationStatus = 5; - attribute(readonly, reportable) char_string applicationVersion = 6; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) char_string vendorName = 0; + attribute(readonly) int16u vendorId = 1; + attribute(readonly) char_string applicationName = 2; + attribute(readonly) int16u productId = 3; + attribute(readonly) ApplicationStatusEnum applicationStatus = 5; + attribute(readonly) char_string applicationVersion = 6; + attribute(readonly) int16u clusterRevision = 65533; } client cluster ApplicationLauncher = 1292 { @@ -88,8 +88,8 @@ client cluster ApplicationLauncher = 1292 { CHAR_STRING applicationId = 2; } - attribute(readonly, reportable) INT16U applicationLauncherList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) INT16U applicationLauncherList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; request struct HideAppRequestRequest { ApplicationLauncherApplication application = 0; @@ -125,8 +125,8 @@ client cluster AudioOutput = 1291 { CHAR_STRING name = 3; } - attribute(readonly, reportable) OutputInfo audioOutputList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) OutputInfo audioOutputList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; request struct RenameOutputRequestRequest { INT8U index = 0; @@ -142,11 +142,11 @@ client cluster AudioOutput = 1291 { } server cluster BarrierControl = 259 { - attribute(readonly, reportable) enum8 barrierMovingState = 1; - attribute(readonly, reportable) bitmap16 barrierSafetyStatus = 2; - attribute(readonly, reportable) bitmap8 barrierCapabilities = 3; - attribute(readonly, reportable) int8u barrierPosition = 10; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) enum8 barrierMovingState = 1; + attribute(readonly) bitmap16 barrierSafetyStatus = 2; + attribute(readonly) bitmap8 barrierCapabilities = 3; + attribute(readonly) int8u barrierPosition = 10; + attribute(readonly) int16u clusterRevision = 65533; request struct BarrierControlGoToPercentRequest { INT8U percentOpen = 0; @@ -171,39 +171,39 @@ server cluster Basic = 40 { boolean reachableNewValue = 0; } - attribute(readonly, reportable) int16u interactionModelVersion = 0; - attribute(readonly, reportable) char_string vendorName = 1; - attribute(readonly, reportable) vendor_id vendorID = 2; - attribute(readonly, reportable) char_string productName = 3; - attribute(readonly, reportable) int16u productID = 4; - attribute(writable, reportable) char_string nodeLabel = 5; - attribute(writable, reportable) char_string location = 6; - attribute(readonly, reportable) int16u hardwareVersion = 7; - attribute(readonly, reportable) char_string hardwareVersionString = 8; - attribute(readonly, reportable) int32u softwareVersion = 9; - attribute(readonly, reportable) char_string softwareVersionString = 10; - attribute(readonly, reportable) char_string manufacturingDate = 11; - attribute(readonly, reportable) char_string partNumber = 12; - attribute(readonly, reportable) long_char_string productURL = 13; - attribute(readonly, reportable) char_string productLabel = 14; - attribute(readonly, reportable) char_string serialNumber = 15; - attribute(writable, reportable) boolean localConfigDisabled = 16; - attribute(readonly, reportable) boolean reachable = 17; - attribute(readonly, reportable) char_string uniqueID = 18; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u interactionModelVersion = 0; + attribute(readonly) char_string vendorName = 1; + attribute(readonly) vendor_id vendorID = 2; + attribute(readonly) char_string productName = 3; + attribute(readonly) int16u productID = 4; + attribute(writable) char_string nodeLabel = 5; + attribute(writable) char_string location = 6; + attribute(readonly) int16u hardwareVersion = 7; + attribute(readonly) char_string hardwareVersionString = 8; + attribute(readonly) int32u softwareVersion = 9; + attribute(readonly) char_string softwareVersionString = 10; + attribute(readonly) char_string manufacturingDate = 11; + attribute(readonly) char_string partNumber = 12; + attribute(readonly) long_char_string productURL = 13; + attribute(readonly) char_string productLabel = 14; + attribute(readonly) char_string serialNumber = 15; + attribute(writable) boolean localConfigDisabled = 16; + attribute(readonly) boolean reachable = 17; + attribute(readonly) char_string uniqueID = 18; + attribute(readonly) int16u clusterRevision = 65533; command MfgSpecificPing(): DefaultSuccess = 0; } server cluster BinaryInputBasic = 15 { - attribute(writable, reportable) boolean outOfService = 81; - attribute(writable, reportable) boolean presentValue = 85; - attribute(readonly, reportable) bitmap8 statusFlags = 111; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) boolean outOfService = 81; + attribute(writable) boolean presentValue = 85; + attribute(readonly) bitmap8 statusFlags = 111; + attribute(readonly) int16u clusterRevision = 65533; } server cluster Binding = 30 { - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u clusterRevision = 65533; request struct BindRequest { NODE_ID nodeId = 0; @@ -224,21 +224,21 @@ server cluster Binding = 30 { } server cluster BridgedDeviceBasic = 57 { - attribute(readonly, reportable) char_string vendorName = 1; - attribute(readonly, reportable) int16u vendorID = 2; - attribute(readonly, reportable) char_string productName = 3; - attribute(writable, reportable) char_string nodeLabel = 5; - attribute(readonly, reportable) int16u hardwareVersion = 7; - attribute(readonly, reportable) char_string hardwareVersionString = 8; - attribute(readonly, reportable) int32u softwareVersion = 9; - attribute(readonly, reportable) char_string softwareVersionString = 10; - attribute(readonly, reportable) char_string manufacturingDate = 11; - attribute(readonly, reportable) char_string partNumber = 12; - attribute(readonly, reportable) long_char_string productURL = 13; - attribute(readonly, reportable) char_string productLabel = 14; - attribute(readonly, reportable) char_string serialNumber = 15; - attribute(readonly, reportable) boolean reachable = 17; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) char_string vendorName = 1; + attribute(readonly) int16u vendorID = 2; + attribute(readonly) char_string productName = 3; + attribute(writable) char_string nodeLabel = 5; + attribute(readonly) int16u hardwareVersion = 7; + attribute(readonly) char_string hardwareVersionString = 8; + attribute(readonly) int32u softwareVersion = 9; + attribute(readonly) char_string softwareVersionString = 10; + attribute(readonly) char_string manufacturingDate = 11; + attribute(readonly) char_string partNumber = 12; + attribute(readonly) long_char_string productURL = 13; + attribute(readonly) char_string productLabel = 14; + attribute(readonly) char_string serialNumber = 15; + attribute(readonly) boolean reachable = 17; + attribute(readonly) int16u clusterRevision = 65533; command Leave(): DefaultSuccess = 2; command ReachableChanged(): DefaultSuccess = 3; @@ -271,10 +271,10 @@ client cluster Channel = 1284 { LineupInfoTypeEnum lineupInfoType = 4; } - attribute(readonly, reportable) ChannelInfo channelList[] = 0; - attribute(writable, reportable) LineupInfo channelLineup = 1; - attribute(writable, reportable) ChannelInfo currentChannel = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) ChannelInfo channelList[] = 0; + attribute(writable) LineupInfo channelLineup = 1; + attribute(writable) ChannelInfo currentChannel = 2; + attribute(readonly) int16u clusterRevision = 65533; request struct ChangeChannelByNumberRequestRequest { INT16U majorNumber = 0; @@ -341,57 +341,57 @@ server cluster ColorControl = 768 { kDown = 3; } - attribute(readonly, reportable) int8u currentHue = 0; - attribute(readonly, reportable) int8u currentSaturation = 1; - attribute(readonly, reportable) int16u remainingTime = 2; - attribute(readonly, reportable) int16u currentX = 3; - attribute(readonly, reportable) int16u currentY = 4; - attribute(readonly, reportable) enum8 driftCompensation = 5; - attribute(readonly, reportable) char_string compensationText = 6; - attribute(readonly, reportable) int16u colorTemperature = 7; - attribute(readonly, reportable) enum8 colorMode = 8; - attribute(writable, reportable) bitmap8 colorControlOptions = 15; - attribute(readonly, reportable) int8u numberOfPrimaries = 16; - attribute(readonly, reportable) int16u primary1X = 17; - attribute(readonly, reportable) int16u primary1Y = 18; - attribute(readonly, reportable) int8u primary1Intensity = 19; - attribute(readonly, reportable) int16u primary2X = 21; - attribute(readonly, reportable) int16u primary2Y = 22; - attribute(readonly, reportable) int8u primary2Intensity = 23; - attribute(readonly, reportable) int16u primary3X = 25; - attribute(readonly, reportable) int16u primary3Y = 26; - attribute(readonly, reportable) int8u primary3Intensity = 27; - attribute(readonly, reportable) int16u primary4X = 32; - attribute(readonly, reportable) int16u primary4Y = 33; - attribute(readonly, reportable) int8u primary4Intensity = 34; - attribute(readonly, reportable) int16u primary5X = 36; - attribute(readonly, reportable) int16u primary5Y = 37; - attribute(readonly, reportable) int8u primary5Intensity = 38; - attribute(readonly, reportable) int16u primary6X = 40; - attribute(readonly, reportable) int16u primary6Y = 41; - attribute(readonly, reportable) int8u primary6Intensity = 42; - attribute(writable, reportable) int16u whitePointX = 48; - attribute(writable, reportable) int16u whitePointY = 49; - attribute(writable, reportable) int16u colorPointRX = 50; - attribute(writable, reportable) int16u colorPointRY = 51; - attribute(writable, reportable) int8u colorPointRIntensity = 52; - attribute(writable, reportable) int16u colorPointGX = 54; - attribute(writable, reportable) int16u colorPointGY = 55; - attribute(writable, reportable) int8u colorPointGIntensity = 56; - attribute(writable, reportable) int16u colorPointBX = 58; - attribute(writable, reportable) int16u colorPointBY = 59; - attribute(writable, reportable) int8u colorPointBIntensity = 60; - attribute(readonly, reportable) int16u enhancedCurrentHue = 16384; - attribute(readonly, reportable) enum8 enhancedColorMode = 16385; - attribute(readonly, reportable) int8u colorLoopActive = 16386; - attribute(readonly, reportable) int8u colorLoopDirection = 16387; - attribute(readonly, reportable) int16u colorLoopTime = 16388; - attribute(readonly, reportable) bitmap16 colorCapabilities = 16394; - attribute(readonly, reportable) int16u colorTempPhysicalMin = 16395; - attribute(readonly, reportable) int16u colorTempPhysicalMax = 16396; - attribute(readonly, reportable) int16u coupleColorTempToLevelMinMireds = 16397; - attribute(writable, reportable) int16u startUpColorTemperatureMireds = 16400; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u currentHue = 0; + attribute(readonly) int8u currentSaturation = 1; + attribute(readonly) int16u remainingTime = 2; + attribute(readonly) int16u currentX = 3; + attribute(readonly) int16u currentY = 4; + attribute(readonly) enum8 driftCompensation = 5; + attribute(readonly) char_string compensationText = 6; + attribute(readonly) int16u colorTemperature = 7; + attribute(readonly) enum8 colorMode = 8; + attribute(writable) bitmap8 colorControlOptions = 15; + attribute(readonly) int8u numberOfPrimaries = 16; + attribute(readonly) int16u primary1X = 17; + attribute(readonly) int16u primary1Y = 18; + attribute(readonly) int8u primary1Intensity = 19; + attribute(readonly) int16u primary2X = 21; + attribute(readonly) int16u primary2Y = 22; + attribute(readonly) int8u primary2Intensity = 23; + attribute(readonly) int16u primary3X = 25; + attribute(readonly) int16u primary3Y = 26; + attribute(readonly) int8u primary3Intensity = 27; + attribute(readonly) int16u primary4X = 32; + attribute(readonly) int16u primary4Y = 33; + attribute(readonly) int8u primary4Intensity = 34; + attribute(readonly) int16u primary5X = 36; + attribute(readonly) int16u primary5Y = 37; + attribute(readonly) int8u primary5Intensity = 38; + attribute(readonly) int16u primary6X = 40; + attribute(readonly) int16u primary6Y = 41; + attribute(readonly) int8u primary6Intensity = 42; + attribute(writable) int16u whitePointX = 48; + attribute(writable) int16u whitePointY = 49; + attribute(writable) int16u colorPointRX = 50; + attribute(writable) int16u colorPointRY = 51; + attribute(writable) int8u colorPointRIntensity = 52; + attribute(writable) int16u colorPointGX = 54; + attribute(writable) int16u colorPointGY = 55; + attribute(writable) int8u colorPointGIntensity = 56; + attribute(writable) int16u colorPointBX = 58; + attribute(writable) int16u colorPointBY = 59; + attribute(writable) int8u colorPointBIntensity = 60; + attribute(readonly) int16u enhancedCurrentHue = 16384; + attribute(readonly) enum8 enhancedColorMode = 16385; + attribute(readonly) int8u colorLoopActive = 16386; + attribute(readonly) int8u colorLoopDirection = 16387; + attribute(readonly) int16u colorLoopTime = 16388; + attribute(readonly) bitmap16 colorCapabilities = 16394; + attribute(readonly) int16u colorTempPhysicalMin = 16395; + attribute(readonly) int16u colorTempPhysicalMax = 16396; + attribute(readonly) int16u coupleColorTempToLevelMinMireds = 16397; + attribute(writable) int16u startUpColorTemperatureMireds = 16400; + attribute(readonly) int16u clusterRevision = 65533; request struct MoveColorRequest { INT16S rateX = 0; @@ -580,9 +580,9 @@ client cluster ContentLauncher = 1290 { MetricTypeEnum metric = 3; } - attribute(readonly, reportable) CHAR_STRING acceptHeaderList[] = 0; - attribute(writable, reportable) bitmap32 supportedStreamingProtocols = 1; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) CHAR_STRING acceptHeaderList[] = 0; + attribute(writable) bitmap32 supportedStreamingProtocols = 1; + attribute(readonly) int16u clusterRevision = 65533; request struct LaunchContentRequestRequest { BOOLEAN autoPlay = 0; @@ -606,11 +606,11 @@ server cluster Descriptor = 29 { INT16U revision = 2; } - attribute(readonly, reportable) DeviceType deviceList[] = 0; - attribute(readonly, reportable) CLUSTER_ID serverList[] = 1; - attribute(readonly, reportable) CLUSTER_ID clientList[] = 2; - attribute(readonly, reportable) ENDPOINT_NO partsList[] = 3; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) DeviceType deviceList[] = 0; + attribute(readonly) CLUSTER_ID serverList[] = 1; + attribute(readonly) CLUSTER_ID clientList[] = 2; + attribute(readonly) ENDPOINT_NO partsList[] = 3; + attribute(readonly) int16u clusterRevision = 65533; } server cluster DiagnosticLogs = 50 { @@ -879,34 +879,34 @@ server cluster DoorLock = 257 { nullable INT16U dataIndex = 6; } - attribute(readonly, reportable) DlLockState lockState = 0; - attribute(readonly, reportable) DlLockType lockType = 1; - attribute(readonly, reportable) boolean actuatorEnabled = 2; - attribute(readonly, reportable) DlDoorState doorState = 3; - attribute(writable, reportable) int32u doorOpenEvents = 4; - attribute(writable, reportable) int32u doorClosedEvents = 5; - attribute(writable, reportable) int16u openPeriod = 6; - attribute(readonly, reportable) int16u numberOfTotalUsersSupported = 17; - attribute(readonly, reportable) int16u numberOfPINUsersSupported = 18; - attribute(readonly, reportable) int16u numberOfWeekDaySchedulesSupportedPerUser = 20; - attribute(readonly, reportable) int16u numberOfYearDaySchedulesSupportedPerUser = 21; - attribute(readonly, reportable) int16u numberOfHolidaySchedulesSupported = 22; - attribute(readonly, reportable) int8u maxPINCodeLength = 23; - attribute(readonly, reportable) int8u minPINCodeLength = 24; - attribute(readonly, reportable) bitmap8 credentialRulesSupport = 27; - attribute(writable, reportable) char_string language = 33; - attribute(writable, reportable) int32u autoRelockTime = 35; - attribute(writable, reportable) int8u soundVolume = 36; - attribute(writable, reportable) DlOperatingMode operatingMode = 37; - attribute(readonly, reportable) bitmap16 supportedOperatingModes = 38; - attribute(readonly, reportable) bitmap16 defaultConfigurationRegister = 39; - attribute(writable, reportable) boolean enableOneTouchLocking = 41; - attribute(writable, reportable) boolean enableInsideStatusLED = 42; - attribute(writable, reportable) boolean enablePrivacyModeButton = 43; - attribute(writable, reportable) int8u wrongCodeEntryLimit = 48; - attribute(writable, reportable) int8u userCodeTemporaryDisableTime = 49; - attribute(writable, reportable) boolean requirePINforRemoteOperation = 51; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) DlLockState lockState = 0; + attribute(readonly) DlLockType lockType = 1; + attribute(readonly) boolean actuatorEnabled = 2; + attribute(readonly) DlDoorState doorState = 3; + attribute(writable) int32u doorOpenEvents = 4; + attribute(writable) int32u doorClosedEvents = 5; + attribute(writable) int16u openPeriod = 6; + attribute(readonly) int16u numberOfTotalUsersSupported = 17; + attribute(readonly) int16u numberOfPINUsersSupported = 18; + attribute(readonly) int16u numberOfWeekDaySchedulesSupportedPerUser = 20; + attribute(readonly) int16u numberOfYearDaySchedulesSupportedPerUser = 21; + attribute(readonly) int16u numberOfHolidaySchedulesSupported = 22; + attribute(readonly) int8u maxPINCodeLength = 23; + attribute(readonly) int8u minPINCodeLength = 24; + attribute(readonly) bitmap8 credentialRulesSupport = 27; + attribute(writable) char_string language = 33; + attribute(writable) int32u autoRelockTime = 35; + attribute(writable) int8u soundVolume = 36; + attribute(writable) DlOperatingMode operatingMode = 37; + attribute(readonly) bitmap16 supportedOperatingModes = 38; + attribute(readonly) bitmap16 defaultConfigurationRegister = 39; + attribute(writable) boolean enableOneTouchLocking = 41; + attribute(writable) boolean enableInsideStatusLED = 42; + attribute(writable) boolean enablePrivacyModeButton = 43; + attribute(writable) int8u wrongCodeEntryLimit = 48; + attribute(writable) int8u userCodeTemporaryDisableTime = 49; + attribute(writable) boolean requirePINforRemoteOperation = 51; + attribute(readonly) int16u clusterRevision = 65533; request struct ClearCredentialRequest { DlCredential credential = 0; @@ -999,29 +999,29 @@ server cluster EthernetNetworkDiagnostics = 55 { k400g = 9; } - attribute(readonly, reportable) enum8 PHYRate = 0; - attribute(readonly, reportable) boolean fullDuplex = 1; - attribute(readonly, reportable) int64u packetRxCount = 2; - attribute(readonly, reportable) int64u packetTxCount = 3; - attribute(readonly, reportable) int64u txErrCount = 4; - attribute(readonly, reportable) int64u collisionCount = 5; - attribute(readonly, reportable) int64u overrunCount = 6; - attribute(readonly, reportable) boolean carrierDetect = 7; - attribute(readonly, reportable) int64u timeSinceReset = 8; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) enum8 PHYRate = 0; + attribute(readonly) boolean fullDuplex = 1; + attribute(readonly) int64u packetRxCount = 2; + attribute(readonly) int64u packetTxCount = 3; + attribute(readonly) int64u txErrCount = 4; + attribute(readonly) int64u collisionCount = 5; + attribute(readonly) int64u overrunCount = 6; + attribute(readonly) boolean carrierDetect = 7; + attribute(readonly) int64u timeSinceReset = 8; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster FixedLabel = 64 { - attribute(readonly, reportable) LabelStruct labelList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) LabelStruct labelList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } server cluster FlowMeasurement = 1028 { - attribute(readonly, reportable) int16s measuredValue = 0; - attribute(readonly, reportable) int16s minMeasuredValue = 1; - attribute(readonly, reportable) int16s maxMeasuredValue = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16s measuredValue = 0; + attribute(readonly) int16s minMeasuredValue = 1; + attribute(readonly) int16s maxMeasuredValue = 2; + attribute(readonly) int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -1042,12 +1042,12 @@ server cluster GeneralCommissioning = 48 { INT32U failSafeExpiryLengthMs = 1; } - attribute(writable, reportable) int64u breadcrumb = 0; - attribute(readonly, reportable) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; - attribute(readonly, reportable) enum8 regulatoryConfig = 2; - attribute(readonly, reportable) enum8 locationCapability = 3; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) int64u breadcrumb = 0; + attribute(readonly) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; + attribute(readonly) enum8 regulatoryConfig = 2; + attribute(readonly) enum8 locationCapability = 3; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -1160,15 +1160,15 @@ server cluster GeneralDiagnostics = 51 { BootReasonType bootReason = 0; } - attribute(readonly, reportable) NetworkInterfaceType networkInterfaces[] = 0; - attribute(readonly, reportable) int16u rebootCount = 1; - attribute(readonly, reportable) int64u upTime = 2; - attribute(readonly, reportable) int32u totalOperationalHours = 3; - attribute(readonly, reportable) enum8 bootReasons = 4; - attribute(readonly, reportable) ENUM8 activeHardwareFaults[] = 5; - attribute(readonly, reportable) ENUM8 activeRadioFaults[] = 6; - attribute(readonly, reportable) ENUM8 activeNetworkFaults[] = 7; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) NetworkInterfaceType networkInterfaces[] = 0; + attribute(readonly) int16u rebootCount = 1; + attribute(readonly) int64u upTime = 2; + attribute(readonly) int32u totalOperationalHours = 3; + attribute(readonly) enum8 bootReasons = 4; + attribute(readonly) ENUM8 activeHardwareFaults[] = 5; + attribute(readonly) ENUM8 activeRadioFaults[] = 6; + attribute(readonly) ENUM8 activeNetworkFaults[] = 7; + attribute(readonly) int16u clusterRevision = 65533; } server cluster GroupKeyManagement = 63 { @@ -1190,14 +1190,14 @@ server cluster GroupKeyManagement = 63 { CHAR_STRING groupName = 3; } - attribute(readonly, reportable) GroupKey groupKeyMap[] = 0; - attribute(readonly, reportable) GroupInfo groupTable[] = 1; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) GroupKey groupKeyMap[] = 0; + attribute(readonly) GroupInfo groupTable[] = 1; + attribute(readonly) int16u clusterRevision = 65533; } server cluster Groups = 4 { - attribute(readonly, reportable) bitmap8 nameSupport = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) bitmap8 nameSupport = 0; + attribute(readonly) int16u clusterRevision = 65533; request struct AddGroupRequest { INT16U groupId = 0; @@ -1277,12 +1277,12 @@ server cluster IasZone = 1280 { kInvalidZoneType = 65535; } - attribute(readonly, reportable) enum8 zoneState = 0; - attribute(readonly, reportable) enum16 zoneType = 1; - attribute(readonly, reportable) bitmap16 zoneStatus = 2; - attribute(writable, reportable) node_id iasCieAddress = 16; - attribute(readonly, reportable) int8u zoneId = 17; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) enum8 zoneState = 0; + attribute(readonly) enum16 zoneType = 1; + attribute(readonly) bitmap16 zoneStatus = 2; + attribute(writable) node_id iasCieAddress = 16; + attribute(readonly) int8u zoneId = 17; + attribute(readonly) int16u clusterRevision = 65533; request struct ZoneEnrollRequestRequest { IasZoneType zoneType = 0; @@ -1328,8 +1328,8 @@ server cluster Identify = 3 { kActuator = 5; } - attribute(writable, reportable) int16u identifyTime = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) int16u identifyTime = 0; + attribute(readonly) int16u clusterRevision = 65533; request struct IdentifyRequest { INT16U identifyTime = 0; @@ -1439,7 +1439,7 @@ client cluster KeypadInput = 1289 { kInvalidKeyInCurrentState = 2; } - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u clusterRevision = 65533; request struct SendKeyRequestRequest { CecKeyCode keyCode = 0; @@ -1459,21 +1459,21 @@ server cluster LevelControl = 8 { kDown = 1; } - attribute(readonly, reportable) int8u currentLevel = 0; - attribute(readonly, reportable) int16u remainingTime = 1; - attribute(readonly, reportable) int8u minLevel = 2; - attribute(readonly, reportable) int8u maxLevel = 3; - attribute(readonly, reportable) int16u currentFrequency = 4; - attribute(readonly, reportable) int16u minFrequency = 5; - attribute(readonly, reportable) int16u maxFrequency = 6; - attribute(writable, reportable) bitmap8 options = 15; - attribute(writable, reportable) int16u onOffTransitionTime = 16; - attribute(writable, reportable) int8u onLevel = 17; - attribute(writable, reportable) int16u onTransitionTime = 18; - attribute(writable, reportable) int16u offTransitionTime = 19; - attribute(writable, reportable) int8u defaultMoveRate = 20; - attribute(writable, reportable) int8u startUpCurrentLevel = 16384; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u currentLevel = 0; + attribute(readonly) int16u remainingTime = 1; + attribute(readonly) int8u minLevel = 2; + attribute(readonly) int8u maxLevel = 3; + attribute(readonly) int16u currentFrequency = 4; + attribute(readonly) int16u minFrequency = 5; + attribute(readonly) int16u maxFrequency = 6; + attribute(writable) bitmap8 options = 15; + attribute(writable) int16u onOffTransitionTime = 16; + attribute(writable) int8u onLevel = 17; + attribute(writable) int16u onTransitionTime = 18; + attribute(writable) int16u offTransitionTime = 19; + attribute(writable) int8u defaultMoveRate = 20; + attribute(writable) int8u startUpCurrentLevel = 16384; + attribute(readonly) int16u clusterRevision = 65533; request struct MoveRequest { MoveMode moveMode = 0; @@ -1529,8 +1529,8 @@ server cluster LevelControl = 8 { } server cluster LocalizationConfiguration = 43 { - attribute(writable, reportable) char_string activeLocale = 1; - attribute(readonly, reportable) CHAR_STRING supportedLocales[] = 2; + attribute(writable) char_string activeLocale = 1; + attribute(readonly) CHAR_STRING supportedLocales[] = 2; } client cluster MediaInput = 1287 { @@ -1556,8 +1556,8 @@ client cluster MediaInput = 1287 { CHAR_STRING description = 4; } - attribute(readonly, reportable) InputInfo mediaInputList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) InputInfo mediaInputList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; request struct RenameInputRequestRequest { INT8U index = 0; @@ -1591,7 +1591,7 @@ client cluster MediaPlayback = 1286 { kSeekOutOfRange = 5; } - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u clusterRevision = 65533; request struct SeekRequestRequest { INT64U position = 0; @@ -1668,16 +1668,16 @@ server cluster NetworkCommissioning = 49 { INT8U lqi = 8; } - attribute(readonly, reportable) int8u maxNetworks = 0; - attribute(readonly, reportable) NetworkInfo networks[] = 1; - attribute(readonly, reportable) int8u scanMaxTimeSeconds = 2; - attribute(readonly, reportable) int8u connectMaxTimeSeconds = 3; - attribute(writable, reportable) boolean interfaceEnabled = 4; - attribute(readonly, reportable) NetworkCommissioningStatus lastNetworkingStatus = 5; - attribute(readonly, reportable) octet_string lastNetworkID = 6; - attribute(readonly, reportable) int32u lastConnectErrorValue = 7; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u maxNetworks = 0; + attribute(readonly) NetworkInfo networks[] = 1; + attribute(readonly) int8u scanMaxTimeSeconds = 2; + attribute(readonly) int8u connectMaxTimeSeconds = 3; + attribute(writable) boolean interfaceEnabled = 4; + attribute(readonly) NetworkCommissioningStatus lastNetworkingStatus = 5; + attribute(readonly) octet_string lastNetworkID = 6; + attribute(readonly) int32u lastConnectErrorValue = 7; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -1758,7 +1758,7 @@ server cluster OtaSoftwareUpdateProvider = 41 { kDownloadProtocolNotSupported = 3; } - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u clusterRevision = 65533; request struct ApplyUpdateRequestRequest { OCTET_STRING updateToken = 0; @@ -1803,10 +1803,10 @@ server cluster OtaSoftwareUpdateProvider = 41 { } server cluster OccupancySensing = 1030 { - attribute(readonly, reportable) bitmap8 occupancy = 0; - attribute(readonly, reportable) enum8 occupancySensorType = 1; - attribute(readonly, reportable) bitmap8 occupancySensorTypeBitmap = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) bitmap8 occupancy = 0; + attribute(readonly) enum8 occupancySensorType = 1; + attribute(readonly) bitmap8 occupancySensorTypeBitmap = 2; + attribute(readonly) int16u clusterRevision = 65533; } server cluster OnOff = 6 { @@ -1825,13 +1825,13 @@ server cluster OnOff = 6 { kDyingLight = 1; } - attribute(readonly, reportable) boolean onOff = 0; - attribute(readonly, reportable) boolean globalSceneControl = 16384; - attribute(writable, reportable) int16u onTime = 16385; - attribute(writable, reportable) int16u offWaitTime = 16386; - attribute(writable, reportable) enum8 startUpOnOff = 16387; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) boolean onOff = 0; + attribute(readonly) boolean globalSceneControl = 16384; + attribute(writable) int16u onTime = 16385; + attribute(writable) int16u offWaitTime = 16386; + attribute(writable) enum8 startUpOnOff = 16387; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; command Off(): DefaultSuccess = 0; command On(): DefaultSuccess = 1; @@ -1861,12 +1861,12 @@ server cluster OperationalCredentials = 62 { CHAR_STRING label = 6; } - attribute(readonly, reportable) FabricDescriptor fabricsList[] = 1; - attribute(readonly, reportable) int8u supportedFabrics = 2; - attribute(readonly, reportable) int8u commissionedFabrics = 3; - attribute(readonly, reportable) OCTET_STRING trustedRootCertificates[] = 4; - attribute(readonly, reportable) fabric_idx currentFabricIndex = 5; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) FabricDescriptor fabricsList[] = 1; + attribute(readonly) int8u supportedFabrics = 2; + attribute(readonly) int8u commissionedFabrics = 3; + attribute(readonly) OCTET_STRING trustedRootCertificates[] = 4; + attribute(readonly) fabric_idx currentFabricIndex = 5; + attribute(readonly) int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -1941,17 +1941,17 @@ server cluster OperationalCredentials = 62 { } server cluster PressureMeasurement = 1027 { - attribute(readonly, reportable) int16s measuredValue = 0; - attribute(readonly, reportable) int16s minMeasuredValue = 1; - attribute(readonly, reportable) int16s maxMeasuredValue = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16s measuredValue = 0; + attribute(readonly) int16s minMeasuredValue = 1; + attribute(readonly) int16s maxMeasuredValue = 2; + attribute(readonly) int16u clusterRevision = 65533; } server cluster RelativeHumidityMeasurement = 1029 { - attribute(readonly, reportable) int16u measuredValue = 0; - attribute(readonly, reportable) int16u minMeasuredValue = 1; - attribute(readonly, reportable) int16u maxMeasuredValue = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u measuredValue = 0; + attribute(readonly) int16u minMeasuredValue = 1; + attribute(readonly) int16u maxMeasuredValue = 2; + attribute(readonly) int16u clusterRevision = 65533; } server cluster Scenes = 5 { @@ -1961,12 +1961,12 @@ server cluster Scenes = 5 { INT8U value = 3; } - attribute(readonly, reportable) int8u sceneCount = 0; - attribute(readonly, reportable) int8u currentScene = 1; - attribute(readonly, reportable) int16u currentGroup = 2; - attribute(readonly, reportable) boolean sceneValid = 3; - attribute(readonly, reportable) bitmap8 nameSupport = 4; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u sceneCount = 0; + attribute(readonly) int8u currentScene = 1; + attribute(readonly) int16u currentGroup = 2; + attribute(readonly) boolean sceneValid = 3; + attribute(readonly) bitmap8 nameSupport = 4; + attribute(readonly) int16u clusterRevision = 65533; request struct AddSceneRequest { INT16U groupId = 0; @@ -2067,12 +2067,12 @@ server cluster SoftwareDiagnostics = 52 { SoftwareFault softwareFault = 0; } - attribute(readonly, reportable) ThreadMetrics threadMetrics[] = 0; - attribute(readonly, reportable) int64u currentHeapFree = 1; - attribute(readonly, reportable) int64u currentHeapUsed = 2; - attribute(readonly, reportable) int64u currentHeapHighWatermark = 3; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) ThreadMetrics threadMetrics[] = 0; + attribute(readonly) int64u currentHeapFree = 1; + attribute(readonly) int64u currentHeapUsed = 2; + attribute(readonly) int64u currentHeapHighWatermark = 3; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster Switch = 59 { @@ -2106,9 +2106,9 @@ server cluster Switch = 59 { INT8U totalNumberOfPressesCounted = 1; } - attribute(readonly, reportable) int8u numberOfPositions = 0; - attribute(readonly, reportable) int8u currentPosition = 1; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u numberOfPositions = 0; + attribute(readonly) int8u currentPosition = 1; + attribute(readonly) int16u clusterRevision = 65533; } client cluster TargetNavigator = 1285 { @@ -2123,8 +2123,8 @@ client cluster TargetNavigator = 1285 { CHAR_STRING name = 2; } - attribute(readonly, reportable) TargetInfo targetNavigatorList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) TargetInfo targetNavigatorList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; request struct NavigateTargetRequestRequest { INT8U target = 0; @@ -2135,10 +2135,10 @@ client cluster TargetNavigator = 1285 { } server cluster TemperatureMeasurement = 1026 { - attribute(readonly, reportable) int16s measuredValue = 0; - attribute(readonly, reportable) int16s minMeasuredValue = 1; - attribute(readonly, reportable) int16s maxMeasuredValue = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16s measuredValue = 0; + attribute(readonly) int16s minMeasuredValue = 1; + attribute(readonly) int16s maxMeasuredValue = 2; + attribute(readonly) int16u clusterRevision = 65533; } server cluster TestCluster = 1295 { @@ -2163,27 +2163,27 @@ server cluster TestCluster = 1295 { SimpleEnum arg6[] = 6; } - attribute(writable, reportable) boolean boolean = 0; - attribute(writable, reportable) bitmap8 bitmap8 = 1; - attribute(writable, reportable) bitmap16 bitmap16 = 2; - attribute(writable, reportable) bitmap32 bitmap32 = 3; - attribute(writable, reportable) bitmap64 bitmap64 = 4; - attribute(writable, reportable) int8u int8u = 5; - attribute(writable, reportable) int16u int16u = 6; - attribute(writable, reportable) int32u int32u = 8; - attribute(writable, reportable) int64u int64u = 12; - attribute(writable, reportable) int8s int8s = 13; - attribute(writable, reportable) int16s int16s = 14; - attribute(writable, reportable) int32s int32s = 16; - attribute(writable, reportable) int64s int64s = 20; - attribute(writable, reportable) enum8 enum8 = 21; - attribute(writable, reportable) enum16 enum16 = 22; - attribute(writable, reportable) octet_string octetString = 25; - attribute(writable, reportable) INT8U listInt8u[] = 26; - attribute(writable, reportable) OCTET_STRING listOctetString[] = 27; - attribute(writable, reportable) TestListStructOctet listStructOctetString[] = 28; - attribute(writable, reportable) long_octet_string longOctetString = 29; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) boolean boolean = 0; + attribute(writable) bitmap8 bitmap8 = 1; + attribute(writable) bitmap16 bitmap16 = 2; + attribute(writable) bitmap32 bitmap32 = 3; + attribute(writable) bitmap64 bitmap64 = 4; + attribute(writable) int8u int8u = 5; + attribute(writable) int16u int16u = 6; + attribute(writable) int32u int32u = 8; + attribute(writable) int64u int64u = 12; + attribute(writable) int8s int8s = 13; + attribute(writable) int16s int16s = 14; + attribute(writable) int32s int32s = 16; + attribute(writable) int64s int64s = 20; + attribute(writable) enum8 enum8 = 21; + attribute(writable) enum16 enum16 = 22; + attribute(writable) octet_string octetString = 25; + attribute(writable) INT8U listInt8u[] = 26; + attribute(writable) OCTET_STRING listOctetString[] = 27; + attribute(writable) TestListStructOctet listStructOctetString[] = 28; + attribute(writable) long_octet_string longOctetString = 29; + attribute(readonly) int16u clusterRevision = 65533; response struct TestSpecificResponse { INT8U returnValue = 0; @@ -2201,16 +2201,16 @@ server cluster Thermostat = 513 { kHeatAndCoolSetpoints = 2; } - attribute(readonly, reportable) int16s localTemperature = 0; - attribute(writable, reportable) int16s occupiedCoolingSetpoint = 17; - attribute(writable, reportable) int16s occupiedHeatingSetpoint = 18; - attribute(writable, reportable) enum8 controlSequenceOfOperation = 27; - attribute(writable, reportable) enum8 systemMode = 28; - attribute(readonly, reportable) enum8 startOfWeek = 32; - attribute(readonly, reportable) int8u numberOfWeeklyTransitions = 33; - attribute(readonly, reportable) int8u numberOfDailyTransitions = 34; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16s localTemperature = 0; + attribute(writable) int16s occupiedCoolingSetpoint = 17; + attribute(writable) int16s occupiedHeatingSetpoint = 18; + attribute(writable) enum8 controlSequenceOfOperation = 27; + attribute(writable) enum8 systemMode = 28; + attribute(readonly) enum8 startOfWeek = 32; + attribute(readonly) int8u numberOfWeeklyTransitions = 33; + attribute(readonly) int8u numberOfDailyTransitions = 34; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; response struct GetWeeklyScheduleResponse { ENUM8 numberOfTransitionsForSequence = 0; @@ -2297,81 +2297,81 @@ server cluster ThreadNetworkDiagnostics = 53 { ThreadConnectionStatus connectionStatus = 0; } - attribute(readonly, reportable) int16u channel = 0; - attribute(readonly, reportable) enum8 routingRole = 1; - attribute(readonly, reportable) octet_string networkName = 2; - attribute(readonly, reportable) int16u panId = 3; - attribute(readonly, reportable) int64u extendedPanId = 4; - attribute(readonly, reportable) octet_string meshLocalPrefix = 5; - attribute(readonly, reportable) int64u overrunCount = 6; - attribute(readonly, reportable) NeighborTable neighborTableList[] = 7; - attribute(readonly, reportable) RouteTable routeTableList[] = 8; - attribute(readonly, reportable) int32u partitionId = 9; - attribute(readonly, reportable) int8u weighting = 10; - attribute(readonly, reportable) int8u dataVersion = 11; - attribute(readonly, reportable) int8u stableDataVersion = 12; - attribute(readonly, reportable) int8u leaderRouterId = 13; - attribute(readonly, reportable) int16u detachedRoleCount = 14; - attribute(readonly, reportable) int16u childRoleCount = 15; - attribute(readonly, reportable) int16u routerRoleCount = 16; - attribute(readonly, reportable) int16u leaderRoleCount = 17; - attribute(readonly, reportable) int16u attachAttemptCount = 18; - attribute(readonly, reportable) int16u partitionIdChangeCount = 19; - attribute(readonly, reportable) int16u betterPartitionAttachAttemptCount = 20; - attribute(readonly, reportable) int16u parentChangeCount = 21; - attribute(readonly, reportable) int32u txTotalCount = 22; - attribute(readonly, reportable) int32u txUnicastCount = 23; - attribute(readonly, reportable) int32u txBroadcastCount = 24; - attribute(readonly, reportable) int32u txAckRequestedCount = 25; - attribute(readonly, reportable) int32u txAckedCount = 26; - attribute(readonly, reportable) int32u txNoAckRequestedCount = 27; - attribute(readonly, reportable) int32u txDataCount = 28; - attribute(readonly, reportable) int32u txDataPollCount = 29; - attribute(readonly, reportable) int32u txBeaconCount = 30; - attribute(readonly, reportable) int32u txBeaconRequestCount = 31; - attribute(readonly, reportable) int32u txOtherCount = 32; - attribute(readonly, reportable) int32u txRetryCount = 33; - attribute(readonly, reportable) int32u txDirectMaxRetryExpiryCount = 34; - attribute(readonly, reportable) int32u txIndirectMaxRetryExpiryCount = 35; - attribute(readonly, reportable) int32u txErrCcaCount = 36; - attribute(readonly, reportable) int32u txErrAbortCount = 37; - attribute(readonly, reportable) int32u txErrBusyChannelCount = 38; - attribute(readonly, reportable) int32u rxTotalCount = 39; - attribute(readonly, reportable) int32u rxUnicastCount = 40; - attribute(readonly, reportable) int32u rxBroadcastCount = 41; - attribute(readonly, reportable) int32u rxDataCount = 42; - attribute(readonly, reportable) int32u rxDataPollCount = 43; - attribute(readonly, reportable) int32u rxBeaconCount = 44; - attribute(readonly, reportable) int32u rxBeaconRequestCount = 45; - attribute(readonly, reportable) int32u rxOtherCount = 46; - attribute(readonly, reportable) int32u rxAddressFilteredCount = 47; - attribute(readonly, reportable) int32u rxDestAddrFilteredCount = 48; - attribute(readonly, reportable) int32u rxDuplicatedCount = 49; - attribute(readonly, reportable) int32u rxErrNoFrameCount = 50; - attribute(readonly, reportable) int32u rxErrUnknownNeighborCount = 51; - attribute(readonly, reportable) int32u rxErrInvalidSrcAddrCount = 52; - attribute(readonly, reportable) int32u rxErrSecCount = 53; - attribute(readonly, reportable) int32u rxErrFcsCount = 54; - attribute(readonly, reportable) int32u rxErrOtherCount = 55; - attribute(readonly, reportable) int64u activeTimestamp = 56; - attribute(readonly, reportable) int64u pendingTimestamp = 57; - attribute(readonly, reportable) int32u delay = 58; - attribute(readonly, reportable) SecurityPolicy securityPolicy[] = 59; - attribute(readonly, reportable) octet_string channelMask = 60; - attribute(readonly, reportable) OperationalDatasetComponents operationalDatasetComponents[] = 61; - attribute(readonly, reportable) NetworkFault activeNetworkFaultsList[] = 62; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u channel = 0; + attribute(readonly) enum8 routingRole = 1; + attribute(readonly) octet_string networkName = 2; + attribute(readonly) int16u panId = 3; + attribute(readonly) int64u extendedPanId = 4; + attribute(readonly) octet_string meshLocalPrefix = 5; + attribute(readonly) int64u overrunCount = 6; + attribute(readonly) NeighborTable neighborTableList[] = 7; + attribute(readonly) RouteTable routeTableList[] = 8; + attribute(readonly) int32u partitionId = 9; + attribute(readonly) int8u weighting = 10; + attribute(readonly) int8u dataVersion = 11; + attribute(readonly) int8u stableDataVersion = 12; + attribute(readonly) int8u leaderRouterId = 13; + attribute(readonly) int16u detachedRoleCount = 14; + attribute(readonly) int16u childRoleCount = 15; + attribute(readonly) int16u routerRoleCount = 16; + attribute(readonly) int16u leaderRoleCount = 17; + attribute(readonly) int16u attachAttemptCount = 18; + attribute(readonly) int16u partitionIdChangeCount = 19; + attribute(readonly) int16u betterPartitionAttachAttemptCount = 20; + attribute(readonly) int16u parentChangeCount = 21; + attribute(readonly) int32u txTotalCount = 22; + attribute(readonly) int32u txUnicastCount = 23; + attribute(readonly) int32u txBroadcastCount = 24; + attribute(readonly) int32u txAckRequestedCount = 25; + attribute(readonly) int32u txAckedCount = 26; + attribute(readonly) int32u txNoAckRequestedCount = 27; + attribute(readonly) int32u txDataCount = 28; + attribute(readonly) int32u txDataPollCount = 29; + attribute(readonly) int32u txBeaconCount = 30; + attribute(readonly) int32u txBeaconRequestCount = 31; + attribute(readonly) int32u txOtherCount = 32; + attribute(readonly) int32u txRetryCount = 33; + attribute(readonly) int32u txDirectMaxRetryExpiryCount = 34; + attribute(readonly) int32u txIndirectMaxRetryExpiryCount = 35; + attribute(readonly) int32u txErrCcaCount = 36; + attribute(readonly) int32u txErrAbortCount = 37; + attribute(readonly) int32u txErrBusyChannelCount = 38; + attribute(readonly) int32u rxTotalCount = 39; + attribute(readonly) int32u rxUnicastCount = 40; + attribute(readonly) int32u rxBroadcastCount = 41; + attribute(readonly) int32u rxDataCount = 42; + attribute(readonly) int32u rxDataPollCount = 43; + attribute(readonly) int32u rxBeaconCount = 44; + attribute(readonly) int32u rxBeaconRequestCount = 45; + attribute(readonly) int32u rxOtherCount = 46; + attribute(readonly) int32u rxAddressFilteredCount = 47; + attribute(readonly) int32u rxDestAddrFilteredCount = 48; + attribute(readonly) int32u rxDuplicatedCount = 49; + attribute(readonly) int32u rxErrNoFrameCount = 50; + attribute(readonly) int32u rxErrUnknownNeighborCount = 51; + attribute(readonly) int32u rxErrInvalidSrcAddrCount = 52; + attribute(readonly) int32u rxErrSecCount = 53; + attribute(readonly) int32u rxErrFcsCount = 54; + attribute(readonly) int32u rxErrOtherCount = 55; + attribute(readonly) int64u activeTimestamp = 56; + attribute(readonly) int64u pendingTimestamp = 57; + attribute(readonly) int32u delay = 58; + attribute(readonly) SecurityPolicy securityPolicy[] = 59; + attribute(readonly) octet_string channelMask = 60; + attribute(readonly) OperationalDatasetComponents operationalDatasetComponents[] = 61; + attribute(readonly) NetworkFault activeNetworkFaultsList[] = 62; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster UserLabel = 65 { - attribute(writable, reportable) LabelStruct labelList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) LabelStruct labelList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } server cluster WakeOnLan = 1283 { - attribute(readonly, reportable) char_string wakeOnLanMacAddress = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) char_string wakeOnLanMacAddress = 0; + attribute(readonly) int16u clusterRevision = 65533; } server cluster WiFiNetworkDiagnostics = 54 { @@ -2418,43 +2418,43 @@ server cluster WiFiNetworkDiagnostics = 54 { WiFiConnectionStatus connectionStatus = 0; } - attribute(readonly, reportable) octet_string bssid = 0; - attribute(readonly, reportable) enum8 securityType = 1; - attribute(readonly, reportable) enum8 wiFiVersion = 2; - attribute(readonly, reportable) int16u channelNumber = 3; - attribute(readonly, reportable) int8s rssi = 4; - attribute(readonly, reportable) int32u beaconLostCount = 5; - attribute(readonly, reportable) int32u beaconRxCount = 6; - attribute(readonly, reportable) int32u packetMulticastRxCount = 7; - attribute(readonly, reportable) int32u packetMulticastTxCount = 8; - attribute(readonly, reportable) int32u packetUnicastRxCount = 9; - attribute(readonly, reportable) int32u packetUnicastTxCount = 10; - attribute(readonly, reportable) int64u currentMaxRate = 11; - attribute(readonly, reportable) int64u overrunCount = 12; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) octet_string bssid = 0; + attribute(readonly) enum8 securityType = 1; + attribute(readonly) enum8 wiFiVersion = 2; + attribute(readonly) int16u channelNumber = 3; + attribute(readonly) int8s rssi = 4; + attribute(readonly) int32u beaconLostCount = 5; + attribute(readonly) int32u beaconRxCount = 6; + attribute(readonly) int32u packetMulticastRxCount = 7; + attribute(readonly) int32u packetMulticastTxCount = 8; + attribute(readonly) int32u packetUnicastRxCount = 9; + attribute(readonly) int32u packetUnicastTxCount = 10; + attribute(readonly) int64u currentMaxRate = 11; + attribute(readonly) int64u overrunCount = 12; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster WindowCovering = 258 { - attribute(readonly, reportable) enum8 type = 0; - attribute(readonly, reportable) int16u currentPositionLift = 3; - attribute(readonly, reportable) int16u currentPositionTilt = 4; - attribute(readonly, reportable) bitmap8 configStatus = 7; - attribute(readonly, reportable) Percent currentPositionLiftPercentage = 8; - attribute(readonly, reportable) Percent currentPositionTiltPercentage = 9; - attribute(readonly, reportable) bitmap8 operationalStatus = 10; - attribute(readonly, reportable) Percent100ths targetPositionLiftPercent100ths = 11; - attribute(readonly, reportable) Percent100ths targetPositionTiltPercent100ths = 12; - attribute(readonly, reportable) enum8 endProductType = 13; - attribute(readonly, reportable) Percent100ths currentPositionLiftPercent100ths = 14; - attribute(readonly, reportable) Percent100ths currentPositionTiltPercent100ths = 15; - attribute(readonly, reportable) int16u installedOpenLimitLift = 16; - attribute(readonly, reportable) int16u installedClosedLimitLift = 17; - attribute(readonly, reportable) int16u installedOpenLimitTilt = 18; - attribute(readonly, reportable) int16u installedClosedLimitTilt = 19; - attribute(writable, reportable) bitmap8 mode = 23; - attribute(readonly, reportable) bitmap16 safetyStatus = 26; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) enum8 type = 0; + attribute(readonly) int16u currentPositionLift = 3; + attribute(readonly) int16u currentPositionTilt = 4; + attribute(readonly) bitmap8 configStatus = 7; + attribute(readonly) Percent currentPositionLiftPercentage = 8; + attribute(readonly) Percent currentPositionTiltPercentage = 9; + attribute(readonly) bitmap8 operationalStatus = 10; + attribute(readonly) Percent100ths targetPositionLiftPercent100ths = 11; + attribute(readonly) Percent100ths targetPositionTiltPercent100ths = 12; + attribute(readonly) enum8 endProductType = 13; + attribute(readonly) Percent100ths currentPositionLiftPercent100ths = 14; + attribute(readonly) Percent100ths currentPositionTiltPercent100ths = 15; + attribute(readonly) int16u installedOpenLimitLift = 16; + attribute(readonly) int16u installedClosedLimitLift = 17; + attribute(readonly) int16u installedOpenLimitTilt = 18; + attribute(readonly) int16u installedClosedLimitTilt = 19; + attribute(writable) bitmap8 mode = 23; + attribute(readonly) bitmap16 safetyStatus = 26; + attribute(readonly) int16u clusterRevision = 65533; } diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index 761b83c3792474..3417687e94b7a9 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -19,10 +19,10 @@ server cluster AdministratorCommissioning = 60 { kWindowNotOpen = 3; } - attribute(readonly, reportable) int8u windowStatus = 0; - attribute(readonly, reportable) fabric_idx adminFabricIndex = 1; - attribute(readonly, reportable) int16u adminVendorId = 2; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u windowStatus = 0; + attribute(readonly) fabric_idx adminFabricIndex = 1; + attribute(readonly) int16u adminVendorId = 2; + attribute(readonly) int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -57,25 +57,25 @@ server cluster Basic = 40 { boolean reachableNewValue = 0; } - attribute(readonly, reportable) int16u interactionModelVersion = 0; - attribute(readonly, reportable) char_string vendorName = 1; - attribute(readonly, reportable) vendor_id vendorID = 2; - attribute(readonly, reportable) char_string productName = 3; - attribute(readonly, reportable) int16u productID = 4; - attribute(writable, reportable) char_string nodeLabel = 5; - attribute(writable, reportable) char_string location = 6; - attribute(readonly, reportable) int16u hardwareVersion = 7; - attribute(readonly, reportable) char_string hardwareVersionString = 8; - attribute(readonly, reportable) int32u softwareVersion = 9; - attribute(readonly, reportable) char_string softwareVersionString = 10; - attribute(readonly, reportable) char_string manufacturingDate = 11; - attribute(readonly, reportable) char_string partNumber = 12; - attribute(readonly, reportable) long_char_string productURL = 13; - attribute(readonly, reportable) char_string productLabel = 14; - attribute(readonly, reportable) char_string serialNumber = 15; - attribute(writable, reportable) boolean localConfigDisabled = 16; - attribute(readonly, reportable) boolean reachable = 17; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u interactionModelVersion = 0; + attribute(readonly) char_string vendorName = 1; + attribute(readonly) vendor_id vendorID = 2; + attribute(readonly) char_string productName = 3; + attribute(readonly) int16u productID = 4; + attribute(writable) char_string nodeLabel = 5; + attribute(writable) char_string location = 6; + attribute(readonly) int16u hardwareVersion = 7; + attribute(readonly) char_string hardwareVersionString = 8; + attribute(readonly) int32u softwareVersion = 9; + attribute(readonly) char_string softwareVersionString = 10; + attribute(readonly) char_string manufacturingDate = 11; + attribute(readonly) char_string partNumber = 12; + attribute(readonly) long_char_string productURL = 13; + attribute(readonly) char_string productLabel = 14; + attribute(readonly) char_string serialNumber = 15; + attribute(writable) boolean localConfigDisabled = 16; + attribute(readonly) boolean reachable = 17; + attribute(readonly) int16u clusterRevision = 65533; } server cluster Descriptor = 29 { @@ -84,11 +84,11 @@ server cluster Descriptor = 29 { INT16U revision = 2; } - attribute(readonly, reportable) DeviceType deviceList[] = 0; - attribute(readonly, reportable) CLUSTER_ID serverList[] = 1; - attribute(readonly, reportable) CLUSTER_ID clientList[] = 2; - attribute(readonly, reportable) ENDPOINT_NO partsList[] = 3; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) DeviceType deviceList[] = 0; + attribute(readonly) CLUSTER_ID serverList[] = 1; + attribute(readonly) CLUSTER_ID clientList[] = 2; + attribute(readonly) ENDPOINT_NO partsList[] = 3; + attribute(readonly) int16u clusterRevision = 65533; } server cluster EthernetNetworkDiagnostics = 55 { @@ -105,22 +105,22 @@ server cluster EthernetNetworkDiagnostics = 55 { k400g = 9; } - attribute(readonly, reportable) enum8 PHYRate = 0; - attribute(readonly, reportable) boolean fullDuplex = 1; - attribute(readonly, reportable) int64u packetRxCount = 2; - attribute(readonly, reportable) int64u packetTxCount = 3; - attribute(readonly, reportable) int64u txErrCount = 4; - attribute(readonly, reportable) int64u collisionCount = 5; - attribute(readonly, reportable) int64u overrunCount = 6; - attribute(readonly, reportable) boolean carrierDetect = 7; - attribute(readonly, reportable) int64u timeSinceReset = 8; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) enum8 PHYRate = 0; + attribute(readonly) boolean fullDuplex = 1; + attribute(readonly) int64u packetRxCount = 2; + attribute(readonly) int64u packetTxCount = 3; + attribute(readonly) int64u txErrCount = 4; + attribute(readonly) int64u collisionCount = 5; + attribute(readonly) int64u overrunCount = 6; + attribute(readonly) boolean carrierDetect = 7; + attribute(readonly) int64u timeSinceReset = 8; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster FixedLabel = 64 { - attribute(readonly, reportable) LabelStruct labelList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) LabelStruct labelList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -141,12 +141,12 @@ server cluster GeneralCommissioning = 48 { INT32U failSafeExpiryLengthMs = 1; } - attribute(writable, reportable) int64u breadcrumb = 0; - attribute(readonly, reportable) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; - attribute(readonly, reportable) enum8 regulatoryConfig = 2; - attribute(readonly, reportable) enum8 locationCapability = 3; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) int64u breadcrumb = 0; + attribute(readonly) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; + attribute(readonly) enum8 regulatoryConfig = 2; + attribute(readonly) enum8 locationCapability = 3; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -259,15 +259,15 @@ server cluster GeneralDiagnostics = 51 { BootReasonType bootReason = 0; } - attribute(readonly, reportable) NetworkInterfaceType networkInterfaces[] = 0; - attribute(readonly, reportable) int16u rebootCount = 1; - attribute(readonly, reportable) int64u upTime = 2; - attribute(readonly, reportable) int32u totalOperationalHours = 3; - attribute(readonly, reportable) enum8 bootReasons = 4; - attribute(readonly, reportable) ENUM8 activeHardwareFaults[] = 5; - attribute(readonly, reportable) ENUM8 activeRadioFaults[] = 6; - attribute(readonly, reportable) ENUM8 activeNetworkFaults[] = 7; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) NetworkInterfaceType networkInterfaces[] = 0; + attribute(readonly) int16u rebootCount = 1; + attribute(readonly) int64u upTime = 2; + attribute(readonly) int32u totalOperationalHours = 3; + attribute(readonly) enum8 bootReasons = 4; + attribute(readonly) ENUM8 activeHardwareFaults[] = 5; + attribute(readonly) ENUM8 activeRadioFaults[] = 6; + attribute(readonly) ENUM8 activeNetworkFaults[] = 7; + attribute(readonly) int16u clusterRevision = 65533; } server cluster Identify = 3 { @@ -293,9 +293,9 @@ server cluster Identify = 3 { kActuator = 5; } - attribute(writable, reportable) int16u identifyTime = 0; - attribute(readonly, reportable) enum8 identifyType = 1; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) int16u identifyTime = 0; + attribute(readonly) enum8 identifyType = 1; + attribute(readonly) int16u clusterRevision = 65533; request struct IdentifyRequest { INT16U identifyTime = 0; @@ -316,8 +316,8 @@ server cluster Identify = 3 { } server cluster LocalizationConfiguration = 43 { - attribute(writable, reportable) char_string activeLocale = 1; - attribute(readonly, reportable) CHAR_STRING supportedLocales[] = 2; + attribute(writable) char_string activeLocale = 1; + attribute(readonly) CHAR_STRING supportedLocales[] = 2; } server cluster NetworkCommissioning = 49 { @@ -370,16 +370,16 @@ server cluster NetworkCommissioning = 49 { INT8U lqi = 8; } - attribute(readonly, reportable) int8u maxNetworks = 0; - attribute(readonly, reportable) NetworkInfo networks[] = 1; - attribute(readonly, reportable) int8u scanMaxTimeSeconds = 2; - attribute(readonly, reportable) int8u connectMaxTimeSeconds = 3; - attribute(writable, reportable) boolean interfaceEnabled = 4; - attribute(readonly, reportable) NetworkCommissioningStatus lastNetworkingStatus = 5; - attribute(readonly, reportable) octet_string lastNetworkID = 6; - attribute(readonly, reportable) int32u lastConnectErrorValue = 7; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u maxNetworks = 0; + attribute(readonly) NetworkInfo networks[] = 1; + attribute(readonly) int8u scanMaxTimeSeconds = 2; + attribute(readonly) int8u connectMaxTimeSeconds = 3; + attribute(writable) boolean interfaceEnabled = 4; + attribute(readonly) NetworkCommissioningStatus lastNetworkingStatus = 5; + attribute(readonly) octet_string lastNetworkID = 6; + attribute(readonly) int32u lastConnectErrorValue = 7; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -462,12 +462,12 @@ server cluster OperationalCredentials = 62 { CHAR_STRING label = 6; } - attribute(readonly, reportable) FabricDescriptor fabricsList[] = 1; - attribute(readonly, reportable) int8u supportedFabrics = 2; - attribute(readonly, reportable) int8u commissionedFabrics = 3; - attribute(readonly, reportable) OCTET_STRING trustedRootCertificates[] = 4; - attribute(readonly, reportable) fabric_idx currentFabricIndex = 5; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) FabricDescriptor fabricsList[] = 1; + attribute(readonly) int8u supportedFabrics = 2; + attribute(readonly) int8u commissionedFabrics = 3; + attribute(readonly) OCTET_STRING trustedRootCertificates[] = 4; + attribute(readonly) fabric_idx currentFabricIndex = 5; + attribute(readonly) int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -542,17 +542,17 @@ server cluster OperationalCredentials = 62 { } server cluster PowerSource = 47 { - attribute(readonly, reportable) enum8 status = 0; - attribute(readonly, reportable) int8u order = 1; - attribute(readonly, reportable) char_string description = 2; - attribute(readonly, reportable) int32u batteryVoltage = 11; - attribute(readonly, reportable) int8u batteryPercentRemaining = 12; - attribute(readonly, reportable) int32u batteryTimeRemaining = 13; - attribute(readonly, reportable) enum8 batteryChargeLevel = 14; - attribute(readonly, reportable) ENUM8 activeBatteryFaults[] = 18; - attribute(readonly, reportable) enum8 batteryChargeState = 26; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) enum8 status = 0; + attribute(readonly) int8u order = 1; + attribute(readonly) char_string description = 2; + attribute(readonly) int32u batteryVoltage = 11; + attribute(readonly) int8u batteryPercentRemaining = 12; + attribute(readonly) int32u batteryTimeRemaining = 13; + attribute(readonly) enum8 batteryChargeLevel = 14; + attribute(readonly) ENUM8 activeBatteryFaults[] = 18; + attribute(readonly) enum8 batteryChargeState = 26; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster SoftwareDiagnostics = 52 { @@ -568,12 +568,12 @@ server cluster SoftwareDiagnostics = 52 { SoftwareFault softwareFault = 0; } - attribute(readonly, reportable) ThreadMetrics threadMetrics[] = 0; - attribute(readonly, reportable) int64u currentHeapFree = 1; - attribute(readonly, reportable) int64u currentHeapUsed = 2; - attribute(readonly, reportable) int64u currentHeapHighWatermark = 3; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) ThreadMetrics threadMetrics[] = 0; + attribute(readonly) int64u currentHeapFree = 1; + attribute(readonly) int64u currentHeapUsed = 2; + attribute(readonly) int64u currentHeapHighWatermark = 3; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster ThreadNetworkDiagnostics = 53 { @@ -653,76 +653,76 @@ server cluster ThreadNetworkDiagnostics = 53 { ThreadConnectionStatus connectionStatus = 0; } - attribute(readonly, reportable) int16u channel = 0; - attribute(readonly, reportable) enum8 routingRole = 1; - attribute(readonly, reportable) octet_string networkName = 2; - attribute(readonly, reportable) int16u panId = 3; - attribute(readonly, reportable) int64u extendedPanId = 4; - attribute(readonly, reportable) octet_string meshLocalPrefix = 5; - attribute(readonly, reportable) int64u overrunCount = 6; - attribute(readonly, reportable) NeighborTable neighborTableList[] = 7; - attribute(readonly, reportable) RouteTable routeTableList[] = 8; - attribute(readonly, reportable) int32u partitionId = 9; - attribute(readonly, reportable) int8u weighting = 10; - attribute(readonly, reportable) int8u dataVersion = 11; - attribute(readonly, reportable) int8u stableDataVersion = 12; - attribute(readonly, reportable) int8u leaderRouterId = 13; - attribute(readonly, reportable) int16u detachedRoleCount = 14; - attribute(readonly, reportable) int16u childRoleCount = 15; - attribute(readonly, reportable) int16u routerRoleCount = 16; - attribute(readonly, reportable) int16u leaderRoleCount = 17; - attribute(readonly, reportable) int16u attachAttemptCount = 18; - attribute(readonly, reportable) int16u partitionIdChangeCount = 19; - attribute(readonly, reportable) int16u betterPartitionAttachAttemptCount = 20; - attribute(readonly, reportable) int16u parentChangeCount = 21; - attribute(readonly, reportable) int32u txTotalCount = 22; - attribute(readonly, reportable) int32u txUnicastCount = 23; - attribute(readonly, reportable) int32u txBroadcastCount = 24; - attribute(readonly, reportable) int32u txAckRequestedCount = 25; - attribute(readonly, reportable) int32u txAckedCount = 26; - attribute(readonly, reportable) int32u txNoAckRequestedCount = 27; - attribute(readonly, reportable) int32u txDataCount = 28; - attribute(readonly, reportable) int32u txDataPollCount = 29; - attribute(readonly, reportable) int32u txBeaconCount = 30; - attribute(readonly, reportable) int32u txBeaconRequestCount = 31; - attribute(readonly, reportable) int32u txOtherCount = 32; - attribute(readonly, reportable) int32u txRetryCount = 33; - attribute(readonly, reportable) int32u txDirectMaxRetryExpiryCount = 34; - attribute(readonly, reportable) int32u txIndirectMaxRetryExpiryCount = 35; - attribute(readonly, reportable) int32u txErrCcaCount = 36; - attribute(readonly, reportable) int32u txErrAbortCount = 37; - attribute(readonly, reportable) int32u txErrBusyChannelCount = 38; - attribute(readonly, reportable) int32u rxTotalCount = 39; - attribute(readonly, reportable) int32u rxUnicastCount = 40; - attribute(readonly, reportable) int32u rxBroadcastCount = 41; - attribute(readonly, reportable) int32u rxDataCount = 42; - attribute(readonly, reportable) int32u rxDataPollCount = 43; - attribute(readonly, reportable) int32u rxBeaconCount = 44; - attribute(readonly, reportable) int32u rxBeaconRequestCount = 45; - attribute(readonly, reportable) int32u rxOtherCount = 46; - attribute(readonly, reportable) int32u rxAddressFilteredCount = 47; - attribute(readonly, reportable) int32u rxDestAddrFilteredCount = 48; - attribute(readonly, reportable) int32u rxDuplicatedCount = 49; - attribute(readonly, reportable) int32u rxErrNoFrameCount = 50; - attribute(readonly, reportable) int32u rxErrUnknownNeighborCount = 51; - attribute(readonly, reportable) int32u rxErrInvalidSrcAddrCount = 52; - attribute(readonly, reportable) int32u rxErrSecCount = 53; - attribute(readonly, reportable) int32u rxErrFcsCount = 54; - attribute(readonly, reportable) int32u rxErrOtherCount = 55; - attribute(readonly, reportable) int64u activeTimestamp = 56; - attribute(readonly, reportable) int64u pendingTimestamp = 57; - attribute(readonly, reportable) int32u delay = 58; - attribute(readonly, reportable) SecurityPolicy securityPolicy[] = 59; - attribute(readonly, reportable) octet_string channelMask = 60; - attribute(readonly, reportable) OperationalDatasetComponents operationalDatasetComponents[] = 61; - attribute(readonly, reportable) NetworkFault activeNetworkFaultsList[] = 62; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u channel = 0; + attribute(readonly) enum8 routingRole = 1; + attribute(readonly) octet_string networkName = 2; + attribute(readonly) int16u panId = 3; + attribute(readonly) int64u extendedPanId = 4; + attribute(readonly) octet_string meshLocalPrefix = 5; + attribute(readonly) int64u overrunCount = 6; + attribute(readonly) NeighborTable neighborTableList[] = 7; + attribute(readonly) RouteTable routeTableList[] = 8; + attribute(readonly) int32u partitionId = 9; + attribute(readonly) int8u weighting = 10; + attribute(readonly) int8u dataVersion = 11; + attribute(readonly) int8u stableDataVersion = 12; + attribute(readonly) int8u leaderRouterId = 13; + attribute(readonly) int16u detachedRoleCount = 14; + attribute(readonly) int16u childRoleCount = 15; + attribute(readonly) int16u routerRoleCount = 16; + attribute(readonly) int16u leaderRoleCount = 17; + attribute(readonly) int16u attachAttemptCount = 18; + attribute(readonly) int16u partitionIdChangeCount = 19; + attribute(readonly) int16u betterPartitionAttachAttemptCount = 20; + attribute(readonly) int16u parentChangeCount = 21; + attribute(readonly) int32u txTotalCount = 22; + attribute(readonly) int32u txUnicastCount = 23; + attribute(readonly) int32u txBroadcastCount = 24; + attribute(readonly) int32u txAckRequestedCount = 25; + attribute(readonly) int32u txAckedCount = 26; + attribute(readonly) int32u txNoAckRequestedCount = 27; + attribute(readonly) int32u txDataCount = 28; + attribute(readonly) int32u txDataPollCount = 29; + attribute(readonly) int32u txBeaconCount = 30; + attribute(readonly) int32u txBeaconRequestCount = 31; + attribute(readonly) int32u txOtherCount = 32; + attribute(readonly) int32u txRetryCount = 33; + attribute(readonly) int32u txDirectMaxRetryExpiryCount = 34; + attribute(readonly) int32u txIndirectMaxRetryExpiryCount = 35; + attribute(readonly) int32u txErrCcaCount = 36; + attribute(readonly) int32u txErrAbortCount = 37; + attribute(readonly) int32u txErrBusyChannelCount = 38; + attribute(readonly) int32u rxTotalCount = 39; + attribute(readonly) int32u rxUnicastCount = 40; + attribute(readonly) int32u rxBroadcastCount = 41; + attribute(readonly) int32u rxDataCount = 42; + attribute(readonly) int32u rxDataPollCount = 43; + attribute(readonly) int32u rxBeaconCount = 44; + attribute(readonly) int32u rxBeaconRequestCount = 45; + attribute(readonly) int32u rxOtherCount = 46; + attribute(readonly) int32u rxAddressFilteredCount = 47; + attribute(readonly) int32u rxDestAddrFilteredCount = 48; + attribute(readonly) int32u rxDuplicatedCount = 49; + attribute(readonly) int32u rxErrNoFrameCount = 50; + attribute(readonly) int32u rxErrUnknownNeighborCount = 51; + attribute(readonly) int32u rxErrInvalidSrcAddrCount = 52; + attribute(readonly) int32u rxErrSecCount = 53; + attribute(readonly) int32u rxErrFcsCount = 54; + attribute(readonly) int32u rxErrOtherCount = 55; + attribute(readonly) int64u activeTimestamp = 56; + attribute(readonly) int64u pendingTimestamp = 57; + attribute(readonly) int32u delay = 58; + attribute(readonly) SecurityPolicy securityPolicy[] = 59; + attribute(readonly) octet_string channelMask = 60; + attribute(readonly) OperationalDatasetComponents operationalDatasetComponents[] = 61; + attribute(readonly) NetworkFault activeNetworkFaultsList[] = 62; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster UserLabel = 65 { - attribute(writable, reportable) LabelStruct labelList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) LabelStruct labelList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } server cluster WiFiNetworkDiagnostics = 54 { @@ -769,44 +769,44 @@ server cluster WiFiNetworkDiagnostics = 54 { WiFiConnectionStatus connectionStatus = 0; } - attribute(readonly, reportable) octet_string bssid = 0; - attribute(readonly, reportable) enum8 securityType = 1; - attribute(readonly, reportable) enum8 wiFiVersion = 2; - attribute(readonly, reportable) int16u channelNumber = 3; - attribute(readonly, reportable) int8s rssi = 4; - attribute(readonly, reportable) int32u beaconLostCount = 5; - attribute(readonly, reportable) int32u beaconRxCount = 6; - attribute(readonly, reportable) int32u packetMulticastRxCount = 7; - attribute(readonly, reportable) int32u packetMulticastTxCount = 8; - attribute(readonly, reportable) int32u packetUnicastRxCount = 9; - attribute(readonly, reportable) int32u packetUnicastTxCount = 10; - attribute(readonly, reportable) int64u currentMaxRate = 11; - attribute(readonly, reportable) int64u overrunCount = 12; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) octet_string bssid = 0; + attribute(readonly) enum8 securityType = 1; + attribute(readonly) enum8 wiFiVersion = 2; + attribute(readonly) int16u channelNumber = 3; + attribute(readonly) int8s rssi = 4; + attribute(readonly) int32u beaconLostCount = 5; + attribute(readonly) int32u beaconRxCount = 6; + attribute(readonly) int32u packetMulticastRxCount = 7; + attribute(readonly) int32u packetMulticastTxCount = 8; + attribute(readonly) int32u packetUnicastRxCount = 9; + attribute(readonly) int32u packetUnicastTxCount = 10; + attribute(readonly) int64u currentMaxRate = 11; + attribute(readonly) int64u overrunCount = 12; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } server cluster WindowCovering = 258 { - attribute(readonly, reportable) enum8 type = 0; - attribute(readonly, reportable) int16u currentPositionLift = 3; - attribute(readonly, reportable) int16u currentPositionTilt = 4; - attribute(readonly, reportable) bitmap8 configStatus = 7; - attribute(readonly, reportable) Percent currentPositionLiftPercentage = 8; - attribute(readonly, reportable) Percent currentPositionTiltPercentage = 9; - attribute(readonly, reportable) bitmap8 operationalStatus = 10; - attribute(readonly, reportable) Percent100ths targetPositionLiftPercent100ths = 11; - attribute(readonly, reportable) Percent100ths targetPositionTiltPercent100ths = 12; - attribute(readonly, reportable) enum8 endProductType = 13; - attribute(readonly, reportable) Percent100ths currentPositionLiftPercent100ths = 14; - attribute(readonly, reportable) Percent100ths currentPositionTiltPercent100ths = 15; - attribute(readonly, reportable) int16u installedOpenLimitLift = 16; - attribute(readonly, reportable) int16u installedClosedLimitLift = 17; - attribute(readonly, reportable) int16u installedOpenLimitTilt = 18; - attribute(readonly, reportable) int16u installedClosedLimitTilt = 19; - attribute(writable, reportable) bitmap8 mode = 23; - attribute(readonly, reportable) bitmap16 safetyStatus = 26; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) enum8 type = 0; + attribute(readonly) int16u currentPositionLift = 3; + attribute(readonly) int16u currentPositionTilt = 4; + attribute(readonly) bitmap8 configStatus = 7; + attribute(readonly) Percent currentPositionLiftPercentage = 8; + attribute(readonly) Percent currentPositionTiltPercentage = 9; + attribute(readonly) bitmap8 operationalStatus = 10; + attribute(readonly) Percent100ths targetPositionLiftPercent100ths = 11; + attribute(readonly) Percent100ths targetPositionTiltPercent100ths = 12; + attribute(readonly) enum8 endProductType = 13; + attribute(readonly) Percent100ths currentPositionLiftPercent100ths = 14; + attribute(readonly) Percent100ths currentPositionTiltPercent100ths = 15; + attribute(readonly) int16u installedOpenLimitLift = 16; + attribute(readonly) int16u installedClosedLimitLift = 17; + attribute(readonly) int16u installedOpenLimitTilt = 18; + attribute(readonly) int16u installedClosedLimitTilt = 19; + attribute(writable) bitmap8 mode = 23; + attribute(readonly) bitmap16 safetyStatus = 26; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct GoToLiftPercentageRequest { Percent liftPercentageValue = 0; diff --git a/integrations/docker/ci-only-images/chip-cirque-device-base/Dockerfile b/integrations/docker/ci-only-images/chip-cirque-device-base/Dockerfile index 98e4b414a5ae87..2d04d0fffe90ff 100644 --- a/integrations/docker/ci-only-images/chip-cirque-device-base/Dockerfile +++ b/integrations/docker/ci-only-images/chip-cirque-device-base/Dockerfile @@ -19,7 +19,7 @@ RUN apt-get update \ avahi-utils=0.7-4ubuntu7.1 \ ca-certificates=20210119~20.04.2 \ dhcpcd5=7.1.0-2build1 \ - gdb=9.2-0ubuntu1~20.04 \ + gdb=9.2-0ubuntu1~20.04.1 \ git=1:2.25.1-1ubuntu3.2 \ iproute2=5.5.0-1ubuntu1 \ libavahi-client3=0.7-4ubuntu7.1 \ diff --git a/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt b/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt index 4e07abd270c089..ed842866a36702 100644 --- a/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt +++ b/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt @@ -171,7 +171,7 @@ bool emberAf{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Call GET_CLUSTER_RESPONSE_CALLBACKS("{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callback"); Callback::Callback<{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callback> * cb = Callback::Callback<{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callback>::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext{{#chip_cluster_response_arguments}}, {{#if isArray}}{{asSymbol label}}{{else}}{{#if_is_struct type}}{{asUnderlyingZclType type}}(){{else}}{{asSymbol label}}{{/if_is_struct}}{{/if}}{{/chip_cluster_response_arguments}}); + cb->mCall(cb->mContext{{#chip_cluster_response_arguments}}, {{#if isArray}}{{asSymbol label}}{{else}}{{#if_is_struct type}}::{{asUnderlyingZclType type}}(){{else}}{{asSymbol label}}{{/if_is_struct}}{{/if}}{{/chip_cluster_response_arguments}}); return true; } diff --git a/src/app/zap-templates/templates/app/MatterIDL.zapt b/src/app/zap-templates/templates/app/MatterIDL.zapt index 44906fc5e8ac5a..a20411c00e3f8b 100644 --- a/src/app/zap-templates/templates/app/MatterIDL.zapt +++ b/src/app/zap-templates/templates/app/MatterIDL.zapt @@ -37,9 +37,9 @@ {{~else~}} readonly {{~/if~}} - {{~#if isReportableAttribute~}} - , reportable - {{~/if~}} + {{~#unless isReportableAttribute~}} + , nosubscribe + {{~/unless~}} ) {{type}} {{asLowerCamelCase name~}} {{~#if isList~}} [] diff --git a/src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml index fe997a4c3cda39..6b912b1de27157 100644 --- a/src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml @@ -33,6 +33,13 @@ limitations under the License. + + + + + + + @@ -79,5 +86,21 @@ limitations under the License. + + The cluster SHALL send AccessControlEntryChanged events whenever its ACL attribute data is changed by an Administrator. + + + + + + + + The cluster SHALL send AccessControlExtensionChanged events whenever its extension attribute data is changed by an Administrator. + + + + + + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 60efc6717c3eab..f37ee214bc9abb 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -13,6 +13,12 @@ client cluster AccessControl = 31 { kGroup = 3; } + enum ChangeTypeEnum : ENUM8 { + kChanged = 0; + kAdded = 1; + kRemoved = 2; + } + enum Privilege : ENUM8 { kView = 1; kProxyView = 2; @@ -40,15 +46,31 @@ client cluster AccessControl = 31 { OCTET_STRING data = 1; } - attribute(writable, reportable) AccessControlEntry acl[] = 0; - attribute(writable, reportable) ExtensionEntry extension[] = 1; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + info event AccessControlEntryChanged = 0 { + fabric_idx adminFabricIndex = 0; + node_id adminNodeID = 1; + INT16U adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + AccessControlEntry latestValue = 4; + } + + info event AccessControlExtensionChanged = 1 { + fabric_idx adminFabricIndex = 0; + node_id adminNodeID = 1; + INT16U adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + ExtensionEntry latestValue = 4; + } + + attribute(writable) AccessControlEntry acl[] = 0; + attribute(writable) ExtensionEntry extension[] = 1; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; } client cluster AccountLogin = 1294 { - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; request struct GetSetupPINRequestRequest { CHAR_STRING tempAccountIdentifier = 0; @@ -81,11 +103,11 @@ client cluster AdministratorCommissioning = 60 { kWindowNotOpen = 3; } - attribute(readonly, reportable) int8u windowStatus = 0; - attribute(readonly, reportable) fabric_idx adminFabricIndex = 1; - attribute(readonly, reportable) int16u adminVendorId = 2; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u windowStatus = 0; + attribute(readonly) fabric_idx adminFabricIndex = 1; + attribute(readonly) int16u adminVendorId = 2; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -118,16 +140,16 @@ client cluster ApplicationBasic = 1293 { CHAR_STRING applicationId = 2; } - attribute(readonly, reportable) char_string vendorName = 0; - attribute(readonly, reportable) int16u vendorId = 1; - attribute(readonly, reportable) char_string applicationName = 2; - attribute(readonly, reportable) int16u productId = 3; - attribute(writable, reportable) ApplicationBasicApplication applicationApp = 4; - attribute(readonly, reportable) ApplicationStatusEnum applicationStatus = 5; - attribute(readonly, reportable) char_string applicationVersion = 6; - attribute(readonly, reportable) vendor_id allowedVendorList[] = 7; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) char_string vendorName = 0; + attribute(readonly) int16u vendorId = 1; + attribute(readonly) char_string applicationName = 2; + attribute(readonly) int16u productId = 3; + attribute(writable) ApplicationBasicApplication applicationApp = 4; + attribute(readonly) ApplicationStatusEnum applicationStatus = 5; + attribute(readonly) char_string applicationVersion = 6; + attribute(readonly) vendor_id allowedVendorList[] = 7; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; } client cluster ApplicationLauncher = 1292 { @@ -142,9 +164,9 @@ client cluster ApplicationLauncher = 1292 { CHAR_STRING applicationId = 2; } - attribute(readonly, reportable) INT16U applicationLauncherList[] = 0; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) INT16U applicationLauncherList[] = 0; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; request struct HideAppRequestRequest { ApplicationLauncherApplication application = 0; @@ -185,10 +207,10 @@ client cluster AudioOutput = 1291 { CHAR_STRING name = 3; } - attribute(readonly, reportable) OutputInfo audioOutputList[] = 0; - attribute(readonly, reportable) int8u currentAudioOutput = 1; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) OutputInfo audioOutputList[] = 0; + attribute(readonly) int8u currentAudioOutput = 1; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; request struct RenameOutputRequestRequest { INT8U index = 0; @@ -204,12 +226,12 @@ client cluster AudioOutput = 1291 { } client cluster BarrierControl = 259 { - attribute(readonly, reportable) enum8 barrierMovingState = 1; - attribute(readonly, reportable) bitmap16 barrierSafetyStatus = 2; - attribute(readonly, reportable) bitmap8 barrierCapabilities = 3; - attribute(readonly, reportable) int8u barrierPosition = 10; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) enum8 barrierMovingState = 1; + attribute(readonly) bitmap16 barrierSafetyStatus = 2; + attribute(readonly) bitmap8 barrierCapabilities = 3; + attribute(readonly) int8u barrierPosition = 10; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; request struct BarrierControlGoToPercentRequest { INT8U percentOpen = 0; @@ -234,42 +256,42 @@ client cluster Basic = 40 { boolean reachableNewValue = 0; } - attribute(readonly, reportable) int16u interactionModelVersion = 0; - attribute(readonly, reportable) char_string vendorName = 1; - attribute(readonly, reportable) vendor_id vendorID = 2; - attribute(readonly, reportable) char_string productName = 3; - attribute(readonly, reportable) int16u productID = 4; - attribute(writable, reportable) char_string nodeLabel = 5; - attribute(writable, reportable) char_string location = 6; - attribute(readonly, reportable) int16u hardwareVersion = 7; - attribute(readonly, reportable) char_string hardwareVersionString = 8; - attribute(readonly, reportable) int32u softwareVersion = 9; - attribute(readonly, reportable) char_string softwareVersionString = 10; - attribute(readonly, reportable) char_string manufacturingDate = 11; - attribute(readonly, reportable) char_string partNumber = 12; - attribute(readonly, reportable) long_char_string productURL = 13; - attribute(readonly, reportable) char_string productLabel = 14; - attribute(readonly, reportable) char_string serialNumber = 15; - attribute(writable, reportable) boolean localConfigDisabled = 16; - attribute(readonly, reportable) boolean reachable = 17; - attribute(readonly, reportable) char_string uniqueID = 18; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u interactionModelVersion = 0; + attribute(readonly) char_string vendorName = 1; + attribute(readonly) vendor_id vendorID = 2; + attribute(readonly) char_string productName = 3; + attribute(readonly) int16u productID = 4; + attribute(writable) char_string nodeLabel = 5; + attribute(writable) char_string location = 6; + attribute(readonly) int16u hardwareVersion = 7; + attribute(readonly) char_string hardwareVersionString = 8; + attribute(readonly) int32u softwareVersion = 9; + attribute(readonly) char_string softwareVersionString = 10; + attribute(readonly) char_string manufacturingDate = 11; + attribute(readonly) char_string partNumber = 12; + attribute(readonly) long_char_string productURL = 13; + attribute(readonly) char_string productLabel = 14; + attribute(readonly) char_string serialNumber = 15; + attribute(writable) boolean localConfigDisabled = 16; + attribute(readonly) boolean reachable = 17; + attribute(readonly) char_string uniqueID = 18; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; command MfgSpecificPing(): DefaultSuccess = 0; } client cluster BinaryInputBasic = 15 { - attribute(writable, reportable) boolean outOfService = 81; - attribute(writable, reportable) boolean presentValue = 85; - attribute(readonly, reportable) bitmap8 statusFlags = 111; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) boolean outOfService = 81; + attribute(writable) boolean presentValue = 85; + attribute(readonly) bitmap8 statusFlags = 111; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; } client cluster Binding = 30 { - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; request struct BindRequest { NODE_ID nodeId = 0; @@ -294,9 +316,9 @@ client cluster BooleanState = 69 { boolean stateValue = 0; } - attribute(readonly, reportable) boolean stateValue = 0; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) boolean stateValue = 0; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; } client cluster BridgedActions = 37 { @@ -357,11 +379,11 @@ client cluster BridgedActions = 37 { ActionErrorEnum error = 3; } - attribute(readonly, reportable) ActionStruct actionList[] = 0; - attribute(readonly, reportable) EndpointListStruct endpointList[] = 1; - attribute(readonly, reportable) long_char_string setupUrl = 2; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) ActionStruct actionList[] = 0; + attribute(readonly) EndpointListStruct endpointList[] = 1; + attribute(readonly) long_char_string setupUrl = 2; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; request struct DisableActionRequest { INT16U actionID = 0; @@ -443,8 +465,8 @@ client cluster BridgedActions = 37 { } client cluster BridgedDeviceBasic = 57 { - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; } client cluster Channel = 1284 { @@ -465,9 +487,9 @@ client cluster Channel = 1284 { CHAR_STRING affiliateCallSign = 5; } - attribute(readonly, reportable) ChannelInfo channelList[] = 0; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) ChannelInfo channelList[] = 0; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; request struct ChangeChannelByNumberRequestRequest { INT16U majorNumber = 0; @@ -539,60 +561,60 @@ client cluster ColorControl = 768 { kDown = 3; } - attribute(readonly, reportable) int8u currentHue = 0; - attribute(readonly, reportable) int8u currentSaturation = 1; - attribute(readonly, reportable) int16u remainingTime = 2; - attribute(readonly, reportable) int16u currentX = 3; - attribute(readonly, reportable) int16u currentY = 4; - attribute(readonly, reportable) enum8 driftCompensation = 5; - attribute(readonly, reportable) char_string compensationText = 6; - attribute(readonly, reportable) int16u colorTemperature = 7; - attribute(readonly, reportable) enum8 colorMode = 8; - attribute(writable, reportable) bitmap8 colorControlOptions = 15; - attribute(readonly, reportable) int8u numberOfPrimaries = 16; - attribute(readonly, reportable) int16u primary1X = 17; - attribute(readonly, reportable) int16u primary1Y = 18; - attribute(readonly, reportable) int8u primary1Intensity = 19; - attribute(readonly, reportable) int16u primary2X = 21; - attribute(readonly, reportable) int16u primary2Y = 22; - attribute(readonly, reportable) int8u primary2Intensity = 23; - attribute(readonly, reportable) int16u primary3X = 25; - attribute(readonly, reportable) int16u primary3Y = 26; - attribute(readonly, reportable) int8u primary3Intensity = 27; - attribute(readonly, reportable) int16u primary4X = 32; - attribute(readonly, reportable) int16u primary4Y = 33; - attribute(readonly, reportable) int8u primary4Intensity = 34; - attribute(readonly, reportable) int16u primary5X = 36; - attribute(readonly, reportable) int16u primary5Y = 37; - attribute(readonly, reportable) int8u primary5Intensity = 38; - attribute(readonly, reportable) int16u primary6X = 40; - attribute(readonly, reportable) int16u primary6Y = 41; - attribute(readonly, reportable) int8u primary6Intensity = 42; - attribute(writable, reportable) int16u whitePointX = 48; - attribute(writable, reportable) int16u whitePointY = 49; - attribute(writable, reportable) int16u colorPointRX = 50; - attribute(writable, reportable) int16u colorPointRY = 51; - attribute(writable, reportable) int8u colorPointRIntensity = 52; - attribute(writable, reportable) int16u colorPointGX = 54; - attribute(writable, reportable) int16u colorPointGY = 55; - attribute(writable, reportable) int8u colorPointGIntensity = 56; - attribute(writable, reportable) int16u colorPointBX = 58; - attribute(writable, reportable) int16u colorPointBY = 59; - attribute(writable, reportable) int8u colorPointBIntensity = 60; - attribute(readonly, reportable) int16u enhancedCurrentHue = 16384; - attribute(readonly, reportable) enum8 enhancedColorMode = 16385; - attribute(readonly, reportable) int8u colorLoopActive = 16386; - attribute(readonly, reportable) int8u colorLoopDirection = 16387; - attribute(readonly, reportable) int16u colorLoopTime = 16388; - attribute(readonly, reportable) int16u colorLoopStartEnhancedHue = 16389; - attribute(readonly, reportable) int16u colorLoopStoredEnhancedHue = 16390; - attribute(readonly, reportable) bitmap16 colorCapabilities = 16394; - attribute(readonly, reportable) int16u colorTempPhysicalMin = 16395; - attribute(readonly, reportable) int16u colorTempPhysicalMax = 16396; - attribute(readonly, reportable) int16u coupleColorTempToLevelMinMireds = 16397; - attribute(writable, reportable) int16u startUpColorTemperatureMireds = 16400; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u currentHue = 0; + attribute(readonly) int8u currentSaturation = 1; + attribute(readonly) int16u remainingTime = 2; + attribute(readonly) int16u currentX = 3; + attribute(readonly) int16u currentY = 4; + attribute(readonly) enum8 driftCompensation = 5; + attribute(readonly) char_string compensationText = 6; + attribute(readonly) int16u colorTemperature = 7; + attribute(readonly) enum8 colorMode = 8; + attribute(writable) bitmap8 colorControlOptions = 15; + attribute(readonly) int8u numberOfPrimaries = 16; + attribute(readonly) int16u primary1X = 17; + attribute(readonly) int16u primary1Y = 18; + attribute(readonly) int8u primary1Intensity = 19; + attribute(readonly) int16u primary2X = 21; + attribute(readonly) int16u primary2Y = 22; + attribute(readonly) int8u primary2Intensity = 23; + attribute(readonly) int16u primary3X = 25; + attribute(readonly) int16u primary3Y = 26; + attribute(readonly) int8u primary3Intensity = 27; + attribute(readonly) int16u primary4X = 32; + attribute(readonly) int16u primary4Y = 33; + attribute(readonly) int8u primary4Intensity = 34; + attribute(readonly) int16u primary5X = 36; + attribute(readonly) int16u primary5Y = 37; + attribute(readonly) int8u primary5Intensity = 38; + attribute(readonly) int16u primary6X = 40; + attribute(readonly) int16u primary6Y = 41; + attribute(readonly) int8u primary6Intensity = 42; + attribute(writable) int16u whitePointX = 48; + attribute(writable) int16u whitePointY = 49; + attribute(writable) int16u colorPointRX = 50; + attribute(writable) int16u colorPointRY = 51; + attribute(writable) int8u colorPointRIntensity = 52; + attribute(writable) int16u colorPointGX = 54; + attribute(writable) int16u colorPointGY = 55; + attribute(writable) int8u colorPointGIntensity = 56; + attribute(writable) int16u colorPointBX = 58; + attribute(writable) int16u colorPointBY = 59; + attribute(writable) int8u colorPointBIntensity = 60; + attribute(readonly) int16u enhancedCurrentHue = 16384; + attribute(readonly) enum8 enhancedColorMode = 16385; + attribute(readonly) int8u colorLoopActive = 16386; + attribute(readonly) int8u colorLoopDirection = 16387; + attribute(readonly) int16u colorLoopTime = 16388; + attribute(readonly) int16u colorLoopStartEnhancedHue = 16389; + attribute(readonly) int16u colorLoopStoredEnhancedHue = 16390; + attribute(readonly) bitmap16 colorCapabilities = 16394; + attribute(readonly) int16u colorTempPhysicalMin = 16395; + attribute(readonly) int16u colorTempPhysicalMax = 16396; + attribute(readonly) int16u coupleColorTempToLevelMinMireds = 16397; + attribute(writable) int16u startUpColorTemperatureMireds = 16400; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; request struct ColorLoopSetRequest { ColorLoopUpdateFlags updateFlags = 0; @@ -827,10 +849,10 @@ client cluster ContentLauncher = 1290 { MetricTypeEnum metric = 3; } - attribute(readonly, reportable) CHAR_STRING acceptHeaderList[] = 0; - attribute(writable, reportable) bitmap32 supportedStreamingProtocols = 1; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) CHAR_STRING acceptHeaderList[] = 0; + attribute(writable) bitmap32 supportedStreamingProtocols = 1; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; request struct LaunchContentRequestRequest { BOOLEAN autoPlay = 0; @@ -859,12 +881,12 @@ client cluster Descriptor = 29 { INT16U revision = 2; } - attribute(readonly, reportable) DeviceType deviceList[] = 0; - attribute(readonly, reportable) CLUSTER_ID serverList[] = 1; - attribute(readonly, reportable) CLUSTER_ID clientList[] = 2; - attribute(readonly, reportable) ENDPOINT_NO partsList[] = 3; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) DeviceType deviceList[] = 0; + attribute(readonly) CLUSTER_ID serverList[] = 1; + attribute(readonly) CLUSTER_ID clientList[] = 2; + attribute(readonly) ENDPOINT_NO partsList[] = 3; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; } client cluster DiagnosticLogs = 50 { @@ -887,7 +909,7 @@ client cluster DiagnosticLogs = 50 { kBdx = 1; } - attribute(readonly, reportable) attrib_id attributeList[] = 65531; + attribute(readonly) attrib_id attributeList[] = 65531; request struct RetrieveLogsRequestRequest { LogsIntent intent = 0; @@ -1141,24 +1163,24 @@ client cluster DoorLock = 257 { nullable INT16U dataIndex = 6; } - attribute(readonly, reportable) DlLockState lockState = 0; - attribute(readonly, reportable) DlLockType lockType = 1; - attribute(readonly, reportable) boolean actuatorEnabled = 2; - attribute(readonly, reportable) DlDoorState doorState = 3; - attribute(readonly, reportable) int16u numberOfTotalUsersSupported = 17; - attribute(readonly, reportable) int16u numberOfPINUsersSupported = 18; - attribute(readonly, reportable) int8u maxPINCodeLength = 23; - attribute(readonly, reportable) int8u minPINCodeLength = 24; - attribute(writable, reportable) char_string language = 33; - attribute(writable, reportable) int32u autoRelockTime = 35; - attribute(writable, reportable) int8u soundVolume = 36; - attribute(writable, reportable) DlOperatingMode operatingMode = 37; - attribute(readonly, reportable) bitmap16 supportedOperatingModes = 38; - attribute(writable, reportable) boolean enableOneTouchLocking = 41; - attribute(writable, reportable) boolean enablePrivacyModeButton = 43; - attribute(writable, reportable) int8u wrongCodeEntryLimit = 48; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) DlLockState lockState = 0; + attribute(readonly) DlLockType lockType = 1; + attribute(readonly) boolean actuatorEnabled = 2; + attribute(readonly) DlDoorState doorState = 3; + attribute(readonly) int16u numberOfTotalUsersSupported = 17; + attribute(readonly) int16u numberOfPINUsersSupported = 18; + attribute(readonly) int8u maxPINCodeLength = 23; + attribute(readonly) int8u minPINCodeLength = 24; + attribute(writable) char_string language = 33; + attribute(writable) int32u autoRelockTime = 35; + attribute(writable) int8u soundVolume = 36; + attribute(writable) DlOperatingMode operatingMode = 37; + attribute(readonly) bitmap16 supportedOperatingModes = 38; + attribute(writable) boolean enableOneTouchLocking = 41; + attribute(writable) boolean enablePrivacyModeButton = 43; + attribute(writable) int8u wrongCodeEntryLimit = 48; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; request struct ClearCredentialRequest { DlCredential credential = 0; @@ -1238,19 +1260,19 @@ client cluster DoorLock = 257 { } client cluster ElectricalMeasurement = 2820 { - attribute(readonly, reportable) bitmap32 measurementType = 0; - attribute(readonly, reportable) int32s totalActivePower = 772; - attribute(readonly, reportable) int16u rmsVoltage = 1285; - attribute(readonly, reportable) int16u rmsVoltageMin = 1286; - attribute(readonly, reportable) int16u rmsVoltageMax = 1287; - attribute(readonly, reportable) int16u rmsCurrent = 1288; - attribute(readonly, reportable) int16u rmsCurrentMin = 1289; - attribute(readonly, reportable) int16u rmsCurrentMax = 1290; - attribute(readonly, reportable) int16s activePower = 1291; - attribute(readonly, reportable) int16s activePowerMin = 1292; - attribute(readonly, reportable) int16s activePowerMax = 1293; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) bitmap32 measurementType = 0; + attribute(readonly) int32s totalActivePower = 772; + attribute(readonly) int16u rmsVoltage = 1285; + attribute(readonly) int16u rmsVoltageMin = 1286; + attribute(readonly) int16u rmsVoltageMax = 1287; + attribute(readonly) int16u rmsCurrent = 1288; + attribute(readonly) int16u rmsCurrentMin = 1289; + attribute(readonly) int16u rmsCurrentMax = 1290; + attribute(readonly) int16s activePower = 1291; + attribute(readonly) int16s activePowerMin = 1292; + attribute(readonly) int16s activePowerMax = 1293; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; } client cluster EthernetNetworkDiagnostics = 55 { @@ -1267,35 +1289,35 @@ client cluster EthernetNetworkDiagnostics = 55 { k400g = 9; } - attribute(readonly, reportable) enum8 PHYRate = 0; - attribute(readonly, reportable) boolean fullDuplex = 1; - attribute(readonly, reportable) int64u packetRxCount = 2; - attribute(readonly, reportable) int64u packetTxCount = 3; - attribute(readonly, reportable) int64u txErrCount = 4; - attribute(readonly, reportable) int64u collisionCount = 5; - attribute(readonly, reportable) int64u overrunCount = 6; - attribute(readonly, reportable) boolean carrierDetect = 7; - attribute(readonly, reportable) int64u timeSinceReset = 8; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) enum8 PHYRate = 0; + attribute(readonly) boolean fullDuplex = 1; + attribute(readonly) int64u packetRxCount = 2; + attribute(readonly) int64u packetTxCount = 3; + attribute(readonly) int64u txErrCount = 4; + attribute(readonly) int64u collisionCount = 5; + attribute(readonly) int64u overrunCount = 6; + attribute(readonly) boolean carrierDetect = 7; + attribute(readonly) int64u timeSinceReset = 8; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; command ResetCounts(): DefaultSuccess = 0; } client cluster FixedLabel = 64 { - attribute(readonly, reportable) LabelStruct labelList[] = 0; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) LabelStruct labelList[] = 0; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; } client cluster FlowMeasurement = 1028 { - attribute(readonly, reportable) int16s measuredValue = 0; - attribute(readonly, reportable) int16s minMeasuredValue = 1; - attribute(readonly, reportable) int16s maxMeasuredValue = 2; - attribute(readonly, reportable) int16u tolerance = 3; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16s measuredValue = 0; + attribute(readonly) int16s minMeasuredValue = 1; + attribute(readonly) int16s maxMeasuredValue = 2; + attribute(readonly) int16u tolerance = 3; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; } client cluster GeneralCommissioning = 48 { @@ -1316,12 +1338,12 @@ client cluster GeneralCommissioning = 48 { INT32U failSafeExpiryLengthMs = 1; } - attribute(writable, reportable) int64u breadcrumb = 0; - attribute(readonly, reportable) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; - attribute(readonly, reportable) enum8 regulatoryConfig = 2; - attribute(readonly, reportable) enum8 locationCapability = 3; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) int64u breadcrumb = 0; + attribute(readonly) BasicCommissioningInfoType basicCommissioningInfoList[] = 1; + attribute(readonly) enum8 regulatoryConfig = 2; + attribute(readonly) enum8 locationCapability = 3; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -1434,16 +1456,16 @@ client cluster GeneralDiagnostics = 51 { BootReasonType bootReason = 0; } - attribute(readonly, reportable) NetworkInterfaceType networkInterfaces[] = 0; - attribute(readonly, reportable) int16u rebootCount = 1; - attribute(readonly, reportable) int64u upTime = 2; - attribute(readonly, reportable) int32u totalOperationalHours = 3; - attribute(readonly, reportable) enum8 bootReasons = 4; - attribute(readonly, reportable) ENUM8 activeHardwareFaults[] = 5; - attribute(readonly, reportable) ENUM8 activeRadioFaults[] = 6; - attribute(readonly, reportable) ENUM8 activeNetworkFaults[] = 7; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) NetworkInterfaceType networkInterfaces[] = 0; + attribute(readonly) int16u rebootCount = 1; + attribute(readonly) int64u upTime = 2; + attribute(readonly) int32u totalOperationalHours = 3; + attribute(readonly) enum8 bootReasons = 4; + attribute(readonly) ENUM8 activeHardwareFaults[] = 5; + attribute(readonly) ENUM8 activeRadioFaults[] = 6; + attribute(readonly) ENUM8 activeNetworkFaults[] = 7; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; } client cluster GroupKeyManagement = 63 { @@ -1476,12 +1498,12 @@ client cluster GroupKeyManagement = 63 { INT64U epochStartTime2 = 7; } - attribute(readonly, reportable) GroupKey groupKeyMap[] = 0; - attribute(readonly, reportable) GroupInfo groupTable[] = 1; - attribute(readonly, reportable) int16u maxGroupsPerFabric = 2; - attribute(readonly, reportable) int16u maxGroupKeysPerFabric = 3; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) GroupKey groupKeyMap[] = 0; + attribute(readonly) GroupInfo groupTable[] = 1; + attribute(readonly) int16u maxGroupsPerFabric = 2; + attribute(readonly) int16u maxGroupKeysPerFabric = 3; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; request struct KeySetReadRequest { INT16U groupKeySetID = 0; @@ -1514,9 +1536,9 @@ client cluster GroupKeyManagement = 63 { } client cluster Groups = 4 { - attribute(readonly, reportable) bitmap8 nameSupport = 0; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) bitmap8 nameSupport = 0; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; request struct AddGroupRequest { INT16U groupId = 0; @@ -1592,10 +1614,10 @@ client cluster Identify = 3 { kActuator = 5; } - attribute(writable, reportable) int16u identifyTime = 0; - attribute(readonly, reportable) enum8 identifyType = 1; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) int16u identifyTime = 0; + attribute(readonly) enum8 identifyType = 1; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; request struct IdentifyRequest { INT16U identifyTime = 0; @@ -1621,13 +1643,13 @@ client cluster IlluminanceMeasurement = 1024 { kCmos = 1; } - attribute(readonly, reportable) int16u measuredValue = 0; - attribute(readonly, reportable) int16u minMeasuredValue = 1; - attribute(readonly, reportable) int16u maxMeasuredValue = 2; - attribute(readonly, reportable) int16u tolerance = 3; - attribute(readonly, reportable) enum8 lightSensorType = 4; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u measuredValue = 0; + attribute(readonly) int16u minMeasuredValue = 1; + attribute(readonly) int16u maxMeasuredValue = 2; + attribute(readonly) int16u tolerance = 3; + attribute(readonly) enum8 lightSensorType = 4; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; } client cluster KeypadInput = 1289 { @@ -1726,8 +1748,8 @@ client cluster KeypadInput = 1289 { kInvalidKeyInCurrentState = 2; } - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; request struct SendKeyRequestRequest { CecKeyCode keyCode = 0; @@ -1751,23 +1773,23 @@ client cluster LevelControl = 8 { kDown = 1; } - attribute(readonly, reportable) int8u currentLevel = 0; - attribute(readonly, reportable) int16u remainingTime = 1; - attribute(readonly, reportable) int8u minLevel = 2; - attribute(readonly, reportable) int8u maxLevel = 3; - attribute(readonly, reportable) int16u currentFrequency = 4; - attribute(readonly, reportable) int16u minFrequency = 5; - attribute(readonly, reportable) int16u maxFrequency = 6; - attribute(writable, reportable) bitmap8 options = 15; - attribute(writable, reportable) int16u onOffTransitionTime = 16; - attribute(writable, reportable) int8u onLevel = 17; - attribute(writable, reportable) int16u onTransitionTime = 18; - attribute(writable, reportable) int16u offTransitionTime = 19; - attribute(writable, reportable) int8u defaultMoveRate = 20; - attribute(writable, reportable) int8u startUpCurrentLevel = 16384; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u currentLevel = 0; + attribute(readonly) int16u remainingTime = 1; + attribute(readonly) int8u minLevel = 2; + attribute(readonly) int8u maxLevel = 3; + attribute(readonly) int16u currentFrequency = 4; + attribute(readonly) int16u minFrequency = 5; + attribute(readonly) int16u maxFrequency = 6; + attribute(writable) bitmap8 options = 15; + attribute(writable) int16u onOffTransitionTime = 16; + attribute(writable) int8u onLevel = 17; + attribute(writable) int16u onTransitionTime = 18; + attribute(writable) int16u offTransitionTime = 19; + attribute(writable) int8u defaultMoveRate = 20; + attribute(writable) int8u startUpCurrentLevel = 16384; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct MoveRequest { MoveMode moveMode = 0; @@ -1823,13 +1845,13 @@ client cluster LevelControl = 8 { } client cluster LocalizationConfiguration = 43 { - attribute(writable, reportable) char_string activeLocale = 1; - attribute(readonly, reportable) CHAR_STRING supportedLocales[] = 2; + attribute(writable) char_string activeLocale = 1; + attribute(readonly) CHAR_STRING supportedLocales[] = 2; } client cluster LowPower = 1288 { - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; command Sleep(): DefaultSuccess = 0; } @@ -1857,10 +1879,10 @@ client cluster MediaInput = 1287 { CHAR_STRING description = 4; } - attribute(readonly, reportable) InputInfo mediaInputList[] = 0; - attribute(readonly, reportable) int8u currentMediaInput = 1; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) InputInfo mediaInputList[] = 0; + attribute(readonly) int8u currentMediaInput = 1; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; request struct RenameInputRequestRequest { INT8U index = 0; @@ -1894,14 +1916,14 @@ client cluster MediaPlayback = 1286 { kSeekOutOfRange = 5; } - attribute(readonly, reportable) PlaybackStateEnum playbackState = 0; - attribute(readonly, reportable) epoch_us startTime = 1; - attribute(readonly, reportable) int64u duration = 2; - attribute(readonly, reportable) single playbackSpeed = 4; - attribute(readonly, reportable) int64u seekRangeEnd = 5; - attribute(readonly, reportable) int64u seekRangeStart = 6; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) PlaybackStateEnum playbackState = 0; + attribute(readonly) epoch_us startTime = 1; + attribute(readonly) int64u duration = 2; + attribute(readonly) single playbackSpeed = 4; + attribute(readonly) int64u seekRangeEnd = 5; + attribute(readonly) int64u seekRangeStart = 6; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; request struct SeekRequestRequest { INT64U position = 0; @@ -1939,13 +1961,13 @@ client cluster ModeSelect = 80 { INT32U semanticTag = 3; } - attribute(readonly, reportable) int8u currentMode = 0; - attribute(readonly, reportable) ModeOptionStruct supportedModes[] = 1; - attribute(writable, reportable) int8u onMode = 2; - attribute(readonly, reportable) int8u startUpMode = 3; - attribute(readonly, reportable) char_string description = 4; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u currentMode = 0; + attribute(readonly) ModeOptionStruct supportedModes[] = 1; + attribute(writable) int8u onMode = 2; + attribute(readonly) int8u startUpMode = 3; + attribute(readonly) char_string description = 4; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; request struct ChangeToModeRequest { INT8U newMode = 0; @@ -2004,16 +2026,16 @@ client cluster NetworkCommissioning = 49 { INT8U lqi = 8; } - attribute(readonly, reportable) int8u maxNetworks = 0; - attribute(readonly, reportable) NetworkInfo networks[] = 1; - attribute(readonly, reportable) int8u scanMaxTimeSeconds = 2; - attribute(readonly, reportable) int8u connectMaxTimeSeconds = 3; - attribute(writable, reportable) boolean interfaceEnabled = 4; - attribute(readonly, reportable) NetworkCommissioningStatus lastNetworkingStatus = 5; - attribute(readonly, reportable) octet_string lastNetworkID = 6; - attribute(readonly, reportable) int32u lastConnectErrorValue = 7; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u maxNetworks = 0; + attribute(readonly) NetworkInfo networks[] = 1; + attribute(readonly) int8u scanMaxTimeSeconds = 2; + attribute(readonly) int8u connectMaxTimeSeconds = 3; + attribute(writable) boolean interfaceEnabled = 4; + attribute(readonly) NetworkCommissioningStatus lastNetworkingStatus = 5; + attribute(readonly) octet_string lastNetworkID = 6; + attribute(readonly) int32u lastConnectErrorValue = 7; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -2094,8 +2116,8 @@ client cluster OtaSoftwareUpdateProvider = 41 { kDownloadProtocolNotSupported = 3; } - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; request struct ApplyUpdateRequestRequest { OCTET_STRING updateToken = 0; @@ -2191,12 +2213,12 @@ client cluster OtaSoftwareUpdateRequestor = 42 { nullable INT64S platformCode = 3; } - attribute(writable, reportable) ProviderLocation defaultOtaProviders[] = 0; - attribute(readonly, reportable) boolean updatePossible = 1; - attribute(readonly, reportable) OTAUpdateStateEnum updateState = 2; - attribute(readonly, reportable) int8u updateStateProgress = 3; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) ProviderLocation defaultOtaProviders[] = 0; + attribute(readonly) boolean updatePossible = 1; + attribute(readonly) OTAUpdateStateEnum updateState = 2; + attribute(readonly) int8u updateStateProgress = 3; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; request struct AnnounceOtaProviderRequest { node_id providerNodeId = 0; @@ -2210,11 +2232,11 @@ client cluster OtaSoftwareUpdateRequestor = 42 { } client cluster OccupancySensing = 1030 { - attribute(readonly, reportable) bitmap8 occupancy = 0; - attribute(readonly, reportable) enum8 occupancySensorType = 1; - attribute(readonly, reportable) bitmap8 occupancySensorTypeBitmap = 2; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) bitmap8 occupancy = 0; + attribute(readonly) enum8 occupancySensorType = 1; + attribute(readonly) bitmap8 occupancySensorTypeBitmap = 2; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; } client cluster OnOff = 6 { @@ -2233,14 +2255,14 @@ client cluster OnOff = 6 { kDyingLight = 1; } - attribute(readonly, reportable) boolean onOff = 0; - attribute(readonly, reportable) boolean globalSceneControl = 16384; - attribute(writable, reportable) int16u onTime = 16385; - attribute(writable, reportable) int16u offWaitTime = 16386; - attribute(writable, reportable) enum8 startUpOnOff = 16387; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) boolean onOff = 0; + attribute(readonly) boolean globalSceneControl = 16384; + attribute(writable) int16u onTime = 16385; + attribute(writable) int16u offWaitTime = 16386; + attribute(writable) enum8 startUpOnOff = 16387; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct OffWithEffectRequest { OnOffEffectIdentifier effectId = 0; @@ -2262,10 +2284,10 @@ client cluster OnOff = 6 { } client cluster OnOffSwitchConfiguration = 7 { - attribute(readonly, reportable) enum8 switchType = 0; - attribute(writable, reportable) enum8 switchActions = 16; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) enum8 switchType = 0; + attribute(writable) enum8 switchActions = 16; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; } client cluster OperationalCredentials = 62 { @@ -2291,13 +2313,13 @@ client cluster OperationalCredentials = 62 { CHAR_STRING label = 6; } - attribute(readonly, reportable) FabricDescriptor fabricsList[] = 1; - attribute(readonly, reportable) int8u supportedFabrics = 2; - attribute(readonly, reportable) int8u commissionedFabrics = 3; - attribute(readonly, reportable) OCTET_STRING trustedRootCertificates[] = 4; - attribute(readonly, reportable) fabric_idx currentFabricIndex = 5; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) FabricDescriptor fabricsList[] = 1; + attribute(readonly) int8u supportedFabrics = 2; + attribute(readonly) int8u commissionedFabrics = 3; + attribute(readonly) OCTET_STRING trustedRootCertificates[] = 4; + attribute(readonly) fabric_idx currentFabricIndex = 5; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -2372,32 +2394,32 @@ client cluster OperationalCredentials = 62 { } client cluster PowerSource = 47 { - attribute(readonly, reportable) enum8 status = 0; - attribute(readonly, reportable) int8u order = 1; - attribute(readonly, reportable) char_string description = 2; - attribute(readonly, reportable) int32u batteryVoltage = 11; - attribute(readonly, reportable) int8u batteryPercentRemaining = 12; - attribute(readonly, reportable) int32u batteryTimeRemaining = 13; - attribute(readonly, reportable) enum8 batteryChargeLevel = 14; - attribute(readonly, reportable) ENUM8 activeBatteryFaults[] = 18; - attribute(readonly, reportable) enum8 batteryChargeState = 26; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) enum8 status = 0; + attribute(readonly) int8u order = 1; + attribute(readonly) char_string description = 2; + attribute(readonly) int32u batteryVoltage = 11; + attribute(readonly) int8u batteryPercentRemaining = 12; + attribute(readonly) int32u batteryTimeRemaining = 13; + attribute(readonly) enum8 batteryChargeLevel = 14; + attribute(readonly) ENUM8 activeBatteryFaults[] = 18; + attribute(readonly) enum8 batteryChargeState = 26; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } client cluster PowerSourceConfiguration = 46 { - attribute(readonly, reportable) INT8U sources[] = 0; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) INT8U sources[] = 0; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; } client cluster PressureMeasurement = 1027 { - attribute(readonly, reportable) int16s measuredValue = 0; - attribute(readonly, reportable) int16s minMeasuredValue = 1; - attribute(readonly, reportable) int16s maxMeasuredValue = 2; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16s measuredValue = 0; + attribute(readonly) int16s minMeasuredValue = 1; + attribute(readonly) int16s maxMeasuredValue = 2; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; } client cluster PumpConfigurationAndControl = 512 { @@ -2468,42 +2490,42 @@ client cluster PumpConfigurationAndControl = 512 { info event TurbineOperation = 16 { } - attribute(readonly, reportable) int16s maxPressure = 0; - attribute(readonly, reportable) int16u maxSpeed = 1; - attribute(readonly, reportable) int16u maxFlow = 2; - attribute(readonly, reportable) int16s minConstPressure = 3; - attribute(readonly, reportable) int16s maxConstPressure = 4; - attribute(readonly, reportable) int16s minCompPressure = 5; - attribute(readonly, reportable) int16s maxCompPressure = 6; - attribute(readonly, reportable) int16u minConstSpeed = 7; - attribute(readonly, reportable) int16u maxConstSpeed = 8; - attribute(readonly, reportable) int16u minConstFlow = 9; - attribute(readonly, reportable) int16u maxConstFlow = 10; - attribute(readonly, reportable) int16s minConstTemp = 11; - attribute(readonly, reportable) int16s maxConstTemp = 12; - attribute(readonly, reportable) bitmap16 pumpStatus = 16; - attribute(readonly, reportable) enum8 effectiveOperationMode = 17; - attribute(readonly, reportable) enum8 effectiveControlMode = 18; - attribute(readonly, reportable) int16s capacity = 19; - attribute(readonly, reportable) int16u speed = 20; - attribute(writable, reportable) int24u lifetimeRunningHours = 21; - attribute(readonly, reportable) int24u power = 22; - attribute(writable, reportable) int32u lifetimeEnergyConsumed = 23; - attribute(writable, reportable) enum8 operationMode = 32; - attribute(writable, reportable) enum8 controlMode = 33; - attribute(readonly, reportable) bitmap16 alarmMask = 34; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16s maxPressure = 0; + attribute(readonly) int16u maxSpeed = 1; + attribute(readonly) int16u maxFlow = 2; + attribute(readonly) int16s minConstPressure = 3; + attribute(readonly) int16s maxConstPressure = 4; + attribute(readonly) int16s minCompPressure = 5; + attribute(readonly) int16s maxCompPressure = 6; + attribute(readonly) int16u minConstSpeed = 7; + attribute(readonly) int16u maxConstSpeed = 8; + attribute(readonly) int16u minConstFlow = 9; + attribute(readonly) int16u maxConstFlow = 10; + attribute(readonly) int16s minConstTemp = 11; + attribute(readonly) int16s maxConstTemp = 12; + attribute(readonly) bitmap16 pumpStatus = 16; + attribute(readonly) enum8 effectiveOperationMode = 17; + attribute(readonly) enum8 effectiveControlMode = 18; + attribute(readonly) int16s capacity = 19; + attribute(readonly) int16u speed = 20; + attribute(writable) int24u lifetimeRunningHours = 21; + attribute(readonly) int24u power = 22; + attribute(writable) int32u lifetimeEnergyConsumed = 23; + attribute(writable) enum8 operationMode = 32; + attribute(writable) enum8 controlMode = 33; + attribute(readonly) bitmap16 alarmMask = 34; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } client cluster RelativeHumidityMeasurement = 1029 { - attribute(readonly, reportable) int16u measuredValue = 0; - attribute(readonly, reportable) int16u minMeasuredValue = 1; - attribute(readonly, reportable) int16u maxMeasuredValue = 2; - attribute(readonly, reportable) int16u tolerance = 3; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u measuredValue = 0; + attribute(readonly) int16u minMeasuredValue = 1; + attribute(readonly) int16u maxMeasuredValue = 2; + attribute(readonly) int16u tolerance = 3; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; } client cluster Scenes = 5 { @@ -2513,13 +2535,13 @@ client cluster Scenes = 5 { INT8U value = 3; } - attribute(readonly, reportable) int8u sceneCount = 0; - attribute(readonly, reportable) int8u currentScene = 1; - attribute(readonly, reportable) int16u currentGroup = 2; - attribute(readonly, reportable) boolean sceneValid = 3; - attribute(readonly, reportable) bitmap8 nameSupport = 4; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u sceneCount = 0; + attribute(readonly) int8u currentScene = 1; + attribute(readonly) int16u currentGroup = 2; + attribute(readonly) boolean sceneValid = 3; + attribute(readonly) bitmap8 nameSupport = 4; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; request struct AddSceneRequest { INT16U groupId = 0; @@ -2620,13 +2642,13 @@ client cluster SoftwareDiagnostics = 52 { SoftwareFault softwareFault = 0; } - attribute(readonly, reportable) ThreadMetrics threadMetrics[] = 0; - attribute(readonly, reportable) int64u currentHeapFree = 1; - attribute(readonly, reportable) int64u currentHeapUsed = 2; - attribute(readonly, reportable) int64u currentHeapHighWatermark = 3; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) ThreadMetrics threadMetrics[] = 0; + attribute(readonly) int64u currentHeapFree = 1; + attribute(readonly) int64u currentHeapUsed = 2; + attribute(readonly) int64u currentHeapHighWatermark = 3; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; command ResetWatermarks(): DefaultSuccess = 0; } @@ -2662,12 +2684,12 @@ client cluster Switch = 59 { INT8U totalNumberOfPressesCounted = 1; } - attribute(readonly, reportable) int8u numberOfPositions = 0; - attribute(readonly, reportable) int8u currentPosition = 1; - attribute(readonly, reportable) int8u multiPressMax = 2; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int8u numberOfPositions = 0; + attribute(readonly) int8u currentPosition = 1; + attribute(readonly) int8u multiPressMax = 2; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; } client cluster TargetNavigator = 1285 { @@ -2682,10 +2704,10 @@ client cluster TargetNavigator = 1285 { CHAR_STRING name = 2; } - attribute(readonly, reportable) TargetInfo targetNavigatorList[] = 0; - attribute(readonly, reportable) int8u currentNavigatorTarget = 1; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) TargetInfo targetNavigatorList[] = 0; + attribute(readonly) int8u currentNavigatorTarget = 1; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; request struct NavigateTargetRequestRequest { INT8U target = 0; @@ -2701,12 +2723,12 @@ client cluster TargetNavigator = 1285 { } client cluster TemperatureMeasurement = 1026 { - attribute(readonly, reportable) int16s measuredValue = 0; - attribute(readonly, reportable) int16s minMeasuredValue = 1; - attribute(readonly, reportable) int16s maxMeasuredValue = 2; - attribute(readonly, reportable) int16u tolerance = 3; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16s measuredValue = 0; + attribute(readonly) int16s minMeasuredValue = 1; + attribute(readonly) int16s maxMeasuredValue = 2; + attribute(readonly) int16u tolerance = 3; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; } client cluster TestCluster = 1295 { @@ -2773,86 +2795,86 @@ client cluster TestCluster = 1295 { SimpleEnum arg6[] = 6; } - attribute(writable, reportable) boolean boolean = 0; - attribute(writable, reportable) bitmap8 bitmap8 = 1; - attribute(writable, reportable) bitmap16 bitmap16 = 2; - attribute(writable, reportable) bitmap32 bitmap32 = 3; - attribute(writable, reportable) bitmap64 bitmap64 = 4; - attribute(writable, reportable) int8u int8u = 5; - attribute(writable, reportable) int16u int16u = 6; - attribute(writable, reportable) int24u int24u = 7; - attribute(writable, reportable) int32u int32u = 8; - attribute(writable, reportable) int40u int40u = 9; - attribute(writable, reportable) int48u int48u = 10; - attribute(writable, reportable) int56u int56u = 11; - attribute(writable, reportable) int64u int64u = 12; - attribute(writable, reportable) int8s int8s = 13; - attribute(writable, reportable) int16s int16s = 14; - attribute(writable, reportable) int24s int24s = 15; - attribute(writable, reportable) int32s int32s = 16; - attribute(writable, reportable) int40s int40s = 17; - attribute(writable, reportable) int48s int48s = 18; - attribute(writable, reportable) int56s int56s = 19; - attribute(writable, reportable) int64s int64s = 20; - attribute(writable, reportable) enum8 enum8 = 21; - attribute(writable, reportable) enum16 enum16 = 22; - attribute(writable, reportable) single floatSingle = 23; - attribute(writable, reportable) double floatDouble = 24; - attribute(writable, reportable) octet_string octetString = 25; - attribute(writable, reportable) INT8U listInt8u[] = 26; - attribute(writable, reportable) OCTET_STRING listOctetString[] = 27; - attribute(writable, reportable) TestListStructOctet listStructOctetString[] = 28; - attribute(writable, reportable) long_octet_string longOctetString = 29; - attribute(writable, reportable) char_string charString = 30; - attribute(writable, reportable) long_char_string longCharString = 31; - attribute(writable, reportable) epoch_us epochUs = 32; - attribute(writable, reportable) epoch_s epochS = 33; - attribute(writable, reportable) vendor_id vendorId = 34; - attribute(writable, reportable) NullablesAndOptionalsStruct listNullablesAndOptionalsStruct[] = 35; - attribute(writable, reportable) SimpleEnum enumAttr = 36; - attribute(writable, reportable) SimpleStruct structAttr = 37; - attribute(writable, reportable) int8u rangeRestrictedInt8u = 38; - attribute(writable, reportable) int8s rangeRestrictedInt8s = 39; - attribute(writable, reportable) int16u rangeRestrictedInt16u = 40; - attribute(writable, reportable) int16s rangeRestrictedInt16s = 41; - attribute(readonly, reportable) LONG_OCTET_STRING listLongOctetString[] = 42; - attribute(writable, reportable) boolean timedWriteBoolean = 48; - attribute(writable, reportable) boolean unsupported = 255; - attribute(writable, reportable) boolean nullableBoolean = 32768; - attribute(writable, reportable) bitmap8 nullableBitmap8 = 32769; - attribute(writable, reportable) bitmap16 nullableBitmap16 = 32770; - attribute(writable, reportable) bitmap32 nullableBitmap32 = 32771; - attribute(writable, reportable) bitmap64 nullableBitmap64 = 32772; - attribute(writable, reportable) int8u nullableInt8u = 32773; - attribute(writable, reportable) int16u nullableInt16u = 32774; - attribute(writable, reportable) int24u nullableInt24u = 32775; - attribute(writable, reportable) int32u nullableInt32u = 32776; - attribute(writable, reportable) int40u nullableInt40u = 32777; - attribute(writable, reportable) int48u nullableInt48u = 32778; - attribute(writable, reportable) int56u nullableInt56u = 32779; - attribute(writable, reportable) int64u nullableInt64u = 32780; - attribute(writable, reportable) int8s nullableInt8s = 32781; - attribute(writable, reportable) int16s nullableInt16s = 32782; - attribute(writable, reportable) int24s nullableInt24s = 32783; - attribute(writable, reportable) int32s nullableInt32s = 32784; - attribute(writable, reportable) int40s nullableInt40s = 32785; - attribute(writable, reportable) int48s nullableInt48s = 32786; - attribute(writable, reportable) int56s nullableInt56s = 32787; - attribute(writable, reportable) int64s nullableInt64s = 32788; - attribute(writable, reportable) enum8 nullableEnum8 = 32789; - attribute(writable, reportable) enum16 nullableEnum16 = 32790; - attribute(writable, reportable) single nullableFloatSingle = 32791; - attribute(writable, reportable) double nullableFloatDouble = 32792; - attribute(writable, reportable) octet_string nullableOctetString = 32793; - attribute(writable, reportable) char_string nullableCharString = 32798; - attribute(writable, reportable) SimpleEnum nullableEnumAttr = 32804; - attribute(writable, reportable) SimpleStruct nullableStruct = 32805; - attribute(writable, reportable) int8u nullableRangeRestrictedInt8u = 32806; - attribute(writable, reportable) int8s nullableRangeRestrictedInt8s = 32807; - attribute(writable, reportable) int16u nullableRangeRestrictedInt16u = 32808; - attribute(writable, reportable) int16s nullableRangeRestrictedInt16s = 32809; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) boolean boolean = 0; + attribute(writable) bitmap8 bitmap8 = 1; + attribute(writable) bitmap16 bitmap16 = 2; + attribute(writable) bitmap32 bitmap32 = 3; + attribute(writable) bitmap64 bitmap64 = 4; + attribute(writable) int8u int8u = 5; + attribute(writable) int16u int16u = 6; + attribute(writable) int24u int24u = 7; + attribute(writable) int32u int32u = 8; + attribute(writable) int40u int40u = 9; + attribute(writable) int48u int48u = 10; + attribute(writable) int56u int56u = 11; + attribute(writable) int64u int64u = 12; + attribute(writable) int8s int8s = 13; + attribute(writable) int16s int16s = 14; + attribute(writable) int24s int24s = 15; + attribute(writable) int32s int32s = 16; + attribute(writable) int40s int40s = 17; + attribute(writable) int48s int48s = 18; + attribute(writable) int56s int56s = 19; + attribute(writable) int64s int64s = 20; + attribute(writable) enum8 enum8 = 21; + attribute(writable) enum16 enum16 = 22; + attribute(writable) single floatSingle = 23; + attribute(writable) double floatDouble = 24; + attribute(writable) octet_string octetString = 25; + attribute(writable) INT8U listInt8u[] = 26; + attribute(writable) OCTET_STRING listOctetString[] = 27; + attribute(writable) TestListStructOctet listStructOctetString[] = 28; + attribute(writable) long_octet_string longOctetString = 29; + attribute(writable) char_string charString = 30; + attribute(writable) long_char_string longCharString = 31; + attribute(writable) epoch_us epochUs = 32; + attribute(writable) epoch_s epochS = 33; + attribute(writable) vendor_id vendorId = 34; + attribute(writable) NullablesAndOptionalsStruct listNullablesAndOptionalsStruct[] = 35; + attribute(writable) SimpleEnum enumAttr = 36; + attribute(writable) SimpleStruct structAttr = 37; + attribute(writable) int8u rangeRestrictedInt8u = 38; + attribute(writable) int8s rangeRestrictedInt8s = 39; + attribute(writable) int16u rangeRestrictedInt16u = 40; + attribute(writable) int16s rangeRestrictedInt16s = 41; + attribute(readonly) LONG_OCTET_STRING listLongOctetString[] = 42; + attribute(writable) boolean timedWriteBoolean = 48; + attribute(writable) boolean unsupported = 255; + attribute(writable) boolean nullableBoolean = 32768; + attribute(writable) bitmap8 nullableBitmap8 = 32769; + attribute(writable) bitmap16 nullableBitmap16 = 32770; + attribute(writable) bitmap32 nullableBitmap32 = 32771; + attribute(writable) bitmap64 nullableBitmap64 = 32772; + attribute(writable) int8u nullableInt8u = 32773; + attribute(writable) int16u nullableInt16u = 32774; + attribute(writable) int24u nullableInt24u = 32775; + attribute(writable) int32u nullableInt32u = 32776; + attribute(writable) int40u nullableInt40u = 32777; + attribute(writable) int48u nullableInt48u = 32778; + attribute(writable) int56u nullableInt56u = 32779; + attribute(writable) int64u nullableInt64u = 32780; + attribute(writable) int8s nullableInt8s = 32781; + attribute(writable) int16s nullableInt16s = 32782; + attribute(writable) int24s nullableInt24s = 32783; + attribute(writable) int32s nullableInt32s = 32784; + attribute(writable) int40s nullableInt40s = 32785; + attribute(writable) int48s nullableInt48s = 32786; + attribute(writable) int56s nullableInt56s = 32787; + attribute(writable) int64s nullableInt64s = 32788; + attribute(writable) enum8 nullableEnum8 = 32789; + attribute(writable) enum16 nullableEnum16 = 32790; + attribute(writable) single nullableFloatSingle = 32791; + attribute(writable) double nullableFloatDouble = 32792; + attribute(writable) octet_string nullableOctetString = 32793; + attribute(writable) char_string nullableCharString = 32798; + attribute(writable) SimpleEnum nullableEnumAttr = 32804; + attribute(writable) SimpleStruct nullableStruct = 32805; + attribute(writable) int8u nullableRangeRestrictedInt8u = 32806; + attribute(writable) int8s nullableRangeRestrictedInt8s = 32807; + attribute(writable) int16u nullableRangeRestrictedInt16u = 32808; + attribute(writable) int16s nullableRangeRestrictedInt16s = 32809; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; request struct SimpleStructEchoRequestRequest { SimpleStruct arg1 = 0; @@ -2973,26 +2995,26 @@ client cluster Thermostat = 513 { kHeatAndCoolSetpoints = 2; } - attribute(readonly, reportable) int16s localTemperature = 0; - attribute(readonly, reportable) int16s absMinHeatSetpointLimit = 3; - attribute(readonly, reportable) int16s absMaxHeatSetpointLimit = 4; - attribute(readonly, reportable) int16s absMinCoolSetpointLimit = 5; - attribute(readonly, reportable) int16s absMaxCoolSetpointLimit = 6; - attribute(writable, reportable) int16s occupiedCoolingSetpoint = 17; - attribute(writable, reportable) int16s occupiedHeatingSetpoint = 18; - attribute(writable, reportable) int16s minHeatSetpointLimit = 21; - attribute(writable, reportable) int16s maxHeatSetpointLimit = 22; - attribute(writable, reportable) int16s minCoolSetpointLimit = 23; - attribute(writable, reportable) int16s maxCoolSetpointLimit = 24; - attribute(writable, reportable) int8s minSetpointDeadBand = 25; - attribute(writable, reportable) enum8 controlSequenceOfOperation = 27; - attribute(writable, reportable) enum8 systemMode = 28; - attribute(readonly, reportable) enum8 startOfWeek = 32; - attribute(readonly, reportable) int8u numberOfWeeklyTransitions = 33; - attribute(readonly, reportable) int8u numberOfDailyTransitions = 34; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16s localTemperature = 0; + attribute(readonly) int16s absMinHeatSetpointLimit = 3; + attribute(readonly) int16s absMaxHeatSetpointLimit = 4; + attribute(readonly) int16s absMinCoolSetpointLimit = 5; + attribute(readonly) int16s absMaxCoolSetpointLimit = 6; + attribute(writable) int16s occupiedCoolingSetpoint = 17; + attribute(writable) int16s occupiedHeatingSetpoint = 18; + attribute(writable) int16s minHeatSetpointLimit = 21; + attribute(writable) int16s maxHeatSetpointLimit = 22; + attribute(writable) int16s minCoolSetpointLimit = 23; + attribute(writable) int16s maxCoolSetpointLimit = 24; + attribute(writable) int8s minSetpointDeadBand = 25; + attribute(writable) enum8 controlSequenceOfOperation = 27; + attribute(writable) enum8 systemMode = 28; + attribute(readonly) enum8 startOfWeek = 32; + attribute(readonly) int8u numberOfWeeklyTransitions = 33; + attribute(readonly) int8u numberOfDailyTransitions = 34; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct GetWeeklyScheduleRequest { DayOfWeek daysToReturn = 0; @@ -3035,11 +3057,11 @@ client cluster Thermostat = 513 { } client cluster ThermostatUserInterfaceConfiguration = 516 { - attribute(writable, reportable) enum8 temperatureDisplayMode = 0; - attribute(writable, reportable) enum8 keypadLockout = 1; - attribute(writable, reportable) enum8 scheduleProgrammingVisibility = 2; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) enum8 temperatureDisplayMode = 0; + attribute(writable) enum8 keypadLockout = 1; + attribute(writable) enum8 scheduleProgrammingVisibility = 2; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; } client cluster ThreadNetworkDiagnostics = 53 { @@ -3119,85 +3141,85 @@ client cluster ThreadNetworkDiagnostics = 53 { ThreadConnectionStatus connectionStatus = 0; } - attribute(readonly, reportable) int16u channel = 0; - attribute(readonly, reportable) enum8 routingRole = 1; - attribute(readonly, reportable) octet_string networkName = 2; - attribute(readonly, reportable) int16u panId = 3; - attribute(readonly, reportable) int64u extendedPanId = 4; - attribute(readonly, reportable) octet_string meshLocalPrefix = 5; - attribute(readonly, reportable) int64u overrunCount = 6; - attribute(readonly, reportable) NeighborTable neighborTableList[] = 7; - attribute(readonly, reportable) RouteTable routeTableList[] = 8; - attribute(readonly, reportable) int32u partitionId = 9; - attribute(readonly, reportable) int8u weighting = 10; - attribute(readonly, reportable) int8u dataVersion = 11; - attribute(readonly, reportable) int8u stableDataVersion = 12; - attribute(readonly, reportable) int8u leaderRouterId = 13; - attribute(readonly, reportable) int16u detachedRoleCount = 14; - attribute(readonly, reportable) int16u childRoleCount = 15; - attribute(readonly, reportable) int16u routerRoleCount = 16; - attribute(readonly, reportable) int16u leaderRoleCount = 17; - attribute(readonly, reportable) int16u attachAttemptCount = 18; - attribute(readonly, reportable) int16u partitionIdChangeCount = 19; - attribute(readonly, reportable) int16u betterPartitionAttachAttemptCount = 20; - attribute(readonly, reportable) int16u parentChangeCount = 21; - attribute(readonly, reportable) int32u txTotalCount = 22; - attribute(readonly, reportable) int32u txUnicastCount = 23; - attribute(readonly, reportable) int32u txBroadcastCount = 24; - attribute(readonly, reportable) int32u txAckRequestedCount = 25; - attribute(readonly, reportable) int32u txAckedCount = 26; - attribute(readonly, reportable) int32u txNoAckRequestedCount = 27; - attribute(readonly, reportable) int32u txDataCount = 28; - attribute(readonly, reportable) int32u txDataPollCount = 29; - attribute(readonly, reportable) int32u txBeaconCount = 30; - attribute(readonly, reportable) int32u txBeaconRequestCount = 31; - attribute(readonly, reportable) int32u txOtherCount = 32; - attribute(readonly, reportable) int32u txRetryCount = 33; - attribute(readonly, reportable) int32u txDirectMaxRetryExpiryCount = 34; - attribute(readonly, reportable) int32u txIndirectMaxRetryExpiryCount = 35; - attribute(readonly, reportable) int32u txErrCcaCount = 36; - attribute(readonly, reportable) int32u txErrAbortCount = 37; - attribute(readonly, reportable) int32u txErrBusyChannelCount = 38; - attribute(readonly, reportable) int32u rxTotalCount = 39; - attribute(readonly, reportable) int32u rxUnicastCount = 40; - attribute(readonly, reportable) int32u rxBroadcastCount = 41; - attribute(readonly, reportable) int32u rxDataCount = 42; - attribute(readonly, reportable) int32u rxDataPollCount = 43; - attribute(readonly, reportable) int32u rxBeaconCount = 44; - attribute(readonly, reportable) int32u rxBeaconRequestCount = 45; - attribute(readonly, reportable) int32u rxOtherCount = 46; - attribute(readonly, reportable) int32u rxAddressFilteredCount = 47; - attribute(readonly, reportable) int32u rxDestAddrFilteredCount = 48; - attribute(readonly, reportable) int32u rxDuplicatedCount = 49; - attribute(readonly, reportable) int32u rxErrNoFrameCount = 50; - attribute(readonly, reportable) int32u rxErrUnknownNeighborCount = 51; - attribute(readonly, reportable) int32u rxErrInvalidSrcAddrCount = 52; - attribute(readonly, reportable) int32u rxErrSecCount = 53; - attribute(readonly, reportable) int32u rxErrFcsCount = 54; - attribute(readonly, reportable) int32u rxErrOtherCount = 55; - attribute(readonly, reportable) int64u activeTimestamp = 56; - attribute(readonly, reportable) int64u pendingTimestamp = 57; - attribute(readonly, reportable) int32u delay = 58; - attribute(readonly, reportable) SecurityPolicy securityPolicy[] = 59; - attribute(readonly, reportable) octet_string channelMask = 60; - attribute(readonly, reportable) OperationalDatasetComponents operationalDatasetComponents[] = 61; - attribute(readonly, reportable) NetworkFault activeNetworkFaultsList[] = 62; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) int16u channel = 0; + attribute(readonly) enum8 routingRole = 1; + attribute(readonly) octet_string networkName = 2; + attribute(readonly) int16u panId = 3; + attribute(readonly) int64u extendedPanId = 4; + attribute(readonly) octet_string meshLocalPrefix = 5; + attribute(readonly) int64u overrunCount = 6; + attribute(readonly) NeighborTable neighborTableList[] = 7; + attribute(readonly) RouteTable routeTableList[] = 8; + attribute(readonly) int32u partitionId = 9; + attribute(readonly) int8u weighting = 10; + attribute(readonly) int8u dataVersion = 11; + attribute(readonly) int8u stableDataVersion = 12; + attribute(readonly) int8u leaderRouterId = 13; + attribute(readonly) int16u detachedRoleCount = 14; + attribute(readonly) int16u childRoleCount = 15; + attribute(readonly) int16u routerRoleCount = 16; + attribute(readonly) int16u leaderRoleCount = 17; + attribute(readonly) int16u attachAttemptCount = 18; + attribute(readonly) int16u partitionIdChangeCount = 19; + attribute(readonly) int16u betterPartitionAttachAttemptCount = 20; + attribute(readonly) int16u parentChangeCount = 21; + attribute(readonly) int32u txTotalCount = 22; + attribute(readonly) int32u txUnicastCount = 23; + attribute(readonly) int32u txBroadcastCount = 24; + attribute(readonly) int32u txAckRequestedCount = 25; + attribute(readonly) int32u txAckedCount = 26; + attribute(readonly) int32u txNoAckRequestedCount = 27; + attribute(readonly) int32u txDataCount = 28; + attribute(readonly) int32u txDataPollCount = 29; + attribute(readonly) int32u txBeaconCount = 30; + attribute(readonly) int32u txBeaconRequestCount = 31; + attribute(readonly) int32u txOtherCount = 32; + attribute(readonly) int32u txRetryCount = 33; + attribute(readonly) int32u txDirectMaxRetryExpiryCount = 34; + attribute(readonly) int32u txIndirectMaxRetryExpiryCount = 35; + attribute(readonly) int32u txErrCcaCount = 36; + attribute(readonly) int32u txErrAbortCount = 37; + attribute(readonly) int32u txErrBusyChannelCount = 38; + attribute(readonly) int32u rxTotalCount = 39; + attribute(readonly) int32u rxUnicastCount = 40; + attribute(readonly) int32u rxBroadcastCount = 41; + attribute(readonly) int32u rxDataCount = 42; + attribute(readonly) int32u rxDataPollCount = 43; + attribute(readonly) int32u rxBeaconCount = 44; + attribute(readonly) int32u rxBeaconRequestCount = 45; + attribute(readonly) int32u rxOtherCount = 46; + attribute(readonly) int32u rxAddressFilteredCount = 47; + attribute(readonly) int32u rxDestAddrFilteredCount = 48; + attribute(readonly) int32u rxDuplicatedCount = 49; + attribute(readonly) int32u rxErrNoFrameCount = 50; + attribute(readonly) int32u rxErrUnknownNeighborCount = 51; + attribute(readonly) int32u rxErrInvalidSrcAddrCount = 52; + attribute(readonly) int32u rxErrSecCount = 53; + attribute(readonly) int32u rxErrFcsCount = 54; + attribute(readonly) int32u rxErrOtherCount = 55; + attribute(readonly) int64u activeTimestamp = 56; + attribute(readonly) int64u pendingTimestamp = 57; + attribute(readonly) int32u delay = 58; + attribute(readonly) SecurityPolicy securityPolicy[] = 59; + attribute(readonly) octet_string channelMask = 60; + attribute(readonly) OperationalDatasetComponents operationalDatasetComponents[] = 61; + attribute(readonly) NetworkFault activeNetworkFaultsList[] = 62; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; command ResetCounts(): DefaultSuccess = 0; } client cluster UserLabel = 65 { - attribute(writable, reportable) LabelStruct labelList[] = 0; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(writable) LabelStruct labelList[] = 0; + attribute(readonly) int16u clusterRevision = 65533; } client cluster WakeOnLan = 1283 { - attribute(readonly, reportable) char_string wakeOnLanMacAddress = 0; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) char_string wakeOnLanMacAddress = 0; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) int16u clusterRevision = 65533; } client cluster WiFiNetworkDiagnostics = 54 { @@ -3244,48 +3266,48 @@ client cluster WiFiNetworkDiagnostics = 54 { WiFiConnectionStatus connectionStatus = 0; } - attribute(readonly, reportable) octet_string bssid = 0; - attribute(readonly, reportable) enum8 securityType = 1; - attribute(readonly, reportable) enum8 wiFiVersion = 2; - attribute(readonly, reportable) int16u channelNumber = 3; - attribute(readonly, reportable) int8s rssi = 4; - attribute(readonly, reportable) int32u beaconLostCount = 5; - attribute(readonly, reportable) int32u beaconRxCount = 6; - attribute(readonly, reportable) int32u packetMulticastRxCount = 7; - attribute(readonly, reportable) int32u packetMulticastTxCount = 8; - attribute(readonly, reportable) int32u packetUnicastRxCount = 9; - attribute(readonly, reportable) int32u packetUnicastTxCount = 10; - attribute(readonly, reportable) int64u currentMaxRate = 11; - attribute(readonly, reportable) int64u overrunCount = 12; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) octet_string bssid = 0; + attribute(readonly) enum8 securityType = 1; + attribute(readonly) enum8 wiFiVersion = 2; + attribute(readonly) int16u channelNumber = 3; + attribute(readonly) int8s rssi = 4; + attribute(readonly) int32u beaconLostCount = 5; + attribute(readonly) int32u beaconRxCount = 6; + attribute(readonly) int32u packetMulticastRxCount = 7; + attribute(readonly) int32u packetMulticastTxCount = 8; + attribute(readonly) int32u packetUnicastRxCount = 9; + attribute(readonly) int32u packetUnicastTxCount = 10; + attribute(readonly) int64u currentMaxRate = 11; + attribute(readonly) int64u overrunCount = 12; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; command ResetCounts(): DefaultSuccess = 0; } client cluster WindowCovering = 258 { - attribute(readonly, reportable) enum8 type = 0; - attribute(readonly, reportable) int16u currentPositionLift = 3; - attribute(readonly, reportable) int16u currentPositionTilt = 4; - attribute(readonly, reportable) bitmap8 configStatus = 7; - attribute(readonly, reportable) Percent currentPositionLiftPercentage = 8; - attribute(readonly, reportable) Percent currentPositionTiltPercentage = 9; - attribute(readonly, reportable) bitmap8 operationalStatus = 10; - attribute(readonly, reportable) Percent100ths targetPositionLiftPercent100ths = 11; - attribute(readonly, reportable) Percent100ths targetPositionTiltPercent100ths = 12; - attribute(readonly, reportable) enum8 endProductType = 13; - attribute(readonly, reportable) Percent100ths currentPositionLiftPercent100ths = 14; - attribute(readonly, reportable) Percent100ths currentPositionTiltPercent100ths = 15; - attribute(readonly, reportable) int16u installedOpenLimitLift = 16; - attribute(readonly, reportable) int16u installedClosedLimitLift = 17; - attribute(readonly, reportable) int16u installedOpenLimitTilt = 18; - attribute(readonly, reportable) int16u installedClosedLimitTilt = 19; - attribute(writable, reportable) bitmap8 mode = 23; - attribute(readonly, reportable) bitmap16 safetyStatus = 26; - attribute(readonly, reportable) attrib_id attributeList[] = 65531; - attribute(readonly, reportable) bitmap32 featureMap = 65532; - attribute(readonly, reportable) int16u clusterRevision = 65533; + attribute(readonly) enum8 type = 0; + attribute(readonly) int16u currentPositionLift = 3; + attribute(readonly) int16u currentPositionTilt = 4; + attribute(readonly) bitmap8 configStatus = 7; + attribute(readonly) Percent currentPositionLiftPercentage = 8; + attribute(readonly) Percent currentPositionTiltPercentage = 9; + attribute(readonly) bitmap8 operationalStatus = 10; + attribute(readonly) Percent100ths targetPositionLiftPercent100ths = 11; + attribute(readonly) Percent100ths targetPositionTiltPercent100ths = 12; + attribute(readonly) enum8 endProductType = 13; + attribute(readonly) Percent100ths currentPositionLiftPercent100ths = 14; + attribute(readonly) Percent100ths currentPositionTiltPercent100ths = 15; + attribute(readonly) int16u installedOpenLimitLift = 16; + attribute(readonly) int16u installedClosedLimitLift = 17; + attribute(readonly) int16u installedOpenLimitTilt = 18; + attribute(readonly) int16u installedClosedLimitTilt = 19; + attribute(writable) bitmap8 mode = 23; + attribute(readonly) bitmap16 safetyStatus = 26; + attribute(readonly) attrib_id attributeList[] = 65531; + attribute(readonly) bitmap32 featureMap = 65532; + attribute(readonly) int16u clusterRevision = 65533; request struct GoToLiftPercentageRequest { Percent liftPercentageValue = 0; diff --git a/src/controller/java/BUILD.gn b/src/controller/java/BUILD.gn index 697a49f1b433db..5d9b6f8a0db893 100644 --- a/src/controller/java/BUILD.gn +++ b/src/controller/java/BUILD.gn @@ -34,6 +34,7 @@ shared_library("jni") { "CHIPDeviceController-JNI.cpp", "zap-generated/CHIPClusters-JNI.cpp", "zap-generated/CHIPClustersRead-JNI.cpp", + "zap-generated/CHIPClustersWrite-JNI.cpp", "zap-generated/CHIPInvokeCallbacks.cpp", "zap-generated/CHIPInvokeCallbacks.h", "zap-generated/CHIPReadCallbacks.cpp", diff --git a/src/controller/java/CHIPDeviceController-JNI.cpp b/src/controller/java/CHIPDeviceController-JNI.cpp index f80a21896e327d..5adb06dd43f17c 100644 --- a/src/controller/java/CHIPDeviceController-JNI.cpp +++ b/src/controller/java/CHIPDeviceController-JNI.cpp @@ -187,8 +187,11 @@ JNI_METHOD(void, commissionDevice) ChipLogProgress(Controller, "commissionDevice() called"); CommissioningParameters commissioningParams = CommissioningParameters(); - err = wrapper->ApplyNetworkCredentials(commissioningParams, networkCredentials); - VerifyOrExit(err == CHIP_NO_ERROR, err = CHIP_ERROR_INVALID_ARGUMENT); + if (networkCredentials != nullptr) + { + err = wrapper->ApplyNetworkCredentials(commissioningParams, networkCredentials); + VerifyOrExit(err == CHIP_NO_ERROR, err = CHIP_ERROR_INVALID_ARGUMENT); + } if (csrNonce != nullptr) { diff --git a/src/controller/java/src/chip/devicecontroller/ChipDeviceController.java b/src/controller/java/src/chip/devicecontroller/ChipDeviceController.java index 477e47058bf5ac..5f85dede15a222 100644 --- a/src/controller/java/src/chip/devicecontroller/ChipDeviceController.java +++ b/src/controller/java/src/chip/devicecontroller/ChipDeviceController.java @@ -141,7 +141,7 @@ public void establishPaseConnection(long deviceId, String address, int port, lon * @param deviceId the ID of the node to be commissioned * @param networkCredentials the credentials (Wi-Fi or Thread) to be provisioned */ - public void commissionDevice(long deviceId, NetworkCredentials networkCredentials) { + public void commissionDevice(long deviceId, @Nullable NetworkCredentials networkCredentials) { commissionDevice(deviceControllerPtr, deviceId, /* csrNonce= */ null, networkCredentials); } @@ -155,7 +155,7 @@ public void commissionDevice(long deviceId, NetworkCredentials networkCredential * @param networkCredentials the credentials (Wi-Fi or Thread) to be provisioned */ public void commissionDevice( - long deviceId, @Nullable byte[] csrNonce, NetworkCredentials networkCredentials) { + long deviceId, @Nullable byte[] csrNonce, @Nullable NetworkCredentials networkCredentials) { commissionDevice(deviceControllerPtr, deviceId, csrNonce, networkCredentials); } @@ -331,7 +331,7 @@ private native void commissionDevice( long deviceControllerPtr, long deviceId, @Nullable byte[] csrNonce, - NetworkCredentials networkCredentials); + @Nullable NetworkCredentials networkCredentials); private native void unpairDevice(long deviceControllerPtr, long deviceId); diff --git a/src/controller/java/templates/CHIPClusters-JNI.zapt b/src/controller/java/templates/CHIPClusters-JNI.zapt index 7ae507f0d7e56a..9c5fb5bff7fcce 100644 --- a/src/controller/java/templates/CHIPClusters-JNI.zapt +++ b/src/controller/java/templates/CHIPClusters-JNI.zapt @@ -87,47 +87,6 @@ JNI_METHOD(void, {{asUpperCamelCase ../name}}Cluster, {{asLowerCamelCase name}}) {{/chip_cluster_commands}} {{#chip_server_cluster_attributes}} {{#unless (isStrEqual chipCallback.name "Unsupported")}} -{{#if isWritableAttribute}} -{{! TODO: Lists not supported in attribute writes yet. }} -{{#unless isList}} - -JNI_METHOD(void, {{asUpperCamelCase ../name}}Cluster, write{{asUpperCamelCase name}}Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, {{asJniBasicType type true}} value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::{{asUpperCamelCase parent.name}}::Attributes::{{asUpperCamelCase name}}::TypeInfo; - TypeInfo::Type cppValue; - - {{>encode_value target="cppValue" source="value" cluster=parent.name}} - - std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure(Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - {{asCamelCased ../name false}}Cluster * cppCluster = reinterpret_cast<{{asCamelCased ../name false}}Cluster *>(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - {{#if mustUseTimedWrite}} - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - {{else}} - if (timedWriteTimeoutMs == nullptr) { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } else { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - {{/if}} - VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -{{/unless}} -{{/if}} {{#if isReportableAttribute}} {{#unless isList}} JNI_METHOD(void, {{asCamelCased ../name false}}Cluster, subscribe{{asCamelCased name false}}Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) diff --git a/src/controller/java/templates/CHIPClustersWrite-JNI.zapt b/src/controller/java/templates/CHIPClustersWrite-JNI.zapt new file mode 100644 index 00000000000000..d6cf240b496302 --- /dev/null +++ b/src/controller/java/templates/CHIPClustersWrite-JNI.zapt @@ -0,0 +1,74 @@ +{{> header}} +{{#if (chip_has_client_clusters)}} +#include "CHIPCallbackTypes.h" +#include "CHIPInvokeCallbacks.h" +#include "CHIPReadCallbacks.h" + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define JNI_METHOD(RETURN, CLASS_NAME, METHOD_NAME) \ + extern "C" JNIEXPORT RETURN JNICALL Java_chip_devicecontroller_ChipClusters_00024##CLASS_NAME##_##METHOD_NAME + +using namespace chip; +using namespace chip::Controller; + +{{#chip_client_clusters}} +{{#chip_server_cluster_attributes}} +{{#unless (isStrEqual chipCallback.name "Unsupported")}} +{{#if isWritableAttribute}} +{{! TODO: Lists not supported in attribute writes yet. }} +{{#unless isList}} + +JNI_METHOD(void, {{asUpperCamelCase ../name}}Cluster, write{{asUpperCamelCase name}}Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, {{asJniBasicType type true}} value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::{{asUpperCamelCase parent.name}}::Attributes::{{asUpperCamelCase name}}::TypeInfo; + TypeInfo::Type cppValue; + + {{>encode_value target="cppValue" source="value" cluster=parent.name}} + + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure(Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + {{asCamelCased ../name false}}Cluster * cppCluster = reinterpret_cast<{{asCamelCased ../name false}}Cluster *>(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + {{#if mustUseTimedWrite}} + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + {{else}} + if (timedWriteTimeoutMs == nullptr) { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } else { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + {{/if}} + VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} +{{/unless}} +{{/if}} +{{/unless}} +{{/chip_server_cluster_attributes}} +{{/chip_client_clusters}} +{{/if}} diff --git a/src/controller/java/templates/templates.json b/src/controller/java/templates/templates.json index 67884e239c724d..d7cc8dfb9cc88d 100644 --- a/src/controller/java/templates/templates.json +++ b/src/controller/java/templates/templates.json @@ -71,6 +71,11 @@ "name": "CHIP ZCL API for Java (native code for reads)", "output": "src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp" }, + { + "path": "CHIPClustersWrite-JNI.zapt", + "name": "CHIP ZCL API for Java (native code for writes)", + "output": "src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp" + }, { "path": "CHIPReadCallbacks.zapt", "name": "CHIP cluster attribute read callback for Java (native code)", diff --git a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp index 35460734475ca5..7d7a7c1a0394f3 100644 --- a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp @@ -1741,53 +1741,6 @@ JNI_METHOD(void, BasicCluster, subscribeProductIDAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, BasicCluster, writeNodeLabelAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::Basic::Attributes::NodeLabel::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = chip::JniUtfString(env, static_cast(value)).charSpan(); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} JNI_METHOD(void, BasicCluster, subscribeNodeLabelAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { @@ -1824,53 +1777,6 @@ JNI_METHOD(void, BasicCluster, subscribeNodeLabelAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, BasicCluster, writeLocationAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::Basic::Attributes::Location::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = chip::JniUtfString(env, static_cast(value)).charSpan(); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} JNI_METHOD(void, BasicCluster, subscribeLocationAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { @@ -2238,53 +2144,6 @@ JNI_METHOD(void, BasicCluster, subscribeSerialNumberAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, BasicCluster, writeLocalConfigDisabledAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::Basic::Attributes::LocalConfigDisabled::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} JNI_METHOD(void, BasicCluster, subscribeLocalConfigDisabledAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { @@ -2440,52 +2299,6 @@ JNI_METHOD(jlong, BinaryInputBasicCluster, initWithDevice)(JNIEnv * env, jobject return reinterpret_cast(cppCluster); } -JNI_METHOD(void, BinaryInputBasicCluster, writeOutOfServiceAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::BinaryInputBasic::Attributes::OutOfService::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BinaryInputBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} JNI_METHOD(void, BinaryInputBasicCluster, subscribeOutOfServiceAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { @@ -2523,53 +2336,6 @@ JNI_METHOD(void, BinaryInputBasicCluster, subscribeOutOfServiceAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, BinaryInputBasicCluster, writePresentValueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::BinaryInputBasic::Attributes::PresentValue::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BinaryInputBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} JNI_METHOD(void, BinaryInputBasicCluster, subscribePresentValueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { @@ -5199,53 +4965,6 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorModeAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, writeColorControlOptionsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorControlOptions::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} JNI_METHOD(void, ColorControlCluster, subscribeColorControlOptionsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { @@ -5986,24 +5705,18 @@ JNI_METHOD(void, ColorControlCluster, subscribePrimary6IntensityAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, writeWhitePointXAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, ColorControlCluster, subscribeWhitePointXAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::WhitePointX::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -6014,26 +5727,22 @@ JNI_METHOD(void, ColorControlCluster, writeWhitePointXAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::WhitePointX::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeWhitePointXAttribute) +JNI_METHOD(void, ColorControlCluster, subscribeWhitePointYAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -6055,9 +5764,9 @@ JNI_METHOD(void, ColorControlCluster, subscribeWhitePointXAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::WhitePointX::TypeInfo; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::WhitePointY::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -6070,24 +5779,18 @@ JNI_METHOD(void, ColorControlCluster, subscribeWhitePointXAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, writeWhitePointYAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, ColorControlCluster, subscribeColorPointRXAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::WhitePointY::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -6098,26 +5801,22 @@ JNI_METHOD(void, ColorControlCluster, writeWhitePointYAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointRX::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeWhitePointYAttribute) +JNI_METHOD(void, ColorControlCluster, subscribeColorPointRYAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -6139,9 +5838,9 @@ JNI_METHOD(void, ColorControlCluster, subscribeWhitePointYAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::WhitePointY::TypeInfo; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointRY::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -6154,24 +5853,18 @@ JNI_METHOD(void, ColorControlCluster, subscribeWhitePointYAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, writeColorPointRXAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, ColorControlCluster, subscribeColorPointRIntensityAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointRX::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -6182,26 +5875,22 @@ JNI_METHOD(void, ColorControlCluster, writeColorPointRXAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointRIntensity::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeColorPointRXAttribute) +JNI_METHOD(void, ColorControlCluster, subscribeColorPointGXAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -6223,9 +5912,9 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorPointRXAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointRX::TypeInfo; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointGX::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -6238,24 +5927,18 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorPointRXAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, writeColorPointRYAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, ColorControlCluster, subscribeColorPointGYAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointRY::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -6266,31 +5949,27 @@ JNI_METHOD(void, ColorControlCluster, writeColorPointRYAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointGY::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeColorPointRYAttribute) +JNI_METHOD(void, ColorControlCluster, subscribeColorPointGIntensityAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6307,14 +5986,14 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorPointRYAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointRY::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointGIntensity::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -6322,24 +6001,18 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorPointRYAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, writeColorPointRIntensityAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, ColorControlCluster, subscribeColorPointBXAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointRIntensity::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -6350,31 +6023,27 @@ JNI_METHOD(void, ColorControlCluster, writeColorPointRIntensityAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointBX::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeColorPointRIntensityAttribute) +JNI_METHOD(void, ColorControlCluster, subscribeColorPointBYAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6391,14 +6060,14 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorPointRIntensityAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointRIntensity::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointBY::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -6406,24 +6075,18 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorPointRIntensityAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, writeColorPointGXAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, ColorControlCluster, subscribeColorPointBIntensityAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointGX::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -6434,26 +6097,22 @@ JNI_METHOD(void, ColorControlCluster, writeColorPointGXAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointBIntensity::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeColorPointGXAttribute) +JNI_METHOD(void, ColorControlCluster, subscribeEnhancedCurrentHueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -6475,9 +6134,9 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorPointGXAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointGX::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::EnhancedCurrentHue::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -6490,24 +6149,18 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorPointGXAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, writeColorPointGYAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, ColorControlCluster, subscribeEnhancedColorModeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointGY::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -6518,31 +6171,27 @@ JNI_METHOD(void, ColorControlCluster, writeColorPointGYAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::EnhancedColorMode::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeColorPointGYAttribute) +JNI_METHOD(void, ColorControlCluster, subscribeColorLoopActiveAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6559,14 +6208,14 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorPointGYAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointGY::TypeInfo; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorLoopActive::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -6574,24 +6223,18 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorPointGYAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, writeColorPointGIntensityAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, ColorControlCluster, subscribeColorLoopDirectionAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointGIntensity::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -6602,31 +6245,27 @@ JNI_METHOD(void, ColorControlCluster, writeColorPointGIntensityAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorLoopDirection::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeColorPointGIntensityAttribute) +JNI_METHOD(void, ColorControlCluster, subscribeColorLoopTimeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6643,14 +6282,14 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorPointGIntensityAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointGIntensity::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorLoopTime::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -6658,24 +6297,18 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorPointGIntensityAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, writeColorPointBXAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, ColorControlCluster, subscribeColorLoopStartEnhancedHueAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointBX::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -6686,26 +6319,23 @@ JNI_METHOD(void, ColorControlCluster, writeColorPointBXAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorLoopStartEnhancedHue::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeColorPointBXAttribute) +JNI_METHOD(void, ColorControlCluster, subscribeColorLoopStoredEnhancedHueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -6727,9 +6357,10 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorPointBXAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointBX::TypeInfo; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorLoopStoredEnhancedHue::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -6742,24 +6373,18 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorPointBXAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, writeColorPointBYAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, ColorControlCluster, subscribeColorCapabilitiesAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointBY::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -6770,26 +6395,22 @@ JNI_METHOD(void, ColorControlCluster, writeColorPointBYAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorCapabilities::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeColorPointBYAttribute) +JNI_METHOD(void, ColorControlCluster, subscribeColorTempPhysicalMinAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -6811,9 +6432,9 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorPointBYAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointBY::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorTempPhysicalMin::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -6826,24 +6447,18 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorPointBYAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, writeColorPointBIntensityAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, ColorControlCluster, subscribeColorTempPhysicalMaxAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointBIntensity::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -6854,31 +6469,27 @@ JNI_METHOD(void, ColorControlCluster, writeColorPointBIntensityAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorTempPhysicalMax::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeColorPointBIntensityAttribute) +JNI_METHOD(void, ColorControlCluster, subscribeCoupleColorTempToLevelMinMiredsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6895,14 +6506,15 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorPointBIntensityAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointBIntensity::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::CoupleColorTempToLevelMinMireds::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -6910,7 +6522,7 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorPointBIntensityAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeEnhancedCurrentHueAttribute) +JNI_METHOD(void, ColorControlCluster, subscribeStartUpColorTemperatureMiredsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -6932,9 +6544,10 @@ JNI_METHOD(void, ColorControlCluster, subscribeEnhancedCurrentHueAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::EnhancedCurrentHue::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::StartUpColorTemperatureMireds::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -6947,12 +6560,12 @@ JNI_METHOD(void, ColorControlCluster, subscribeEnhancedCurrentHueAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeEnhancedColorModeAttribute) +JNI_METHOD(void, ColorControlCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6969,14 +6582,14 @@ JNI_METHOD(void, ColorControlCluster, subscribeEnhancedColorModeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::EnhancedColorMode::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -6984,49 +6597,123 @@ JNI_METHOD(void, ColorControlCluster, subscribeEnhancedColorModeAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeColorLoopActiveAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(jlong, ContentLauncherCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + ContentLauncherCluster * cppCluster = new ContentLauncherCluster(); + + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} + +JNI_METHOD(void, ContentLauncherCluster, launchContentRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject autoPlay, jstring data, jobject parameterList, + jobject timedInvokeTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + ContentLauncherCluster * cppCluster; + + chip::app::Clusters::ContentLauncher::Commands::LaunchContentRequest::Type request; + + request.autoPlay = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(autoPlay)); + request.data = chip::JniUtfString(env, static_cast(data)).charSpan(); + request.search = chip::app::DataModel::List(); + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, ContentLauncherCluster, launchURLRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring contentURL, jstring displayString, jstring providerName, + jobject background, jobject logo, jobject progressBar, jobject splash, jobject waterMark, jobject timedInvokeTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + ContentLauncherCluster * cppCluster; + + chip::app::Clusters::ContentLauncher::Commands::LaunchURLRequest::Type request; + + request.contentURL = chip::JniUtfString(env, static_cast(contentURL)).charSpan(); + request.displayString = chip::JniUtfString(env, static_cast(displayString)).charSpan(); + request.brandingInformation = chip::app::Clusters::ContentLauncher::Structs::BrandingInformation::Type(); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorLoopActive::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeColorLoopDirectionAttribute) +JNI_METHOD(void, ContentLauncherCluster, subscribeSupportedStreamingProtocolsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7037,20 +6724,21 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorLoopDirectionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ContentLauncherCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorLoopDirection::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ContentLauncher::Attributes::SupportedStreamingProtocols::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -7058,7 +6746,7 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorLoopDirectionAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeColorLoopTimeAttribute) +JNI_METHOD(void, ContentLauncherCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -7074,15 +6762,15 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorLoopTimeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ContentLauncherCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorLoopTime::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ContentLauncher::Attributes::ClusterRevision::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -7095,7 +6783,16 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorLoopTimeAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeColorLoopStartEnhancedHueAttribute) +JNI_METHOD(jlong, DescriptorCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + DescriptorCluster * cppCluster = new DescriptorCluster(); + + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} + +JNI_METHOD(void, DescriptorCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -7111,16 +6808,15 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorLoopStartEnhancedHueAttribut chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + DescriptorCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorLoopStartEnhancedHue::TypeInfo; + using TypeInfo = chip::app::Clusters::Descriptor::Attributes::ClusterRevision::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -7133,341 +6829,281 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorLoopStartEnhancedHueAttribut onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeColorLoopStoredEnhancedHueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(jlong, DiagnosticLogsCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + DiagnosticLogsCluster * cppCluster = new DiagnosticLogsCluster(); + + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} + +JNI_METHOD(void, DiagnosticLogsCluster, retrieveLogsRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject intent, jobject requestedProtocol, + jbyteArray transferFileDesignator, jobject timedInvokeTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + DiagnosticLogsCluster * cppCluster; + + chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsRequest::Type request; + + request.intent = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(intent)); + request.requestedProtocol = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(requestedProtocol)); + request.transferFileDesignator = chip::JniByteArray(env, static_cast(transferFileDesignator)).byteSpan(); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorLoopStoredEnhancedHue::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeColorCapabilitiesAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(jlong, DoorLockCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + DoorLockCluster * cppCluster = new DoorLockCluster(); + + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} + +JNI_METHOD(void, DoorLockCluster, clearCredential) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject credentialType, jobject credentialIndex, + jobject timedInvokeTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster; + + chip::app::Clusters::DoorLock::Commands::ClearCredential::Type request; + + request.credential = chip::app::Clusters::DoorLock::Structs::DlCredential::Type(); + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorCapabilities::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeColorTempPhysicalMinAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, DoorLockCluster, clearUser) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject userIndex, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster; + + chip::app::Clusters::DoorLock::Commands::ClearUser::Type request; + + request.userIndex = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userIndex)); + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorTempPhysicalMin::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeColorTempPhysicalMaxAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, DoorLockCluster, getCredentialStatus) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject credentialType, jobject credentialIndex, + jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster; + + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type request; + request.credential = chip::app::Clusters::DoorLock::Structs::DlCredential::Type(); + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorTempPhysicalMax::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, ColorControlCluster, subscribeCoupleColorTempToLevelMinMiredsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::CoupleColorTempToLevelMinMireds::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, writeStartUpColorTemperatureMiredsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, DoorLockCluster, getUser) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject userIndex, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::StartUpColorTemperatureMireds::TypeInfo; - TypeInfo::Type cppValue; + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster; - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + chip::app::Clusters::DoorLock::Commands::GetUser::Type request; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + request.userIndex = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userIndex)); + std::unique_ptr onSuccess( + Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) + if (timedInvokeTimeoutMs == nullptr) { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); } else { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, ColorControlCluster, subscribeStartUpColorTemperatureMiredsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::StartUpColorTemperatureMireds::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, ColorControlCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ClusterRevision::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, ContentLauncherCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - ContentLauncherCluster * cppCluster = new ContentLauncherCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, ContentLauncherCluster, launchContentRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject autoPlay, jstring data, jobject parameterList, - jobject timedInvokeTimeoutMs) +JNI_METHOD(void, DoorLockCluster, lockDoor) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject pinCode, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - ContentLauncherCluster * cppCluster; + DoorLockCluster * cppCluster; - chip::app::Clusters::ContentLauncher::Commands::LaunchContentRequest::Type request; + chip::app::Clusters::DoorLock::Commands::LockDoor::Type request; - request.autoPlay = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(autoPlay)); - request.data = chip::JniUtfString(env, static_cast(data)).charSpan(); - request.search = chip::app::DataModel::List(); + chip::JniReferences::GetInstance().GetOptionalValue(pinCode, pinCode); + request.pinCode = chip::Optional(chip::JniByteArray(env, static_cast(pinCode)).byteSpan()); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -7477,13 +7113,12 @@ JNI_METHOD(void, ContentLauncherCluster, launchContentRequest) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); if (timedInvokeTimeoutMs == nullptr) @@ -7502,23 +7137,27 @@ JNI_METHOD(void, ContentLauncherCluster, launchContentRequest) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ContentLauncherCluster, launchURLRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring contentURL, jstring displayString, jstring providerName, - jobject background, jobject logo, jobject progressBar, jobject splash, jobject waterMark, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, DoorLockCluster, setCredential) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject operationType, jobject credentialType, + jobject credentialIndex, jbyteArray credentialData, jobject userIndex, jobject userStatus, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - ContentLauncherCluster * cppCluster; + DoorLockCluster * cppCluster; - chip::app::Clusters::ContentLauncher::Commands::LaunchURLRequest::Type request; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type request; - request.contentURL = chip::JniUtfString(env, static_cast(contentURL)).charSpan(); - request.displayString = chip::JniUtfString(env, static_cast(displayString)).charSpan(); - request.brandingInformation = chip::app::Clusters::ContentLauncher::Structs::BrandingInformation::Type(); + request.operationType = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(operationType)); + request.credential = chip::app::Clusters::DoorLock::Structs::DlCredential::Type(); + request.credentialData = chip::JniByteArray(env, static_cast(credentialData)).byteSpan(); + request.userIndex = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userIndex)); + request.userStatus = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userStatus)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -7528,13 +7167,13 @@ JNI_METHOD(void, ContentLauncherCluster, launchURLRequest) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); if (timedInvokeTimeoutMs == nullptr) @@ -7553,59 +7192,128 @@ JNI_METHOD(void, ContentLauncherCluster, launchURLRequest) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ContentLauncherCluster, writeSupportedStreamingProtocolsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, DoorLockCluster, setUser) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject operationType, jobject userIndex, jstring userName, + jobject userUniqueId, jobject userStatus, jobject userType, jobject credentialRule, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ContentLauncher::Attributes::SupportedStreamingProtocols::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ContentLauncherCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster; - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + chip::app::Clusters::DoorLock::Commands::SetUser::Type request; - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + request.operationType = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(operationType)); + request.userIndex = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userIndex)); + chip::CharSpan userNameValue; + if (userName != nullptr) + { + userNameValue = chip::JniUtfString(env, static_cast(userName)).charSpan(); + } + request.userName = userName == nullptr ? chip::app::DataModel::Nullable() + : chip::app::DataModel::Nullable(userNameValue); + uint32_t userUniqueIdValue; + if (userUniqueId != nullptr) + { + userUniqueIdValue = chip::JniReferences::GetInstance().LongToPrimitive(userUniqueId); + } + request.userUniqueId = userUniqueId == nullptr ? chip::app::DataModel::Nullable() + : chip::app::DataModel::Nullable(userUniqueIdValue); + request.userStatus = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userStatus)); + request.userType = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userType)); + request.credentialRule = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(credentialRule)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); } else { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ContentLauncherCluster, subscribeSupportedStreamingProtocolsAttribute) +JNI_METHOD(void, DoorLockCluster, unlockDoor) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject pinCode, jobject timedInvokeTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster; + + chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type request; + + chip::JniReferences::GetInstance().GetOptionalValue(pinCode, pinCode); + request.pinCode = chip::Optional(chip::JniByteArray(env, static_cast(pinCode)).byteSpan()); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, DoorLockCluster, subscribeLockStateAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7616,21 +7324,20 @@ JNI_METHOD(void, ContentLauncherCluster, subscribeSupportedStreamingProtocolsAtt chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ContentLauncherCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ContentLauncher::Attributes::SupportedStreamingProtocols::TypeInfo; + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::LockState::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt32uAttributeCallback::OnSubscriptionEstablished); + CHIPDoorLockLockStateAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -7638,12 +7345,12 @@ JNI_METHOD(void, ContentLauncherCluster, subscribeSupportedStreamingProtocolsAtt onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ContentLauncherCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, DoorLockCluster, subscribeLockTypeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7654,20 +7361,20 @@ JNI_METHOD(void, ContentLauncherCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ContentLauncherCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ContentLauncher::Attributes::ClusterRevision::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::LockType::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -7675,21 +7382,12 @@ JNI_METHOD(void, ContentLauncherCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, DescriptorCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - DescriptorCluster * cppCluster = new DescriptorCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, DescriptorCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, DoorLockCluster, subscribeActuatorEnabledAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7700,20 +7398,20 @@ JNI_METHOD(void, DescriptorCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - DescriptorCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::Descriptor::Attributes::ClusterRevision::TypeInfo; + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::ActuatorEnabled::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + CHIPBooleanAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -7721,491 +7419,235 @@ JNI_METHOD(void, DescriptorCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, DiagnosticLogsCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - DiagnosticLogsCluster * cppCluster = new DiagnosticLogsCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, DiagnosticLogsCluster, retrieveLogsRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject intent, jobject requestedProtocol, - jbyteArray transferFileDesignator, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, DoorLockCluster, subscribeDoorStateAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - DiagnosticLogsCluster * cppCluster; - - chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsRequest::Type request; - - request.intent = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(intent)); - request.requestedProtocol = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(requestedProtocol)); - request.transferFileDesignator = chip::JniByteArray(env, static_cast(transferFileDesignator)).byteSpan(); + std::unique_ptr onSuccess( + Platform::New(callback, true), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::DoorState::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPDoorLockDoorStateAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, DoorLockCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +JNI_METHOD(void, DoorLockCluster, subscribeNumberOfTotalUsersSupportedAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - DoorLockCluster * cppCluster = new DoorLockCluster(); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); -JNI_METHOD(void, DoorLockCluster, clearCredential) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject credentialType, jobject credentialIndex, - jobject timedInvokeTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster; + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - chip::app::Clusters::DoorLock::Commands::ClearCredential::Type request; - - request.credential = chip::app::Clusters::DoorLock::Structs::DlCredential::Type(); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::NumberOfTotalUsersSupported::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, DoorLockCluster, clearUser) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject userIndex, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, DoorLockCluster, subscribeNumberOfPINUsersSupportedAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster; - - chip::app::Clusters::DoorLock::Commands::ClearUser::Type request; - - request.userIndex = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userIndex)); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::NumberOfPINUsersSupported::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, DoorLockCluster, getCredentialStatus) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject credentialType, jobject credentialIndex, - jobject timedInvokeTimeoutMs) +JNI_METHOD(void, DoorLockCluster, subscribeMaxPINCodeLengthAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster; - - chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type request; - - request.credential = chip::app::Clusters::DoorLock::Structs::DlCredential::Type(); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::MaxPINCodeLength::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, DoorLockCluster, getUser) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject userIndex, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, DoorLockCluster, subscribeMinPINCodeLengthAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster; - - chip::app::Clusters::DoorLock::Commands::GetUser::Type request; - - request.userIndex = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userIndex)); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::MinPINCodeLength::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, DoorLockCluster, lockDoor) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject pinCode, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, DoorLockCluster, subscribeLanguageAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster; - - chip::app::Clusters::DoorLock::Commands::LockDoor::Type request; - - chip::JniReferences::GetInstance().GetOptionalValue(pinCode, pinCode); - request.pinCode = chip::Optional(chip::JniByteArray(env, static_cast(pinCode)).byteSpan()); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::Language::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPCharStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, DoorLockCluster, setCredential) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject operationType, jobject credentialType, - jobject credentialIndex, jbyteArray credentialData, jobject userIndex, jobject userStatus, jobject timedInvokeTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster; - - chip::app::Clusters::DoorLock::Commands::SetCredential::Type request; - - request.operationType = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(operationType)); - request.credential = chip::app::Clusters::DoorLock::Structs::DlCredential::Type(); - request.credentialData = chip::JniByteArray(env, static_cast(credentialData)).byteSpan(); - request.userIndex = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userIndex)); - request.userStatus = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userStatus)); - - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, DoorLockCluster, setUser) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject operationType, jobject userIndex, jstring userName, - jobject userUniqueId, jobject userStatus, jobject userType, jobject credentialRule, jobject timedInvokeTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster; - - chip::app::Clusters::DoorLock::Commands::SetUser::Type request; - - request.operationType = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(operationType)); - request.userIndex = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userIndex)); - chip::CharSpan userNameValue; - if (userName != nullptr) - { - userNameValue = chip::JniUtfString(env, static_cast(userName)).charSpan(); - } - request.userName = userName == nullptr ? chip::app::DataModel::Nullable() - : chip::app::DataModel::Nullable(userNameValue); - uint32_t userUniqueIdValue; - if (userUniqueId != nullptr) - { - userUniqueIdValue = chip::JniReferences::GetInstance().LongToPrimitive(userUniqueId); - } - request.userUniqueId = userUniqueId == nullptr ? chip::app::DataModel::Nullable() - : chip::app::DataModel::Nullable(userUniqueIdValue); - request.userStatus = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userStatus)); - request.userType = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userType)); - request.credentialRule = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(credentialRule)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, DoorLockCluster, unlockDoor) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject pinCode, jobject timedInvokeTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster; - - chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type request; - - chip::JniReferences::GetInstance().GetOptionalValue(pinCode, pinCode); - request.pinCode = chip::Optional(chip::JniByteArray(env, static_cast(pinCode)).byteSpan()); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, DoorLockCluster, subscribeLockStateAttribute) +JNI_METHOD(void, DoorLockCluster, subscribeAutoRelockTimeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), - chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8222,14 +7664,14 @@ JNI_METHOD(void, DoorLockCluster, subscribeLockStateAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::DoorLock::Attributes::LockState::TypeInfo; + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::AutoRelockTime::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPDoorLockLockStateAttributeCallback::OnSubscriptionEstablished); + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -8237,7 +7679,7 @@ JNI_METHOD(void, DoorLockCluster, subscribeLockStateAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, DoorLockCluster, subscribeLockTypeAttribute) +JNI_METHOD(void, DoorLockCluster, subscribeSoundVolumeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -8259,9 +7701,9 @@ JNI_METHOD(void, DoorLockCluster, subscribeLockTypeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::DoorLock::Attributes::LockType::TypeInfo; + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::SoundVolume::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -8274,12 +7716,12 @@ JNI_METHOD(void, DoorLockCluster, subscribeLockTypeAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, DoorLockCluster, subscribeActuatorEnabledAttribute) +JNI_METHOD(void, DoorLockCluster, subscribeOperatingModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8296,14 +7738,14 @@ JNI_METHOD(void, DoorLockCluster, subscribeActuatorEnabledAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::DoorLock::Attributes::ActuatorEnabled::TypeInfo; + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::OperatingMode::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPBooleanAttributeCallback::OnSubscriptionEstablished); + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -8311,13 +7753,12 @@ JNI_METHOD(void, DoorLockCluster, subscribeActuatorEnabledAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, DoorLockCluster, subscribeDoorStateAttribute) +JNI_METHOD(void, DoorLockCluster, subscribeSupportedOperatingModesAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), - chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8334,14 +7775,14 @@ JNI_METHOD(void, DoorLockCluster, subscribeDoorStateAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::DoorLock::Attributes::DoorState::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::SupportedOperatingModes::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPDoorLockDoorStateAttributeCallback::OnSubscriptionEstablished); + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -8349,12 +7790,12 @@ JNI_METHOD(void, DoorLockCluster, subscribeDoorStateAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, DoorLockCluster, subscribeNumberOfTotalUsersSupportedAttribute) +JNI_METHOD(void, DoorLockCluster, subscribeEnableOneTouchLockingAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8371,14 +7812,14 @@ JNI_METHOD(void, DoorLockCluster, subscribeNumberOfTotalUsersSupportedAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::DoorLock::Attributes::NumberOfTotalUsersSupported::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::EnableOneTouchLocking::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + CHIPBooleanAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -8386,12 +7827,12 @@ JNI_METHOD(void, DoorLockCluster, subscribeNumberOfTotalUsersSupportedAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, DoorLockCluster, subscribeNumberOfPINUsersSupportedAttribute) +JNI_METHOD(void, DoorLockCluster, subscribeEnablePrivacyModeButtonAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8408,14 +7849,14 @@ JNI_METHOD(void, DoorLockCluster, subscribeNumberOfPINUsersSupportedAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::DoorLock::Attributes::NumberOfPINUsersSupported::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::EnablePrivacyModeButton::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + CHIPBooleanAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -8423,7 +7864,7 @@ JNI_METHOD(void, DoorLockCluster, subscribeNumberOfPINUsersSupportedAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, DoorLockCluster, subscribeMaxPINCodeLengthAttribute) +JNI_METHOD(void, DoorLockCluster, subscribeWrongCodeEntryLimitAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -8445,9 +7886,9 @@ JNI_METHOD(void, DoorLockCluster, subscribeMaxPINCodeLengthAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::DoorLock::Attributes::MaxPINCodeLength::TypeInfo; + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::WrongCodeEntryLimit::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -8460,12 +7901,12 @@ JNI_METHOD(void, DoorLockCluster, subscribeMaxPINCodeLengthAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, DoorLockCluster, subscribeMinPINCodeLengthAttribute) +JNI_METHOD(void, DoorLockCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8482,14 +7923,14 @@ JNI_METHOD(void, DoorLockCluster, subscribeMinPINCodeLengthAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::DoorLock::Attributes::MinPINCodeLength::TypeInfo; + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::ClusterRevision::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -8497,59 +7938,58 @@ JNI_METHOD(void, DoorLockCluster, subscribeMinPINCodeLengthAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, DoorLockCluster, writeLanguageAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value, jobject timedWriteTimeoutMs) +JNI_METHOD(jlong, ElectricalMeasurementCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::DoorLock::Attributes::Language::TypeInfo; - TypeInfo::Type cppValue; + ElectricalMeasurementCluster * cppCluster = new ElectricalMeasurementCluster(); - cppValue = chip::JniUtfString(env, static_cast(value)).charSpan(); + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); +JNI_METHOD(void, ElectricalMeasurementCluster, subscribeMeasurementTypeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::MeasurementType::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, DoorLockCluster, subscribeLanguageAttribute) +JNI_METHOD(void, ElectricalMeasurementCluster, subscribeTotalActivePowerAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8560,20 +8000,21 @@ JNI_METHOD(void, DoorLockCluster, subscribeLanguageAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::DoorLock::Attributes::Language::TypeInfo; + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::TotalActivePower::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPCharStringAttributeCallback::OnSubscriptionEstablished); + CHIPInt32sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -8581,59 +8022,49 @@ JNI_METHOD(void, DoorLockCluster, subscribeLanguageAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, DoorLockCluster, writeAutoRelockTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsVoltageAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::DoorLock::Attributes::AutoRelockTime::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltage::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, DoorLockCluster, subscribeAutoRelockTimeAttribute) +JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsVoltageMinAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8644,20 +8075,20 @@ JNI_METHOD(void, DoorLockCluster, subscribeAutoRelockTimeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::DoorLock::Attributes::AutoRelockTime::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageMin::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt32uAttributeCallback::OnSubscriptionEstablished); + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -8665,59 +8096,49 @@ JNI_METHOD(void, DoorLockCluster, subscribeAutoRelockTimeAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, DoorLockCluster, writeSoundVolumeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsVoltageMaxAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::DoorLock::Attributes::SoundVolume::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageMax::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, DoorLockCluster, subscribeSoundVolumeAttribute) +JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsCurrentAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8728,20 +8149,20 @@ JNI_METHOD(void, DoorLockCluster, subscribeSoundVolumeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::DoorLock::Attributes::SoundVolume::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrent::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -8749,59 +8170,49 @@ JNI_METHOD(void, DoorLockCluster, subscribeSoundVolumeAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, DoorLockCluster, writeOperatingModeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsCurrentMinAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::DoorLock::Attributes::OperatingMode::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentMin::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, DoorLockCluster, subscribeOperatingModeAttribute) +JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsCurrentMaxAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8812,20 +8223,20 @@ JNI_METHOD(void, DoorLockCluster, subscribeOperatingModeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::DoorLock::Attributes::OperatingMode::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentMax::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -8833,12 +8244,12 @@ JNI_METHOD(void, DoorLockCluster, subscribeOperatingModeAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, DoorLockCluster, subscribeSupportedOperatingModesAttribute) +JNI_METHOD(void, ElectricalMeasurementCluster, subscribeActivePowerAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8849,20 +8260,20 @@ JNI_METHOD(void, DoorLockCluster, subscribeSupportedOperatingModesAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::DoorLock::Attributes::SupportedOperatingModes::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePower::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -8870,59 +8281,49 @@ JNI_METHOD(void, DoorLockCluster, subscribeSupportedOperatingModesAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, DoorLockCluster, writeEnableOneTouchLockingAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, ElectricalMeasurementCluster, subscribeActivePowerMinAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::DoorLock::Attributes::EnableOneTouchLocking::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerMin::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, DoorLockCluster, subscribeEnableOneTouchLockingAttribute) +JNI_METHOD(void, ElectricalMeasurementCluster, subscribeActivePowerMaxAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8933,20 +8334,20 @@ JNI_METHOD(void, DoorLockCluster, subscribeEnableOneTouchLockingAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::DoorLock::Attributes::EnableOneTouchLocking::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerMax::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPBooleanAttributeCallback::OnSubscriptionEstablished); + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -8954,59 +8355,12 @@ JNI_METHOD(void, DoorLockCluster, subscribeEnableOneTouchLockingAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, DoorLockCluster, writeEnablePrivacyModeButtonAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::DoorLock::Attributes::EnablePrivacyModeButton::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, DoorLockCluster, subscribeEnablePrivacyModeButtonAttribute) +JNI_METHOD(void, ElectricalMeasurementCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9017,20 +8371,20 @@ JNI_METHOD(void, DoorLockCluster, subscribeEnablePrivacyModeButtonAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::DoorLock::Attributes::EnablePrivacyModeButton::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::ClusterRevision::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPBooleanAttributeCallback::OnSubscriptionEstablished); + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -9038,54 +8392,60 @@ JNI_METHOD(void, DoorLockCluster, subscribeEnablePrivacyModeButtonAttribute) onSuccess.release(); onFailure.release(); } +JNI_METHOD(jlong, EthernetNetworkDiagnosticsCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + EthernetNetworkDiagnosticsCluster * cppCluster = new EthernetNetworkDiagnosticsCluster(); + + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} -JNI_METHOD(void, DoorLockCluster, writeWrongCodeEntryLimitAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, resetCounts) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::DoorLock::Attributes::WrongCodeEntryLimit::TypeInfo; - TypeInfo::Type cppValue; + CHIP_ERROR err = CHIP_NO_ERROR; + EthernetNetworkDiagnosticsCluster * cppCluster; - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + chip::app::Clusters::EthernetNetworkDiagnostics::Commands::ResetCounts::Type request; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) + if (timedInvokeTimeoutMs == nullptr) { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); } else { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, DoorLockCluster, subscribeWrongCodeEntryLimitAttribute) +JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribePHYRateAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -9101,15 +8461,15 @@ JNI_METHOD(void, DoorLockCluster, subscribeWrongCodeEntryLimitAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::DoorLock::Attributes::WrongCodeEntryLimit::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::PHYRate::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -9122,12 +8482,12 @@ JNI_METHOD(void, DoorLockCluster, subscribeWrongCodeEntryLimitAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, DoorLockCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeFullDuplexAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9138,20 +8498,20 @@ JNI_METHOD(void, DoorLockCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::DoorLock::Attributes::ClusterRevision::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::FullDuplex::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + CHIPBooleanAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -9159,21 +8519,12 @@ JNI_METHOD(void, DoorLockCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, ElectricalMeasurementCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - ElectricalMeasurementCluster * cppCluster = new ElectricalMeasurementCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, ElectricalMeasurementCluster, subscribeMeasurementTypeAttribute) +JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribePacketRxCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9184,20 +8535,21 @@ JNI_METHOD(void, ElectricalMeasurementCluster, subscribeMeasurementTypeAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::MeasurementType::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::PacketRxCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt32uAttributeCallback::OnSubscriptionEstablished); + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -9205,12 +8557,12 @@ JNI_METHOD(void, ElectricalMeasurementCluster, subscribeMeasurementTypeAttribute onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ElectricalMeasurementCluster, subscribeTotalActivePowerAttribute) +JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribePacketTxCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9221,21 +8573,21 @@ JNI_METHOD(void, ElectricalMeasurementCluster, subscribeTotalActivePowerAttribut chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::TotalActivePower::TypeInfo; + using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::PacketTxCount::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( + chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt32sAttributeCallback::OnSubscriptionEstablished); + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -9243,12 +8595,12 @@ JNI_METHOD(void, ElectricalMeasurementCluster, subscribeTotalActivePowerAttribut onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsVoltageAttribute) +JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeTxErrCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9259,20 +8611,20 @@ JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsVoltageAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltage::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( + using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::TxErrCount::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -9280,12 +8632,12 @@ JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsVoltageAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsVoltageMinAttribute) +JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeCollisionCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9296,20 +8648,21 @@ JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsVoltageMinAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageMin::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::CollisionCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -9317,12 +8670,12 @@ JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsVoltageMinAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsVoltageMaxAttribute) +JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeOverrunCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9333,20 +8686,21 @@ JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsVoltageMaxAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageMax::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::OverrunCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -9354,12 +8708,12 @@ JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsVoltageMaxAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsCurrentAttribute) +JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeCarrierDetectAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9370,20 +8724,21 @@ JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsCurrentAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrent::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::CarrierDetect::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + CHIPBooleanAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -9391,12 +8746,12 @@ JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsCurrentAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsCurrentMinAttribute) +JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeTimeSinceResetAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9407,20 +8762,21 @@ JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsCurrentMinAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentMin::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::TimeSinceReset::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -9428,12 +8784,12 @@ JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsCurrentMinAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsCurrentMaxAttribute) +JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeFeatureMapAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9444,20 +8800,20 @@ JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsCurrentMaxAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentMax::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( + using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::FeatureMap::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -9465,12 +8821,12 @@ JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsCurrentMaxAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ElectricalMeasurementCluster, subscribeActivePowerAttribute) +JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9481,20 +8837,21 @@ JNI_METHOD(void, ElectricalMeasurementCluster, subscribeActivePowerAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePower::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -9502,12 +8859,21 @@ JNI_METHOD(void, ElectricalMeasurementCluster, subscribeActivePowerAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ElectricalMeasurementCluster, subscribeActivePowerMinAttribute) +JNI_METHOD(jlong, FixedLabelCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + FixedLabelCluster * cppCluster = new FixedLabelCluster(); + + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} + +JNI_METHOD(void, FixedLabelCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9518,20 +8884,20 @@ JNI_METHOD(void, ElectricalMeasurementCluster, subscribeActivePowerMinAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + FixedLabelCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerMin::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::FixedLabel::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -9539,7 +8905,16 @@ JNI_METHOD(void, ElectricalMeasurementCluster, subscribeActivePowerMinAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ElectricalMeasurementCluster, subscribeActivePowerMaxAttribute) +JNI_METHOD(jlong, FlowMeasurementCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + FlowMeasurementCluster * cppCluster = new FlowMeasurementCluster(); + + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} + +JNI_METHOD(void, FlowMeasurementCluster, subscribeMeasuredValueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -9555,15 +8930,15 @@ JNI_METHOD(void, ElectricalMeasurementCluster, subscribeActivePowerMaxAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + FlowMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerMax::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::FlowMeasurement::Attributes::MeasuredValue::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -9576,12 +8951,12 @@ JNI_METHOD(void, ElectricalMeasurementCluster, subscribeActivePowerMaxAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ElectricalMeasurementCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, FlowMeasurementCluster, subscribeMinMeasuredValueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9592,20 +8967,20 @@ JNI_METHOD(void, ElectricalMeasurementCluster, subscribeClusterRevisionAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + FlowMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::ClusterRevision::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( + using TypeInfo = chip::app::Clusters::FlowMeasurement::Attributes::MinMeasuredValue::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -9613,65 +8988,12 @@ JNI_METHOD(void, ElectricalMeasurementCluster, subscribeClusterRevisionAttribute onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, EthernetNetworkDiagnosticsCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - EthernetNetworkDiagnosticsCluster * cppCluster = new EthernetNetworkDiagnosticsCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, resetCounts) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - EthernetNetworkDiagnosticsCluster * cppCluster; - - chip::app::Clusters::EthernetNetworkDiagnostics::Commands::ResetCounts::Type request; - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribePHYRateAttribute) +JNI_METHOD(void, FlowMeasurementCluster, subscribeMaxMeasuredValueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9682,20 +9004,20 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribePHYRateAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + FlowMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::PHYRate::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( + using TypeInfo = chip::app::Clusters::FlowMeasurement::Attributes::MaxMeasuredValue::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -9703,12 +9025,12 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribePHYRateAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeFullDuplexAttribute) +JNI_METHOD(void, FlowMeasurementCluster, subscribeToleranceAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9719,20 +9041,20 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeFullDuplexAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + FlowMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::FullDuplex::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::FlowMeasurement::Attributes::Tolerance::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPBooleanAttributeCallback::OnSubscriptionEstablished); + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -9740,12 +9062,12 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeFullDuplexAttribute onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribePacketRxCountAttribute) +JNI_METHOD(void, FlowMeasurementCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9756,21 +9078,20 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribePacketRxCountAttrib chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + FlowMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::PacketRxCount::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::FlowMeasurement::Attributes::ClusterRevision::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt64uAttributeCallback::OnSubscriptionEstablished); + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -9778,163 +9099,176 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribePacketRxCountAttrib onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribePacketTxCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(jlong, GeneralCommissioningCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + GeneralCommissioningCluster * cppCluster = new GeneralCommissioningCluster(); - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} - CHIP_ERROR err = CHIP_NO_ERROR; - EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); +JNI_METHOD(void, GeneralCommissioningCluster, armFailSafe) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject expiryLengthSeconds, jobject breadcrumb, jobject timeoutMs, + jobject timedInvokeTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + GeneralCommissioningCluster * cppCluster; - using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::PacketTxCount::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafe::Type request; - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt64uAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeTxErrCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + request.expiryLengthSeconds = static_cast( + chip::JniReferences::GetInstance().IntegerToPrimitive(expiryLengthSeconds)); + request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); + request.timeoutMs = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(timeoutMs)); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::TxErrCount::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( + auto successFn = chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt64uAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeCollisionCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, GeneralCommissioningCluster, commissioningComplete) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + GeneralCommissioningCluster * cppCluster; + + chip::app::Clusters::GeneralCommissioning::Commands::CommissioningComplete::Type request; + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::CollisionCount::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( + chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt64uAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeOverrunCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, GeneralCommissioningCluster, setRegulatoryConfig) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject location, jstring countryCode, jobject breadcrumb, + jobject timeoutMs, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + GeneralCommissioningCluster * cppCluster; + + chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfig::Type request; + + request.location = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(location)); + request.countryCode = chip::JniUtfString(env, static_cast(countryCode)).charSpan(); + request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); + request.timeoutMs = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(timeoutMs)); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::OverrunCount::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( + chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt64uAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeCarrierDetectAttribute) +JNI_METHOD(void, GeneralCommissioningCluster, subscribeBreadcrumbAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9945,21 +9279,20 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeCarrierDetectAttrib chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + GeneralCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::CarrierDetect::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::GeneralCommissioning::Attributes::Breadcrumb::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPBooleanAttributeCallback::OnSubscriptionEstablished); + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -9967,12 +9300,12 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeCarrierDetectAttrib onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeTimeSinceResetAttribute) +JNI_METHOD(void, GeneralCommissioningCluster, subscribeRegulatoryConfigAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9983,21 +9316,20 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeTimeSinceResetAttri chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + GeneralCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::TimeSinceReset::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::GeneralCommissioning::Attributes::RegulatoryConfig::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt64uAttributeCallback::OnSubscriptionEstablished); + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -10005,12 +9337,12 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeTimeSinceResetAttri onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeFeatureMapAttribute) +JNI_METHOD(void, GeneralCommissioningCluster, subscribeLocationCapabilityAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -10021,20 +9353,21 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeFeatureMapAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + GeneralCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::FeatureMap::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::GeneralCommissioning::Attributes::LocationCapability::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt32uAttributeCallback::OnSubscriptionEstablished); + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -10042,7 +9375,7 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeFeatureMapAttribute onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, GeneralCommissioningCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -10058,16 +9391,15 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeClusterRevisionAttr chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + GeneralCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::ClusterRevision::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::GeneralCommissioning::Attributes::ClusterRevision::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -10080,16 +9412,16 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeClusterRevisionAttr onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, FixedLabelCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +JNI_METHOD(jlong, GeneralDiagnosticsCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - FixedLabelCluster * cppCluster = new FixedLabelCluster(); + GeneralDiagnosticsCluster * cppCluster = new GeneralDiagnosticsCluster(); cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); return reinterpret_cast(cppCluster); } -JNI_METHOD(void, FixedLabelCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, GeneralDiagnosticsCluster, subscribeRebootCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -10105,15 +9437,15 @@ JNI_METHOD(void, FixedLabelCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - FixedLabelCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + GeneralDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::FixedLabel::Attributes::ClusterRevision::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::GeneralDiagnostics::Attributes::RebootCount::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -10126,21 +9458,12 @@ JNI_METHOD(void, FixedLabelCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, FlowMeasurementCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +JNI_METHOD(void, GeneralDiagnosticsCluster, subscribeUpTimeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - FlowMeasurementCluster * cppCluster = new FlowMeasurementCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, FlowMeasurementCluster, subscribeMeasuredValueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -10151,20 +9474,20 @@ JNI_METHOD(void, FlowMeasurementCluster, subscribeMeasuredValueAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - FlowMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + GeneralDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::FlowMeasurement::Attributes::MeasuredValue::TypeInfo; + using TypeInfo = chip::app::Clusters::GeneralDiagnostics::Attributes::UpTime::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -10172,12 +9495,12 @@ JNI_METHOD(void, FlowMeasurementCluster, subscribeMeasuredValueAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, FlowMeasurementCluster, subscribeMinMeasuredValueAttribute) +JNI_METHOD(void, GeneralDiagnosticsCluster, subscribeTotalOperationalHoursAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -10188,20 +9511,21 @@ JNI_METHOD(void, FlowMeasurementCluster, subscribeMinMeasuredValueAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - FlowMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + GeneralDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::FlowMeasurement::Attributes::MinMeasuredValue::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::GeneralDiagnostics::Attributes::TotalOperationalHours::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -10209,12 +9533,12 @@ JNI_METHOD(void, FlowMeasurementCluster, subscribeMinMeasuredValueAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, FlowMeasurementCluster, subscribeMaxMeasuredValueAttribute) +JNI_METHOD(void, GeneralDiagnosticsCluster, subscribeBootReasonsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -10225,57 +9549,20 @@ JNI_METHOD(void, FlowMeasurementCluster, subscribeMaxMeasuredValueAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - FlowMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + GeneralDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::FlowMeasurement::Attributes::MaxMeasuredValue::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( + using TypeInfo = chip::app::Clusters::GeneralDiagnostics::Attributes::BootReasons::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16sAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, FlowMeasurementCluster, subscribeToleranceAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - FlowMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::FlowMeasurement::Attributes::Tolerance::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -10283,7 +9570,7 @@ JNI_METHOD(void, FlowMeasurementCluster, subscribeToleranceAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, FlowMeasurementCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, GeneralDiagnosticsCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -10299,14 +9586,14 @@ JNI_METHOD(void, FlowMeasurementCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - FlowMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + GeneralDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::FlowMeasurement::Attributes::ClusterRevision::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( + using TypeInfo = chip::app::Clusters::GeneralDiagnostics::Attributes::ClusterRevision::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); @@ -10320,34 +9607,31 @@ JNI_METHOD(void, FlowMeasurementCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, GeneralCommissioningCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +JNI_METHOD(jlong, GroupKeyManagementCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - GeneralCommissioningCluster * cppCluster = new GeneralCommissioningCluster(); + GroupKeyManagementCluster * cppCluster = new GroupKeyManagementCluster(); cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); return reinterpret_cast(cppCluster); } -JNI_METHOD(void, GeneralCommissioningCluster, armFailSafe) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject expiryLengthSeconds, jobject breadcrumb, jobject timeoutMs, - jobject timedInvokeTimeoutMs) +JNI_METHOD(void, GroupKeyManagementCluster, keySetRead) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupKeySetID, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - GeneralCommissioningCluster * cppCluster; + GroupKeyManagementCluster * cppCluster; - chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafe::Type request; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::Type request; - request.expiryLengthSeconds = static_cast( - chip::JniReferences::GetInstance().IntegerToPrimitive(expiryLengthSeconds)); - request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); - request.timeoutMs = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(timeoutMs)); + request.groupKeySetID = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupKeySetID)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -10357,13 +9641,13 @@ JNI_METHOD(void, GeneralCommissioningCluster, armFailSafe) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); if (timedInvokeTimeoutMs == nullptr) @@ -10382,19 +9666,21 @@ JNI_METHOD(void, GeneralCommissioningCluster, armFailSafe) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, GeneralCommissioningCluster, commissioningComplete) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, GroupKeyManagementCluster, keySetReadAllIndices) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupKeySetIDs, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - GeneralCommissioningCluster * cppCluster; + GroupKeyManagementCluster * cppCluster; - chip::app::Clusters::GeneralCommissioning::Commands::CommissioningComplete::Type request; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndices::Type request; - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + request.groupKeySetIDs = chip::app::DataModel::List(); + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -10404,13 +9690,13 @@ JNI_METHOD(void, GeneralCommissioningCluster, commissioningComplete) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); auto successFn = - chip::Callback::Callback::FromCancelable( + chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); @@ -10430,25 +9716,20 @@ JNI_METHOD(void, GeneralCommissioningCluster, commissioningComplete) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, GeneralCommissioningCluster, setRegulatoryConfig) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject location, jstring countryCode, jobject breadcrumb, - jobject timeoutMs, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, GroupKeyManagementCluster, keySetRemove) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupKeySetID, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - GeneralCommissioningCluster * cppCluster; + GroupKeyManagementCluster * cppCluster; - chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfig::Type request; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetRemove::Type request; - request.location = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(location)); - request.countryCode = chip::JniUtfString(env, static_cast(countryCode)).charSpan(); - request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); - request.timeoutMs = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(timeoutMs)); + request.groupKeySetID = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupKeySetID)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -10458,14 +9739,12 @@ JNI_METHOD(void, GeneralCommissioningCluster, setRegulatoryConfig) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); if (timedInvokeTimeoutMs == nullptr) @@ -10484,59 +9763,60 @@ JNI_METHOD(void, GeneralCommissioningCluster, setRegulatoryConfig) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, GeneralCommissioningCluster, writeBreadcrumbAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, GroupKeyManagementCluster, keySetWrite) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupKeySetID, jobject securityPolicy, + jbyteArray epochKey0, jobject epochStartTime0, jbyteArray epochKey1, jobject epochStartTime1, jbyteArray epochKey2, + jobject epochStartTime2, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::GeneralCommissioning::Attributes::Breadcrumb::TypeInfo; - TypeInfo::Type cppValue; + CHIP_ERROR err = CHIP_NO_ERROR; + GroupKeyManagementCluster * cppCluster; + + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type request; - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + request.groupKeySet = chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySet::Type(); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - GeneralCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) + if (timedInvokeTimeoutMs == nullptr) { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); } else { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, GeneralCommissioningCluster, subscribeBreadcrumbAttribute) +JNI_METHOD(void, GroupKeyManagementCluster, subscribeMaxGroupsPerFabricAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -10547,20 +9827,20 @@ JNI_METHOD(void, GeneralCommissioningCluster, subscribeBreadcrumbAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - GeneralCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + GroupKeyManagementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::GeneralCommissioning::Attributes::Breadcrumb::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( + using TypeInfo = chip::app::Clusters::GroupKeyManagement::Attributes::MaxGroupsPerFabric::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt64uAttributeCallback::OnSubscriptionEstablished); + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -10568,12 +9848,12 @@ JNI_METHOD(void, GeneralCommissioningCluster, subscribeBreadcrumbAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, GeneralCommissioningCluster, subscribeRegulatoryConfigAttribute) +JNI_METHOD(void, GroupKeyManagementCluster, subscribeMaxGroupKeysPerFabricAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -10584,20 +9864,21 @@ JNI_METHOD(void, GeneralCommissioningCluster, subscribeRegulatoryConfigAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - GeneralCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + GroupKeyManagementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::GeneralCommissioning::Attributes::RegulatoryConfig::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::GroupKeyManagement::Attributes::MaxGroupKeysPerFabric::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -10605,45 +9886,7 @@ JNI_METHOD(void, GeneralCommissioningCluster, subscribeRegulatoryConfigAttribute onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, GeneralCommissioningCluster, subscribeLocationCapabilityAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - GeneralCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::GeneralCommissioning::Attributes::LocationCapability::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, GeneralCommissioningCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, GroupKeyManagementCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -10659,14 +9902,14 @@ JNI_METHOD(void, GeneralCommissioningCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - GeneralCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + GroupKeyManagementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::GeneralCommissioning::Attributes::ClusterRevision::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( + using TypeInfo = chip::app::Clusters::GroupKeyManagement::Attributes::ClusterRevision::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); @@ -10680,226 +9923,265 @@ JNI_METHOD(void, GeneralCommissioningCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, GeneralDiagnosticsCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +JNI_METHOD(jlong, GroupsCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - GeneralDiagnosticsCluster * cppCluster = new GeneralDiagnosticsCluster(); + GroupsCluster * cppCluster = new GroupsCluster(); cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); return reinterpret_cast(cppCluster); } -JNI_METHOD(void, GeneralDiagnosticsCluster, subscribeRebootCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, GroupsCluster, addGroup) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jstring groupName, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + GroupsCluster * cppCluster; + + chip::app::Clusters::Groups::Commands::AddGroup::Type request; + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + request.groupName = chip::JniUtfString(env, static_cast(groupName)).charSpan(); + + std::unique_ptr onSuccess( + Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - GeneralDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::GeneralDiagnostics::Attributes::RebootCount::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, GeneralDiagnosticsCluster, subscribeUpTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, GroupsCluster, addGroupIfIdentifying) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jstring groupName, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + GroupsCluster * cppCluster; + + chip::app::Clusters::Groups::Commands::AddGroupIfIdentifying::Type request; + + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + request.groupName = chip::JniUtfString(env, static_cast(groupName)).charSpan(); + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - GeneralDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::GeneralDiagnostics::Attributes::UpTime::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt64uAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, GeneralDiagnosticsCluster, subscribeTotalOperationalHoursAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, GroupsCluster, getGroupMembership) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupList, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + GroupsCluster * cppCluster; + + chip::app::Clusters::Groups::Commands::GetGroupMembership::Type request; + + request.groupList = chip::app::DataModel::List(); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - GeneralDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::GeneralDiagnostics::Attributes::TotalOperationalHours::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt32uAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, GeneralDiagnosticsCluster, subscribeBootReasonsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, GroupsCluster, removeAllGroups) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + GroupsCluster * cppCluster; + + chip::app::Clusters::Groups::Commands::RemoveAllGroups::Type request; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - GeneralDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::GeneralDiagnostics::Attributes::BootReasons::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, GeneralDiagnosticsCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, GroupsCluster, removeGroup) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + GroupsCluster * cppCluster; + + chip::app::Clusters::Groups::Commands::RemoveGroup::Type request; + + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - GeneralDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::GeneralDiagnostics::Attributes::ClusterRevision::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, GroupKeyManagementCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - GroupKeyManagementCluster * cppCluster = new GroupKeyManagementCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, GroupKeyManagementCluster, keySetRead) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupKeySetID, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, GroupsCluster, viewGroup) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - GroupKeyManagementCluster * cppCluster; + GroupsCluster * cppCluster; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::Type request; + chip::app::Clusters::Groups::Commands::ViewGroup::Type request; - request.groupKeySetID = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupKeySetID)); + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -10909,13 +10191,12 @@ JNI_METHOD(void, GroupKeyManagementCluster, keySetRead) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); if (timedInvokeTimeoutMs == nullptr) @@ -10934,21 +10215,103 @@ JNI_METHOD(void, GroupKeyManagementCluster, keySetRead) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, GroupKeyManagementCluster, keySetReadAllIndices) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupKeySetIDs, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, GroupsCluster, subscribeNameSupportAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + GroupsCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + using TypeInfo = chip::app::Clusters::Groups::Attributes::NameSupport::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, GroupsCluster, subscribeClusterRevisionAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + GroupsCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + using TypeInfo = chip::app::Clusters::Groups::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(jlong, IdentifyCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + IdentifyCluster * cppCluster = new IdentifyCluster(); + + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} + +JNI_METHOD(void, IdentifyCluster, identify) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject identifyTime, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - GroupKeyManagementCluster * cppCluster; + IdentifyCluster * cppCluster; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndices::Type request; + chip::app::Clusters::Identify::Commands::Identify::Type request; - request.groupKeySetIDs = chip::app::DataModel::List(); + request.identifyTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(identifyTime)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -10958,14 +10321,12 @@ JNI_METHOD(void, GroupKeyManagementCluster, keySetReadAllIndices) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); if (timedInvokeTimeoutMs == nullptr) @@ -10984,20 +10345,18 @@ JNI_METHOD(void, GroupKeyManagementCluster, keySetReadAllIndices) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, GroupKeyManagementCluster, keySetRemove) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupKeySetID, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, IdentifyCluster, identifyQuery) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - GroupKeyManagementCluster * cppCluster; - - chip::app::Clusters::GroupKeyManagement::Commands::KeySetRemove::Type request; + IdentifyCluster * cppCluster; - request.groupKeySetID = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupKeySetID)); + chip::app::Clusters::Identify::Commands::IdentifyQuery::Type request; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -11007,12 +10366,13 @@ JNI_METHOD(void, GroupKeyManagementCluster, keySetRemove) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); if (timedInvokeTimeoutMs == nullptr) @@ -11031,18 +10391,20 @@ JNI_METHOD(void, GroupKeyManagementCluster, keySetRemove) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, GroupKeyManagementCluster, keySetWrite) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupKeySetID, jobject securityPolicy, - jbyteArray epochKey0, jobject epochStartTime0, jbyteArray epochKey1, jobject epochStartTime1, jbyteArray epochKey2, - jobject epochStartTime2, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, IdentifyCluster, triggerEffect) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject effectIdentifier, jobject effectVariant, + jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - GroupKeyManagementCluster * cppCluster; + IdentifyCluster * cppCluster; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type request; + chip::app::Clusters::Identify::Commands::TriggerEffect::Type request; - request.groupKeySet = chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySet::Type(); + request.effectIdentifier = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(effectIdentifier)); + request.effectVariant = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(effectVariant)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -11055,7 +10417,7 @@ JNI_METHOD(void, GroupKeyManagementCluster, keySetWrite) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -11079,7 +10441,7 @@ JNI_METHOD(void, GroupKeyManagementCluster, keySetWrite) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, GroupKeyManagementCluster, subscribeMaxGroupsPerFabricAttribute) +JNI_METHOD(void, IdentifyCluster, subscribeIdentifyTimeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -11095,15 +10457,15 @@ JNI_METHOD(void, GroupKeyManagementCluster, subscribeMaxGroupsPerFabricAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - GroupKeyManagementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + IdentifyCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::GroupKeyManagement::Attributes::MaxGroupsPerFabric::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::Identify::Attributes::IdentifyTime::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -11116,12 +10478,12 @@ JNI_METHOD(void, GroupKeyManagementCluster, subscribeMaxGroupsPerFabricAttribute onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, GroupKeyManagementCluster, subscribeMaxGroupKeysPerFabricAttribute) +JNI_METHOD(void, IdentifyCluster, subscribeIdentifyTypeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -11132,21 +10494,20 @@ JNI_METHOD(void, GroupKeyManagementCluster, subscribeMaxGroupKeysPerFabricAttrib chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - GroupKeyManagementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + IdentifyCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::GroupKeyManagement::Attributes::MaxGroupKeysPerFabric::TypeInfo; + using TypeInfo = chip::app::Clusters::Identify::Attributes::IdentifyType::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -11154,7 +10515,7 @@ JNI_METHOD(void, GroupKeyManagementCluster, subscribeMaxGroupKeysPerFabricAttrib onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, GroupKeyManagementCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, IdentifyCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -11170,15 +10531,15 @@ JNI_METHOD(void, GroupKeyManagementCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - GroupKeyManagementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + IdentifyCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::GroupKeyManagement::Attributes::ClusterRevision::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::Identify::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -11191,265 +10552,272 @@ JNI_METHOD(void, GroupKeyManagementCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, GroupsCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +JNI_METHOD(jlong, IlluminanceMeasurementCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - GroupsCluster * cppCluster = new GroupsCluster(); + IlluminanceMeasurementCluster * cppCluster = new IlluminanceMeasurementCluster(); cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); return reinterpret_cast(cppCluster); } -JNI_METHOD(void, GroupsCluster, addGroup) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jstring groupName, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeMeasuredValueAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - GroupsCluster * cppCluster; - - chip::app::Clusters::Groups::Commands::AddGroup::Type request; - - request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); - request.groupName = chip::JniUtfString(env, static_cast(groupName)).charSpan(); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::IlluminanceMeasurement::Attributes::MeasuredValue::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), CHIPIlluminanceMeasurementMeasuredValueAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, GroupsCluster, addGroupIfIdentifying) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jstring groupName, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeMinMeasuredValueAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - GroupsCluster * cppCluster; - - chip::app::Clusters::Groups::Commands::AddGroupIfIdentifying::Type request; - - request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); - request.groupName = chip::JniUtfString(env, static_cast(groupName)).charSpan(); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::IlluminanceMeasurement::Attributes::MinMeasuredValue::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), CHIPIlluminanceMeasurementMinMeasuredValueAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, GroupsCluster, getGroupMembership) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupList, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeMaxMeasuredValueAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - GroupsCluster * cppCluster; - - chip::app::Clusters::Groups::Commands::GetGroupMembership::Type request; - - request.groupList = chip::app::DataModel::List(); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::IlluminanceMeasurement::Attributes::MaxMeasuredValue::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), CHIPIlluminanceMeasurementMaxMeasuredValueAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, GroupsCluster, removeAllGroups) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeToleranceAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - GroupsCluster * cppCluster; - - chip::app::Clusters::Groups::Commands::RemoveAllGroups::Type request; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::IlluminanceMeasurement::Attributes::Tolerance::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, GroupsCluster, removeGroup) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeLightSensorTypeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - GroupsCluster * cppCluster; + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - chip::app::Clusters::Groups::Commands::RemoveGroup::Type request; + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + CHIP_ERROR err = CHIP_NO_ERROR; + IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + using TypeInfo = chip::app::Clusters::IlluminanceMeasurement::Attributes::LightSensorType::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), CHIPIlluminanceMeasurementLightSensorTypeAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeClusterRevisionAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::IlluminanceMeasurement::Attributes::ClusterRevision::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, GroupsCluster, viewGroup) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jobject timedInvokeTimeoutMs) +JNI_METHOD(jlong, KeypadInputCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + KeypadInputCluster * cppCluster = new KeypadInputCluster(); + + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} + +JNI_METHOD(void, KeypadInputCluster, sendKeyRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject keyCode, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - GroupsCluster * cppCluster; + KeypadInputCluster * cppCluster; - chip::app::Clusters::Groups::Commands::ViewGroup::Type request; + chip::app::Clusters::KeypadInput::Commands::SendKeyRequest::Type request; - request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + request.keyCode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(keyCode)); - std::unique_ptr onSuccess( - Platform::New(callback), - Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -11459,12 +10827,13 @@ JNI_METHOD(void, GroupsCluster, viewGroup) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); if (timedInvokeTimeoutMs == nullptr) @@ -11483,44 +10852,7 @@ JNI_METHOD(void, GroupsCluster, viewGroup) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, GroupsCluster, subscribeNameSupportAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - GroupsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::Groups::Attributes::NameSupport::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, GroupsCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, KeypadInputCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -11536,15 +10868,15 @@ JNI_METHOD(void, GroupsCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - GroupsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + KeypadInputCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::Groups::Attributes::ClusterRevision::TypeInfo; + using TypeInfo = chip::app::Clusters::KeypadInput::Attributes::ClusterRevision::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -11557,26 +10889,31 @@ JNI_METHOD(void, GroupsCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, IdentifyCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +JNI_METHOD(jlong, LevelControlCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - IdentifyCluster * cppCluster = new IdentifyCluster(); + LevelControlCluster * cppCluster = new LevelControlCluster(); cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); return reinterpret_cast(cppCluster); } -JNI_METHOD(void, IdentifyCluster, identify) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject identifyTime, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, LevelControlCluster, move) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject moveMode, jobject rate, jobject optionMask, + jobject optionOverride, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - IdentifyCluster * cppCluster; + LevelControlCluster * cppCluster; - chip::app::Clusters::Identify::Commands::Identify::Type request; + chip::app::Clusters::LevelControl::Commands::Move::Type request; - request.identifyTime = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(identifyTime)); + request.moveMode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(moveMode)); + request.rate = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(rate)); + request.optionMask = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionMask)); + request.optionOverride = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionOverride)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -11589,7 +10926,7 @@ JNI_METHOD(void, IdentifyCluster, identify) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -11613,18 +10950,26 @@ JNI_METHOD(void, IdentifyCluster, identify) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, IdentifyCluster, identifyQuery) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, LevelControlCluster, moveToLevel) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject level, jobject transitionTime, jobject optionMask, + jobject optionOverride, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - IdentifyCluster * cppCluster; + LevelControlCluster * cppCluster; - chip::app::Clusters::Identify::Commands::IdentifyQuery::Type request; + chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type request; - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + request.level = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(level)); + request.transitionTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); + request.optionMask = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionMask)); + request.optionOverride = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionOverride)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -11634,13 +10979,12 @@ JNI_METHOD(void, IdentifyCluster, identifyQuery) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); if (timedInvokeTimeoutMs == nullptr) @@ -11659,20 +11003,19 @@ JNI_METHOD(void, IdentifyCluster, identifyQuery) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, IdentifyCluster, triggerEffect) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject effectIdentifier, jobject effectVariant, +JNI_METHOD(void, LevelControlCluster, moveToLevelWithOnOff) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject level, jobject transitionTime, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - IdentifyCluster * cppCluster; + LevelControlCluster * cppCluster; - chip::app::Clusters::Identify::Commands::TriggerEffect::Type request; + chip::app::Clusters::LevelControl::Commands::MoveToLevelWithOnOff::Type request; - request.effectIdentifier = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(effectIdentifier)); - request.effectVariant = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(effectVariant)); + request.level = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(level)); + request.transitionTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -11685,7 +11028,7 @@ JNI_METHOD(void, IdentifyCluster, triggerEffect) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -11709,91 +11052,252 @@ JNI_METHOD(void, IdentifyCluster, triggerEffect) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, IdentifyCluster, writeIdentifyTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, LevelControlCluster, moveWithOnOff) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject moveMode, jobject rate, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::Identify::Attributes::IdentifyTime::TypeInfo; - TypeInfo::Type cppValue; + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster; + + chip::app::Clusters::LevelControl::Commands::MoveWithOnOff::Type request; - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + request.moveMode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(moveMode)); + request.rate = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(rate)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - IdentifyCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) + if (timedInvokeTimeoutMs == nullptr) { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); } else { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, IdentifyCluster, subscribeIdentifyTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, LevelControlCluster, step) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject stepMode, jobject stepSize, jobject transitionTime, + jobject optionMask, jobject optionOverride, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster; + + chip::app::Clusters::LevelControl::Commands::Step::Type request; + + request.stepMode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(stepMode)); + request.stepSize = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(stepSize)); + request.transitionTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); + request.optionMask = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionMask)); + request.optionOverride = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionOverride)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, LevelControlCluster, stepWithOnOff) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject stepMode, jobject stepSize, jobject transitionTime, + jobject timedInvokeTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster; + + chip::app::Clusters::LevelControl::Commands::StepWithOnOff::Type request; + + request.stepMode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(stepMode)); + request.stepSize = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(stepSize)); + request.transitionTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - IdentifyCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::Identify::Attributes::IdentifyTime::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, IdentifyCluster, subscribeIdentifyTypeAttribute) +JNI_METHOD(void, LevelControlCluster, stop) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject optionMask, jobject optionOverride, + jobject timedInvokeTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster; + + chip::app::Clusters::LevelControl::Commands::Stop::Type request; + + request.optionMask = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionMask)); + request.optionOverride = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionOverride)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, LevelControlCluster, stopWithOnOff) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster; + + chip::app::Clusters::LevelControl::Commands::StopWithOnOff::Type request; + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, LevelControlCluster, subscribeCurrentLevelAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -11809,15 +11313,15 @@ JNI_METHOD(void, IdentifyCluster, subscribeIdentifyTypeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - IdentifyCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::Identify::Attributes::IdentifyType::TypeInfo; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::CurrentLevel::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -11830,7 +11334,7 @@ JNI_METHOD(void, IdentifyCluster, subscribeIdentifyTypeAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, IdentifyCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, LevelControlCluster, subscribeRemainingTimeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -11846,15 +11350,15 @@ JNI_METHOD(void, IdentifyCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - IdentifyCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::Identify::Attributes::ClusterRevision::TypeInfo; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::RemainingTime::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -11867,23 +11371,12 @@ JNI_METHOD(void, IdentifyCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, IlluminanceMeasurementCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - IlluminanceMeasurementCluster * cppCluster = new IlluminanceMeasurementCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeMeasuredValueAttribute) +JNI_METHOD(void, LevelControlCluster, subscribeMinLevelAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -11894,20 +11387,20 @@ JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeMeasuredValueAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::IlluminanceMeasurement::Attributes::MeasuredValue::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::MinLevel::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute( - onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), - static_cast(maxInterval), CHIPIlluminanceMeasurementMeasuredValueAttributeCallback::OnSubscriptionEstablished); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -11915,14 +11408,12 @@ JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeMeasuredValueAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeMinMeasuredValueAttribute) +JNI_METHOD(void, LevelControlCluster, subscribeMaxLevelAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -11933,21 +11424,20 @@ JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeMinMeasuredValueAttribu chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::IlluminanceMeasurement::Attributes::MinMeasuredValue::TypeInfo; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::MaxLevel::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute( - onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), - static_cast(maxInterval), CHIPIlluminanceMeasurementMinMeasuredValueAttributeCallback::OnSubscriptionEstablished); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -11955,14 +11445,12 @@ JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeMinMeasuredValueAttribu onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeMaxMeasuredValueAttribute) +JNI_METHOD(void, LevelControlCluster, subscribeCurrentFrequencyAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -11973,21 +11461,20 @@ JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeMaxMeasuredValueAttribu chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::IlluminanceMeasurement::Attributes::MaxMeasuredValue::TypeInfo; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::CurrentFrequency::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute( - onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), - static_cast(maxInterval), CHIPIlluminanceMeasurementMaxMeasuredValueAttributeCallback::OnSubscriptionEstablished); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -11995,7 +11482,7 @@ JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeMaxMeasuredValueAttribu onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeToleranceAttribute) +JNI_METHOD(void, LevelControlCluster, subscribeMinFrequencyAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -12011,15 +11498,15 @@ JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeToleranceAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::IlluminanceMeasurement::Attributes::Tolerance::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::MinFrequency::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -12032,14 +11519,12 @@ JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeToleranceAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeLightSensorTypeAttribute) +JNI_METHOD(void, LevelControlCluster, subscribeMaxFrequencyAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12050,21 +11535,20 @@ JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeLightSensorTypeAttribut chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::IlluminanceMeasurement::Attributes::LightSensorType::TypeInfo; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::MaxFrequency::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute( - onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), - static_cast(maxInterval), CHIPIlluminanceMeasurementLightSensorTypeAttributeCallback::OnSubscriptionEstablished); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -12072,12 +11556,12 @@ JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeLightSensorTypeAttribut onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, LevelControlCluster, subscribeOptionsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12088,21 +11572,20 @@ JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeClusterRevisionAttribut chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::IlluminanceMeasurement::Attributes::ClusterRevision::TypeInfo; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::Options::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -12110,69 +11593,50 @@ JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeClusterRevisionAttribut onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, KeypadInputCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - KeypadInputCluster * cppCluster = new KeypadInputCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, KeypadInputCluster, sendKeyRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject keyCode, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, LevelControlCluster, subscribeOnOffTransitionTimeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - KeypadInputCluster * cppCluster; - - chip::app::Clusters::KeypadInput::Commands::SendKeyRequest::Type request; - - request.keyCode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(keyCode)); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OnOffTransitionTime::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, KeypadInputCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, LevelControlCluster, subscribeOnLevelAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12183,20 +11647,20 @@ JNI_METHOD(void, KeypadInputCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - KeypadInputCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::KeypadInput::Attributes::ClusterRevision::TypeInfo; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OnLevel::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + CHIPLevelControlOnLevelAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -12204,284 +11668,299 @@ JNI_METHOD(void, KeypadInputCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, LevelControlCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - LevelControlCluster * cppCluster = new LevelControlCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, LevelControlCluster, move) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject moveMode, jobject rate, jobject optionMask, - jobject optionOverride, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, LevelControlCluster, subscribeOnTransitionTimeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster; - - chip::app::Clusters::LevelControl::Commands::Move::Type request; - - request.moveMode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(moveMode)); - request.rate = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(rate)); - request.optionMask = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionMask)); - request.optionOverride = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionOverride)); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OnTransitionTime::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPLevelControlOnTransitionTimeAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, LevelControlCluster, moveToLevel) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject level, jobject transitionTime, jobject optionMask, - jobject optionOverride, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, LevelControlCluster, subscribeOffTransitionTimeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster; - - chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type request; - - request.level = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(level)); - request.transitionTime = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); - request.optionMask = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionMask)); - request.optionOverride = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionOverride)); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OffTransitionTime::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPLevelControlOffTransitionTimeAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, LevelControlCluster, moveToLevelWithOnOff) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject level, jobject transitionTime, - jobject timedInvokeTimeoutMs) +JNI_METHOD(void, LevelControlCluster, subscribeDefaultMoveRateAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster; - - chip::app::Clusters::LevelControl::Commands::MoveToLevelWithOnOff::Type request; - - request.level = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(level)); - request.transitionTime = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::DefaultMoveRate::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPLevelControlDefaultMoveRateAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, LevelControlCluster, moveWithOnOff) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject moveMode, jobject rate, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, LevelControlCluster, subscribeStartUpCurrentLevelAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster; - - chip::app::Clusters::LevelControl::Commands::MoveWithOnOff::Type request; - - request.moveMode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(moveMode)); - request.rate = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(rate)); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::StartUpCurrentLevel::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPLevelControlStartUpCurrentLevelAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, LevelControlCluster, step) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject stepMode, jobject stepSize, jobject transitionTime, - jobject optionMask, jobject optionOverride, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, LevelControlCluster, subscribeFeatureMapAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster; - - chip::app::Clusters::LevelControl::Commands::Step::Type request; - - request.stepMode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(stepMode)); - request.stepSize = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(stepSize)); - request.transitionTime = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); - request.optionMask = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionMask)); - request.optionOverride = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionOverride)); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::FeatureMap::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, LevelControlCluster, stepWithOnOff) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject stepMode, jobject stepSize, jobject transitionTime, - jobject timedInvokeTimeoutMs) +JNI_METHOD(void, LevelControlCluster, subscribeClusterRevisionAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - chip::app::Clusters::LevelControl::Commands::StepWithOnOff::Type request; + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - request.stepMode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(stepMode)); - request.stepSize = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(stepSize)); - request.transitionTime = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(jlong, LocalizationConfigurationCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + LocalizationConfigurationCluster * cppCluster = new LocalizationConfigurationCluster(); + + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} + +JNI_METHOD(void, LocalizationConfigurationCluster, subscribeActiveLocaleAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + LocalizationConfigurationCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + using TypeInfo = chip::app::Clusters::LocalizationConfiguration::Attributes::ActiveLocale::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPCharStringAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(jlong, LowPowerCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + LowPowerCluster * cppCluster = new LowPowerCluster(); + + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} + +JNI_METHOD(void, LowPowerCluster, sleep) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + LowPowerCluster * cppCluster; + + chip::app::Clusters::LowPower::Commands::Sleep::Type request; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -12494,7 +11973,7 @@ JNI_METHOD(void, LevelControlCluster, stepWithOnOff) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -12518,20 +11997,60 @@ JNI_METHOD(void, LevelControlCluster, stepWithOnOff) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, LevelControlCluster, stop) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject optionMask, jobject optionOverride, - jobject timedInvokeTimeoutMs) +JNI_METHOD(void, LowPowerCluster, subscribeClusterRevisionAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - chip::app::Clusters::LevelControl::Commands::Stop::Type request; + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - request.optionMask = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionMask)); - request.optionOverride = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionOverride)); + CHIP_ERROR err = CHIP_NO_ERROR; + LowPowerCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + using TypeInfo = chip::app::Clusters::LowPower::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(jlong, MediaInputCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + MediaInputCluster * cppCluster = new MediaInputCluster(); + + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} + +JNI_METHOD(void, MediaInputCluster, hideInputStatusRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + MediaInputCluster * cppCluster; + + chip::app::Clusters::MediaInput::Commands::HideInputStatusRequest::Type request; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -12544,7 +12063,7 @@ JNI_METHOD(void, LevelControlCluster, stop) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -12568,14 +12087,17 @@ JNI_METHOD(void, LevelControlCluster, stop) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, LevelControlCluster, stopWithOnOff) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, MediaInputCluster, renameInputRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject index, jstring name, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster; + MediaInputCluster * cppCluster; - chip::app::Clusters::LevelControl::Commands::StopWithOnOff::Type request; + chip::app::Clusters::MediaInput::Commands::RenameInputRequest::Type request; + + request.index = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(index)); + request.name = chip::JniUtfString(env, static_cast(name)).charSpan(); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -12588,7 +12110,7 @@ JNI_METHOD(void, LevelControlCluster, stopWithOnOff) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -12612,81 +12134,97 @@ JNI_METHOD(void, LevelControlCluster, stopWithOnOff) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, LevelControlCluster, subscribeCurrentLevelAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, MediaInputCluster, selectInputRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject index, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaInputCluster * cppCluster; + + chip::app::Clusters::MediaInput::Commands::SelectInputRequest::Type request; + + request.index = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(index)); + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::LevelControl::Attributes::CurrentLevel::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, LevelControlCluster, subscribeRemainingTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, MediaInputCluster, showInputStatusRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaInputCluster * cppCluster; + chip::app::Clusters::MediaInput::Commands::ShowInputStatusRequest::Type request; + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::LevelControl::Attributes::RemainingTime::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, LevelControlCluster, subscribeMinLevelAttribute) +JNI_METHOD(void, MediaInputCluster, subscribeCurrentMediaInputAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -12702,15 +12240,15 @@ JNI_METHOD(void, LevelControlCluster, subscribeMinLevelAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaInputCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::LevelControl::Attributes::MinLevel::TypeInfo; + using TypeInfo = chip::app::Clusters::MediaInput::Attributes::CurrentMediaInput::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -12723,12 +12261,12 @@ JNI_METHOD(void, LevelControlCluster, subscribeMinLevelAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, LevelControlCluster, subscribeMaxLevelAttribute) +JNI_METHOD(void, MediaInputCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12739,20 +12277,20 @@ JNI_METHOD(void, LevelControlCluster, subscribeMaxLevelAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaInputCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::LevelControl::Attributes::MaxLevel::TypeInfo; + using TypeInfo = chip::app::Clusters::MediaInput::Attributes::ClusterRevision::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -12760,526 +12298,535 @@ JNI_METHOD(void, LevelControlCluster, subscribeMaxLevelAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, LevelControlCluster, subscribeCurrentFrequencyAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(jlong, MediaPlaybackCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + MediaPlaybackCluster * cppCluster = new MediaPlaybackCluster(); + + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} + +JNI_METHOD(void, MediaPlaybackCluster, fastForwardRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster; + + chip::app::Clusters::MediaPlayback::Commands::FastForwardRequest::Type request; + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::LevelControl::Attributes::CurrentFrequency::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, LevelControlCluster, subscribeMinFrequencyAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, MediaPlaybackCluster, nextRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster; + + chip::app::Clusters::MediaPlayback::Commands::NextRequest::Type request; + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::LevelControl::Attributes::MinFrequency::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, LevelControlCluster, subscribeMaxFrequencyAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, MediaPlaybackCluster, pauseRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster; + chip::app::Clusters::MediaPlayback::Commands::PauseRequest::Type request; + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::LevelControl::Attributes::MaxFrequency::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, LevelControlCluster, writeOptionsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, MediaPlaybackCluster, playRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::LevelControl::Attributes::Options::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + chip::app::Clusters::MediaPlayback::Commands::PlayRequest::Type request; + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) + if (timedInvokeTimeoutMs == nullptr) { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); } else { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, LevelControlCluster, subscribeOptionsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, MediaPlaybackCluster, previousRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster; + + chip::app::Clusters::MediaPlayback::Commands::PreviousRequest::Type request; + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::LevelControl::Attributes::Options::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, LevelControlCluster, writeOnOffTransitionTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, MediaPlaybackCluster, rewindRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OnOffTransitionTime::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + chip::app::Clusters::MediaPlayback::Commands::RewindRequest::Type request; + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) + if (timedInvokeTimeoutMs == nullptr) { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); } else { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, LevelControlCluster, subscribeOnOffTransitionTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OnOffTransitionTime::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, LevelControlCluster, writeOnLevelAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, MediaPlaybackCluster, seekRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject position, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OnLevel::TypeInfo; - TypeInfo::Type cppValue; + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster; - uint8_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + chip::app::Clusters::MediaPlayback::Commands::SeekRequest::Type request; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + request.position = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(position)); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) + if (timedInvokeTimeoutMs == nullptr) { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); } else { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, LevelControlCluster, subscribeOnLevelAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, MediaPlaybackCluster, skipBackwardRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject deltaPositionMilliseconds, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster; + + chip::app::Clusters::MediaPlayback::Commands::SkipBackwardRequest::Type request; + + request.deltaPositionMilliseconds = static_cast( + chip::JniReferences::GetInstance().LongToPrimitive(deltaPositionMilliseconds)); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OnLevel::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPLevelControlOnLevelAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, LevelControlCluster, writeOnTransitionTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, MediaPlaybackCluster, skipForwardRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject deltaPositionMilliseconds, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OnTransitionTime::TypeInfo; - TypeInfo::Type cppValue; + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster; - uint16_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + chip::app::Clusters::MediaPlayback::Commands::SkipForwardRequest::Type request; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + request.deltaPositionMilliseconds = static_cast( + chip::JniReferences::GetInstance().LongToPrimitive(deltaPositionMilliseconds)); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) + if (timedInvokeTimeoutMs == nullptr) { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); } else { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, LevelControlCluster, subscribeOnTransitionTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, MediaPlaybackCluster, startOverRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster; + + chip::app::Clusters::MediaPlayback::Commands::StartOverRequest::Type request; + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OnTransitionTime::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPLevelControlOnTransitionTimeAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, LevelControlCluster, writeOffTransitionTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, MediaPlaybackCluster, stopRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OffTransitionTime::TypeInfo; - TypeInfo::Type cppValue; - - uint16_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + chip::app::Clusters::MediaPlayback::Commands::StopRequest::Type request; + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) + if (timedInvokeTimeoutMs == nullptr) { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); } else { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, LevelControlCluster, subscribeOffTransitionTimeAttribute) +JNI_METHOD(void, MediaPlaybackCluster, subscribePlaybackStateAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -13290,20 +12837,20 @@ JNI_METHOD(void, LevelControlCluster, subscribeOffTransitionTimeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OffTransitionTime::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::MediaPlayback::Attributes::PlaybackState::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPLevelControlOffTransitionTimeAttributeCallback::OnSubscriptionEstablished); + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -13311,65 +12858,49 @@ JNI_METHOD(void, LevelControlCluster, subscribeOffTransitionTimeAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, LevelControlCluster, writeDefaultMoveRateAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, MediaPlaybackCluster, subscribeStartTimeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::LevelControl::Attributes::DefaultMoveRate::TypeInfo; - TypeInfo::Type cppValue; - - uint8_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::MediaPlayback::Attributes::StartTime::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, LevelControlCluster, subscribeDefaultMoveRateAttribute) +JNI_METHOD(void, MediaPlaybackCluster, subscribeDurationAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -13380,20 +12911,20 @@ JNI_METHOD(void, LevelControlCluster, subscribeDefaultMoveRateAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::LevelControl::Attributes::DefaultMoveRate::TypeInfo; + using TypeInfo = chip::app::Clusters::MediaPlayback::Attributes::Duration::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPLevelControlDefaultMoveRateAttributeCallback::OnSubscriptionEstablished); + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -13401,66 +12932,49 @@ JNI_METHOD(void, LevelControlCluster, subscribeDefaultMoveRateAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, LevelControlCluster, writeStartUpCurrentLevelAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, MediaPlaybackCluster, subscribePlaybackSpeedAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::LevelControl::Attributes::StartUpCurrentLevel::TypeInfo; - TypeInfo::Type cppValue; - - uint8_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::MediaPlayback::Attributes::PlaybackSpeed::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPFloatAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, LevelControlCluster, subscribeStartUpCurrentLevelAttribute) +JNI_METHOD(void, MediaPlaybackCluster, subscribeSeekRangeEndAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -13471,20 +12985,20 @@ JNI_METHOD(void, LevelControlCluster, subscribeStartUpCurrentLevelAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::LevelControl::Attributes::StartUpCurrentLevel::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::MediaPlayback::Attributes::SeekRangeEnd::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPLevelControlStartUpCurrentLevelAttributeCallback::OnSubscriptionEstablished); + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -13492,12 +13006,12 @@ JNI_METHOD(void, LevelControlCluster, subscribeStartUpCurrentLevelAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, LevelControlCluster, subscribeFeatureMapAttribute) +JNI_METHOD(void, MediaPlaybackCluster, subscribeSeekRangeStartAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -13508,20 +13022,20 @@ JNI_METHOD(void, LevelControlCluster, subscribeFeatureMapAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::LevelControl::Attributes::FeatureMap::TypeInfo; + using TypeInfo = chip::app::Clusters::MediaPlayback::Attributes::SeekRangeStart::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt32uAttributeCallback::OnSubscriptionEstablished); + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -13529,7 +13043,7 @@ JNI_METHOD(void, LevelControlCluster, subscribeFeatureMapAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, LevelControlCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, MediaPlaybackCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -13545,15 +13059,15 @@ JNI_METHOD(void, LevelControlCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::LevelControl::Attributes::ClusterRevision::TypeInfo; + using TypeInfo = chip::app::Clusters::MediaPlayback::Attributes::ClusterRevision::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -13566,67 +13080,67 @@ JNI_METHOD(void, LevelControlCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, LocalizationConfigurationCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +JNI_METHOD(jlong, ModeSelectCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - LocalizationConfigurationCluster * cppCluster = new LocalizationConfigurationCluster(); + ModeSelectCluster * cppCluster = new ModeSelectCluster(); cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); return reinterpret_cast(cppCluster); } -JNI_METHOD(void, LocalizationConfigurationCluster, writeActiveLocaleAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, ModeSelectCluster, changeToMode) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject newMode, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::LocalizationConfiguration::Attributes::ActiveLocale::TypeInfo; - TypeInfo::Type cppValue; + CHIP_ERROR err = CHIP_NO_ERROR; + ModeSelectCluster * cppCluster; - cppValue = chip::JniUtfString(env, static_cast(value)).charSpan(); + chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Type request; + + request.newMode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(newMode)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - LocalizationConfigurationCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) + if (timedInvokeTimeoutMs == nullptr) { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); } else { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, LocalizationConfigurationCluster, subscribeActiveLocaleAttribute) +JNI_METHOD(void, ModeSelectCluster, subscribeCurrentModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -13637,21 +13151,20 @@ JNI_METHOD(void, LocalizationConfigurationCluster, subscribeActiveLocaleAttribut chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - LocalizationConfigurationCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::LocalizationConfiguration::Attributes::ActiveLocale::TypeInfo; + using TypeInfo = chip::app::Clusters::ModeSelect::Attributes::CurrentMode::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPCharStringAttributeCallback::OnSubscriptionEstablished); + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -13659,60 +13172,118 @@ JNI_METHOD(void, LocalizationConfigurationCluster, subscribeActiveLocaleAttribut onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, LowPowerCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +JNI_METHOD(void, ModeSelectCluster, subscribeOnModeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - LowPowerCluster * cppCluster = new LowPowerCluster(); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); -JNI_METHOD(void, LowPowerCluster, sleep) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) + CHIP_ERROR err = CHIP_NO_ERROR; + ModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + using TypeInfo = chip::app::Clusters::ModeSelect::Attributes::OnMode::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, ModeSelectCluster, subscribeStartUpModeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - LowPowerCluster * cppCluster; - - chip::app::Clusters::LowPower::Commands::Sleep::Type request; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + using TypeInfo = chip::app::Clusters::ModeSelect::Attributes::StartUpMode::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, ModeSelectCluster, subscribeDescriptionAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ModeSelect::Attributes::Description::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPCharStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, LowPowerCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, ModeSelectCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -13728,15 +13299,15 @@ JNI_METHOD(void, LowPowerCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - LowPowerCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::LowPower::Attributes::ClusterRevision::TypeInfo; + using TypeInfo = chip::app::Clusters::ModeSelect::Attributes::ClusterRevision::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -13749,26 +13320,32 @@ JNI_METHOD(void, LowPowerCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, MediaInputCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +JNI_METHOD(jlong, NetworkCommissioningCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - MediaInputCluster * cppCluster = new MediaInputCluster(); + NetworkCommissioningCluster * cppCluster = new NetworkCommissioningCluster(); cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); return reinterpret_cast(cppCluster); } -JNI_METHOD(void, MediaInputCluster, hideInputStatusRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, NetworkCommissioningCluster, addOrUpdateThreadNetwork) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray operationalDataset, jobject breadcrumb, + jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - MediaInputCluster * cppCluster; + NetworkCommissioningCluster * cppCluster; - chip::app::Clusters::MediaInput::Commands::HideInputStatusRequest::Type request; + chip::app::Clusters::NetworkCommissioning::Commands::AddOrUpdateThreadNetwork::Type request; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + request.operationalDataset = chip::JniByteArray(env, static_cast(operationalDataset)).byteSpan(); + request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -13778,12 +13355,13 @@ JNI_METHOD(void, MediaInputCluster, hideInputStatusRequest) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); if (timedInvokeTimeoutMs == nullptr) @@ -13802,20 +13380,24 @@ JNI_METHOD(void, MediaInputCluster, hideInputStatusRequest) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, MediaInputCluster, renameInputRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject index, jstring name, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, NetworkCommissioningCluster, addOrUpdateWiFiNetwork) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray ssid, jbyteArray credentials, jobject breadcrumb, + jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - MediaInputCluster * cppCluster; + NetworkCommissioningCluster * cppCluster; - chip::app::Clusters::MediaInput::Commands::RenameInputRequest::Type request; + chip::app::Clusters::NetworkCommissioning::Commands::AddOrUpdateWiFiNetwork::Type request; - request.index = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(index)); - request.name = chip::JniUtfString(env, static_cast(name)).charSpan(); + request.ssid = chip::JniByteArray(env, static_cast(ssid)).byteSpan(); + request.credentials = chip::JniByteArray(env, static_cast(credentials)).byteSpan(); + request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -13825,12 +13407,13 @@ JNI_METHOD(void, MediaInputCluster, renameInputRequest) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); if (timedInvokeTimeoutMs == nullptr) @@ -13849,19 +13432,23 @@ JNI_METHOD(void, MediaInputCluster, renameInputRequest) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, MediaInputCluster, selectInputRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject index, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, NetworkCommissioningCluster, connectNetwork) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray networkID, jobject breadcrumb, + jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - MediaInputCluster * cppCluster; + NetworkCommissioningCluster * cppCluster; - chip::app::Clusters::MediaInput::Commands::SelectInputRequest::Type request; + chip::app::Clusters::NetworkCommissioning::Commands::ConnectNetwork::Type request; - request.index = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(index)); + request.networkID = chip::JniByteArray(env, static_cast(networkID)).byteSpan(); + request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -13871,12 +13458,13 @@ JNI_METHOD(void, MediaInputCluster, selectInputRequest) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); if (timedInvokeTimeoutMs == nullptr) @@ -13895,17 +13483,23 @@ JNI_METHOD(void, MediaInputCluster, selectInputRequest) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, MediaInputCluster, showInputStatusRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, NetworkCommissioningCluster, removeNetwork) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray networkID, jobject breadcrumb, + jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - MediaInputCluster * cppCluster; + NetworkCommissioningCluster * cppCluster; - chip::app::Clusters::MediaInput::Commands::ShowInputStatusRequest::Type request; + chip::app::Clusters::NetworkCommissioning::Commands::RemoveNetwork::Type request; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + request.networkID = chip::JniByteArray(env, static_cast(networkID)).byteSpan(); + request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -13915,12 +13509,13 @@ JNI_METHOD(void, MediaInputCluster, showInputStatusRequest) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); if (timedInvokeTimeoutMs == nullptr) @@ -13939,101 +13534,25 @@ JNI_METHOD(void, MediaInputCluster, showInputStatusRequest) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, MediaInputCluster, subscribeCurrentMediaInputAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - MediaInputCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::MediaInput::Attributes::CurrentMediaInput::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, MediaInputCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - MediaInputCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::MediaInput::Attributes::ClusterRevision::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(jlong, MediaPlaybackCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - MediaPlaybackCluster * cppCluster = new MediaPlaybackCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, MediaPlaybackCluster, fastForwardRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, NetworkCommissioningCluster, reorderNetwork) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray networkID, jobject networkIndex, jobject breadcrumb, + jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster; + NetworkCommissioningCluster * cppCluster; - chip::app::Clusters::MediaPlayback::Commands::FastForwardRequest::Type request; + chip::app::Clusters::NetworkCommissioning::Commands::ReorderNetwork::Type request; - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + request.networkID = chip::JniByteArray(env, static_cast(networkID)).byteSpan(); + request.networkIndex = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(networkIndex)); + request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -14043,13 +13562,13 @@ JNI_METHOD(void, MediaPlaybackCluster, fastForwardRequest) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); if (timedInvokeTimeoutMs == nullptr) @@ -14068,18 +13587,22 @@ JNI_METHOD(void, MediaPlaybackCluster, fastForwardRequest) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, MediaPlaybackCluster, nextRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, NetworkCommissioningCluster, scanNetworks) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray ssid, jobject breadcrumb, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster; + NetworkCommissioningCluster * cppCluster; - chip::app::Clusters::MediaPlayback::Commands::NextRequest::Type request; + chip::app::Clusters::NetworkCommissioning::Commands::ScanNetworks::Type request; - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + request.ssid = chip::JniByteArray(env, static_cast(ssid)).byteSpan(); + request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -14089,13 +13612,13 @@ JNI_METHOD(void, MediaPlaybackCluster, nextRequest) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); if (timedInvokeTimeoutMs == nullptr) @@ -14114,348 +13637,369 @@ JNI_METHOD(void, MediaPlaybackCluster, nextRequest) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, MediaPlaybackCluster, pauseRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, NetworkCommissioningCluster, subscribeMaxNetworksAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster; - - chip::app::Clusters::MediaPlayback::Commands::PauseRequest::Type request; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + NetworkCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::NetworkCommissioning::Attributes::MaxNetworks::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, MediaPlaybackCluster, playRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, NetworkCommissioningCluster, subscribeScanMaxTimeSecondsAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster; - - chip::app::Clusters::MediaPlayback::Commands::PlayRequest::Type request; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + NetworkCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::NetworkCommissioning::Attributes::ScanMaxTimeSeconds::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, MediaPlaybackCluster, previousRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, NetworkCommissioningCluster, subscribeConnectMaxTimeSecondsAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster; - - chip::app::Clusters::MediaPlayback::Commands::PreviousRequest::Type request; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + NetworkCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::NetworkCommissioning::Attributes::ConnectMaxTimeSeconds::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, MediaPlaybackCluster, rewindRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, NetworkCommissioningCluster, subscribeInterfaceEnabledAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster; - - chip::app::Clusters::MediaPlayback::Commands::RewindRequest::Type request; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + NetworkCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::NetworkCommissioning::Attributes::InterfaceEnabled::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPBooleanAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, MediaPlaybackCluster, seekRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject position, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, NetworkCommissioningCluster, subscribeLastNetworkingStatusAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster; - - chip::app::Clusters::MediaPlayback::Commands::SeekRequest::Type request; - - request.position = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(position)); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + NetworkCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::NetworkCommissioning::Attributes::LastNetworkingStatus::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, MediaPlaybackCluster, skipBackwardRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject deltaPositionMilliseconds, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, NetworkCommissioningCluster, subscribeLastNetworkIDAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster; - - chip::app::Clusters::MediaPlayback::Commands::SkipBackwardRequest::Type request; - - request.deltaPositionMilliseconds = static_cast( - chip::JniReferences::GetInstance().LongToPrimitive(deltaPositionMilliseconds)); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + NetworkCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::NetworkCommissioning::Attributes::LastNetworkID::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPOctetStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, MediaPlaybackCluster, skipForwardRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject deltaPositionMilliseconds, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, NetworkCommissioningCluster, subscribeLastConnectErrorValueAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster; - - chip::app::Clusters::MediaPlayback::Commands::SkipForwardRequest::Type request; - - request.deltaPositionMilliseconds = static_cast( - chip::JniReferences::GetInstance().LongToPrimitive(deltaPositionMilliseconds)); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + NetworkCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::NetworkCommissioning::Attributes::LastConnectErrorValue::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, MediaPlaybackCluster, startOverRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, NetworkCommissioningCluster, subscribeFeatureMapAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + NetworkCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + using TypeInfo = chip::app::Clusters::NetworkCommissioning::Attributes::FeatureMap::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, NetworkCommissioningCluster, subscribeClusterRevisionAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + NetworkCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + using TypeInfo = chip::app::Clusters::NetworkCommissioning::Attributes::ClusterRevision::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(jlong, OtaSoftwareUpdateProviderCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + OtaSoftwareUpdateProviderCluster * cppCluster = new OtaSoftwareUpdateProviderCluster(); + + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} + +JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, applyUpdateRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray updateToken, jobject newVersion, + jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster; + OtaSoftwareUpdateProviderCluster * cppCluster; - chip::app::Clusters::MediaPlayback::Commands::StartOverRequest::Type request; + chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateRequest::Type request; - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + request.updateToken = chip::JniByteArray(env, static_cast(updateToken)).byteSpan(); + request.newVersion = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(newVersion)); + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -14465,13 +14009,13 @@ JNI_METHOD(void, MediaPlaybackCluster, startOverRequest) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); if (timedInvokeTimeoutMs == nullptr) @@ -14490,18 +14034,22 @@ JNI_METHOD(void, MediaPlaybackCluster, startOverRequest) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, MediaPlaybackCluster, stopRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, notifyUpdateApplied) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray updateToken, jobject softwareVersion, + jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster; + OtaSoftwareUpdateProviderCluster * cppCluster; - chip::app::Clusters::MediaPlayback::Commands::StopRequest::Type request; + chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::NotifyUpdateApplied::Type request; - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + request.updateToken = chip::JniByteArray(env, static_cast(updateToken)).byteSpan(); + request.softwareVersion = + static_cast(chip::JniReferences::GetInstance().LongToPrimitive(softwareVersion)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -14511,13 +14059,12 @@ JNI_METHOD(void, MediaPlaybackCluster, stopRequest) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); if (timedInvokeTimeoutMs == nullptr) @@ -14536,49 +14083,79 @@ JNI_METHOD(void, MediaPlaybackCluster, stopRequest) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, MediaPlaybackCluster, subscribePlaybackStateAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, queryImage) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject vendorId, jobject productId, jobject softwareVersion, + jobject protocolsSupported, jobject hardwareVersion, jobject location, jobject requestorCanConsent, jobject metadataForProvider, + jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + OtaSoftwareUpdateProviderCluster * cppCluster; + + chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImage::Type request; + + request.vendorId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(vendorId)); + request.productId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(productId)); + request.softwareVersion = + static_cast(chip::JniReferences::GetInstance().LongToPrimitive(softwareVersion)); + request.protocolsSupported = + chip::app::DataModel::List(); + chip::JniReferences::GetInstance().GetOptionalValue(hardwareVersion, hardwareVersion); + request.hardwareVersion = chip::Optional( + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(hardwareVersion))); + chip::JniReferences::GetInstance().GetOptionalValue(location, location); + request.location = chip::Optional(chip::JniUtfString(env, static_cast(location)).charSpan()); + chip::JniReferences::GetInstance().GetOptionalValue(requestorCanConsent, requestorCanConsent); + request.requestorCanConsent = chip::Optional(static_cast( + chip::JniReferences::GetInstance().BooleanToPrimitive(requestorCanConsent))); + chip::JniReferences::GetInstance().GetOptionalValue(metadataForProvider, metadataForProvider); + request.metadataForProvider = + chip::Optional(chip::JniByteArray(env, static_cast(metadataForProvider)).byteSpan()); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::MediaPlayback::Attributes::PlaybackState::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, MediaPlaybackCluster, subscribeStartTimeAttribute) +JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14589,20 +14166,21 @@ JNI_METHOD(void, MediaPlaybackCluster, subscribeStartTimeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OtaSoftwareUpdateProviderCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::MediaPlayback::Attributes::StartTime::TypeInfo; + using TypeInfo = chip::app::Clusters::OtaSoftwareUpdateProvider::Attributes::ClusterRevision::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt64uAttributeCallback::OnSubscriptionEstablished); + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -14610,49 +14188,76 @@ JNI_METHOD(void, MediaPlaybackCluster, subscribeStartTimeAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, MediaPlaybackCluster, subscribeDurationAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(jlong, OtaSoftwareUpdateRequestorCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + OtaSoftwareUpdateRequestorCluster * cppCluster = new OtaSoftwareUpdateRequestorCluster(); - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); +JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, announceOtaProvider) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject providerNodeId, jobject vendorId, + jobject announcementReason, jobject metadataForNode, jobject endpoint, jobject timedInvokeTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + OtaSoftwareUpdateRequestorCluster * cppCluster; - using TypeInfo = chip::app::Clusters::MediaPlayback::Attributes::Duration::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::app::Clusters::OtaSoftwareUpdateRequestor::Commands::AnnounceOtaProvider::Type request; + + request.providerNodeId = + static_cast(chip::JniReferences::GetInstance().LongToPrimitive(providerNodeId)); + request.vendorId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(vendorId)); + request.announcementReason = static_cast( + chip::JniReferences::GetInstance().IntegerToPrimitive(announcementReason)); + chip::JniReferences::GetInstance().GetOptionalValue(metadataForNode, metadataForNode); + request.metadataForNode = + chip::Optional(chip::JniByteArray(env, static_cast(metadataForNode)).byteSpan()); + request.endpoint = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(endpoint)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt64uAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, MediaPlaybackCluster, subscribePlaybackSpeedAttribute) +JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, subscribeUpdatePossibleAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14663,20 +14268,21 @@ JNI_METHOD(void, MediaPlaybackCluster, subscribePlaybackSpeedAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OtaSoftwareUpdateRequestorCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::MediaPlayback::Attributes::PlaybackSpeed::TypeInfo; + using TypeInfo = chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::UpdatePossible::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPFloatAttributeCallback::OnSubscriptionEstablished); + CHIPBooleanAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -14684,12 +14290,12 @@ JNI_METHOD(void, MediaPlaybackCluster, subscribePlaybackSpeedAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, MediaPlaybackCluster, subscribeSeekRangeEndAttribute) +JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, subscribeUpdateStateAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14700,20 +14306,21 @@ JNI_METHOD(void, MediaPlaybackCluster, subscribeSeekRangeEndAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OtaSoftwareUpdateRequestorCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::MediaPlayback::Attributes::SeekRangeEnd::TypeInfo; + using TypeInfo = chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::UpdateState::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt64uAttributeCallback::OnSubscriptionEstablished); + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -14721,12 +14328,14 @@ JNI_METHOD(void, MediaPlaybackCluster, subscribeSeekRangeEndAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, MediaPlaybackCluster, subscribeSeekRangeStartAttribute) +JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, subscribeUpdateStateProgressAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14737,20 +14346,22 @@ JNI_METHOD(void, MediaPlaybackCluster, subscribeSeekRangeStartAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OtaSoftwareUpdateRequestorCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::MediaPlayback::Attributes::SeekRangeStart::TypeInfo; + using TypeInfo = chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::UpdateStateProgress::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt64uAttributeCallback::OnSubscriptionEstablished); + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), + CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -14758,7 +14369,7 @@ JNI_METHOD(void, MediaPlaybackCluster, subscribeSeekRangeStartAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, MediaPlaybackCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -14774,15 +14385,16 @@ JNI_METHOD(void, MediaPlaybackCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OtaSoftwareUpdateRequestorCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::MediaPlayback::Attributes::ClusterRevision::TypeInfo; + using TypeInfo = chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::ClusterRevision::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -14795,62 +14407,16 @@ JNI_METHOD(void, MediaPlaybackCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, ModeSelectCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +JNI_METHOD(jlong, OccupancySensingCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - ModeSelectCluster * cppCluster = new ModeSelectCluster(); + OccupancySensingCluster * cppCluster = new OccupancySensingCluster(); cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); return reinterpret_cast(cppCluster); } -JNI_METHOD(void, ModeSelectCluster, changeToMode) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject newMode, jobject timedInvokeTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - ModeSelectCluster * cppCluster; - - chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Type request; - - request.newMode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(newMode)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, ModeSelectCluster, subscribeCurrentModeAttribute) +JNI_METHOD(void, OccupancySensingCluster, subscribeOccupancyAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -14866,15 +14432,15 @@ JNI_METHOD(void, ModeSelectCluster, subscribeCurrentModeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OccupancySensingCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ModeSelect::Attributes::CurrentMode::TypeInfo; + using TypeInfo = chip::app::Clusters::OccupancySensing::Attributes::Occupancy::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -14887,54 +14453,44 @@ JNI_METHOD(void, ModeSelectCluster, subscribeCurrentModeAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ModeSelectCluster, writeOnModeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, OccupancySensingCluster, subscribeOccupancySensorTypeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ModeSelect::Attributes::OnMode::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OccupancySensingCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::OccupancySensing::Attributes::OccupancySensorType::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ModeSelectCluster, subscribeOnModeAttribute) +JNI_METHOD(void, OccupancySensingCluster, subscribeOccupancySensorTypeBitmapAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -14950,15 +14506,16 @@ JNI_METHOD(void, ModeSelectCluster, subscribeOnModeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OccupancySensingCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ModeSelect::Attributes::OnMode::TypeInfo; + using TypeInfo = chip::app::Clusters::OccupancySensing::Attributes::OccupancySensorTypeBitmap::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -14971,12 +14528,12 @@ JNI_METHOD(void, ModeSelectCluster, subscribeOnModeAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ModeSelectCluster, subscribeStartUpModeAttribute) +JNI_METHOD(void, OccupancySensingCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14987,20 +14544,20 @@ JNI_METHOD(void, ModeSelectCluster, subscribeStartUpModeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OccupancySensingCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::ModeSelect::Attributes::StartUpMode::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::OccupancySensing::Attributes::ClusterRevision::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -15008,106 +14565,25 @@ JNI_METHOD(void, ModeSelectCluster, subscribeStartUpModeAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ModeSelectCluster, subscribeDescriptionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(jlong, OnOffCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::ModeSelect::Attributes::Description::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPCharStringAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, ModeSelectCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::ModeSelect::Attributes::ClusterRevision::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(jlong, NetworkCommissioningCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - NetworkCommissioningCluster * cppCluster = new NetworkCommissioningCluster(); + OnOffCluster * cppCluster = new OnOffCluster(); cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); return reinterpret_cast(cppCluster); } -JNI_METHOD(void, NetworkCommissioningCluster, addOrUpdateThreadNetwork) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray operationalDataset, jobject breadcrumb, - jobject timedInvokeTimeoutMs) +JNI_METHOD(void, OnOffCluster, off)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - NetworkCommissioningCluster * cppCluster; - - chip::app::Clusters::NetworkCommissioning::Commands::AddOrUpdateThreadNetwork::Type request; + OnOffCluster * cppCluster; - request.operationalDataset = chip::JniByteArray(env, static_cast(operationalDataset)).byteSpan(); - request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); + chip::app::Clusters::OnOff::Commands::Off::Type request; - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -15117,13 +14593,12 @@ JNI_METHOD(void, NetworkCommissioningCluster, addOrUpdateThreadNetwork) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); if (timedInvokeTimeoutMs == nullptr) @@ -15142,24 +14617,22 @@ JNI_METHOD(void, NetworkCommissioningCluster, addOrUpdateThreadNetwork) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, NetworkCommissioningCluster, addOrUpdateWiFiNetwork) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray ssid, jbyteArray credentials, jobject breadcrumb, +JNI_METHOD(void, OnOffCluster, offWithEffect) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject effectId, jobject effectVariant, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - NetworkCommissioningCluster * cppCluster; + OnOffCluster * cppCluster; - chip::app::Clusters::NetworkCommissioning::Commands::AddOrUpdateWiFiNetwork::Type request; + chip::app::Clusters::OnOff::Commands::OffWithEffect::Type request; - request.ssid = chip::JniByteArray(env, static_cast(ssid)).byteSpan(); - request.credentials = chip::JniByteArray(env, static_cast(credentials)).byteSpan(); - request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); + request.effectId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(effectId)); + request.effectVariant = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(effectVariant)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -15169,13 +14642,12 @@ JNI_METHOD(void, NetworkCommissioningCluster, addOrUpdateWiFiNetwork) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); if (timedInvokeTimeoutMs == nullptr) @@ -15194,23 +14666,16 @@ JNI_METHOD(void, NetworkCommissioningCluster, addOrUpdateWiFiNetwork) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, NetworkCommissioningCluster, connectNetwork) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray networkID, jobject breadcrumb, - jobject timedInvokeTimeoutMs) +JNI_METHOD(void, OnOffCluster, on)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - NetworkCommissioningCluster * cppCluster; - - chip::app::Clusters::NetworkCommissioning::Commands::ConnectNetwork::Type request; + OnOffCluster * cppCluster; - request.networkID = chip::JniByteArray(env, static_cast(networkID)).byteSpan(); - request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); + chip::app::Clusters::OnOff::Commands::On::Type request; - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -15220,13 +14685,12 @@ JNI_METHOD(void, NetworkCommissioningCluster, connectNetwork) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); if (timedInvokeTimeoutMs == nullptr) @@ -15245,23 +14709,17 @@ JNI_METHOD(void, NetworkCommissioningCluster, connectNetwork) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, NetworkCommissioningCluster, removeNetwork) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray networkID, jobject breadcrumb, - jobject timedInvokeTimeoutMs) +JNI_METHOD(void, OnOffCluster, onWithRecallGlobalScene) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - NetworkCommissioningCluster * cppCluster; - - chip::app::Clusters::NetworkCommissioning::Commands::RemoveNetwork::Type request; + OnOffCluster * cppCluster; - request.networkID = chip::JniByteArray(env, static_cast(networkID)).byteSpan(); - request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); + chip::app::Clusters::OnOff::Commands::OnWithRecallGlobalScene::Type request; - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -15271,13 +14729,12 @@ JNI_METHOD(void, NetworkCommissioningCluster, removeNetwork) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); if (timedInvokeTimeoutMs == nullptr) @@ -15296,25 +14753,24 @@ JNI_METHOD(void, NetworkCommissioningCluster, removeNetwork) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, NetworkCommissioningCluster, reorderNetwork) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray networkID, jobject networkIndex, jobject breadcrumb, +JNI_METHOD(void, OnOffCluster, onWithTimedOff) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject onOffControl, jobject onTime, jobject offWaitTime, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - NetworkCommissioningCluster * cppCluster; + OnOffCluster * cppCluster; - chip::app::Clusters::NetworkCommissioning::Commands::ReorderNetwork::Type request; + chip::app::Clusters::OnOff::Commands::OnWithTimedOff::Type request; - request.networkID = chip::JniByteArray(env, static_cast(networkID)).byteSpan(); - request.networkIndex = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(networkIndex)); - request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); + request.onOffControl = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(onOffControl)); + request.onTime = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(onTime)); + request.offWaitTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(offWaitTime)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -15324,13 +14780,12 @@ JNI_METHOD(void, NetworkCommissioningCluster, reorderNetwork) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); if (timedInvokeTimeoutMs == nullptr) @@ -15349,22 +14804,16 @@ JNI_METHOD(void, NetworkCommissioningCluster, reorderNetwork) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, NetworkCommissioningCluster, scanNetworks) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray ssid, jobject breadcrumb, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, OnOffCluster, toggle)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - NetworkCommissioningCluster * cppCluster; - - chip::app::Clusters::NetworkCommissioning::Commands::ScanNetworks::Type request; + OnOffCluster * cppCluster; - request.ssid = chip::JniByteArray(env, static_cast(ssid)).byteSpan(); - request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); + chip::app::Clusters::OnOff::Commands::Toggle::Type request; - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -15374,13 +14823,12 @@ JNI_METHOD(void, NetworkCommissioningCluster, scanNetworks) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); if (timedInvokeTimeoutMs == nullptr) @@ -15399,12 +14847,12 @@ JNI_METHOD(void, NetworkCommissioningCluster, scanNetworks) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, NetworkCommissioningCluster, subscribeMaxNetworksAttribute) +JNI_METHOD(void, OnOffCluster, subscribeOnOffAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -15415,20 +14863,19 @@ JNI_METHOD(void, NetworkCommissioningCluster, subscribeMaxNetworksAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - NetworkCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::NetworkCommissioning::Attributes::MaxNetworks::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::OnOff::Attributes::OnOff::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + CHIPBooleanAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -15436,12 +14883,12 @@ JNI_METHOD(void, NetworkCommissioningCluster, subscribeMaxNetworksAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, NetworkCommissioningCluster, subscribeScanMaxTimeSecondsAttribute) +JNI_METHOD(void, OnOffCluster, subscribeGlobalSceneControlAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -15452,21 +14899,20 @@ JNI_METHOD(void, NetworkCommissioningCluster, subscribeScanMaxTimeSecondsAttribu chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - NetworkCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::NetworkCommissioning::Attributes::ScanMaxTimeSeconds::TypeInfo; + using TypeInfo = chip::app::Clusters::OnOff::Attributes::GlobalSceneControl::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + CHIPBooleanAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -15474,12 +14920,12 @@ JNI_METHOD(void, NetworkCommissioningCluster, subscribeScanMaxTimeSecondsAttribu onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, NetworkCommissioningCluster, subscribeConnectMaxTimeSecondsAttribute) +JNI_METHOD(void, OnOffCluster, subscribeOnTimeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -15490,21 +14936,19 @@ JNI_METHOD(void, NetworkCommissioningCluster, subscribeConnectMaxTimeSecondsAttr chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - NetworkCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::NetworkCommissioning::Attributes::ConnectMaxTimeSeconds::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + using TypeInfo = chip::app::Clusters::OnOff::Attributes::OnTime::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -15512,59 +14956,49 @@ JNI_METHOD(void, NetworkCommissioningCluster, subscribeConnectMaxTimeSecondsAttr onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, NetworkCommissioningCluster, writeInterfaceEnabledAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, OnOffCluster, subscribeOffWaitTimeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::NetworkCommissioning::Attributes::InterfaceEnabled::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - NetworkCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::OnOff::Attributes::OffWaitTime::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, NetworkCommissioningCluster, subscribeInterfaceEnabledAttribute) +JNI_METHOD(void, OnOffCluster, subscribeStartUpOnOffAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -15575,20 +15009,20 @@ JNI_METHOD(void, NetworkCommissioningCluster, subscribeInterfaceEnabledAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - NetworkCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::NetworkCommissioning::Attributes::InterfaceEnabled::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::OnOff::Attributes::StartUpOnOff::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPBooleanAttributeCallback::OnSubscriptionEstablished); + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -15596,12 +15030,12 @@ JNI_METHOD(void, NetworkCommissioningCluster, subscribeInterfaceEnabledAttribute onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, NetworkCommissioningCluster, subscribeLastNetworkingStatusAttribute) +JNI_METHOD(void, OnOffCluster, subscribeFeatureMapAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -15612,21 +15046,19 @@ JNI_METHOD(void, NetworkCommissioningCluster, subscribeLastNetworkingStatusAttri chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - NetworkCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::NetworkCommissioning::Attributes::LastNetworkingStatus::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::OnOff::Attributes::FeatureMap::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -15634,12 +15066,12 @@ JNI_METHOD(void, NetworkCommissioningCluster, subscribeLastNetworkingStatusAttri onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, NetworkCommissioningCluster, subscribeLastNetworkIDAttribute) +JNI_METHOD(void, OnOffCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -15650,20 +15082,20 @@ JNI_METHOD(void, NetworkCommissioningCluster, subscribeLastNetworkIDAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - NetworkCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::NetworkCommissioning::Attributes::LastNetworkID::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::OnOff::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPOctetStringAttributeCallback::OnSubscriptionEstablished); + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -15671,12 +15103,21 @@ JNI_METHOD(void, NetworkCommissioningCluster, subscribeLastNetworkIDAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, NetworkCommissioningCluster, subscribeLastConnectErrorValueAttribute) +JNI_METHOD(jlong, OnOffSwitchConfigurationCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + OnOffSwitchConfigurationCluster * cppCluster = new OnOffSwitchConfigurationCluster(); + + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} + +JNI_METHOD(void, OnOffSwitchConfigurationCluster, subscribeSwitchTypeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -15687,21 +15128,20 @@ JNI_METHOD(void, NetworkCommissioningCluster, subscribeLastConnectErrorValueAttr chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - NetworkCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OnOffSwitchConfigurationCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::NetworkCommissioning::Attributes::LastConnectErrorValue::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::OnOffSwitchConfiguration::Attributes::SwitchType::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt32uAttributeCallback::OnSubscriptionEstablished); + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -15709,12 +15149,12 @@ JNI_METHOD(void, NetworkCommissioningCluster, subscribeLastConnectErrorValueAttr onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, NetworkCommissioningCluster, subscribeFeatureMapAttribute) +JNI_METHOD(void, OnOffSwitchConfigurationCluster, subscribeSwitchActionsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -15725,20 +15165,21 @@ JNI_METHOD(void, NetworkCommissioningCluster, subscribeFeatureMapAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - NetworkCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OnOffSwitchConfigurationCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::NetworkCommissioning::Attributes::FeatureMap::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::OnOffSwitchConfiguration::Attributes::SwitchActions::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt32uAttributeCallback::OnSubscriptionEstablished); + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -15746,7 +15187,7 @@ JNI_METHOD(void, NetworkCommissioningCluster, subscribeFeatureMapAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, NetworkCommissioningCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, OnOffSwitchConfigurationCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -15762,15 +15203,16 @@ JNI_METHOD(void, NetworkCommissioningCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - NetworkCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OnOffSwitchConfigurationCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::NetworkCommissioning::Attributes::ClusterRevision::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::OnOffSwitchConfiguration::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -15783,32 +15225,38 @@ JNI_METHOD(void, NetworkCommissioningCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, OtaSoftwareUpdateProviderCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +JNI_METHOD(jlong, OperationalCredentialsCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - OtaSoftwareUpdateProviderCluster * cppCluster = new OtaSoftwareUpdateProviderCluster(); + OperationalCredentialsCluster * cppCluster = new OperationalCredentialsCluster(); cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); return reinterpret_cast(cppCluster); } -JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, applyUpdateRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray updateToken, jobject newVersion, - jobject timedInvokeTimeoutMs) +JNI_METHOD(void, OperationalCredentialsCluster, addNOC) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray NOCValue, jobject ICACValue, jbyteArray IPKValue, + jobject caseAdminNode, jobject adminVendorId, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - OtaSoftwareUpdateProviderCluster * cppCluster; + OperationalCredentialsCluster * cppCluster; - chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateRequest::Type request; + chip::app::Clusters::OperationalCredentials::Commands::AddNOC::Type request; - request.updateToken = chip::JniByteArray(env, static_cast(updateToken)).byteSpan(); - request.newVersion = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(newVersion)); + request.NOCValue = chip::JniByteArray(env, static_cast(NOCValue)).byteSpan(); + chip::JniReferences::GetInstance().GetOptionalValue(ICACValue, ICACValue); + request.ICACValue = chip::Optional(chip::JniByteArray(env, static_cast(ICACValue)).byteSpan()); + request.IPKValue = chip::JniByteArray(env, static_cast(IPKValue)).byteSpan(); + request.caseAdminNode = + static_cast(chip::JniReferences::GetInstance().LongToPrimitive(caseAdminNode)); + request.adminVendorId = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(adminVendorId)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -15818,13 +15266,13 @@ JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, applyUpdateRequest) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); if (timedInvokeTimeoutMs == nullptr) @@ -15843,19 +15291,16 @@ JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, applyUpdateRequest) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, notifyUpdateApplied) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray updateToken, jobject softwareVersion, - jobject timedInvokeTimeoutMs) +JNI_METHOD(void, OperationalCredentialsCluster, addTrustedRootCertificate) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray rootCertificate, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - OtaSoftwareUpdateProviderCluster * cppCluster; + OperationalCredentialsCluster * cppCluster; - chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::NotifyUpdateApplied::Type request; + chip::app::Clusters::OperationalCredentials::Commands::AddTrustedRootCertificate::Type request; - request.updateToken = chip::JniByteArray(env, static_cast(updateToken)).byteSpan(); - request.softwareVersion = - static_cast(chip::JniReferences::GetInstance().LongToPrimitive(softwareVersion)); + request.rootCertificate = chip::JniByteArray(env, static_cast(rootCertificate)).byteSpan(); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -15868,7 +15313,7 @@ JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, notifyUpdateApplied) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -15892,39 +15337,21 @@ JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, notifyUpdateApplied) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, queryImage) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject vendorId, jobject productId, jobject softwareVersion, - jobject protocolsSupported, jobject hardwareVersion, jobject location, jobject requestorCanConsent, jobject metadataForProvider, - jobject timedInvokeTimeoutMs) +JNI_METHOD(void, OperationalCredentialsCluster, attestationRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray attestationNonce, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - OtaSoftwareUpdateProviderCluster * cppCluster; + OperationalCredentialsCluster * cppCluster; - chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImage::Type request; + chip::app::Clusters::OperationalCredentials::Commands::AttestationRequest::Type request; - request.vendorId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(vendorId)); - request.productId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(productId)); - request.softwareVersion = - static_cast(chip::JniReferences::GetInstance().LongToPrimitive(softwareVersion)); - request.protocolsSupported = - chip::app::DataModel::List(); - chip::JniReferences::GetInstance().GetOptionalValue(hardwareVersion, hardwareVersion); - request.hardwareVersion = chip::Optional( - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(hardwareVersion))); - chip::JniReferences::GetInstance().GetOptionalValue(location, location); - request.location = chip::Optional(chip::JniUtfString(env, static_cast(location)).charSpan()); - chip::JniReferences::GetInstance().GetOptionalValue(requestorCanConsent, requestorCanConsent); - request.requestorCanConsent = chip::Optional(static_cast( - chip::JniReferences::GetInstance().BooleanToPrimitive(requestorCanConsent))); - chip::JniReferences::GetInstance().GetOptionalValue(metadataForProvider, metadataForProvider); - request.metadataForProvider = - chip::Optional(chip::JniByteArray(env, static_cast(metadataForProvider)).byteSpan()); + request.attestationNonce = chip::JniByteArray(env, static_cast(attestationNonce)).byteSpan(); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -15934,12 +15361,12 @@ JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, queryImage) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable( + auto successFn = chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); @@ -15959,75 +15386,72 @@ JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, queryImage) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, OperationalCredentialsCluster, certificateChainRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject certificateType, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + OperationalCredentialsCluster * cppCluster; - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + chip::app::Clusters::OperationalCredentials::Commands::CertificateChainRequest::Type request; - CHIP_ERROR err = CHIP_NO_ERROR; - OtaSoftwareUpdateProviderCluster * cppCluster = reinterpret_cast(clusterPtr); + request.certificateType = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(certificateType)); + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::OtaSoftwareUpdateProvider::Attributes::ClusterRevision::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( + chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, OtaSoftwareUpdateRequestorCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - OtaSoftwareUpdateRequestorCluster * cppCluster = new OtaSoftwareUpdateRequestorCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, announceOtaProvider) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject providerNodeId, jobject vendorId, - jobject announcementReason, jobject metadataForNode, jobject endpoint, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, OperationalCredentialsCluster, opCSRRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray CSRNonce, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - OtaSoftwareUpdateRequestorCluster * cppCluster; + OperationalCredentialsCluster * cppCluster; - chip::app::Clusters::OtaSoftwareUpdateRequestor::Commands::AnnounceOtaProvider::Type request; + chip::app::Clusters::OperationalCredentials::Commands::OpCSRRequest::Type request; - request.providerNodeId = - static_cast(chip::JniReferences::GetInstance().LongToPrimitive(providerNodeId)); - request.vendorId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(vendorId)); - request.announcementReason = static_cast( - chip::JniReferences::GetInstance().IntegerToPrimitive(announcementReason)); - chip::JniReferences::GetInstance().GetOptionalValue(metadataForNode, metadataForNode); - request.metadataForNode = - chip::Optional(chip::JniByteArray(env, static_cast(metadataForNode)).byteSpan()); - request.endpoint = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(endpoint)); + request.CSRNonce = chip::JniByteArray(env, static_cast(CSRNonce)).byteSpan(); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -16037,12 +15461,13 @@ JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, announceOtaProvider) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); if (timedInvokeTimeoutMs == nullptr) @@ -16061,171 +15486,204 @@ JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, announceOtaProvider) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, subscribeUpdatePossibleAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, OperationalCredentialsCluster, removeFabric) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject fabricIndex, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + OperationalCredentialsCluster * cppCluster; + + chip::app::Clusters::OperationalCredentials::Commands::RemoveFabric::Type request; + + request.fabricIndex = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(fabricIndex)); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OtaSoftwareUpdateRequestorCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::UpdatePossible::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPBooleanAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, subscribeUpdateStateAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, OperationalCredentialsCluster, removeTrustedRootCertificate) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray trustedRootIdentifier, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + OperationalCredentialsCluster * cppCluster; + + chip::app::Clusters::OperationalCredentials::Commands::RemoveTrustedRootCertificate::Type request; + + request.trustedRootIdentifier = chip::JniByteArray(env, static_cast(trustedRootIdentifier)).byteSpan(); + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OtaSoftwareUpdateRequestorCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::UpdateState::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, subscribeUpdateStateProgressAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, OperationalCredentialsCluster, updateFabricLabel) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring label, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + OperationalCredentialsCluster * cppCluster; + + chip::app::Clusters::OperationalCredentials::Commands::UpdateFabricLabel::Type request; + + request.label = chip::JniUtfString(env, static_cast(label)).charSpan(); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OtaSoftwareUpdateRequestorCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::UpdateStateProgress::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute( - onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), - static_cast(maxInterval), - CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); +JNI_METHOD(void, OperationalCredentialsCluster, updateNOC) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray NOCValue, jobject ICACValue, + jobject timedInvokeTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + OperationalCredentialsCluster * cppCluster; + + chip::app::Clusters::OperationalCredentials::Commands::UpdateNOC::Type request; + + request.NOCValue = chip::JniByteArray(env, static_cast(NOCValue)).byteSpan(); + chip::JniReferences::GetInstance().GetOptionalValue(ICACValue, ICACValue); + request.ICACValue = chip::Optional(chip::JniByteArray(env, static_cast(ICACValue)).byteSpan()); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OtaSoftwareUpdateRequestorCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::ClusterRevision::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, OccupancySensingCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - OccupancySensingCluster * cppCluster = new OccupancySensingCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, OccupancySensingCluster, subscribeOccupancyAttribute) +JNI_METHOD(void, OperationalCredentialsCluster, subscribeSupportedFabricsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -16241,15 +15699,16 @@ JNI_METHOD(void, OccupancySensingCluster, subscribeOccupancyAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OccupancySensingCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OperationalCredentialsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::OccupancySensing::Attributes::Occupancy::TypeInfo; + using TypeInfo = chip::app::Clusters::OperationalCredentials::Attributes::SupportedFabrics::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -16262,7 +15721,7 @@ JNI_METHOD(void, OccupancySensingCluster, subscribeOccupancyAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OccupancySensingCluster, subscribeOccupancySensorTypeAttribute) +JNI_METHOD(void, OperationalCredentialsCluster, subscribeCommissionedFabricsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -16278,15 +15737,16 @@ JNI_METHOD(void, OccupancySensingCluster, subscribeOccupancySensorTypeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OccupancySensingCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OperationalCredentialsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::OccupancySensing::Attributes::OccupancySensorType::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::OperationalCredentials::Attributes::CommissionedFabrics::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -16299,12 +15759,14 @@ JNI_METHOD(void, OccupancySensingCluster, subscribeOccupancySensorTypeAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OccupancySensingCluster, subscribeOccupancySensorTypeBitmapAttribute) +JNI_METHOD(void, OperationalCredentialsCluster, subscribeCurrentFabricIndexAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -16315,21 +15777,22 @@ JNI_METHOD(void, OccupancySensingCluster, subscribeOccupancySensorTypeBitmapAttr chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OccupancySensingCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OperationalCredentialsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::OccupancySensing::Attributes::OccupancySensorTypeBitmap::TypeInfo; + using TypeInfo = chip::app::Clusters::OperationalCredentials::Attributes::CurrentFabricIndex::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( + chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), + CHIPOperationalCredentialsCurrentFabricIndexAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -16337,7 +15800,7 @@ JNI_METHOD(void, OccupancySensingCluster, subscribeOccupancySensorTypeBitmapAttr onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OccupancySensingCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, OperationalCredentialsCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -16353,15 +15816,16 @@ JNI_METHOD(void, OccupancySensingCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OccupancySensingCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OperationalCredentialsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::OccupancySensing::Attributes::ClusterRevision::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::OperationalCredentials::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -16374,294 +15838,206 @@ JNI_METHOD(void, OccupancySensingCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, OnOffCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +JNI_METHOD(jlong, PowerSourceCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - OnOffCluster * cppCluster = new OnOffCluster(); + PowerSourceCluster * cppCluster = new PowerSourceCluster(); cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); return reinterpret_cast(cppCluster); } -JNI_METHOD(void, OnOffCluster, off)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, PowerSourceCluster, subscribeStatusAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster; - - chip::app::Clusters::OnOff::Commands::Off::Type request; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PowerSource::Attributes::Status::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OnOffCluster, offWithEffect) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject effectId, jobject effectVariant, - jobject timedInvokeTimeoutMs) +JNI_METHOD(void, PowerSourceCluster, subscribeOrderAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster; - - chip::app::Clusters::OnOff::Commands::OffWithEffect::Type request; - - request.effectId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(effectId)); - request.effectVariant = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(effectVariant)); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PowerSource::Attributes::Order::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OnOffCluster, on)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, PowerSourceCluster, subscribeDescriptionAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster; - - chip::app::Clusters::OnOff::Commands::On::Type request; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PowerSource::Attributes::Description::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPCharStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OnOffCluster, onWithRecallGlobalScene) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, PowerSourceCluster, subscribeBatteryVoltageAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster; - - chip::app::Clusters::OnOff::Commands::OnWithRecallGlobalScene::Type request; - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, OnOffCluster, onWithTimedOff) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject onOffControl, jobject onTime, jobject offWaitTime, - jobject timedInvokeTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster; - - chip::app::Clusters::OnOff::Commands::OnWithTimedOff::Type request; - - request.onOffControl = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(onOffControl)); - request.onTime = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(onTime)); - request.offWaitTime = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(offWaitTime)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PowerSource::Attributes::BatteryVoltage::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OnOffCluster, toggle)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, PowerSourceCluster, subscribeBatteryPercentRemainingAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster; - - chip::app::Clusters::OnOff::Commands::Toggle::Type request; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PowerSource::Attributes::BatteryPercentRemaining::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OnOffCluster, subscribeOnOffAttribute) +JNI_METHOD(void, PowerSourceCluster, subscribeBatteryTimeRemainingAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -16672,19 +16048,20 @@ JNI_METHOD(void, OnOffCluster, subscribeOnOffAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::OnOff::Attributes::OnOff::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PowerSource::Attributes::BatteryTimeRemaining::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPBooleanAttributeCallback::OnSubscriptionEstablished); + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -16692,12 +16069,12 @@ JNI_METHOD(void, OnOffCluster, subscribeOnOffAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OnOffCluster, subscribeGlobalSceneControlAttribute) +JNI_METHOD(void, PowerSourceCluster, subscribeBatteryChargeLevelAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -16708,20 +16085,20 @@ JNI_METHOD(void, OnOffCluster, subscribeGlobalSceneControlAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::OnOff::Attributes::GlobalSceneControl::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PowerSource::Attributes::BatteryChargeLevel::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPBooleanAttributeCallback::OnSubscriptionEstablished); + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -16729,59 +16106,49 @@ JNI_METHOD(void, OnOffCluster, subscribeGlobalSceneControlAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, OnOffCluster, writeOnTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, PowerSourceCluster, subscribeBatteryChargeStateAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::OnOff::Attributes::OnTime::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PowerSource::Attributes::BatteryChargeState::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OnOffCluster, subscribeOnTimeAttribute) +JNI_METHOD(void, PowerSourceCluster, subscribeFeatureMapAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -16792,19 +16159,20 @@ JNI_METHOD(void, OnOffCluster, subscribeOnTimeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::OnOff::Attributes::OnTime::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PowerSource::Attributes::FeatureMap::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -16812,54 +16180,53 @@ JNI_METHOD(void, OnOffCluster, subscribeOnTimeAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, OnOffCluster, writeOffWaitTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, PowerSourceCluster, subscribeClusterRevisionAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::OnOff::Attributes::OffWaitTime::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PowerSource::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OnOffCluster, subscribeOffWaitTimeAttribute) +JNI_METHOD(jlong, PowerSourceConfigurationCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + PowerSourceConfigurationCluster * cppCluster = new PowerSourceConfigurationCluster(); + + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} + +JNI_METHOD(void, PowerSourceConfigurationCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -16875,15 +16242,16 @@ JNI_METHOD(void, OnOffCluster, subscribeOffWaitTimeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PowerSourceConfigurationCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::OnOff::Attributes::OffWaitTime::TypeInfo; + using TypeInfo = chip::app::Clusters::PowerSourceConfiguration::Attributes::ClusterRevision::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -16896,59 +16264,58 @@ JNI_METHOD(void, OnOffCluster, subscribeOffWaitTimeAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, OnOffCluster, writeStartUpOnOffAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(jlong, PressureMeasurementCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::OnOff::Attributes::StartUpOnOff::TypeInfo; - TypeInfo::Type cppValue; + PressureMeasurementCluster * cppCluster = new PressureMeasurementCluster(); - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); +JNI_METHOD(void, PressureMeasurementCluster, subscribeMeasuredValueAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PressureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PressureMeasurement::Attributes::MeasuredValue::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OnOffCluster, subscribeStartUpOnOffAttribute) +JNI_METHOD(void, PressureMeasurementCluster, subscribeMinMeasuredValueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -16959,20 +16326,20 @@ JNI_METHOD(void, OnOffCluster, subscribeStartUpOnOffAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PressureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::OnOff::Attributes::StartUpOnOff::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PressureMeasurement::Attributes::MinMeasuredValue::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -16980,12 +16347,12 @@ JNI_METHOD(void, OnOffCluster, subscribeStartUpOnOffAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OnOffCluster, subscribeFeatureMapAttribute) +JNI_METHOD(void, PressureMeasurementCluster, subscribeMaxMeasuredValueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -16996,19 +16363,20 @@ JNI_METHOD(void, OnOffCluster, subscribeFeatureMapAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PressureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::OnOff::Attributes::FeatureMap::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PressureMeasurement::Attributes::MaxMeasuredValue::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt32uAttributeCallback::OnSubscriptionEstablished); + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -17016,7 +16384,7 @@ JNI_METHOD(void, OnOffCluster, subscribeFeatureMapAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OnOffCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, PressureMeasurementCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -17032,15 +16400,15 @@ JNI_METHOD(void, OnOffCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PressureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::OnOff::Attributes::ClusterRevision::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PressureMeasurement::Attributes::ClusterRevision::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -17053,21 +16421,21 @@ JNI_METHOD(void, OnOffCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, OnOffSwitchConfigurationCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +JNI_METHOD(jlong, PumpConfigurationAndControlCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - OnOffSwitchConfigurationCluster * cppCluster = new OnOffSwitchConfigurationCluster(); + PumpConfigurationAndControlCluster * cppCluster = new PumpConfigurationAndControlCluster(); cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); return reinterpret_cast(cppCluster); } -JNI_METHOD(void, OnOffSwitchConfigurationCluster, subscribeSwitchTypeAttribute) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxPressureAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -17078,20 +16446,21 @@ JNI_METHOD(void, OnOffSwitchConfigurationCluster, subscribeSwitchTypeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffSwitchConfigurationCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::OnOffSwitchConfiguration::Attributes::SwitchType::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxPressure::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -17099,59 +16468,49 @@ JNI_METHOD(void, OnOffSwitchConfigurationCluster, subscribeSwitchTypeAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, OnOffSwitchConfigurationCluster, writeSwitchActionsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxSpeedAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::OnOffSwitchConfiguration::Attributes::SwitchActions::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffSwitchConfigurationCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxSpeed::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OnOffSwitchConfigurationCluster, subscribeSwitchActionsAttribute) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxFlowAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -17162,21 +16521,20 @@ JNI_METHOD(void, OnOffSwitchConfigurationCluster, subscribeSwitchActionsAttribut chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffSwitchConfigurationCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::OnOffSwitchConfiguration::Attributes::SwitchActions::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxFlow::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -17184,12 +16542,12 @@ JNI_METHOD(void, OnOffSwitchConfigurationCluster, subscribeSwitchActionsAttribut onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OnOffSwitchConfigurationCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMinConstPressureAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -17200,21 +16558,21 @@ JNI_METHOD(void, OnOffSwitchConfigurationCluster, subscribeClusterRevisionAttrib chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffSwitchConfigurationCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::OnOffSwitchConfiguration::Attributes::ClusterRevision::TypeInfo; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinConstPressure::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( + chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -17222,470 +16580,354 @@ JNI_METHOD(void, OnOffSwitchConfigurationCluster, subscribeClusterRevisionAttrib onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, OperationalCredentialsCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxConstPressureAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - OperationalCredentialsCluster * cppCluster = new OperationalCredentialsCluster(); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); -JNI_METHOD(void, OperationalCredentialsCluster, addNOC) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray NOCValue, jobject ICACValue, jbyteArray IPKValue, - jobject caseAdminNode, jobject adminVendorId, jobject timedInvokeTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - OperationalCredentialsCluster * cppCluster; - - chip::app::Clusters::OperationalCredentials::Commands::AddNOC::Type request; - - request.NOCValue = chip::JniByteArray(env, static_cast(NOCValue)).byteSpan(); - chip::JniReferences::GetInstance().GetOptionalValue(ICACValue, ICACValue); - request.ICACValue = chip::Optional(chip::JniByteArray(env, static_cast(ICACValue)).byteSpan()); - request.IPKValue = chip::JniByteArray(env, static_cast(IPKValue)).byteSpan(); - request.caseAdminNode = - static_cast(chip::JniReferences::GetInstance().LongToPrimitive(caseAdminNode)); - request.adminVendorId = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(adminVendorId)); - - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxConstPressure::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OperationalCredentialsCluster, addTrustedRootCertificate) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray rootCertificate, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMinCompPressureAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - OperationalCredentialsCluster * cppCluster; - - chip::app::Clusters::OperationalCredentials::Commands::AddTrustedRootCertificate::Type request; - - request.rootCertificate = chip::JniByteArray(env, static_cast(rootCertificate)).byteSpan(); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinCompPressure::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OperationalCredentialsCluster, attestationRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray attestationNonce, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxCompPressureAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - OperationalCredentialsCluster * cppCluster; - - chip::app::Clusters::OperationalCredentials::Commands::AttestationRequest::Type request; - - request.attestationNonce = chip::JniByteArray(env, static_cast(attestationNonce)).byteSpan(); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxCompPressure::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OperationalCredentialsCluster, certificateChainRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject certificateType, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMinConstSpeedAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - OperationalCredentialsCluster * cppCluster; - - chip::app::Clusters::OperationalCredentials::Commands::CertificateChainRequest::Type request; - - request.certificateType = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(certificateType)); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinConstSpeed::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( + chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OperationalCredentialsCluster, opCSRRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray CSRNonce, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxConstSpeedAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - OperationalCredentialsCluster * cppCluster; - - chip::app::Clusters::OperationalCredentials::Commands::OpCSRRequest::Type request; - - request.CSRNonce = chip::JniByteArray(env, static_cast(CSRNonce)).byteSpan(); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxConstSpeed::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OperationalCredentialsCluster, removeFabric) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject fabricIndex, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMinConstFlowAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - OperationalCredentialsCluster * cppCluster; - - chip::app::Clusters::OperationalCredentials::Commands::RemoveFabric::Type request; - - request.fabricIndex = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(fabricIndex)); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinConstFlow::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OperationalCredentialsCluster, removeTrustedRootCertificate) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray trustedRootIdentifier, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxConstFlowAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - OperationalCredentialsCluster * cppCluster; - - chip::app::Clusters::OperationalCredentials::Commands::RemoveTrustedRootCertificate::Type request; - - request.trustedRootIdentifier = chip::JniByteArray(env, static_cast(trustedRootIdentifier)).byteSpan(); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxConstFlow::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OperationalCredentialsCluster, updateFabricLabel) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring label, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMinConstTempAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - OperationalCredentialsCluster * cppCluster; - - chip::app::Clusters::OperationalCredentials::Commands::UpdateFabricLabel::Type request; - - request.label = chip::JniUtfString(env, static_cast(label)).charSpan(); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinConstTemp::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OperationalCredentialsCluster, updateNOC) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray NOCValue, jobject ICACValue, - jobject timedInvokeTimeoutMs) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxConstTempAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - OperationalCredentialsCluster * cppCluster; - - chip::app::Clusters::OperationalCredentials::Commands::UpdateNOC::Type request; - - request.NOCValue = chip::JniByteArray(env, static_cast(NOCValue)).byteSpan(); - chip::JniReferences::GetInstance().GetOptionalValue(ICACValue, ICACValue); - request.ICACValue = chip::Optional(chip::JniByteArray(env, static_cast(ICACValue)).byteSpan()); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxConstTemp::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OperationalCredentialsCluster, subscribeSupportedFabricsAttribute) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribePumpStatusAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -17696,21 +16938,21 @@ JNI_METHOD(void, OperationalCredentialsCluster, subscribeSupportedFabricsAttribu chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OperationalCredentialsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::OperationalCredentials::Attributes::SupportedFabrics::TypeInfo; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::PumpStatus::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( + chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -17718,7 +16960,7 @@ JNI_METHOD(void, OperationalCredentialsCluster, subscribeSupportedFabricsAttribu onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OperationalCredentialsCluster, subscribeCommissionedFabricsAttribute) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeEffectiveOperationModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -17734,15 +16976,15 @@ JNI_METHOD(void, OperationalCredentialsCluster, subscribeCommissionedFabricsAttr chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OperationalCredentialsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::OperationalCredentials::Attributes::CommissionedFabrics::TypeInfo; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::EffectiveOperationMode::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( + chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); @@ -17756,53 +16998,12 @@ JNI_METHOD(void, OperationalCredentialsCluster, subscribeCommissionedFabricsAttr onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OperationalCredentialsCluster, subscribeCurrentFabricIndexAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - OperationalCredentialsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::OperationalCredentials::Attributes::CurrentFabricIndex::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute( - onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), - static_cast(maxInterval), - CHIPOperationalCredentialsCurrentFabricIndexAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, OperationalCredentialsCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeEffectiveControlModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -17813,21 +17014,21 @@ JNI_METHOD(void, OperationalCredentialsCluster, subscribeClusterRevisionAttribut chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OperationalCredentialsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::OperationalCredentials::Attributes::ClusterRevision::TypeInfo; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::EffectiveControlMode::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( + chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -17835,21 +17036,12 @@ JNI_METHOD(void, OperationalCredentialsCluster, subscribeClusterRevisionAttribut onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, PowerSourceCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - PowerSourceCluster * cppCluster = new PowerSourceCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, PowerSourceCluster, subscribeStatusAttribute) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeCapacityAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -17860,20 +17052,20 @@ JNI_METHOD(void, PowerSourceCluster, subscribeStatusAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PowerSource::Attributes::Status::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::Capacity::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -17881,12 +17073,12 @@ JNI_METHOD(void, PowerSourceCluster, subscribeStatusAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PowerSourceCluster, subscribeOrderAttribute) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeSpeedAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -17897,20 +17089,20 @@ JNI_METHOD(void, PowerSourceCluster, subscribeOrderAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PowerSource::Attributes::Order::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::Speed::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -17918,12 +17110,14 @@ JNI_METHOD(void, PowerSourceCluster, subscribeOrderAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PowerSourceCluster, subscribeDescriptionAttribute) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeLifetimeRunningHoursAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -17934,20 +17128,22 @@ JNI_METHOD(void, PowerSourceCluster, subscribeDescriptionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PowerSource::Attributes::Description::TypeInfo; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::LifetimeRunningHours::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPCharStringAttributeCallback::OnSubscriptionEstablished); + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), + CHIPPumpConfigurationAndControlLifetimeRunningHoursAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -17955,7 +17151,7 @@ JNI_METHOD(void, PowerSourceCluster, subscribeDescriptionAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PowerSourceCluster, subscribeBatteryVoltageAttribute) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribePowerAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -17971,15 +17167,15 @@ JNI_METHOD(void, PowerSourceCluster, subscribeBatteryVoltageAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PowerSource::Attributes::BatteryVoltage::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::Power::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -17992,12 +17188,14 @@ JNI_METHOD(void, PowerSourceCluster, subscribeBatteryVoltageAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PowerSourceCluster, subscribeBatteryPercentRemainingAttribute) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeLifetimeEnergyConsumedAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -18008,20 +17206,22 @@ JNI_METHOD(void, PowerSourceCluster, subscribeBatteryPercentRemainingAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PowerSource::Attributes::BatteryPercentRemaining::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::LifetimeEnergyConsumed::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), + CHIPPumpConfigurationAndControlLifetimeEnergyConsumedAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -18029,12 +17229,12 @@ JNI_METHOD(void, PowerSourceCluster, subscribeBatteryPercentRemainingAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PowerSourceCluster, subscribeBatteryTimeRemainingAttribute) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeOperationModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -18045,20 +17245,21 @@ JNI_METHOD(void, PowerSourceCluster, subscribeBatteryTimeRemainingAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PowerSource::Attributes::BatteryTimeRemaining::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::OperationMode::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt32uAttributeCallback::OnSubscriptionEstablished); + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -18066,7 +17267,7 @@ JNI_METHOD(void, PowerSourceCluster, subscribeBatteryTimeRemainingAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PowerSourceCluster, subscribeBatteryChargeLevelAttribute) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeControlModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -18082,15 +17283,16 @@ JNI_METHOD(void, PowerSourceCluster, subscribeBatteryChargeLevelAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PowerSource::Attributes::BatteryChargeLevel::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::ControlMode::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -18103,12 +17305,12 @@ JNI_METHOD(void, PowerSourceCluster, subscribeBatteryChargeLevelAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PowerSourceCluster, subscribeBatteryChargeStateAttribute) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeAlarmMaskAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -18119,20 +17321,20 @@ JNI_METHOD(void, PowerSourceCluster, subscribeBatteryChargeStateAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PowerSource::Attributes::BatteryChargeState::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::AlarmMask::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -18140,7 +17342,7 @@ JNI_METHOD(void, PowerSourceCluster, subscribeBatteryChargeStateAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PowerSourceCluster, subscribeFeatureMapAttribute) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeFeatureMapAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -18156,15 +17358,16 @@ JNI_METHOD(void, PowerSourceCluster, subscribeFeatureMapAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PowerSource::Attributes::FeatureMap::TypeInfo; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::FeatureMap::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -18177,7 +17380,7 @@ JNI_METHOD(void, PowerSourceCluster, subscribeFeatureMapAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PowerSourceCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -18193,15 +17396,16 @@ JNI_METHOD(void, PowerSourceCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PowerSource::Attributes::ClusterRevision::TypeInfo; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::ClusterRevision::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -18214,16 +17418,16 @@ JNI_METHOD(void, PowerSourceCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, PowerSourceConfigurationCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +JNI_METHOD(jlong, RelativeHumidityMeasurementCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - PowerSourceConfigurationCluster * cppCluster = new PowerSourceConfigurationCluster(); + RelativeHumidityMeasurementCluster * cppCluster = new RelativeHumidityMeasurementCluster(); cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); return reinterpret_cast(cppCluster); } -JNI_METHOD(void, PowerSourceConfigurationCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, RelativeHumidityMeasurementCluster, subscribeMeasuredValueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -18239,15 +17443,15 @@ JNI_METHOD(void, PowerSourceConfigurationCluster, subscribeClusterRevisionAttrib chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PowerSourceConfigurationCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + RelativeHumidityMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PowerSourceConfiguration::Attributes::ClusterRevision::TypeInfo; + using TypeInfo = chip::app::Clusters::RelativeHumidityMeasurement::Attributes::MeasuredValue::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( + chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); @@ -18261,21 +17465,12 @@ JNI_METHOD(void, PowerSourceConfigurationCluster, subscribeClusterRevisionAttrib onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, PressureMeasurementCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - PressureMeasurementCluster * cppCluster = new PressureMeasurementCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, PressureMeasurementCluster, subscribeMeasuredValueAttribute) +JNI_METHOD(void, RelativeHumidityMeasurementCluster, subscribeMinMeasuredValueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -18286,20 +17481,21 @@ JNI_METHOD(void, PressureMeasurementCluster, subscribeMeasuredValueAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PressureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + RelativeHumidityMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PressureMeasurement::Attributes::MeasuredValue::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::RelativeHumidityMeasurement::Attributes::MinMeasuredValue::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -18307,12 +17503,12 @@ JNI_METHOD(void, PressureMeasurementCluster, subscribeMeasuredValueAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PressureMeasurementCluster, subscribeMinMeasuredValueAttribute) +JNI_METHOD(void, RelativeHumidityMeasurementCluster, subscribeMaxMeasuredValueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -18323,20 +17519,21 @@ JNI_METHOD(void, PressureMeasurementCluster, subscribeMinMeasuredValueAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PressureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + RelativeHumidityMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PressureMeasurement::Attributes::MinMeasuredValue::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -18344,12 +17541,12 @@ JNI_METHOD(void, PressureMeasurementCluster, subscribeMinMeasuredValueAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PressureMeasurementCluster, subscribeMaxMeasuredValueAttribute) +JNI_METHOD(void, RelativeHumidityMeasurementCluster, subscribeToleranceAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -18360,20 +17557,20 @@ JNI_METHOD(void, PressureMeasurementCluster, subscribeMaxMeasuredValueAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PressureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + RelativeHumidityMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PressureMeasurement::Attributes::MaxMeasuredValue::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( + using TypeInfo = chip::app::Clusters::RelativeHumidityMeasurement::Attributes::Tolerance::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -18381,7 +17578,7 @@ JNI_METHOD(void, PressureMeasurementCluster, subscribeMaxMeasuredValueAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PressureMeasurementCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, RelativeHumidityMeasurementCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -18397,15 +17594,16 @@ JNI_METHOD(void, PressureMeasurementCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PressureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + RelativeHumidityMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PressureMeasurement::Attributes::ClusterRevision::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::RelativeHumidityMeasurement::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -18418,247 +17616,367 @@ JNI_METHOD(void, PressureMeasurementCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, PumpConfigurationAndControlCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +JNI_METHOD(jlong, ScenesCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - PumpConfigurationAndControlCluster * cppCluster = new PumpConfigurationAndControlCluster(); + ScenesCluster * cppCluster = new ScenesCluster(); cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); return reinterpret_cast(cppCluster); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxPressureAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, ScenesCluster, addScene) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jobject sceneId, jobject transitionTime, + jstring sceneName, jobject clusterId, jobject length, jobject value, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + ScenesCluster * cppCluster; + + chip::app::Clusters::Scenes::Commands::AddScene::Type request; + + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + request.sceneId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(sceneId)); + request.transitionTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); + request.sceneName = chip::JniUtfString(env, static_cast(sceneName)).charSpan(); + request.extensionFieldSets = + chip::app::DataModel::List(); + std::unique_ptr onSuccess( + Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxPressure::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxSpeedAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, ScenesCluster, getSceneMembership) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + ScenesCluster * cppCluster; + chip::app::Clusters::Scenes::Commands::GetSceneMembership::Type request; + + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxSpeed::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxFlowAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, ScenesCluster, recallScene) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jobject sceneId, jobject transitionTime, + jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + ScenesCluster * cppCluster; + + chip::app::Clusters::Scenes::Commands::RecallScene::Type request; + + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + request.sceneId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(sceneId)); + request.transitionTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxFlow::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMinConstPressureAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, ScenesCluster, removeAllScenes) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + ScenesCluster * cppCluster; + + chip::app::Clusters::Scenes::Commands::RemoveAllScenes::Type request; + + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinConstPressure::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxConstPressureAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, ScenesCluster, removeScene) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jobject sceneId, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + ScenesCluster * cppCluster; + + chip::app::Clusters::Scenes::Commands::RemoveScene::Type request; + + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + request.sceneId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(sceneId)); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxConstPressure::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMinCompPressureAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, ScenesCluster, storeScene) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jobject sceneId, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + CHIP_ERROR err = CHIP_NO_ERROR; + ScenesCluster * cppCluster; + + chip::app::Clusters::Scenes::Commands::StoreScene::Type request; + + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + request.sceneId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(sceneId)); + + std::unique_ptr onSuccess( + Platform::New(callback), + Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, ScenesCluster, viewScene) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jobject sceneId, jobject timedInvokeTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + ScenesCluster * cppCluster; + + chip::app::Clusters::Scenes::Commands::ViewScene::Type request; + + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + request.sceneId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(sceneId)); + std::unique_ptr onSuccess( + Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinCompPressure::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxCompPressureAttribute) +JNI_METHOD(void, ScenesCluster, subscribeSceneCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -18669,21 +17987,20 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxCompPressureAtt chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ScenesCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxCompPressure::TypeInfo; + using TypeInfo = chip::app::Clusters::Scenes::Attributes::SceneCount::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -18691,12 +18008,12 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxCompPressureAtt onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMinConstSpeedAttribute) +JNI_METHOD(void, ScenesCluster, subscribeCurrentSceneAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -18707,21 +18024,20 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMinConstSpeedAttri chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ScenesCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinConstSpeed::TypeInfo; + using TypeInfo = chip::app::Clusters::Scenes::Attributes::CurrentScene::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -18729,7 +18045,7 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMinConstSpeedAttri onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxConstSpeedAttribute) +JNI_METHOD(void, ScenesCluster, subscribeCurrentGroupAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -18745,16 +18061,15 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxConstSpeedAttri chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ScenesCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxConstSpeed::TypeInfo; + using TypeInfo = chip::app::Clusters::Scenes::Attributes::CurrentGroup::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -18767,12 +18082,12 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxConstSpeedAttri onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMinConstFlowAttribute) +JNI_METHOD(void, ScenesCluster, subscribeSceneValidAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -18783,21 +18098,20 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMinConstFlowAttrib chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ScenesCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinConstFlow::TypeInfo; + using TypeInfo = chip::app::Clusters::Scenes::Attributes::SceneValid::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + CHIPBooleanAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -18805,12 +18119,12 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMinConstFlowAttrib onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxConstFlowAttribute) +JNI_METHOD(void, ScenesCluster, subscribeNameSupportAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -18821,21 +18135,20 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxConstFlowAttrib chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ScenesCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxConstFlow::TypeInfo; + using TypeInfo = chip::app::Clusters::Scenes::Attributes::NameSupport::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -18843,12 +18156,12 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxConstFlowAttrib onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMinConstTempAttribute) +JNI_METHOD(void, ScenesCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -18859,21 +18172,20 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMinConstTempAttrib chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ScenesCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinConstTemp::TypeInfo; + using TypeInfo = chip::app::Clusters::Scenes::Attributes::ClusterRevision::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -18881,50 +18193,65 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMinConstTempAttrib onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxConstTempAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(jlong, SoftwareDiagnosticsCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + SoftwareDiagnosticsCluster * cppCluster = new SoftwareDiagnosticsCluster(); + + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} + +JNI_METHOD(void, SoftwareDiagnosticsCluster, resetWatermarks) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + SoftwareDiagnosticsCluster * cppCluster; + + chip::app::Clusters::SoftwareDiagnostics::Commands::ResetWatermarks::Type request; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxConstTemp::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribePumpStatusAttribute) +JNI_METHOD(void, SoftwareDiagnosticsCluster, subscribeCurrentHeapFreeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -18935,21 +18262,20 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribePumpStatusAttribut chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + SoftwareDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::PumpStatus::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::SoftwareDiagnostics::Attributes::CurrentHeapFree::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -18957,12 +18283,12 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribePumpStatusAttribut onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeEffectiveOperationModeAttribute) +JNI_METHOD(void, SoftwareDiagnosticsCluster, subscribeCurrentHeapUsedAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -18973,21 +18299,20 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeEffectiveOperation chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + SoftwareDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::EffectiveOperationMode::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::SoftwareDiagnostics::Attributes::CurrentHeapUsed::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -18995,12 +18320,12 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeEffectiveOperation onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeEffectiveControlModeAttribute) +JNI_METHOD(void, SoftwareDiagnosticsCluster, subscribeCurrentHeapHighWatermarkAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -19011,21 +18336,21 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeEffectiveControlMo chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + SoftwareDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::EffectiveControlMode::TypeInfo; + using TypeInfo = chip::app::Clusters::SoftwareDiagnostics::Attributes::CurrentHeapHighWatermark::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( + chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -19033,12 +18358,12 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeEffectiveControlMo onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeCapacityAttribute) +JNI_METHOD(void, SoftwareDiagnosticsCluster, subscribeFeatureMapAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -19049,20 +18374,20 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeCapacityAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + SoftwareDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::Capacity::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( + using TypeInfo = chip::app::Clusters::SoftwareDiagnostics::Attributes::FeatureMap::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -19070,7 +18395,7 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeCapacityAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeSpeedAttribute) +JNI_METHOD(void, SoftwareDiagnosticsCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -19086,14 +18411,14 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeSpeedAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + SoftwareDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::Speed::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( + using TypeInfo = chip::app::Clusters::SoftwareDiagnostics::Attributes::ClusterRevision::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); @@ -19107,66 +18432,58 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeSpeedAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PumpConfigurationAndControlCluster, writeLifetimeRunningHoursAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(jlong, SwitchCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::LifetimeRunningHours::TypeInfo; - TypeInfo::Type cppValue; + SwitchCluster * cppCluster = new SwitchCluster(); - uint32_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); +JNI_METHOD(void, SwitchCluster, subscribeNumberOfPositionsAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + SwitchCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::Switch::Attributes::NumberOfPositions::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeLifetimeRunningHoursAttribute) +JNI_METHOD(void, SwitchCluster, subscribeCurrentPositionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -19177,22 +18494,20 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeLifetimeRunningHou chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + SwitchCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::LifetimeRunningHours::TypeInfo; + using TypeInfo = chip::app::Clusters::Switch::Attributes::CurrentPosition::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute( - onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), - static_cast(maxInterval), - CHIPPumpConfigurationAndControlLifetimeRunningHoursAttributeCallback::OnSubscriptionEstablished); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -19200,13 +18515,13 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeLifetimeRunningHou onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribePowerAttribute) +JNI_METHOD(void, SwitchCluster, subscribeMultiPressMaxAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -19216,20 +18531,20 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribePowerAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + SwitchCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::Power::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::Switch::Attributes::MultiPressMax::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt32uAttributeCallback::OnSubscriptionEstablished); + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -19237,66 +18552,49 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribePowerAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PumpConfigurationAndControlCluster, writeLifetimeEnergyConsumedAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, SwitchCluster, subscribeFeatureMapAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::LifetimeEnergyConsumed::TypeInfo; - TypeInfo::Type cppValue; - - uint32_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + SwitchCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::Switch::Attributes::FeatureMap::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeLifetimeEnergyConsumedAttribute) +JNI_METHOD(void, SwitchCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -19307,22 +18605,20 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeLifetimeEnergyCons chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + SwitchCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::LifetimeEnergyConsumed::TypeInfo; + using TypeInfo = chip::app::Clusters::Switch::Attributes::ClusterRevision::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute( - onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), - static_cast(maxInterval), - CHIPPumpConfigurationAndControlLifetimeEnergyConsumedAttributeCallback::OnSubscriptionEstablished); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -19330,54 +18626,66 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeLifetimeEnergyCons onSuccess.release(); onFailure.release(); } +JNI_METHOD(jlong, TargetNavigatorCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + TargetNavigatorCluster * cppCluster = new TargetNavigatorCluster(); + + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} -JNI_METHOD(void, PumpConfigurationAndControlCluster, writeOperationModeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, TargetNavigatorCluster, navigateTargetRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject target, jstring data, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::OperationMode::TypeInfo; - TypeInfo::Type cppValue; + CHIP_ERROR err = CHIP_NO_ERROR; + TargetNavigatorCluster * cppCluster; - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + chip::app::Clusters::TargetNavigator::Commands::NavigateTargetRequest::Type request; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + request.target = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(target)); + request.data = chip::JniUtfString(env, static_cast(data)).charSpan(); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) + if (timedInvokeTimeoutMs == nullptr) { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); } else { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeOperationModeAttribute) +JNI_METHOD(void, TargetNavigatorCluster, subscribeCurrentNavigatorTargetAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -19393,15 +18701,15 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeOperationModeAttri chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TargetNavigatorCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::OperationMode::TypeInfo; + using TypeInfo = chip::app::Clusters::TargetNavigator::Attributes::CurrentNavigatorTarget::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( + chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); @@ -19415,59 +18723,58 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeOperationModeAttri onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PumpConfigurationAndControlCluster, writeControlModeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, TargetNavigatorCluster, subscribeClusterRevisionAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::ControlMode::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TargetNavigatorCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TargetNavigator::Attributes::ClusterRevision::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeControlModeAttribute) +JNI_METHOD(jlong, TemperatureMeasurementCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + TemperatureMeasurementCluster * cppCluster = new TemperatureMeasurementCluster(); + + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} + +JNI_METHOD(void, TemperatureMeasurementCluster, subscribeMeasuredValueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -19478,21 +18785,20 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeControlModeAttribu chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TemperatureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::ControlMode::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TemperatureMeasurement::Attributes::MeasuredValue::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -19500,12 +18806,12 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeControlModeAttribu onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeAlarmMaskAttribute) +JNI_METHOD(void, TemperatureMeasurementCluster, subscribeMinMeasuredValueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -19516,20 +18822,21 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeAlarmMaskAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TemperatureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::AlarmMask::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TemperatureMeasurement::Attributes::MinMeasuredValue::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -19537,12 +18844,12 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeAlarmMaskAttribute onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeFeatureMapAttribute) +JNI_METHOD(void, TemperatureMeasurementCluster, subscribeMaxMeasuredValueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -19553,21 +18860,21 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeFeatureMapAttribut chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TemperatureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::FeatureMap::TypeInfo; + using TypeInfo = chip::app::Clusters::TemperatureMeasurement::Attributes::MaxMeasuredValue::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( + chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt32uAttributeCallback::OnSubscriptionEstablished); + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -19575,7 +18882,7 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeFeatureMapAttribut onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, TemperatureMeasurementCluster, subscribeToleranceAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -19591,16 +18898,15 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeClusterRevisionAtt chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TemperatureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::ClusterRevision::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TemperatureMeasurement::Attributes::Tolerance::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -19613,16 +18919,7 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeClusterRevisionAtt onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, RelativeHumidityMeasurementCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - RelativeHumidityMeasurementCluster * cppCluster = new RelativeHumidityMeasurementCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, RelativeHumidityMeasurementCluster, subscribeMeasuredValueAttribute) +JNI_METHOD(void, TemperatureMeasurementCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -19638,15 +18935,15 @@ JNI_METHOD(void, RelativeHumidityMeasurementCluster, subscribeMeasuredValueAttri chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - RelativeHumidityMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TemperatureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::RelativeHumidityMeasurement::Attributes::MeasuredValue::TypeInfo; + using TypeInfo = chip::app::Clusters::TemperatureMeasurement::Attributes::ClusterRevision::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( + chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); @@ -19660,187 +18957,31 @@ JNI_METHOD(void, RelativeHumidityMeasurementCluster, subscribeMeasuredValueAttri onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, RelativeHumidityMeasurementCluster, subscribeMinMeasuredValueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - RelativeHumidityMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::RelativeHumidityMeasurement::Attributes::MinMeasuredValue::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, RelativeHumidityMeasurementCluster, subscribeMaxMeasuredValueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - RelativeHumidityMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, RelativeHumidityMeasurementCluster, subscribeToleranceAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - RelativeHumidityMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::RelativeHumidityMeasurement::Attributes::Tolerance::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, RelativeHumidityMeasurementCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - RelativeHumidityMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::RelativeHumidityMeasurement::Attributes::ClusterRevision::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(jlong, ScenesCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +JNI_METHOD(jlong, TestClusterCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - ScenesCluster * cppCluster = new ScenesCluster(); + TestClusterCluster * cppCluster = new TestClusterCluster(); cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); return reinterpret_cast(cppCluster); } -JNI_METHOD(void, ScenesCluster, addScene) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jobject sceneId, jobject transitionTime, - jstring sceneName, jobject clusterId, jobject length, jobject value, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, TestClusterCluster, simpleStructEchoRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject a, jobject b, jobject c, jbyteArray d, jstring e, + jobject f, jobject g, jobject h, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - ScenesCluster * cppCluster; + TestClusterCluster * cppCluster; - chip::app::Clusters::Scenes::Commands::AddScene::Type request; + chip::app::Clusters::TestCluster::Commands::SimpleStructEchoRequest::Type request; - request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); - request.sceneId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(sceneId)); - request.transitionTime = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); - request.sceneName = chip::JniUtfString(env, static_cast(sceneName)).charSpan(); - request.extensionFieldSets = - chip::app::DataModel::List(); + request.arg1 = chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type(); - std::unique_ptr onSuccess( - Platform::New(callback), - Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -19850,12 +18991,13 @@ JNI_METHOD(void, ScenesCluster, addScene) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); if (timedInvokeTimeoutMs == nullptr) @@ -19874,21 +19016,17 @@ JNI_METHOD(void, ScenesCluster, addScene) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ScenesCluster, getSceneMembership) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, TestClusterCluster, test) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - ScenesCluster * cppCluster; - - chip::app::Clusters::Scenes::Commands::GetSceneMembership::Type request; + TestClusterCluster * cppCluster; - request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + chip::app::Clusters::TestCluster::Commands::Test::Type request; - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -19898,13 +19036,12 @@ JNI_METHOD(void, ScenesCluster, getSceneMembership) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); if (timedInvokeTimeoutMs == nullptr) @@ -19923,23 +19060,22 @@ JNI_METHOD(void, ScenesCluster, getSceneMembership) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ScenesCluster, recallScene) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jobject sceneId, jobject transitionTime, - jobject timedInvokeTimeoutMs) +JNI_METHOD(void, TestClusterCluster, testAddArguments) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject arg1, jobject arg2, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - ScenesCluster * cppCluster; + TestClusterCluster * cppCluster; - chip::app::Clusters::Scenes::Commands::RecallScene::Type request; + chip::app::Clusters::TestCluster::Commands::TestAddArguments::Type request; - request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); - request.sceneId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(sceneId)); - request.transitionTime = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); + request.arg1 = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(arg1)); + request.arg2 = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(arg2)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -19949,12 +19085,13 @@ JNI_METHOD(void, ScenesCluster, recallScene) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); if (timedInvokeTimeoutMs == nullptr) @@ -19973,20 +19110,24 @@ JNI_METHOD(void, ScenesCluster, recallScene) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ScenesCluster, removeAllScenes) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, TestClusterCluster, testEmitTestEventRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject arg1, jobject arg2, jobject arg3, + jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - ScenesCluster * cppCluster; + TestClusterCluster * cppCluster; - chip::app::Clusters::Scenes::Commands::RemoveAllScenes::Type request; + chip::app::Clusters::TestCluster::Commands::TestEmitTestEventRequest::Type request; - request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + request.arg1 = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(arg1)); + request.arg2 = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(arg2)); + request.arg3 = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(arg3)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -19996,13 +19137,13 @@ JNI_METHOD(void, ScenesCluster, removeAllScenes) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); if (timedInvokeTimeoutMs == nullptr) @@ -20021,21 +19162,21 @@ JNI_METHOD(void, ScenesCluster, removeAllScenes) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ScenesCluster, removeScene) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jobject sceneId, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, TestClusterCluster, testEnumsRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject arg1, jobject arg2, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - ScenesCluster * cppCluster; + TestClusterCluster * cppCluster; - chip::app::Clusters::Scenes::Commands::RemoveScene::Type request; + chip::app::Clusters::TestCluster::Commands::TestEnumsRequest::Type request; - request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); - request.sceneId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(sceneId)); + request.arg1 = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(arg1)); + request.arg2 = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(arg2)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -20045,13 +19186,13 @@ JNI_METHOD(void, ScenesCluster, removeScene) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); if (timedInvokeTimeoutMs == nullptr) @@ -20070,21 +19211,20 @@ JNI_METHOD(void, ScenesCluster, removeScene) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ScenesCluster, storeScene) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jobject sceneId, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, TestClusterCluster, testListInt8UArgumentRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject arg1, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - ScenesCluster * cppCluster; + TestClusterCluster * cppCluster; - chip::app::Clusters::Scenes::Commands::StoreScene::Type request; + chip::app::Clusters::TestCluster::Commands::TestListInt8UArgumentRequest::Type request; - request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); - request.sceneId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(sceneId)); + request.arg1 = chip::app::DataModel::List(); - std::unique_ptr onSuccess( - Platform::New(callback), - Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -20094,12 +19234,13 @@ JNI_METHOD(void, ScenesCluster, storeScene) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); if (timedInvokeTimeoutMs == nullptr) @@ -20118,21 +19259,21 @@ JNI_METHOD(void, ScenesCluster, storeScene) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ScenesCluster, viewScene) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jobject sceneId, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, TestClusterCluster, testListInt8UReverseRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject arg1, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - ScenesCluster * cppCluster; + TestClusterCluster * cppCluster; - chip::app::Clusters::Scenes::Commands::ViewScene::Type request; + chip::app::Clusters::TestCluster::Commands::TestListInt8UReverseRequest::Type request; - request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); - request.sceneId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(sceneId)); + request.arg1 = chip::app::DataModel::List(); - std::unique_ptr onSuccess( - Platform::New(callback), - Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -20142,12 +19283,13 @@ JNI_METHOD(void, ScenesCluster, viewScene) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); if (timedInvokeTimeoutMs == nullptr) @@ -20166,245 +19308,313 @@ JNI_METHOD(void, ScenesCluster, viewScene) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ScenesCluster, subscribeSceneCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, TestClusterCluster, testListNestedStructListArgumentRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject a, jobject b, jobject c, jobject d, jobject e, + jbyteArray f, jobject g, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster; + + chip::app::Clusters::TestCluster::Commands::TestListNestedStructListArgumentRequest::Type request; + + request.arg1 = chip::app::DataModel::List(); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ScenesCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::Scenes::Attributes::SceneCount::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ScenesCluster, subscribeCurrentSceneAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, TestClusterCluster, testListStructArgumentRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject a, jobject b, jobject c, jbyteArray d, jstring e, + jobject f, jobject g, jobject h, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster; + + chip::app::Clusters::TestCluster::Commands::TestListStructArgumentRequest::Type request; + + request.arg1 = chip::app::DataModel::List(); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ScenesCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::Scenes::Attributes::CurrentScene::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ScenesCluster, subscribeCurrentGroupAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, TestClusterCluster, testNestedStructArgumentRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject a, jobject b, jobject c, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster; + chip::app::Clusters::TestCluster::Commands::TestNestedStructArgumentRequest::Type request; + + request.arg1 = chip::app::Clusters::TestCluster::Structs::NestedStruct::Type(); + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ScenesCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::Scenes::Attributes::CurrentGroup::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ScenesCluster, subscribeSceneValidAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, TestClusterCluster, testNestedStructListArgumentRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject a, jobject b, jobject c, jobject d, jobject e, + jbyteArray f, jobject g, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster; + + chip::app::Clusters::TestCluster::Commands::TestNestedStructListArgumentRequest::Type request; + request.arg1 = chip::app::Clusters::TestCluster::Structs::NestedStructList::Type(); + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ScenesCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::Scenes::Attributes::SceneValid::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPBooleanAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ScenesCluster, subscribeNameSupportAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, TestClusterCluster, testNotHandled) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster; + + chip::app::Clusters::TestCluster::Commands::TestNotHandled::Type request; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ScenesCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::Scenes::Attributes::NameSupport::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ScenesCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, TestClusterCluster, testNullableOptionalRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject arg1, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster; + + chip::app::Clusters::TestCluster::Commands::TestNullableOptionalRequest::Type request; + + chip::JniReferences::GetInstance().GetOptionalValue(arg1, arg1); + uint8_t arg1Value; + if (arg1 != nullptr) + { + arg1Value = chip::JniReferences::GetInstance().IntegerToPrimitive(arg1); + } + request.arg1 = chip::Optional>( + arg1 == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(arg1Value)); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ScenesCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::Scenes::Attributes::ClusterRevision::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, SoftwareDiagnosticsCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - SoftwareDiagnosticsCluster * cppCluster = new SoftwareDiagnosticsCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, SoftwareDiagnosticsCluster, resetWatermarks) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, TestClusterCluster, testSimpleOptionalArgumentRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject arg1, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - SoftwareDiagnosticsCluster * cppCluster; + TestClusterCluster * cppCluster; - chip::app::Clusters::SoftwareDiagnostics::Commands::ResetWatermarks::Type request; + chip::app::Clusters::TestCluster::Commands::TestSimpleOptionalArgumentRequest::Type request; + + chip::JniReferences::GetInstance().GetOptionalValue(arg1, arg1); + request.arg1 = + chip::Optional(static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(arg1))); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -20417,7 +19627,7 @@ JNI_METHOD(void, SoftwareDiagnosticsCluster, resetWatermarks) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -20441,86 +19651,189 @@ JNI_METHOD(void, SoftwareDiagnosticsCluster, resetWatermarks) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, SoftwareDiagnosticsCluster, subscribeCurrentHeapFreeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, TestClusterCluster, testSpecific) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster; + chip::app::Clusters::TestCluster::Commands::TestSpecific::Type request; + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - SoftwareDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::SoftwareDiagnostics::Attributes::CurrentHeapFree::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt64uAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, SoftwareDiagnosticsCluster, subscribeCurrentHeapUsedAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, TestClusterCluster, testStructArgumentRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject a, jobject b, jobject c, jbyteArray d, jstring e, + jobject f, jobject g, jobject h, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster; + + chip::app::Clusters::TestCluster::Commands::TestStructArgumentRequest::Type request; + + request.arg1 = chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type(); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - SoftwareDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::SoftwareDiagnostics::Attributes::CurrentHeapUsed::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt64uAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, SoftwareDiagnosticsCluster, subscribeCurrentHeapHighWatermarkAttribute) +JNI_METHOD(void, TestClusterCluster, testUnknownCommand) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster; + + chip::app::Clusters::TestCluster::Commands::TestUnknownCommand::Type request; + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, TestClusterCluster, timedInvokeRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster; + + chip::app::Clusters::TestCluster::Commands::TimedInvokeRequest::Type request; + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, TestClusterCluster, subscribeBooleanAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -20531,21 +19844,20 @@ JNI_METHOD(void, SoftwareDiagnosticsCluster, subscribeCurrentHeapHighWatermarkAt chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - SoftwareDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::SoftwareDiagnostics::Attributes::CurrentHeapHighWatermark::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Boolean::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt64uAttributeCallback::OnSubscriptionEstablished); + CHIPBooleanAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -20553,12 +19865,12 @@ JNI_METHOD(void, SoftwareDiagnosticsCluster, subscribeCurrentHeapHighWatermarkAt onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, SoftwareDiagnosticsCluster, subscribeFeatureMapAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeBitmap8Attribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -20569,20 +19881,20 @@ JNI_METHOD(void, SoftwareDiagnosticsCluster, subscribeFeatureMapAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - SoftwareDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::SoftwareDiagnostics::Attributes::FeatureMap::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap8::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt32uAttributeCallback::OnSubscriptionEstablished); + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -20590,7 +19902,7 @@ JNI_METHOD(void, SoftwareDiagnosticsCluster, subscribeFeatureMapAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, SoftwareDiagnosticsCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeBitmap16Attribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -20606,15 +19918,15 @@ JNI_METHOD(void, SoftwareDiagnosticsCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - SoftwareDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::SoftwareDiagnostics::Attributes::ClusterRevision::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap16::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -20627,21 +19939,49 @@ JNI_METHOD(void, SoftwareDiagnosticsCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, SwitchCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +JNI_METHOD(void, TestClusterCluster, subscribeBitmap32Attribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - SwitchCluster * cppCluster = new SwitchCluster(); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); -JNI_METHOD(void, SwitchCluster, subscribeNumberOfPositionsAttribute) + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap32::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, TestClusterCluster, subscribeBitmap64Attribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -20652,20 +19992,20 @@ JNI_METHOD(void, SwitchCluster, subscribeNumberOfPositionsAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - SwitchCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::Switch::Attributes::NumberOfPositions::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap64::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -20673,7 +20013,7 @@ JNI_METHOD(void, SwitchCluster, subscribeNumberOfPositionsAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, SwitchCluster, subscribeCurrentPositionAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeInt8uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -20689,15 +20029,15 @@ JNI_METHOD(void, SwitchCluster, subscribeCurrentPositionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - SwitchCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::Switch::Attributes::CurrentPosition::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int8u::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -20710,12 +20050,12 @@ JNI_METHOD(void, SwitchCluster, subscribeCurrentPositionAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, SwitchCluster, subscribeMultiPressMaxAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeInt16uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -20726,20 +20066,20 @@ JNI_METHOD(void, SwitchCluster, subscribeMultiPressMaxAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - SwitchCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::Switch::Attributes::MultiPressMax::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int16u::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -20747,7 +20087,7 @@ JNI_METHOD(void, SwitchCluster, subscribeMultiPressMaxAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, SwitchCluster, subscribeFeatureMapAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeInt24uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -20763,15 +20103,15 @@ JNI_METHOD(void, SwitchCluster, subscribeFeatureMapAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - SwitchCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::Switch::Attributes::FeatureMap::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int24u::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -20784,12 +20124,12 @@ JNI_METHOD(void, SwitchCluster, subscribeFeatureMapAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, SwitchCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeInt32uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -20800,20 +20140,20 @@ JNI_METHOD(void, SwitchCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - SwitchCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::Switch::Attributes::ClusterRevision::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int32u::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -20821,71 +20161,49 @@ JNI_METHOD(void, SwitchCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, TargetNavigatorCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +JNI_METHOD(void, TestClusterCluster, subscribeInt40uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - TargetNavigatorCluster * cppCluster = new TargetNavigatorCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, TargetNavigatorCluster, navigateTargetRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject target, jstring data, jobject timedInvokeTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - TargetNavigatorCluster * cppCluster; - - chip::app::Clusters::TargetNavigator::Commands::NavigateTargetRequest::Type request; - - request.target = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(target)); - request.data = chip::JniUtfString(env, static_cast(data)).charSpan(); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int40u::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TargetNavigatorCluster, subscribeCurrentNavigatorTargetAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeInt48uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -20896,21 +20214,20 @@ JNI_METHOD(void, TargetNavigatorCluster, subscribeCurrentNavigatorTargetAttribut chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TargetNavigatorCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::TargetNavigator::Attributes::CurrentNavigatorTarget::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int48u::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -20918,12 +20235,12 @@ JNI_METHOD(void, TargetNavigatorCluster, subscribeCurrentNavigatorTargetAttribut onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TargetNavigatorCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeInt56uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -20934,20 +20251,20 @@ JNI_METHOD(void, TargetNavigatorCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TargetNavigatorCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::TargetNavigator::Attributes::ClusterRevision::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int56u::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -20955,21 +20272,12 @@ JNI_METHOD(void, TargetNavigatorCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, TemperatureMeasurementCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - TemperatureMeasurementCluster * cppCluster = new TemperatureMeasurementCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, TemperatureMeasurementCluster, subscribeMeasuredValueAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeInt64uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -20980,20 +20288,20 @@ JNI_METHOD(void, TemperatureMeasurementCluster, subscribeMeasuredValueAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TemperatureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::TemperatureMeasurement::Attributes::MeasuredValue::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int64u::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -21001,12 +20309,12 @@ JNI_METHOD(void, TemperatureMeasurementCluster, subscribeMeasuredValueAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TemperatureMeasurementCluster, subscribeMinMeasuredValueAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeInt8sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -21017,21 +20325,20 @@ JNI_METHOD(void, TemperatureMeasurementCluster, subscribeMinMeasuredValueAttribu chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TemperatureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::TemperatureMeasurement::Attributes::MinMeasuredValue::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int8s::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + CHIPInt8sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -21039,7 +20346,7 @@ JNI_METHOD(void, TemperatureMeasurementCluster, subscribeMinMeasuredValueAttribu onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TemperatureMeasurementCluster, subscribeMaxMeasuredValueAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeInt16sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -21055,16 +20362,15 @@ JNI_METHOD(void, TemperatureMeasurementCluster, subscribeMaxMeasuredValueAttribu chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TemperatureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::TemperatureMeasurement::Attributes::MaxMeasuredValue::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int16s::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -21077,12 +20383,12 @@ JNI_METHOD(void, TemperatureMeasurementCluster, subscribeMaxMeasuredValueAttribu onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TemperatureMeasurementCluster, subscribeToleranceAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeInt24sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -21093,20 +20399,20 @@ JNI_METHOD(void, TemperatureMeasurementCluster, subscribeToleranceAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TemperatureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::TemperatureMeasurement::Attributes::Tolerance::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int24s::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + CHIPInt32sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -21114,12 +20420,12 @@ JNI_METHOD(void, TemperatureMeasurementCluster, subscribeToleranceAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TemperatureMeasurementCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeInt32sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -21130,21 +20436,20 @@ JNI_METHOD(void, TemperatureMeasurementCluster, subscribeClusterRevisionAttribut chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TemperatureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::TemperatureMeasurement::Attributes::ClusterRevision::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int32s::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + CHIPInt32sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -21152,895 +20457,685 @@ JNI_METHOD(void, TemperatureMeasurementCluster, subscribeClusterRevisionAttribut onSuccess.release(); onFailure.release(); } -JNI_METHOD(jlong, TestClusterCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - TestClusterCluster * cppCluster = new TestClusterCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, TestClusterCluster, simpleStructEchoRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject a, jobject b, jobject c, jbyteArray d, jstring e, - jobject f, jobject g, jobject h, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeInt40sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; - - chip::app::Clusters::TestCluster::Commands::SimpleStructEchoRequest::Type request; - - request.arg1 = chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type(); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int40s::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, test) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeInt48sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; - - chip::app::Clusters::TestCluster::Commands::Test::Type request; - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int48s::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, testAddArguments) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject arg1, jobject arg2, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeInt56sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; - - chip::app::Clusters::TestCluster::Commands::TestAddArguments::Type request; - - request.arg1 = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(arg1)); - request.arg2 = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(arg2)); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int56s::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, testEmitTestEventRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject arg1, jobject arg2, jobject arg3, - jobject timedInvokeTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeInt64sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; - - chip::app::Clusters::TestCluster::Commands::TestEmitTestEventRequest::Type request; - - request.arg1 = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(arg1)); - request.arg2 = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(arg2)); - request.arg3 = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(arg3)); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int64s::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, testEnumsRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject arg1, jobject arg2, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeEnum8Attribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; - - chip::app::Clusters::TestCluster::Commands::TestEnumsRequest::Type request; - - request.arg1 = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(arg1)); - request.arg2 = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(arg2)); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Enum8::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, testListInt8UArgumentRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject arg1, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeEnum16Attribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; - - chip::app::Clusters::TestCluster::Commands::TestListInt8UArgumentRequest::Type request; - - request.arg1 = chip::app::DataModel::List(); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Enum16::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, testListInt8UReverseRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject arg1, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeFloatSingleAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; - - chip::app::Clusters::TestCluster::Commands::TestListInt8UReverseRequest::Type request; - - request.arg1 = chip::app::DataModel::List(); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::FloatSingle::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPFloatAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, testListNestedStructListArgumentRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject a, jobject b, jobject c, jobject d, jobject e, - jbyteArray f, jobject g, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeFloatDoubleAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; - - chip::app::Clusters::TestCluster::Commands::TestListNestedStructListArgumentRequest::Type request; - - request.arg1 = chip::app::DataModel::List(); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::FloatDouble::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPDoubleAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, testListStructArgumentRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject a, jobject b, jobject c, jbyteArray d, jstring e, - jobject f, jobject g, jobject h, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeOctetStringAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; - - chip::app::Clusters::TestCluster::Commands::TestListStructArgumentRequest::Type request; - - request.arg1 = chip::app::DataModel::List(); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::OctetString::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPOctetStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, testNestedStructArgumentRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject a, jobject b, jobject c, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeLongOctetStringAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; - - chip::app::Clusters::TestCluster::Commands::TestNestedStructArgumentRequest::Type request; - - request.arg1 = chip::app::Clusters::TestCluster::Structs::NestedStruct::Type(); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::LongOctetString::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPOctetStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, testNestedStructListArgumentRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject a, jobject b, jobject c, jobject d, jobject e, - jbyteArray f, jobject g, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeCharStringAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; - - chip::app::Clusters::TestCluster::Commands::TestNestedStructListArgumentRequest::Type request; - - request.arg1 = chip::app::Clusters::TestCluster::Structs::NestedStructList::Type(); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::CharString::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPCharStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, testNotHandled) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeLongCharStringAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; - - chip::app::Clusters::TestCluster::Commands::TestNotHandled::Type request; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::LongCharString::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPCharStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, testNullableOptionalRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject arg1, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeEpochUsAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; - - chip::app::Clusters::TestCluster::Commands::TestNullableOptionalRequest::Type request; - - chip::JniReferences::GetInstance().GetOptionalValue(arg1, arg1); - uint8_t arg1Value; - if (arg1 != nullptr) - { - arg1Value = chip::JniReferences::GetInstance().IntegerToPrimitive(arg1); - } - request.arg1 = chip::Optional>( - arg1 == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(arg1Value)); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::EpochUs::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, testSimpleOptionalArgumentRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject arg1, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeEpochSAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; - - chip::app::Clusters::TestCluster::Commands::TestSimpleOptionalArgumentRequest::Type request; - - chip::JniReferences::GetInstance().GetOptionalValue(arg1, arg1); - request.arg1 = - chip::Optional(static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(arg1))); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::EpochS::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, testSpecific) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeVendorIdAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; - - chip::app::Clusters::TestCluster::Commands::TestSpecific::Type request; + std::unique_ptr onSuccess( + Platform::New(callback, true), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::VendorId::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterVendorIdAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, testStructArgumentRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject a, jobject b, jobject c, jbyteArray d, jstring e, - jobject f, jobject g, jobject h, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeEnumAttrAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; - - chip::app::Clusters::TestCluster::Commands::TestStructArgumentRequest::Type request; - - request.arg1 = chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type(); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::EnumAttr::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, testUnknownCommand) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeRangeRestrictedInt8uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; - - chip::app::Clusters::TestCluster::Commands::TestUnknownCommand::Type request; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::RangeRestrictedInt8u::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, timedInvokeRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeRangeRestrictedInt8sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; - - chip::app::Clusters::TestCluster::Commands::TimedInvokeRequest::Type request; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::RangeRestrictedInt8s::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeBooleanAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeRangeRestrictedInt16uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Boolean::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -22051,31 +21146,27 @@ JNI_METHOD(void, TestClusterCluster, writeBooleanAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::RangeRestrictedInt16u::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeBooleanAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeRangeRestrictedInt16sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -22092,14 +21183,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeBooleanAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Boolean::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::RangeRestrictedInt16s::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPBooleanAttributeCallback::OnSubscriptionEstablished); + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -22107,24 +21198,18 @@ JNI_METHOD(void, TestClusterCluster, subscribeBooleanAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeBitmap8Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeTimedWriteBooleanAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap8::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -22135,31 +21220,27 @@ JNI_METHOD(void, TestClusterCluster, writeBitmap8Attribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::TimedWriteBoolean::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPBooleanAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeBitmap8Attribute) +JNI_METHOD(void, TestClusterCluster, subscribeUnsupportedAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -22176,14 +21257,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeBitmap8Attribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap8::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Unsupported::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + CHIPBooleanAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -22191,24 +21272,19 @@ JNI_METHOD(void, TestClusterCluster, subscribeBitmap8Attribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeBitmap16Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeNullableBooleanAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap16::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -22219,31 +21295,28 @@ JNI_METHOD(void, TestClusterCluster, writeBitmap16Attribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBoolean::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableBooleanAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeBitmap16Attribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableBitmap8Attribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -22260,14 +21333,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeBitmap16Attribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap16::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap8::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + CHIPTestClusterNullableBitmap8AttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -22275,24 +21348,19 @@ JNI_METHOD(void, TestClusterCluster, subscribeBitmap16Attribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeBitmap32Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeNullableBitmap16Attribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap32::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -22303,31 +21371,28 @@ JNI_METHOD(void, TestClusterCluster, writeBitmap32Attribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap16::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableBitmap16AttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeBitmap32Attribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableBitmap32Attribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -22344,14 +21409,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeBitmap32Attribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap32::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap32::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt32uAttributeCallback::OnSubscriptionEstablished); + CHIPTestClusterNullableBitmap32AttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -22359,24 +21424,19 @@ JNI_METHOD(void, TestClusterCluster, subscribeBitmap32Attribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeBitmap64Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeNullableBitmap64Attribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap64::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -22387,31 +21447,28 @@ JNI_METHOD(void, TestClusterCluster, writeBitmap64Attribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap64::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableBitmap64AttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeBitmap64Attribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableInt8uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -22428,14 +21485,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeBitmap64Attribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap64::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt8u::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt64uAttributeCallback::OnSubscriptionEstablished); + CHIPTestClusterNullableInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -22443,24 +21500,19 @@ JNI_METHOD(void, TestClusterCluster, subscribeBitmap64Attribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeInt8uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeNullableInt16uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int8u::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -22471,31 +21523,28 @@ JNI_METHOD(void, TestClusterCluster, writeInt8uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt16u::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeInt8uAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableInt24uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -22512,14 +21561,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt8uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int8u::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt24u::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + CHIPTestClusterNullableInt24uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -22527,24 +21576,19 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt8uAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeInt16uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeNullableInt32uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int16u::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -22555,31 +21599,28 @@ JNI_METHOD(void, TestClusterCluster, writeInt16uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt32u::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableInt32uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeInt16uAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableInt40uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -22596,14 +21637,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt16uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int16u::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt40u::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + CHIPTestClusterNullableInt40uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -22611,24 +21652,19 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt16uAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeInt24uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeNullableInt48uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int24u::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -22639,31 +21675,28 @@ JNI_METHOD(void, TestClusterCluster, writeInt24uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt48u::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableInt48uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeInt24uAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableInt56uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -22680,14 +21713,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt24uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int24u::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt56u::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt32uAttributeCallback::OnSubscriptionEstablished); + CHIPTestClusterNullableInt56uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -22695,24 +21728,19 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt24uAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeInt32uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeNullableInt64uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int32u::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -22723,31 +21751,28 @@ JNI_METHOD(void, TestClusterCluster, writeInt32uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt64u::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableInt64uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeInt32uAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableInt8sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -22764,14 +21789,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt32uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int32u::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt8s::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt32uAttributeCallback::OnSubscriptionEstablished); + CHIPTestClusterNullableInt8sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -22779,24 +21804,19 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt32uAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeInt40uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeNullableInt16sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int40u::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -22807,31 +21827,28 @@ JNI_METHOD(void, TestClusterCluster, writeInt40uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt16s::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableInt16sAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeInt40uAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableInt24sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -22848,14 +21865,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt40uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int40u::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt24s::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt64uAttributeCallback::OnSubscriptionEstablished); + CHIPTestClusterNullableInt24sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -22863,24 +21880,19 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt40uAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeInt48uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeNullableInt32sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int48u::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -22891,31 +21903,28 @@ JNI_METHOD(void, TestClusterCluster, writeInt48uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt32s::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableInt32sAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeInt48uAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableInt40sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -22932,14 +21941,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt48uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int48u::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt40s::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt64uAttributeCallback::OnSubscriptionEstablished); + CHIPTestClusterNullableInt40sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -22947,24 +21956,19 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt48uAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeInt56uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeNullableInt48sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int56u::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -22975,31 +21979,28 @@ JNI_METHOD(void, TestClusterCluster, writeInt56uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt48s::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableInt48sAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeInt56uAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableInt56sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -23016,14 +22017,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt56uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int56u::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt56s::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt64uAttributeCallback::OnSubscriptionEstablished); + CHIPTestClusterNullableInt56sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -23031,24 +22032,19 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt56uAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeInt64uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeNullableInt64sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int64u::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -23059,31 +22055,28 @@ JNI_METHOD(void, TestClusterCluster, writeInt64uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt64s::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableInt64sAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeInt64uAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableEnum8Attribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -23100,14 +22093,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt64uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int64u::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableEnum8::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt64uAttributeCallback::OnSubscriptionEstablished); + CHIPTestClusterNullableEnum8AttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -23115,24 +22108,19 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt64uAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeInt8sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeNullableEnum16Attribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int8s::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -23143,31 +22131,29 @@ JNI_METHOD(void, TestClusterCluster, writeInt8sAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableEnum16::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableEnum16AttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeInt8sAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableFloatSingleAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -23184,14 +22170,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt8sAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int8s::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableFloatSingle::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8sAttributeCallback::OnSubscriptionEstablished); + CHIPTestClusterNullableFloatSingleAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -23199,24 +22185,20 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt8sAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeInt16sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeNullableFloatDoubleAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int16s::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -23227,31 +22209,29 @@ JNI_METHOD(void, TestClusterCluster, writeInt16sAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableFloatDouble::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableFloatDoubleAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeInt16sAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableOctetStringAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -23268,14 +22248,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt16sAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int16s::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableOctetString::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + CHIPTestClusterNullableOctetStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -23283,24 +22263,20 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt16sAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeInt24sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, TestClusterCluster, subscribeNullableCharStringAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int24s::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -23311,223 +22287,14 @@ JNI_METHOD(void, TestClusterCluster, writeInt24sAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeInt24sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int24s::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt32sAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeInt32sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int32s::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeInt32sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int32s::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt32sAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeInt40sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int40s::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeInt40sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int40s::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableCharString::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt64sAttributeCallback::OnSubscriptionEstablished); + CHIPTestClusterNullableCharStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -23535,59 +22302,13 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt40sAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeInt48sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int48s::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeInt48sAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableEnumAttrAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -23598,4896 +22319,35 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt48sAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int48s::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt64sAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeInt56sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int56s::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeInt56sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int56s::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt64sAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeInt64sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int64s::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeInt64sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int64s::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt64sAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeEnum8Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Enum8::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeEnum8Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Enum8::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeEnum16Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Enum16::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeEnum16Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Enum16::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeFloatSingleAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::FloatSingle::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().FloatToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeFloatSingleAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::FloatSingle::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPFloatAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeFloatDoubleAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::FloatDouble::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().DoubleToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeFloatDoubleAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::FloatDouble::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPDoubleAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeOctetStringAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::OctetString::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = chip::JniByteArray(env, static_cast(value)).byteSpan(); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeOctetStringAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::OctetString::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPOctetStringAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeLongOctetStringAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::LongOctetString::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = chip::JniByteArray(env, static_cast(value)).byteSpan(); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeLongOctetStringAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::LongOctetString::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPOctetStringAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeCharStringAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::CharString::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = chip::JniUtfString(env, static_cast(value)).charSpan(); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeCharStringAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::CharString::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPCharStringAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeLongCharStringAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::LongCharString::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = chip::JniUtfString(env, static_cast(value)).charSpan(); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeLongCharStringAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::LongCharString::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPCharStringAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeEpochUsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::EpochUs::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeEpochUsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::EpochUs::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt64uAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeEpochSAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::EpochS::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeEpochSAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::EpochS::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt32uAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeVendorIdAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::VendorId::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeVendorIdAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::VendorId::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPTestClusterVendorIdAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeEnumAttrAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::EnumAttr::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeEnumAttrAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::EnumAttr::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeRangeRestrictedInt8uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::RangeRestrictedInt8u::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeRangeRestrictedInt8uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::RangeRestrictedInt8u::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeRangeRestrictedInt8sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::RangeRestrictedInt8s::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeRangeRestrictedInt8sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::RangeRestrictedInt8s::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt8sAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeRangeRestrictedInt16uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::RangeRestrictedInt16u::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeRangeRestrictedInt16uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::RangeRestrictedInt16u::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeRangeRestrictedInt16sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::RangeRestrictedInt16s::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeRangeRestrictedInt16sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::RangeRestrictedInt16s::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16sAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeTimedWriteBooleanAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::TimedWriteBoolean::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeTimedWriteBooleanAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::TimedWriteBoolean::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPBooleanAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeUnsupportedAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Unsupported::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeUnsupportedAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Unsupported::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPBooleanAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableBooleanAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBoolean::TypeInfo; - TypeInfo::Type cppValue; - - bool valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().BooleanToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeNullableBooleanAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBoolean::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPTestClusterNullableBooleanAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableBitmap8Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap8::TypeInfo; - TypeInfo::Type cppValue; - - uint8_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeNullableBitmap8Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap8::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPTestClusterNullableBitmap8AttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableBitmap16Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap16::TypeInfo; - TypeInfo::Type cppValue; - - uint16_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeNullableBitmap16Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap16::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPTestClusterNullableBitmap16AttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableBitmap32Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap32::TypeInfo; - TypeInfo::Type cppValue; - - uint32_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeNullableBitmap32Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap32::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPTestClusterNullableBitmap32AttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableBitmap64Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap64::TypeInfo; - TypeInfo::Type cppValue; - - uint64_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeNullableBitmap64Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap64::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPTestClusterNullableBitmap64AttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableInt8uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt8u::TypeInfo; - TypeInfo::Type cppValue; - - uint8_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeNullableInt8uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt8u::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPTestClusterNullableInt8uAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableInt16uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt16u::TypeInfo; - TypeInfo::Type cppValue; - - uint16_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeNullableInt16uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt16u::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPTestClusterNullableInt16uAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableInt24uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt24u::TypeInfo; - TypeInfo::Type cppValue; - - uint32_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeNullableInt24uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt24u::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPTestClusterNullableInt24uAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableInt32uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt32u::TypeInfo; - TypeInfo::Type cppValue; - - uint32_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeNullableInt32uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt32u::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPTestClusterNullableInt32uAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableInt40uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt40u::TypeInfo; - TypeInfo::Type cppValue; - - uint64_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeNullableInt40uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt40u::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPTestClusterNullableInt40uAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableInt48uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt48u::TypeInfo; - TypeInfo::Type cppValue; - - uint64_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeNullableInt48uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt48u::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPTestClusterNullableInt48uAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableInt56uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt56u::TypeInfo; - TypeInfo::Type cppValue; - - uint64_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeNullableInt56uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt56u::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPTestClusterNullableInt56uAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableInt64uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt64u::TypeInfo; - TypeInfo::Type cppValue; - - uint64_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeNullableInt64uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt64u::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPTestClusterNullableInt64uAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableInt8sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt8s::TypeInfo; - TypeInfo::Type cppValue; - - int8_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeNullableInt8sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt8s::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPTestClusterNullableInt8sAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableInt16sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt16s::TypeInfo; - TypeInfo::Type cppValue; - - int16_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeNullableInt16sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt16s::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPTestClusterNullableInt16sAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableInt24sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt24s::TypeInfo; - TypeInfo::Type cppValue; - - int32_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeNullableInt24sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt24s::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPTestClusterNullableInt24sAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableInt32sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt32s::TypeInfo; - TypeInfo::Type cppValue; - - int32_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeNullableInt32sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt32s::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPTestClusterNullableInt32sAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableInt40sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt40s::TypeInfo; - TypeInfo::Type cppValue; - - int64_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeNullableInt40sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt40s::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPTestClusterNullableInt40sAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableInt48sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt48s::TypeInfo; - TypeInfo::Type cppValue; - - int64_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeNullableInt48sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt48s::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPTestClusterNullableInt48sAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableInt56sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt56s::TypeInfo; - TypeInfo::Type cppValue; - - int64_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeNullableInt56sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt56s::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPTestClusterNullableInt56sAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableInt64sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt64s::TypeInfo; - TypeInfo::Type cppValue; - - int64_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeNullableInt64sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt64s::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPTestClusterNullableInt64sAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableEnum8Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableEnum8::TypeInfo; - TypeInfo::Type cppValue; - - uint8_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeNullableEnum8Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableEnum8::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPTestClusterNullableEnum8AttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableEnum16Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableEnum16::TypeInfo; - TypeInfo::Type cppValue; - - uint16_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeNullableEnum16Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableEnum16::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPTestClusterNullableEnum16AttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableFloatSingleAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableFloatSingle::TypeInfo; - TypeInfo::Type cppValue; - - float valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().FloatToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeNullableFloatSingleAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableFloatSingle::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPTestClusterNullableFloatSingleAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableFloatDoubleAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableFloatDouble::TypeInfo; - TypeInfo::Type cppValue; - - double valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().DoubleToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeNullableFloatDoubleAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableFloatDouble::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPTestClusterNullableFloatDoubleAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableOctetStringAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableOctetString::TypeInfo; - TypeInfo::Type cppValue; - - chip::ByteSpan valueValue; - if (value != nullptr) - { - valueValue = chip::JniByteArray(env, static_cast(value)).byteSpan(); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() - : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeNullableOctetStringAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableOctetString::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPTestClusterNullableOctetStringAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableCharStringAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableCharString::TypeInfo; - TypeInfo::Type cppValue; - - chip::CharSpan valueValue; - if (value != nullptr) - { - valueValue = chip::JniUtfString(env, static_cast(value)).charSpan(); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() - : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeNullableCharStringAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableCharString::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPTestClusterNullableCharStringAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableEnumAttrAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableEnumAttr::TypeInfo; - TypeInfo::Type cppValue; - - decltype(cppValue)::UnderlyingType valueValue; - if (value != nullptr) - { - valueValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() - : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeNullableEnumAttrAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableEnumAttr::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPTestClusterNullableEnumAttrAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableRangeRestrictedInt8uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableRangeRestrictedInt8u::TypeInfo; - TypeInfo::Type cppValue; - - uint8_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeNullableRangeRestrictedInt8uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableRangeRestrictedInt8u::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute( - onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), - static_cast(maxInterval), - CHIPTestClusterNullableRangeRestrictedInt8uAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableRangeRestrictedInt8sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableRangeRestrictedInt8s::TypeInfo; - TypeInfo::Type cppValue; - - int8_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeNullableRangeRestrictedInt8sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableRangeRestrictedInt8s::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute( - onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), - static_cast(maxInterval), - CHIPTestClusterNullableRangeRestrictedInt8sAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableRangeRestrictedInt16uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableRangeRestrictedInt16u::TypeInfo; - TypeInfo::Type cppValue; - - uint16_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeNullableRangeRestrictedInt16uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableRangeRestrictedInt16u::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute( - onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), - static_cast(maxInterval), - CHIPTestClusterNullableRangeRestrictedInt16uAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableRangeRestrictedInt16sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableRangeRestrictedInt16s::TypeInfo; - TypeInfo::Type cppValue; - - int16_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeNullableRangeRestrictedInt16sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr - onSuccess(Platform::New(callback, true), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableRangeRestrictedInt16s::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute( - onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), - static_cast(maxInterval), - CHIPTestClusterNullableRangeRestrictedInt16sAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::ClusterRevision::TypeInfo; - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16uAttributeCallback::OnSubscriptionEstablished); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(jlong, ThermostatCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - ThermostatCluster * cppCluster = new ThermostatCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, ThermostatCluster, clearWeeklySchedule) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster; - - chip::app::Clusters::Thermostat::Commands::ClearWeeklySchedule::Type request; - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, ThermostatCluster, getRelayStatusLog) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster; - - chip::app::Clusters::Thermostat::Commands::GetRelayStatusLog::Type request; - - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, ThermostatCluster, getWeeklySchedule) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject daysToReturn, jobject modeToReturn, - jobject timedInvokeTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster; - - chip::app::Clusters::Thermostat::Commands::GetWeeklySchedule::Type request; - - request.daysToReturn = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(daysToReturn)); - request.modeToReturn = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(modeToReturn)); - - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, ThermostatCluster, setWeeklySchedule) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject numberOfTransitionsForSequence, - jobject dayOfWeekForSequence, jobject modeForSequence, jobject payload, jobject timedInvokeTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster; - - chip::app::Clusters::Thermostat::Commands::SetWeeklySchedule::Type request; - - request.numberOfTransitionsForSequence = static_cast( - chip::JniReferences::GetInstance().IntegerToPrimitive(numberOfTransitionsForSequence)); - request.dayOfWeekForSequence = static_cast( - chip::JniReferences::GetInstance().IntegerToPrimitive(dayOfWeekForSequence)); - request.modeForSequence = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(modeForSequence)); - request.payload = chip::app::DataModel::List(); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, ThermostatCluster, setpointRaiseLower) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject mode, jobject amount, jobject timedInvokeTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster; - - chip::app::Clusters::Thermostat::Commands::SetpointRaiseLower::Type request; - - request.mode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(mode)); - request.amount = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(amount)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableEnumAttr::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableEnumAttrAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, subscribeLocalTemperatureAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableRangeRestrictedInt8uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -28498,20 +22358,22 @@ JNI_METHOD(void, ThermostatCluster, subscribeLocalTemperatureAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::Thermostat::Attributes::LocalTemperature::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableRangeRestrictedInt8u::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), + CHIPTestClusterNullableRangeRestrictedInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -28519,12 +22381,14 @@ JNI_METHOD(void, ThermostatCluster, subscribeLocalTemperatureAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, subscribeAbsMinHeatSetpointLimitAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableRangeRestrictedInt8sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -28535,20 +22399,22 @@ JNI_METHOD(void, ThermostatCluster, subscribeAbsMinHeatSetpointLimitAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::Thermostat::Attributes::AbsMinHeatSetpointLimit::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableRangeRestrictedInt8s::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), + CHIPTestClusterNullableRangeRestrictedInt8sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -28556,12 +22422,14 @@ JNI_METHOD(void, ThermostatCluster, subscribeAbsMinHeatSetpointLimitAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, subscribeAbsMaxHeatSetpointLimitAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableRangeRestrictedInt16uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -28572,20 +22440,22 @@ JNI_METHOD(void, ThermostatCluster, subscribeAbsMaxHeatSetpointLimitAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::Thermostat::Attributes::AbsMaxHeatSetpointLimit::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableRangeRestrictedInt16u::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), + CHIPTestClusterNullableRangeRestrictedInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -28593,12 +22463,14 @@ JNI_METHOD(void, ThermostatCluster, subscribeAbsMaxHeatSetpointLimitAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, subscribeAbsMinCoolSetpointLimitAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableRangeRestrictedInt16sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -28609,20 +22481,22 @@ JNI_METHOD(void, ThermostatCluster, subscribeAbsMinCoolSetpointLimitAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::Thermostat::Attributes::AbsMinCoolSetpointLimit::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableRangeRestrictedInt16s::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), + CHIPTestClusterNullableRangeRestrictedInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -28630,12 +22504,12 @@ JNI_METHOD(void, ThermostatCluster, subscribeAbsMinCoolSetpointLimitAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, subscribeAbsMaxCoolSetpointLimitAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -28646,20 +22520,20 @@ JNI_METHOD(void, ThermostatCluster, subscribeAbsMaxCoolSetpointLimitAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::Thermostat::Attributes::AbsMaxCoolSetpointLimit::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -28667,138 +22541,260 @@ JNI_METHOD(void, ThermostatCluster, subscribeAbsMaxCoolSetpointLimitAttribute) onSuccess.release(); onFailure.release(); } +JNI_METHOD(jlong, ThermostatCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + ThermostatCluster * cppCluster = new ThermostatCluster(); + + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} -JNI_METHOD(void, ThermostatCluster, writeOccupiedCoolingSetpointAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, ThermostatCluster, clearWeeklySchedule) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::Thermostat::Attributes::OccupiedCoolingSetpoint::TypeInfo; - TypeInfo::Type cppValue; + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster; - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + chip::app::Clusters::Thermostat::Commands::ClearWeeklySchedule::Type request; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, ThermostatCluster, getRelayStatusLog) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject timedInvokeTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster; + + chip::app::Clusters::Thermostat::Commands::GetRelayStatusLog::Type request; + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, ThermostatCluster, getWeeklySchedule) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject daysToReturn, jobject modeToReturn, + jobject timedInvokeTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster; + + chip::app::Clusters::Thermostat::Commands::GetWeeklySchedule::Type request; + + request.daysToReturn = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(daysToReturn)); + request.modeToReturn = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(modeToReturn)); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) + if (timedInvokeTimeoutMs == nullptr) { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); } else { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, subscribeOccupiedCoolingSetpointAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, ThermostatCluster, setWeeklySchedule) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject numberOfTransitionsForSequence, + jobject dayOfWeekForSequence, jobject modeForSequence, jobject payload, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster; + + chip::app::Clusters::Thermostat::Commands::SetWeeklySchedule::Type request; + + request.numberOfTransitionsForSequence = static_cast( + chip::JniReferences::GetInstance().IntegerToPrimitive(numberOfTransitionsForSequence)); + request.dayOfWeekForSequence = static_cast( + chip::JniReferences::GetInstance().IntegerToPrimitive(dayOfWeekForSequence)); + request.modeForSequence = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(modeForSequence)); + request.payload = chip::app::DataModel::List(); + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), chip::Platform::Delete); + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::Thermostat::Attributes::OccupiedCoolingSetpoint::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, - static_cast(minInterval), static_cast(maxInterval), - CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + if (timedInvokeTimeoutMs == nullptr) + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); + } VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThermostatCluster, writeOccupiedHeatingSetpointAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, ThermostatCluster, setpointRaiseLower) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject mode, jobject amount, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::Thermostat::Attributes::OccupiedHeatingSetpoint::TypeInfo; - TypeInfo::Type cppValue; + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster; + + chip::app::Clusters::Thermostat::Commands::SetpointRaiseLower::Type request; - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + request.mode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(mode)); + request.amount = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(amount)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) + if (timedInvokeTimeoutMs == nullptr) { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); } else { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, subscribeOccupiedHeatingSetpointAttribute) +JNI_METHOD(void, ThermostatCluster, subscribeLocalTemperatureAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -28820,9 +22816,9 @@ JNI_METHOD(void, ThermostatCluster, subscribeOccupiedHeatingSetpointAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::Thermostat::Attributes::OccupiedHeatingSetpoint::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::LocalTemperature::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, @@ -28835,54 +22831,7 @@ JNI_METHOD(void, ThermostatCluster, subscribeOccupiedHeatingSetpointAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThermostatCluster, writeMinHeatSetpointLimitAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MinHeatSetpointLimit::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, ThermostatCluster, subscribeMinHeatSetpointLimitAttribute) +JNI_METHOD(void, ThermostatCluster, subscribeAbsMinHeatSetpointLimitAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -28904,8 +22853,8 @@ JNI_METHOD(void, ThermostatCluster, subscribeMinHeatSetpointLimitAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MinHeatSetpointLimit::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::AbsMinHeatSetpointLimit::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); @@ -28919,24 +22868,18 @@ JNI_METHOD(void, ThermostatCluster, subscribeMinHeatSetpointLimitAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThermostatCluster, writeMaxHeatSetpointLimitAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, ThermostatCluster, subscribeAbsMaxHeatSetpointLimitAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MaxHeatSetpointLimit::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -28947,26 +22890,22 @@ JNI_METHOD(void, ThermostatCluster, writeMaxHeatSetpointLimitAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::AbsMaxHeatSetpointLimit::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, subscribeMaxHeatSetpointLimitAttribute) +JNI_METHOD(void, ThermostatCluster, subscribeAbsMinCoolSetpointLimitAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -28988,8 +22927,8 @@ JNI_METHOD(void, ThermostatCluster, subscribeMaxHeatSetpointLimitAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MaxHeatSetpointLimit::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::AbsMinCoolSetpointLimit::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); @@ -29003,24 +22942,18 @@ JNI_METHOD(void, ThermostatCluster, subscribeMaxHeatSetpointLimitAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThermostatCluster, writeMinCoolSetpointLimitAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, ThermostatCluster, subscribeAbsMaxCoolSetpointLimitAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MinCoolSetpointLimit::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -29031,26 +22964,22 @@ JNI_METHOD(void, ThermostatCluster, writeMinCoolSetpointLimitAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::AbsMaxCoolSetpointLimit::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, subscribeMinCoolSetpointLimitAttribute) +JNI_METHOD(void, ThermostatCluster, subscribeOccupiedCoolingSetpointAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -29072,8 +23001,8 @@ JNI_METHOD(void, ThermostatCluster, subscribeMinCoolSetpointLimitAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MinCoolSetpointLimit::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::OccupiedCoolingSetpoint::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); @@ -29087,24 +23016,18 @@ JNI_METHOD(void, ThermostatCluster, subscribeMinCoolSetpointLimitAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThermostatCluster, writeMaxCoolSetpointLimitAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, ThermostatCluster, subscribeOccupiedHeatingSetpointAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MaxCoolSetpointLimit::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -29115,26 +23038,22 @@ JNI_METHOD(void, ThermostatCluster, writeMaxCoolSetpointLimitAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::OccupiedHeatingSetpoint::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, subscribeMaxCoolSetpointLimitAttribute) +JNI_METHOD(void, ThermostatCluster, subscribeMinHeatSetpointLimitAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; @@ -29156,8 +23075,8 @@ JNI_METHOD(void, ThermostatCluster, subscribeMaxCoolSetpointLimitAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MaxCoolSetpointLimit::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MinHeatSetpointLimit::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); @@ -29171,24 +23090,18 @@ JNI_METHOD(void, ThermostatCluster, subscribeMaxCoolSetpointLimitAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThermostatCluster, writeMinSetpointDeadBandAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, ThermostatCluster, subscribeMaxHeatSetpointLimitAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MinSetpointDeadBand::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -29199,31 +23112,27 @@ JNI_METHOD(void, ThermostatCluster, writeMinSetpointDeadBandAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MaxHeatSetpointLimit::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, subscribeMinSetpointDeadBandAttribute) +JNI_METHOD(void, ThermostatCluster, subscribeMinCoolSetpointLimitAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -29240,14 +23149,14 @@ JNI_METHOD(void, ThermostatCluster, subscribeMinSetpointDeadBandAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MinSetpointDeadBand::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MinCoolSetpointLimit::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8sAttributeCallback::OnSubscriptionEstablished); + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -29255,24 +23164,18 @@ JNI_METHOD(void, ThermostatCluster, subscribeMinSetpointDeadBandAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThermostatCluster, writeControlSequenceOfOperationAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, ThermostatCluster, subscribeMaxCoolSetpointLimitAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::Thermostat::Attributes::ControlSequenceOfOperation::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -29283,31 +23186,27 @@ JNI_METHOD(void, ThermostatCluster, writeControlSequenceOfOperationAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MaxCoolSetpointLimit::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, subscribeControlSequenceOfOperationAttribute) +JNI_METHOD(void, ThermostatCluster, subscribeMinSetpointDeadBandAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback, true), chip::Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -29324,14 +23223,14 @@ JNI_METHOD(void, ThermostatCluster, subscribeControlSequenceOfOperationAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - using TypeInfo = chip::app::Clusters::Thermostat::Attributes::ControlSequenceOfOperation::TypeInfo; - auto successFn = chip::Callback::Callback::FromCancelable( + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MinSetpointDeadBand::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), - CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + CHIPInt8sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -29339,24 +23238,18 @@ JNI_METHOD(void, ThermostatCluster, subscribeControlSequenceOfOperationAttribute onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThermostatCluster, writeSystemModeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +JNI_METHOD(void, ThermostatCluster, subscribeControlSequenceOfOperationAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::Thermostat::Attributes::SystemMode::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -29367,21 +23260,17 @@ JNI_METHOD(void, ThermostatCluster, writeSystemModeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::ControlSequenceOfOperation::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); @@ -29618,53 +23507,6 @@ JNI_METHOD(jlong, ThermostatUserInterfaceConfigurationCluster, initWithDevice) return reinterpret_cast(cppCluster); } -JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, writeTemperatureDisplayModeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatUserInterfaceConfigurationCluster * cppCluster = - reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, subscribeTemperatureDisplayModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { @@ -29704,54 +23546,6 @@ JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, subscribeTemperatu onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, writeKeypadLockoutAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatUserInterfaceConfigurationCluster * cppCluster = - reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, subscribeKeypadLockoutAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { @@ -29791,54 +23585,6 @@ JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, subscribeKeypadLoc onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, writeScheduleProgrammingVisibilityAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatUserInterfaceConfigurationCluster * cppCluster = - reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, subscribeScheduleProgrammingVisibilityAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { @@ -33926,53 +27672,6 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeInstalledClosedLimitTiltAttribu onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WindowCoveringCluster, writeModeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::Mode::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - WindowCoveringCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedWriteTimeoutMs == nullptr) - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); - } - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} JNI_METHOD(void, WindowCoveringCluster, subscribeModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { diff --git a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp new file mode 100644 index 00000000000000..75cc4c525450ad --- /dev/null +++ b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp @@ -0,0 +1,6345 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// THIS FILE IS GENERATED BY ZAP +#include "CHIPCallbackTypes.h" +#include "CHIPInvokeCallbacks.h" +#include "CHIPReadCallbacks.h" + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define JNI_METHOD(RETURN, CLASS_NAME, METHOD_NAME) \ + extern "C" JNIEXPORT RETURN JNICALL Java_chip_devicecontroller_ChipClusters_00024##CLASS_NAME##_##METHOD_NAME + +using namespace chip; +using namespace chip::Controller; + +JNI_METHOD(void, BasicCluster, writeNodeLabelAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Basic::Attributes::NodeLabel::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = chip::JniUtfString(env, static_cast(value)).charSpan(); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + BasicCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, BasicCluster, writeLocationAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Basic::Attributes::Location::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = chip::JniUtfString(env, static_cast(value)).charSpan(); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + BasicCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, BasicCluster, writeLocalConfigDisabledAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Basic::Attributes::LocalConfigDisabled::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + BasicCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, BinaryInputBasicCluster, writeOutOfServiceAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::BinaryInputBasic::Attributes::OutOfService::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + BinaryInputBasicCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, BinaryInputBasicCluster, writePresentValueAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::BinaryInputBasic::Attributes::PresentValue::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + BinaryInputBasicCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ColorControlCluster, writeColorControlOptionsAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorControlOptions::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ColorControlCluster, writeWhitePointXAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::WhitePointX::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ColorControlCluster, writeWhitePointYAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::WhitePointY::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ColorControlCluster, writeColorPointRXAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointRX::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ColorControlCluster, writeColorPointRYAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointRY::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ColorControlCluster, writeColorPointRIntensityAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointRIntensity::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ColorControlCluster, writeColorPointGXAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointGX::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ColorControlCluster, writeColorPointGYAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointGY::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ColorControlCluster, writeColorPointGIntensityAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointGIntensity::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ColorControlCluster, writeColorPointBXAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointBX::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ColorControlCluster, writeColorPointBYAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointBY::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ColorControlCluster, writeColorPointBIntensityAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointBIntensity::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ColorControlCluster, writeStartUpColorTemperatureMiredsAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::StartUpColorTemperatureMireds::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ContentLauncherCluster, writeSupportedStreamingProtocolsAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ContentLauncher::Attributes::SupportedStreamingProtocols::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ContentLauncherCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, DoorLockCluster, writeLanguageAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::Language::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = chip::JniUtfString(env, static_cast(value)).charSpan(); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, DoorLockCluster, writeAutoRelockTimeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::AutoRelockTime::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, DoorLockCluster, writeSoundVolumeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::SoundVolume::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, DoorLockCluster, writeOperatingModeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::OperatingMode::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, DoorLockCluster, writeEnableOneTouchLockingAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::EnableOneTouchLocking::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, DoorLockCluster, writeEnablePrivacyModeButtonAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::EnablePrivacyModeButton::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, DoorLockCluster, writeWrongCodeEntryLimitAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::WrongCodeEntryLimit::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, GeneralCommissioningCluster, writeBreadcrumbAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::GeneralCommissioning::Attributes::Breadcrumb::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + GeneralCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, IdentifyCluster, writeIdentifyTimeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Identify::Attributes::IdentifyTime::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + IdentifyCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, LevelControlCluster, writeOptionsAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::Options::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, LevelControlCluster, writeOnOffTransitionTimeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OnOffTransitionTime::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, LevelControlCluster, writeOnLevelAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OnLevel::TypeInfo; + TypeInfo::Type cppValue; + + uint8_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, LevelControlCluster, writeOnTransitionTimeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OnTransitionTime::TypeInfo; + TypeInfo::Type cppValue; + + uint16_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, LevelControlCluster, writeOffTransitionTimeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OffTransitionTime::TypeInfo; + TypeInfo::Type cppValue; + + uint16_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, LevelControlCluster, writeDefaultMoveRateAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::DefaultMoveRate::TypeInfo; + TypeInfo::Type cppValue; + + uint8_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, LevelControlCluster, writeStartUpCurrentLevelAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::StartUpCurrentLevel::TypeInfo; + TypeInfo::Type cppValue; + + uint8_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, LocalizationConfigurationCluster, writeActiveLocaleAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::LocalizationConfiguration::Attributes::ActiveLocale::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = chip::JniUtfString(env, static_cast(value)).charSpan(); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + LocalizationConfigurationCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ModeSelectCluster, writeOnModeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ModeSelect::Attributes::OnMode::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, NetworkCommissioningCluster, writeInterfaceEnabledAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::NetworkCommissioning::Attributes::InterfaceEnabled::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + NetworkCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, OnOffCluster, writeOnTimeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OnOff::Attributes::OnTime::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, OnOffCluster, writeOffWaitTimeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OnOff::Attributes::OffWaitTime::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, OnOffCluster, writeStartUpOnOffAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OnOff::Attributes::StartUpOnOff::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, OnOffSwitchConfigurationCluster, writeSwitchActionsAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OnOffSwitchConfiguration::Attributes::SwitchActions::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + OnOffSwitchConfigurationCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, PumpConfigurationAndControlCluster, writeLifetimeRunningHoursAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::LifetimeRunningHours::TypeInfo; + TypeInfo::Type cppValue; + + uint32_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, PumpConfigurationAndControlCluster, writeLifetimeEnergyConsumedAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::LifetimeEnergyConsumed::TypeInfo; + TypeInfo::Type cppValue; + + uint32_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, PumpConfigurationAndControlCluster, writeOperationModeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::OperationMode::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, PumpConfigurationAndControlCluster, writeControlModeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::ControlMode::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeBooleanAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Boolean::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeBitmap8Attribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap8::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeBitmap16Attribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap16::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeBitmap32Attribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap32::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeBitmap64Attribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap64::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeInt8uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int8u::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeInt16uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int16u::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeInt24uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int24u::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeInt32uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int32u::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeInt40uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int40u::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeInt48uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int48u::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeInt56uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int56u::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeInt64uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int64u::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeInt8sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int8s::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeInt16sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int16s::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeInt24sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int24s::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeInt32sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int32s::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeInt40sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int40s::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeInt48sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int48s::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeInt56sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int56s::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeInt64sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int64s::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeEnum8Attribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Enum8::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeEnum16Attribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Enum16::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeFloatSingleAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::FloatSingle::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().FloatToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeFloatDoubleAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::FloatDouble::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().DoubleToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeOctetStringAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::OctetString::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = chip::JniByteArray(env, static_cast(value)).byteSpan(); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeLongOctetStringAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::LongOctetString::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = chip::JniByteArray(env, static_cast(value)).byteSpan(); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeCharStringAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::CharString::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = chip::JniUtfString(env, static_cast(value)).charSpan(); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeLongCharStringAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::LongCharString::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = chip::JniUtfString(env, static_cast(value)).charSpan(); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeEpochUsAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::EpochUs::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeEpochSAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::EpochS::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeVendorIdAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::VendorId::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeEnumAttrAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::EnumAttr::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeRangeRestrictedInt8uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::RangeRestrictedInt8u::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeRangeRestrictedInt8sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::RangeRestrictedInt8s::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeRangeRestrictedInt16uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::RangeRestrictedInt16u::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeRangeRestrictedInt16sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::RangeRestrictedInt16s::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeTimedWriteBooleanAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::TimedWriteBoolean::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeUnsupportedAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Unsupported::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableBooleanAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBoolean::TypeInfo; + TypeInfo::Type cppValue; + + bool valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().BooleanToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableBitmap8Attribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap8::TypeInfo; + TypeInfo::Type cppValue; + + uint8_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableBitmap16Attribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap16::TypeInfo; + TypeInfo::Type cppValue; + + uint16_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableBitmap32Attribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap32::TypeInfo; + TypeInfo::Type cppValue; + + uint32_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableBitmap64Attribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap64::TypeInfo; + TypeInfo::Type cppValue; + + uint64_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableInt8uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt8u::TypeInfo; + TypeInfo::Type cppValue; + + uint8_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableInt16uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt16u::TypeInfo; + TypeInfo::Type cppValue; + + uint16_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableInt24uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt24u::TypeInfo; + TypeInfo::Type cppValue; + + uint32_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableInt32uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt32u::TypeInfo; + TypeInfo::Type cppValue; + + uint32_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableInt40uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt40u::TypeInfo; + TypeInfo::Type cppValue; + + uint64_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableInt48uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt48u::TypeInfo; + TypeInfo::Type cppValue; + + uint64_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableInt56uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt56u::TypeInfo; + TypeInfo::Type cppValue; + + uint64_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableInt64uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt64u::TypeInfo; + TypeInfo::Type cppValue; + + uint64_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableInt8sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt8s::TypeInfo; + TypeInfo::Type cppValue; + + int8_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableInt16sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt16s::TypeInfo; + TypeInfo::Type cppValue; + + int16_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableInt24sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt24s::TypeInfo; + TypeInfo::Type cppValue; + + int32_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableInt32sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt32s::TypeInfo; + TypeInfo::Type cppValue; + + int32_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableInt40sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt40s::TypeInfo; + TypeInfo::Type cppValue; + + int64_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableInt48sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt48s::TypeInfo; + TypeInfo::Type cppValue; + + int64_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableInt56sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt56s::TypeInfo; + TypeInfo::Type cppValue; + + int64_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableInt64sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt64s::TypeInfo; + TypeInfo::Type cppValue; + + int64_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableEnum8Attribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableEnum8::TypeInfo; + TypeInfo::Type cppValue; + + uint8_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableEnum16Attribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableEnum16::TypeInfo; + TypeInfo::Type cppValue; + + uint16_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableFloatSingleAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableFloatSingle::TypeInfo; + TypeInfo::Type cppValue; + + float valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().FloatToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableFloatDoubleAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableFloatDouble::TypeInfo; + TypeInfo::Type cppValue; + + double valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().DoubleToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableOctetStringAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableOctetString::TypeInfo; + TypeInfo::Type cppValue; + + chip::ByteSpan valueValue; + if (value != nullptr) + { + valueValue = chip::JniByteArray(env, static_cast(value)).byteSpan(); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() + : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableCharStringAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableCharString::TypeInfo; + TypeInfo::Type cppValue; + + chip::CharSpan valueValue; + if (value != nullptr) + { + valueValue = chip::JniUtfString(env, static_cast(value)).charSpan(); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() + : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableEnumAttrAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableEnumAttr::TypeInfo; + TypeInfo::Type cppValue; + + decltype(cppValue)::UnderlyingType valueValue; + if (value != nullptr) + { + valueValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() + : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableRangeRestrictedInt8uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableRangeRestrictedInt8u::TypeInfo; + TypeInfo::Type cppValue; + + uint8_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableRangeRestrictedInt8sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableRangeRestrictedInt8s::TypeInfo; + TypeInfo::Type cppValue; + + int8_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableRangeRestrictedInt16uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableRangeRestrictedInt16u::TypeInfo; + TypeInfo::Type cppValue; + + uint16_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableRangeRestrictedInt16sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableRangeRestrictedInt16s::TypeInfo; + TypeInfo::Type cppValue; + + int16_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ThermostatCluster, writeOccupiedCoolingSetpointAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::OccupiedCoolingSetpoint::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ThermostatCluster, writeOccupiedHeatingSetpointAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::OccupiedHeatingSetpoint::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ThermostatCluster, writeMinHeatSetpointLimitAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MinHeatSetpointLimit::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ThermostatCluster, writeMaxHeatSetpointLimitAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MaxHeatSetpointLimit::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ThermostatCluster, writeMinCoolSetpointLimitAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MinCoolSetpointLimit::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ThermostatCluster, writeMaxCoolSetpointLimitAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MaxCoolSetpointLimit::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ThermostatCluster, writeMinSetpointDeadBandAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MinSetpointDeadBand::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ThermostatCluster, writeControlSequenceOfOperationAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::ControlSequenceOfOperation::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ThermostatCluster, writeSystemModeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::SystemMode::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, writeTemperatureDisplayModeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatUserInterfaceConfigurationCluster * cppCluster = + reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, writeKeypadLockoutAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatUserInterfaceConfigurationCluster * cppCluster = + reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, writeScheduleProgrammingVisibilityAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatUserInterfaceConfigurationCluster * cppCluster = + reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, WindowCoveringCluster, writeModeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::Mode::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + WindowCoveringCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index c10a80d81e035c..c41372e5433178 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -5135,6 +5135,11 @@ class AuthMode(IntEnum): kCase = 0x02 kGroup = 0x03 + class ChangeTypeEnum(IntEnum): + kChanged = 0x00 + kAdded = 0x01 + kRemoved = 0x02 + class Privilege(IntEnum): kView = 0x01 kProxyView = 0x02 @@ -5276,6 +5281,61 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'uint' = 0 + class Events: + @dataclass + class AccessControlEntryChanged(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x001F + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields = [ + ClusterObjectFieldDescriptor(Label="adminFabricIndex", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="adminNodeID", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="adminPasscodeID", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="changeType", Tag=3, Type=AccessControl.Enums.ChangeTypeEnum), + ClusterObjectFieldDescriptor(Label="latestValue", Tag=4, Type=AccessControl.Structs.AccessControlEntry), + ]) + + adminFabricIndex: 'uint' = 0 + adminNodeID: 'uint' = 0 + adminPasscodeID: 'uint' = 0 + changeType: 'AccessControl.Enums.ChangeTypeEnum' = 0 + latestValue: 'AccessControl.Structs.AccessControlEntry' = field(default_factory=lambda: AccessControl.Structs.AccessControlEntry()) + + @dataclass + class AccessControlExtensionChanged(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x001F + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields = [ + ClusterObjectFieldDescriptor(Label="adminFabricIndex", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="adminNodeID", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="adminPasscodeID", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="changeType", Tag=3, Type=AccessControl.Enums.ChangeTypeEnum), + ClusterObjectFieldDescriptor(Label="latestValue", Tag=4, Type=AccessControl.Structs.ExtensionEntry), + ]) + + adminFabricIndex: 'uint' = 0 + adminNodeID: 'uint' = 0 + adminPasscodeID: 'uint' = 0 + changeType: 'AccessControl.Enums.ChangeTypeEnum' = 0 + latestValue: 'AccessControl.Structs.ExtensionEntry' = field(default_factory=lambda: AccessControl.Structs.ExtensionEntry()) + @dataclass class PollControl(Cluster): diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm index c9fb60c87a4b87..ceddfbdd80ab0e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm @@ -6724,6 +6724,58 @@ } } +void CHIPAccessControlClusterChangeTypeEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::AccessControl::ChangeTypeEnum value) +{ + NSNumber * _Nonnull objCValue; + objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; + DispatchSuccess(context, objCValue); +}; + +void CHIPAccessControlClusterChangeTypeEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +{ + auto * self = static_cast(context); + if (!self->mQueue) { + return; + } + + if (self->mEstablishedHandler != nil) { + dispatch_async(self->mQueue, self->mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + self->mEstablishedHandler = nil; + } +} + +void CHIPNullableAccessControlClusterChangeTypeEnumAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) +{ + NSNumber * _Nullable objCValue; + if (value.IsNull()) { + objCValue = nil; + } else { + objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value.Value())]; + } + DispatchSuccess(context, objCValue); +}; + +void CHIPNullableAccessControlClusterChangeTypeEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +{ + auto * self = static_cast(context); + if (!self->mQueue) { + return; + } + + if (self->mEstablishedHandler != nil) { + dispatch_async(self->mQueue, self->mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + self->mEstablishedHandler = nil; + } +} + void CHIPAccessControlClusterPrivilegeAttributeCallbackBridge::OnSuccessFn( void * context, chip::app::Clusters::AccessControl::Privilege value) { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h index 2e401162c7c2f0..86c30b46373114 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h @@ -165,6 +165,9 @@ typedef void (*NullableApplianceControlClusterWarningEventAttributeCallback)( typedef void (*AccessControlClusterAuthModeAttributeCallback)(void *, chip::app::Clusters::AccessControl::AuthMode); typedef void (*NullableAccessControlClusterAuthModeAttributeCallback)( void *, const chip::app::DataModel::Nullable &); +typedef void (*AccessControlClusterChangeTypeEnumAttributeCallback)(void *, chip::app::Clusters::AccessControl::ChangeTypeEnum); +typedef void (*NullableAccessControlClusterChangeTypeEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); typedef void (*AccessControlClusterPrivilegeAttributeCallback)(void *, chip::app::Clusters::AccessControl::Privilege); typedef void (*NullableAccessControlClusterPrivilegeAttributeCallback)( void *, const chip::app::DataModel::Nullable &); @@ -5403,6 +5406,64 @@ class CHIPNullableAccessControlClusterAuthModeAttributeCallbackSubscriptionBridg SubscriptionEstablishedHandler mEstablishedHandler; }; +class CHIPAccessControlClusterChangeTypeEnumAttributeCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPAccessControlClusterChangeTypeEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + + static void OnSuccessFn(void * context, chip::app::Clusters::AccessControl::ChangeTypeEnum value); +}; + +class CHIPAccessControlClusterChangeTypeEnumAttributeCallbackSubscriptionBridge + : public CHIPAccessControlClusterChangeTypeEnumAttributeCallbackBridge +{ +public: + CHIPAccessControlClusterChangeTypeEnumAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPAccessControlClusterChangeTypeEnumAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + +class CHIPNullableAccessControlClusterChangeTypeEnumAttributeCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPNullableAccessControlClusterChangeTypeEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; + + static void OnSuccessFn(void * context, + const chip::app::DataModel::Nullable & value); +}; + +class CHIPNullableAccessControlClusterChangeTypeEnumAttributeCallbackSubscriptionBridge + : public CHIPNullableAccessControlClusterChangeTypeEnumAttributeCallbackBridge +{ +public: + CHIPNullableAccessControlClusterChangeTypeEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPNullableAccessControlClusterChangeTypeEnumAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + class CHIPAccessControlClusterPrivilegeAttributeCallbackBridge : public CHIPCallbackBridge { diff --git a/src/transport/SecureMessageCodec.cpp b/src/transport/SecureMessageCodec.cpp index 3fb6775311fd3d..5ae7a56d3eee19 100644 --- a/src/transport/SecureMessageCodec.cpp +++ b/src/transport/SecureMessageCodec.cpp @@ -29,8 +29,6 @@ #include #include -#include "transport/TraceMessage.h" - namespace chip { using System::PacketBuffer; @@ -53,7 +51,6 @@ CHIP_ERROR Encrypt(Transport::SecureSession * session, PayloadHeader & payloadHe uint8_t * data = msgBuf->Start(); uint16_t totalLen = msgBuf->TotalLength(); - CHIP_TRACE_MESSAGE(payloadHeader, packetHeader, data, totalLen); MessageAuthenticationCode mac; ReturnErrorOnFailure(session->EncryptBeforeSend(data, totalLen, data, packetHeader, mac)); diff --git a/src/transport/SessionManager.cpp b/src/transport/SessionManager.cpp index 25a195ff3fca9e..2aca1cdcaf8445 100644 --- a/src/transport/SessionManager.cpp +++ b/src/transport/SessionManager.cpp @@ -29,6 +29,7 @@ #include #include +#include "transport/TraceMessage.h" #include #include #include @@ -135,6 +136,10 @@ CHIP_ERROR SessionManager::PrepareMessage(const SessionHandle & sessionHandle, P { return CHIP_ERROR_INTERNAL; } + + // Trace before any encryption + CHIP_TRACE_MESSAGE_SENT(payloadHeader, packetHeader, message->Start(), message->TotalLength()); + // TODO #11911 Update SecureMessageCodec::Encrypt for Group ReturnErrorOnFailure(payloadHeader.EncodeBeforeData(message)); @@ -158,6 +163,9 @@ CHIP_ERROR SessionManager::PrepareMessage(const SessionHandle & sessionHandle, P .SetSessionId(session->GetPeerSessionId()) // .SetSessionType(Header::SessionType::kUnicastSession); + // Trace before any encryption + CHIP_TRACE_MESSAGE_SENT(payloadHeader, packetHeader, message->Start(), message->TotalLength()); + ReturnErrorOnFailure(SecureMessageCodec::Encrypt(session, payloadHeader, packetHeader, message)); ReturnErrorOnFailure(counter.Advance()); @@ -168,14 +176,16 @@ CHIP_ERROR SessionManager::PrepareMessage(const SessionHandle & sessionHandle, P } break; case Transport::Session::SessionType::kUnauthenticated: { - ReturnErrorOnFailure(payloadHeader.EncodeBeforeData(message)); - MessageCounter & counter = mGlobalUnencryptedMessageCounter; uint32_t messageCounter = counter.Value(); ReturnErrorOnFailure(counter.Advance()); - packetHeader.SetMessageCounter(messageCounter); + // Trace after all headers are settled. + CHIP_TRACE_MESSAGE_SENT(payloadHeader, packetHeader, message->Start(), message->TotalLength()); + + ReturnErrorOnFailure(payloadHeader.EncodeBeforeData(message)); + #if CHIP_PROGRESS_LOGGING destination = kUndefinedNodeId; fabricIndex = kUndefinedFabricIndex; @@ -457,6 +467,7 @@ void SessionManager::MessageDispatch(const PacketHeader & packetHeader, const Tr if (mCB != nullptr) { + CHIP_TRACE_MESSAGE_RECEIVED(payloadHeader, packetHeader, unsecuredSession, peerAddress, msg->Start(), msg->TotalLength()); mCB->OnMessageReceived(packetHeader, payloadHeader, session, peerAddress, isDuplicate, std::move(msg)); } } @@ -532,6 +543,7 @@ void SessionManager::SecureUnicastMessageDispatch(const PacketHeader & packetHea if (mCB != nullptr) { + CHIP_TRACE_MESSAGE_RECEIVED(payloadHeader, packetHeader, secureSession, peerAddress, msg->Start(), msg->TotalLength()); mCB->OnMessageReceived(packetHeader, payloadHeader, session.Value(), peerAddress, isDuplicate, std::move(msg)); } } @@ -609,6 +621,7 @@ void SessionManager::SecureGroupMessageDispatch(const PacketHeader & packetHeade VerifyOrReturn(session.HasValue(), ChipLogError(Inet, "Error when creating group session handle.")); Transport::GroupSession * groupSession = session.Value()->AsGroupSession(); + CHIP_TRACE_MESSAGE_RECEIVED(payloadHeader, packetHeader, groupSession, peerAddress, msg->Start(), msg->TotalLength()); mCB->OnMessageReceived(packetHeader, payloadHeader, session.Value(), peerAddress, isDuplicate, std::move(msg)); RemoveGroupSession(groupSession); diff --git a/src/transport/TraceMessage.h b/src/transport/TraceMessage.h index b59ba910e76e72..0863bf0cc9cec8 100644 --- a/src/transport/TraceMessage.h +++ b/src/transport/TraceMessage.h @@ -19,20 +19,37 @@ #pragma once #include +#include #include +#include #if CHIP_CONFIG_TRANSPORT_TRACE_ENABLED #include "pw_trace/trace.h" -#define CHIP_TRACE_MESSAGE(payloadHeader, packetHeader, data, dataLen) \ +#define CHIP_TRACE_MESSAGE_SENT(payloadHeader, packetHeader, data, dataLen) \ do \ { \ - ::chip::trace::TraceSecureMessageData _trace_data{ &payloadHeader, &packetHeader, data, dataLen }; \ - PW_TRACE_INSTANT_DATA("SecureMsg", ::chip::trace::kTraceSecureMessageDataFormat, \ - reinterpret_cast(&_trace_data), sizeof(_trace_data)); \ + const ::chip::trace::TraceSecureMessageSentData _trace_data{ &payloadHeader, &packetHeader, data, dataLen }; \ + PW_TRACE_INSTANT_DATA("SecureMsg", ::chip::trace::kTraceMessageSentDataFormat, \ + reinterpret_cast(&_trace_data), sizeof(_trace_data)); \ } while (0) + +#define CHIP_TRACE_MESSAGE_RECEIVED(payloadHeader, packetHeader, session, peerAddress, data, dataLen) \ + do \ + { \ + const ::chip::trace::TraceSecureMessageReceivedData _trace_data{ &payloadHeader, &packetHeader, session, \ + &peerAddress, data, dataLen }; \ + PW_TRACE_INSTANT_DATA("SecureMsg", ::chip::trace::kTraceMessageReceivedDataFormat, \ + reinterpret_cast(&_trace_data), sizeof(_trace_data)); \ + } while (0) + #else -#define CHIP_TRACE_MESSAGE(payloadHeader, packetHeader, data, dataLen) \ +#define CHIP_TRACE_MESSAGE_SENT(payloadHeader, packetHeader, data, dataLen) \ + do \ + { \ + } while (0) + +#define CHIP_TRACE_MESSAGE_RECEIVED(payloadHeader, packetHeader, session, peerAddress, data, dataLen) \ do \ { \ } while (0) @@ -42,13 +59,25 @@ namespace chip { namespace trace { -constexpr const char * kTraceSecureMessageDataFormat = "SecMsg"; +constexpr const char * kTraceMessageEvent = "SecureMsg"; +constexpr const char * kTraceMessageSentDataFormat = "SecMsgSent"; +constexpr const char * kTraceMessageReceivedDataFormat = "SecMsgReceived"; + +struct TraceSecureMessageSentData +{ + const PayloadHeader * payloadHeader; + const PacketHeader * packetHeader; + const uint8_t * packetPayload; + size_t packetSize; +}; -struct TraceSecureMessageData +struct TraceSecureMessageReceivedData { - PayloadHeader * payloadHeader; - PacketHeader * packetHeader; - uint8_t * packetPayload; + const PayloadHeader * payloadHeader; + const PacketHeader * packetHeader; + const Transport::Session * session; + const Transport::PeerAddress * peerAddress; + const uint8_t * packetPayload; size_t packetSize; }; diff --git a/src/transport/raw/MessageHeader.h b/src/transport/raw/MessageHeader.h index 14e49272db62b3..e5e048855d5060 100644 --- a/src/transport/raw/MessageHeader.h +++ b/src/transport/raw/MessageHeader.h @@ -439,6 +439,9 @@ class PayloadHeader /** Get the secure msg type from this header. */ uint8_t GetMessageType() const { return mMessageType; } + /** Get the raw exchange flags from this header. */ + uint8_t GetExhangeFlags() const { return mExchangeFlags.Raw(); } + /** Check whether the header has a given secure message type */ bool HasMessageType(uint8_t type) const { return mMessageType == type; } template ::value>> diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index 434c297a8fb0c0..7e95d5d2a9690c 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -4635,6 +4635,106 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre } // namespace Attributes namespace Events { +namespace AccessControlEntryChanged { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kAdminFabricIndex)), adminFabricIndex)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kAdminNodeID)), adminNodeID)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kAdminPasscodeID)), adminPasscodeID)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kChangeType)), changeType)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kLatestValue)), latestValue)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kAdminFabricIndex): + ReturnErrorOnFailure(DataModel::Decode(reader, adminFabricIndex)); + break; + case to_underlying(Fields::kAdminNodeID): + ReturnErrorOnFailure(DataModel::Decode(reader, adminNodeID)); + break; + case to_underlying(Fields::kAdminPasscodeID): + ReturnErrorOnFailure(DataModel::Decode(reader, adminPasscodeID)); + break; + case to_underlying(Fields::kChangeType): + ReturnErrorOnFailure(DataModel::Decode(reader, changeType)); + break; + case to_underlying(Fields::kLatestValue): + ReturnErrorOnFailure(DataModel::Decode(reader, latestValue)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace AccessControlEntryChanged. +namespace AccessControlExtensionChanged { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kAdminFabricIndex)), adminFabricIndex)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kAdminNodeID)), adminNodeID)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kAdminPasscodeID)), adminPasscodeID)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kChangeType)), changeType)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kLatestValue)), latestValue)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kAdminFabricIndex): + ReturnErrorOnFailure(DataModel::Decode(reader, adminFabricIndex)); + break; + case to_underlying(Fields::kAdminNodeID): + ReturnErrorOnFailure(DataModel::Decode(reader, adminNodeID)); + break; + case to_underlying(Fields::kAdminPasscodeID): + ReturnErrorOnFailure(DataModel::Decode(reader, adminPasscodeID)); + break; + case to_underlying(Fields::kChangeType): + ReturnErrorOnFailure(DataModel::Decode(reader, changeType)); + break; + case to_underlying(Fields::kLatestValue): + ReturnErrorOnFailure(DataModel::Decode(reader, latestValue)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace AccessControlExtensionChanged. } // namespace Events } // namespace AccessControl diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 58bd22d5af126a..01549823f9e6bf 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -6402,6 +6402,13 @@ enum class AuthMode : uint8_t kCase = 0x02, kGroup = 0x03, }; +// Enum for ChangeTypeEnum +enum class ChangeTypeEnum : uint8_t +{ + kChanged = 0x00, + kAdded = 0x01, + kRemoved = 0x02, +}; // Enum for Privilege enum class Privilege : uint8_t { @@ -6576,6 +6583,98 @@ struct TypeInfo }; }; } // namespace Attributes +namespace Events { +namespace AccessControlEntryChanged { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; +static constexpr EventId kEventId = 0x00000000; + +enum class Fields +{ + kAdminFabricIndex = 0, + kAdminNodeID = 1, + kAdminPasscodeID = 2, + kChangeType = 3, + kLatestValue = 4, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return kEventId; } + static constexpr ClusterId GetClusterId() { return Clusters::AccessControl::Id; } + + chip::FabricIndex adminFabricIndex = static_cast(0); + chip::NodeId adminNodeID = static_cast(0); + uint16_t adminPasscodeID = static_cast(0); + ChangeTypeEnum changeType = static_cast(0); + Structs::AccessControlEntry::Type latestValue; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return kEventId; } + static constexpr ClusterId GetClusterId() { return Clusters::AccessControl::Id; } + + chip::FabricIndex adminFabricIndex = static_cast(0); + chip::NodeId adminNodeID = static_cast(0); + uint16_t adminPasscodeID = static_cast(0); + ChangeTypeEnum changeType = static_cast(0); + Structs::AccessControlEntry::DecodableType latestValue; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace AccessControlEntryChanged +namespace AccessControlExtensionChanged { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; +static constexpr EventId kEventId = 0x00000001; + +enum class Fields +{ + kAdminFabricIndex = 0, + kAdminNodeID = 1, + kAdminPasscodeID = 2, + kChangeType = 3, + kLatestValue = 4, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return kEventId; } + static constexpr ClusterId GetClusterId() { return Clusters::AccessControl::Id; } + + chip::FabricIndex adminFabricIndex = static_cast(0); + chip::NodeId adminNodeID = static_cast(0); + uint16_t adminPasscodeID = static_cast(0); + ChangeTypeEnum changeType = static_cast(0); + Structs::ExtensionEntry::Type latestValue; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return kEventId; } + static constexpr ClusterId GetClusterId() { return Clusters::AccessControl::Id; } + + chip::FabricIndex adminFabricIndex = static_cast(0); + chip::NodeId adminNodeID = static_cast(0); + uint16_t adminPasscodeID = static_cast(0); + ChangeTypeEnum changeType = static_cast(0); + Structs::ExtensionEntry::DecodableType latestValue; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace AccessControlExtensionChanged +} // namespace Events } // namespace AccessControl namespace PollControl { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 693545450dfaea..5a20477601ac5b 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -148,6 +148,10 @@ CHIP_ERROR LogValue(const char * label, size_t indent, CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::TestCluster::Structs::TestListStructOctet::DecodableType & value); +CHIP_ERROR LogValue(const char * label, size_t indent, + chip::app::Clusters::AccessControl::Events::AccessControlEntryChanged::DecodableType value); +CHIP_ERROR LogValue(const char * label, size_t indent, + chip::app::Clusters::AccessControl::Events::AccessControlExtensionChanged::DecodableType value); CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::BridgedActions::Events::StateChanged::DecodableType value); CHIP_ERROR LogValue(const char * label, size_t indent, @@ -2543,6 +2547,104 @@ CHIP_ERROR LogValue(const char * label, size_t indent, // be logging. #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-function" +CHIP_ERROR LogValue(const char * label, size_t indent, + chip::app::Clusters::AccessControl::Events::AccessControlEntryChanged::DecodableType value) +{ + ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); + { + CHIP_ERROR err = LogValue("AdminFabricIndex", indent + 1, value.adminFabricIndex); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'AdminFabricIndex'", + IndentStr(indent + 1).c_str()); + return err; + } + } + { + CHIP_ERROR err = LogValue("AdminNodeID", indent + 1, value.adminNodeID); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'AdminNodeID'", IndentStr(indent + 1).c_str()); + return err; + } + } + { + CHIP_ERROR err = LogValue("AdminPasscodeID", indent + 1, value.adminPasscodeID); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'AdminPasscodeID'", + IndentStr(indent + 1).c_str()); + return err; + } + } + { + CHIP_ERROR err = LogValue("ChangeType", indent + 1, value.changeType); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'ChangeType'", IndentStr(indent + 1).c_str()); + return err; + } + } + { + CHIP_ERROR err = LogValue("LatestValue", indent + 1, value.latestValue); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'LatestValue'", IndentStr(indent + 1).c_str()); + return err; + } + } + ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); + return CHIP_NO_ERROR; +} +CHIP_ERROR LogValue(const char * label, size_t indent, + chip::app::Clusters::AccessControl::Events::AccessControlExtensionChanged::DecodableType value) +{ + ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); + { + CHIP_ERROR err = LogValue("AdminFabricIndex", indent + 1, value.adminFabricIndex); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'AdminFabricIndex'", + IndentStr(indent + 1).c_str()); + return err; + } + } + { + CHIP_ERROR err = LogValue("AdminNodeID", indent + 1, value.adminNodeID); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'AdminNodeID'", IndentStr(indent + 1).c_str()); + return err; + } + } + { + CHIP_ERROR err = LogValue("AdminPasscodeID", indent + 1, value.adminPasscodeID); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'AdminPasscodeID'", + IndentStr(indent + 1).c_str()); + return err; + } + } + { + CHIP_ERROR err = LogValue("ChangeType", indent + 1, value.changeType); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'ChangeType'", IndentStr(indent + 1).c_str()); + return err; + } + } + { + CHIP_ERROR err = LogValue("LatestValue", indent + 1, value.latestValue); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'LatestValue'", IndentStr(indent + 1).c_str()); + return err; + } + } + ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); + return CHIP_NO_ERROR; +} CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::BridgedActions::Events::StateChanged::DecodableType value) { @@ -4516,8 +4618,157 @@ static void OnThermostatGetWeeklyScheduleResponseSuccess( | * ClusterRevision | 0xFFFD | |------------------------------------------------------------------------------| | Events: | | +| * AccessControlEntryChanged | 0x0000 | +| * AccessControlExtensionChanged | 0x0001 | \*----------------------------------------------------------------------------*/ +/* + * Event AccessControlEntryChanged + */ +class ReadAccessControlAccessControlEntryChanged : public ModelCommand +{ +public: + ReadAccessControlAccessControlEntryChanged() : ModelCommand("read-event") + { + AddArgument("event-name", "access-control-entry-changed"); + ModelCommand::AddArguments(); + } + + ~ReadAccessControlAccessControlEntryChanged() {} + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x001F) ReadEvent on endpoint %" PRIu8, endpointId); + + chip::Controller::AccessControlCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadEvent( + this, OnEventResponse, OnDefaultFailure); + } + + static void OnEventResponse(void * context, + chip::app::Clusters::AccessControl::Events::AccessControlEntryChanged::DecodableType value) + { + OnGeneralAttributeEventResponse(context, "AccessControl.AccessControlEntryChanged response", value); + } +}; + +class ReportAccessControlAccessControlEntryChanged : public ModelCommand +{ +public: + ReportAccessControlAccessControlEntryChanged() : ModelCommand("report-event") + { + AddArgument("event-name", "access-control-entry-changed"); + AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); + AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); + AddArgument("wait", 0, 1, &mWait); + ModelCommand::AddArguments(); + } + + ~ReportAccessControlAccessControlEntryChanged() {} + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x001F) ReportEvent on endpoint %" PRIu8, endpointId); + + chip::Controller::AccessControlCluster cluster; + cluster.Associate(device, endpointId); + + auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; + return cluster.SubscribeEvent( + this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } + + static void OnValueReport(void * context, + chip::app::Clusters::AccessControl::Events::AccessControlEntryChanged::DecodableType value) + { + LogValue("AccessControl.AccessControlEntryChanged report", 0, value); + } + +private: + uint16_t mMinInterval; + uint16_t mMaxInterval; + bool mWait; +}; +/* + * Event AccessControlExtensionChanged + */ +class ReadAccessControlAccessControlExtensionChanged : public ModelCommand +{ +public: + ReadAccessControlAccessControlExtensionChanged() : ModelCommand("read-event") + { + AddArgument("event-name", "access-control-extension-changed"); + ModelCommand::AddArguments(); + } + + ~ReadAccessControlAccessControlExtensionChanged() {} + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x001F) ReadEvent on endpoint %" PRIu8, endpointId); + + chip::Controller::AccessControlCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadEvent( + this, OnEventResponse, OnDefaultFailure); + } + + static void OnEventResponse(void * context, + chip::app::Clusters::AccessControl::Events::AccessControlExtensionChanged::DecodableType value) + { + OnGeneralAttributeEventResponse(context, "AccessControl.AccessControlExtensionChanged response", value); + } +}; + +class ReportAccessControlAccessControlExtensionChanged : public ModelCommand +{ +public: + ReportAccessControlAccessControlExtensionChanged() : ModelCommand("report-event") + { + AddArgument("event-name", "access-control-extension-changed"); + AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); + AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); + AddArgument("wait", 0, 1, &mWait); + ModelCommand::AddArguments(); + } + + ~ReportAccessControlAccessControlExtensionChanged() {} + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x001F) ReportEvent on endpoint %" PRIu8, endpointId); + + chip::Controller::AccessControlCluster cluster; + cluster.Associate(device, endpointId); + + auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; + return cluster.SubscribeEvent( + this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } + + static void OnValueReport(void * context, + chip::app::Clusters::AccessControl::Events::AccessControlExtensionChanged::DecodableType value) + { + LogValue("AccessControl.AccessControlExtensionChanged report", 0, value); + } + +private: + uint16_t mMinInterval; + uint16_t mMaxInterval; + bool mWait; +}; + /* * Attribute Acl */ @@ -59892,11 +60143,15 @@ void registerClusterAccessControl(Commands & commands) const char * clusterName = "AccessControl"; commands_list clusterCommands = { - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // }; commands.Register(clusterName, clusterCommands); diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp index 2747ebd5c3e560..dd20a3ee7b79d6 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp @@ -2331,7 +2331,7 @@ bool emberAfChannelClusterChangeChannelResponseCallback( Callback::Callback * cb = Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext, ChannelInfo(), errorType); + cb->mCall(cb->mContext, ::ChannelInfo(), errorType); return true; } @@ -2498,7 +2498,7 @@ bool emberAfGroupKeyManagementClusterKeySetReadResponseCallback( Callback::Callback * cb = Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext, GroupKeySet()); + cb->mCall(cb->mContext, ::GroupKeySet()); return true; } @@ -2897,7 +2897,7 @@ bool emberAfTestClusterClusterSimpleStructResponseCallback( Callback::Callback * cb = Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext, SimpleStruct()); + cb->mCall(cb->mContext, ::SimpleStruct()); return true; }