From 62bf76b142208dd8b8b5bfb15a6daacd930415b1 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 21 Aug 2024 19:41:16 -0400 Subject: [PATCH 01/10] Fix Darwin to handle renames of Color Control data types. (#35135) https://github.com/project-chip/connectedhomeip/pull/33612 made the following changes to the Color Control cluster: 1) Renamed HueDirection to DirectionEnum 2) Renamed the ShortestDistance and LongestDistance values of DirectionEnum to Shortest and Longest, respectively. 3) Renamed HueMoveMode to MoveModeEnum. 4) Renamed HueStepMode to StepModeEnum. 5) Removed SaturationMoveMode in favor of MoveModeEnum. 6) Removed SaturationStepMode in favor of StepModeEnum. 7) Renamed ColorMode to ColorModeEnum. 8) Renamed the ColorTemperature value to ColorTemperatureMireds 8) Renamed ColorCapabilities to ColorCapabilitiesBitmap. 9) Renamed various fields of ColorCapabilitiesBitmap. 10) Renamed ColorLoopUpdateFlags to UpdateFlagsBitmap. 11) Renamed ColorLoopAction to ColorLoopActionEnum. 12) Added OptionsBitmap, EnhancedColorModeEnum, DriftCompensationEnum. 13) Renamed ColorLoopDirection to ColorLoopDirectionEnum. 14) Renamed the DecrementHue and IncrementHue values of ColorLoopDirectionEnum to Decrement and Increment, respectively. This change adds the right renamed/introduced/deprecated annotations for the above changes, and adds manual shims for the enums that got removed. --- .../Framework/CHIP/MTRBackwardsCompatShims.h | 29 +++ .../CHIP/templates/availability.yaml | 143 +++++++++++++- .../CHIP/zap-generated/MTRBaseClusters.h | 177 +++++++++++++----- 3 files changed, 296 insertions(+), 53 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRBackwardsCompatShims.h b/src/darwin/Framework/CHIP/MTRBackwardsCompatShims.h index 8903957414fc36..1a183c83def9b5 100644 --- a/src/darwin/Framework/CHIP/MTRBackwardsCompatShims.h +++ b/src/darwin/Framework/CHIP/MTRBackwardsCompatShims.h @@ -159,4 +159,33 @@ typedef NS_ENUM(uint8_t, MTROTASoftwareUpdateRequestorOTAUpdateState) { = 0x08, } MTR_DEPRECATED("Please use MTROTASoftwareUpdateRequestorUpdateState", ios(16.4, 17.2), macos(13.3, 14.2), watchos(9.4, 10.2), tvos(16.4, 17.2)); +/** + * ColorControl used to have HueMoveMode/SaturationMoveMode and HueStepMode/SaturationStepMode that had + * identical values. Those got replaced with MoveModeEnum and StepModeEnum respectively. We codegen + * HueMoveMode and HueStepMode as aliases of MoveModeEnum and StepModeEnum, but we need manual shims for + * SaturationMoveMode and SaturationStepMode. + */ +typedef NS_ENUM(uint8_t, MTRColorControlSaturationMoveMode) { + MTRColorControlSaturationMoveModeStop MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlMoveModeStop") + = 0x00, + MTRColorControlSaturationMoveModeUp MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlMoveModeUp") + = 0x01, + MTRColorControlSaturationMoveModeDown MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlMoveModeDown") + = 0x03, +} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlMoveMode"); + +typedef NS_ENUM(uint8_t, MTRColorControlSaturationStepMode) { + MTRColorControlSaturationStepModeUp MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlStepModeUp") + = 0x01, + MTRColorControlSaturationStepModeDown MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlStepModeDown") + = 0x03, +} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlStepMode"); + NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index c1f1e1bd6f0e6c..2272d5256d934e 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -3237,9 +3237,15 @@ - FanModeSequenceType - FanModeType ColorControl: - - ColorLoopAction - - ColorLoopDirection - - ColorMode + # ColorLoopActionEnum, ColorLoopDirectionEnum and ColorModeEnum + # were originally named ColorLoopAction, ColorLoopDirection, and + # ColorMode, but we generate the same API for the names + # with/without "Enum" at the end and the cluster name + # present/absent at the beginning, so the names can just change + # here. + - ColorLoopActionEnum + - ColorLoopDirectionEnum + - ColorModeEnum - HueDirection - HueMoveMode - HueStepMode @@ -3980,14 +3986,20 @@ - Auto - Smart ColorControl: - ColorLoopAction: + # ColorLoopActionEnum, ColorLoopDirectionEnum and ColorModeEnum + # were originally named ColorLoopAction, ColorLoopDirection, and + # ColorMode, but we generate the same API for the names + # with/without "Enum" at the end and the cluster name + # present/absent at the beginning, so the names can just change + # here. + ColorLoopActionEnum: - Deactivate - ActivateFromColorLoopStartEnhancedHue - ActivateFromEnhancedCurrentHue - ColorLoopDirection: + ColorLoopDirectionEnum: - DecrementHue - IncrementHue - ColorMode: + ColorModeEnum: - CurrentHueAndCurrentSaturation - CurrentXAndCurrentY - ColorTemperature @@ -9682,6 +9694,64 @@ - release: "Future" versions: "future" + introduced: + enums: + ColorControl: + - DirectionEnum + - DriftCompensationEnum + - EnhancedColorModeEnum + - MoveModeEnum + - StepModeEnum + enum values: + ColorControl: + ColorLoopDirectionEnum: + - Decrement + - Increment + ColorModeEnum: + - ColorTemperatureMireds + DirectionEnum: + - Shortest + - Longest + - Up + - Down + DriftCompensationEnum: + - None + - OtherOrUnknown + - TemperatureMonitoring + - OpticalLuminanceMonitoringAndFeedback + - OpticalColorMonitoringAndFeedback + EnhancedColorModeEnum: + - CurrentHueAndCurrentSaturation + - CurrentXAndCurrentY + - ColorTemperatureMireds + - EnhancedCurrentHueAndCurrentSaturation + MoveModeEnum: + - Stop + - Up + - Down + StepModeEnum: + - Up + - Down + bitmaps: + ColorControl: + - ColorCapabilitiesBitmap + - OptionsBitmap + - UpdateFlagsBitmap + bitmap values: + ColorControl: + ColorCapabilitiesBitmap: + - HueSaturation + - EnhancedHue + - ColorLoop + - XY + - ColorTemperature + OptionsBitmap: + - ExecuteIfOff + UpdateFlagsBitmap: + - UpdateAction + - UpdateDirection + - UpdateTime + - UpdateStartHue provisional: clusters: # Targeting 1.4 @@ -9820,3 +9890,64 @@ Feature: # Targeting 1.4 - ActionSwitch + renames: + enums: + ColorControl: + DirectionEnum: HueDirection + MoveModeEnum: HueMoveMode + StepModeEnum: HueStepMode + enum values: + ColorControl: + ColorLoopDirectionEnum: + Decrement: DecrementHue + Increment: IncrementHue + ColorModeEnum: + ColorTemperatureMireds: ColorTemperature + HueDirection: + Shortest: ShortestDistance + Longest: LongestDistance + bitmaps: + ColorControl: + ColorCapabilitiesBitmap: ColorCapabilities + UpdateFlagsBitmap: ColorLoopUpdateFlags + bitmap values: + ColorControl: + ColorCapabilities: + HueSaturation: HueSaturationSupported + EnhancedHue: EnhancedHueSupported + ColorLoop: ColorLoopSupported + XY: XYAttributesSupported + ColorTemperature: ColorTemperatureSupported + deprecated: + enums: + ColorControl: + - HueDirection + - HueMoveMode + - HueStepMode + enum values: + ColorControl: + ColorLoopDirectionEnum: + - DecrementHue + - IncrementHue + ColorModeEnum: + - ColorTemperature + bitmaps: + ColorControl: + - ColorCapabilities + - ColorLoopUpdateFlags + removed: + enum values: + ColorControl: + # Don't expose the new value names on the old enum names + HueDirection: + - Shortest + - Longest + bitmap values: + ColorControl: + # Don't expose the new field names on the old bitmap names + ColorCapabilities: + - HueSaturation + - EnhancedHue + - ColorLoop + - XY + - ColorTemperature diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index efb5fca9547fab..c00233470f81d6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -20203,62 +20203,129 @@ typedef NS_ENUM(uint8_t, MTRThermostatUserInterfaceConfigurationTemperatureDispl } MTR_AVAILABLE(ios(17.4), macos(14.4), watchos(10.4), tvos(17.4)); typedef NS_ENUM(uint8_t, MTRColorControlColorLoopAction) { - MTRColorControlColorLoopActionDeactivate MTR_PROVISIONALLY_AVAILABLE = 0x00, - MTRColorControlColorLoopActionActivateFromColorLoopStartEnhancedHue MTR_PROVISIONALLY_AVAILABLE = 0x01, - MTRColorControlColorLoopActionActivateFromEnhancedCurrentHue MTR_PROVISIONALLY_AVAILABLE = 0x02, -} MTR_PROVISIONALLY_AVAILABLE; + MTRColorControlColorLoopActionDeactivate MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x00, + MTRColorControlColorLoopActionActivateFromColorLoopStartEnhancedHue MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x01, + MTRColorControlColorLoopActionActivateFromEnhancedCurrentHue MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x02, +} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); typedef NS_ENUM(uint8_t, MTRColorControlColorLoopDirection) { - MTRColorControlColorLoopDirectionDecrement MTR_PROVISIONALLY_AVAILABLE = 0x00, - MTRColorControlColorLoopDirectionIncrement MTR_PROVISIONALLY_AVAILABLE = 0x01, -} MTR_PROVISIONALLY_AVAILABLE; + MTRColorControlColorLoopDirectionDecrement MTR_NEWLY_AVAILABLE = 0x00, + MTRColorControlColorLoopDirectionDecrementHue MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlColorLoopDirectionDecrement") + = 0x00, + MTRColorControlColorLoopDirectionIncrement MTR_NEWLY_AVAILABLE = 0x01, + MTRColorControlColorLoopDirectionIncrementHue MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlColorLoopDirectionIncrement") + = 0x01, +} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); typedef NS_ENUM(uint8_t, MTRColorControlColorMode) { - MTRColorControlColorModeCurrentHueAndCurrentSaturation MTR_PROVISIONALLY_AVAILABLE = 0x00, - MTRColorControlColorModeCurrentXAndCurrentY MTR_PROVISIONALLY_AVAILABLE = 0x01, - MTRColorControlColorModeColorTemperatureMireds MTR_PROVISIONALLY_AVAILABLE = 0x02, -} MTR_PROVISIONALLY_AVAILABLE; + MTRColorControlColorModeCurrentHueAndCurrentSaturation MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x00, + MTRColorControlColorModeCurrentXAndCurrentY MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x01, + MTRColorControlColorModeColorTemperatureMireds MTR_NEWLY_AVAILABLE = 0x02, + MTRColorControlColorModeColorTemperature MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlColorModeColorTemperatureMireds") + = 0x02, +} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); typedef NS_ENUM(uint8_t, MTRColorControlDirection) { - MTRColorControlDirectionShortest MTR_PROVISIONALLY_AVAILABLE = 0x00, - MTRColorControlDirectionLongest MTR_PROVISIONALLY_AVAILABLE = 0x01, - MTRColorControlDirectionUp MTR_PROVISIONALLY_AVAILABLE = 0x02, - MTRColorControlDirectionDown MTR_PROVISIONALLY_AVAILABLE = 0x03, -} MTR_PROVISIONALLY_AVAILABLE; + MTRColorControlDirectionShortest MTR_NEWLY_AVAILABLE = 0x00, + MTRColorControlDirectionLongest MTR_NEWLY_AVAILABLE = 0x01, + MTRColorControlDirectionUp MTR_NEWLY_AVAILABLE = 0x02, + MTRColorControlDirectionDown MTR_NEWLY_AVAILABLE = 0x03, +} MTR_NEWLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRColorControlHueDirection) { + MTRColorControlHueDirectionShortestDistance MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlDirectionShortest") + = 0x00, + MTRColorControlHueDirectionLongestDistance MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlDirectionLongest") + = 0x01, + MTRColorControlHueDirectionUp MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlDirectionUp") + = 0x02, + MTRColorControlHueDirectionDown MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlDirectionDown") + = 0x03, +} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlDirection"); typedef NS_ENUM(uint8_t, MTRColorControlDriftCompensation) { - MTRColorControlDriftCompensationNone MTR_PROVISIONALLY_AVAILABLE = 0x00, - MTRColorControlDriftCompensationOtherOrUnknown MTR_PROVISIONALLY_AVAILABLE = 0x01, - MTRColorControlDriftCompensationTemperatureMonitoring MTR_PROVISIONALLY_AVAILABLE = 0x02, - MTRColorControlDriftCompensationOpticalLuminanceMonitoringAndFeedback MTR_PROVISIONALLY_AVAILABLE = 0x03, - MTRColorControlDriftCompensationOpticalColorMonitoringAndFeedback MTR_PROVISIONALLY_AVAILABLE = 0x04, -} MTR_PROVISIONALLY_AVAILABLE; + MTRColorControlDriftCompensationNone MTR_NEWLY_AVAILABLE = 0x00, + MTRColorControlDriftCompensationOtherOrUnknown MTR_NEWLY_AVAILABLE = 0x01, + MTRColorControlDriftCompensationTemperatureMonitoring MTR_NEWLY_AVAILABLE = 0x02, + MTRColorControlDriftCompensationOpticalLuminanceMonitoringAndFeedback MTR_NEWLY_AVAILABLE = 0x03, + MTRColorControlDriftCompensationOpticalColorMonitoringAndFeedback MTR_NEWLY_AVAILABLE = 0x04, +} MTR_NEWLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRColorControlEnhancedColorMode) { - MTRColorControlEnhancedColorModeCurrentHueAndCurrentSaturation MTR_PROVISIONALLY_AVAILABLE = 0x00, - MTRColorControlEnhancedColorModeCurrentXAndCurrentY MTR_PROVISIONALLY_AVAILABLE = 0x01, - MTRColorControlEnhancedColorModeColorTemperatureMireds MTR_PROVISIONALLY_AVAILABLE = 0x02, - MTRColorControlEnhancedColorModeEnhancedCurrentHueAndCurrentSaturation MTR_PROVISIONALLY_AVAILABLE = 0x03, -} MTR_PROVISIONALLY_AVAILABLE; + MTRColorControlEnhancedColorModeCurrentHueAndCurrentSaturation MTR_NEWLY_AVAILABLE = 0x00, + MTRColorControlEnhancedColorModeCurrentXAndCurrentY MTR_NEWLY_AVAILABLE = 0x01, + MTRColorControlEnhancedColorModeColorTemperatureMireds MTR_NEWLY_AVAILABLE = 0x02, + MTRColorControlEnhancedColorModeEnhancedCurrentHueAndCurrentSaturation MTR_NEWLY_AVAILABLE = 0x03, +} MTR_NEWLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRColorControlMoveMode) { - MTRColorControlMoveModeStop MTR_PROVISIONALLY_AVAILABLE = 0x00, - MTRColorControlMoveModeUp MTR_PROVISIONALLY_AVAILABLE = 0x01, - MTRColorControlMoveModeDown MTR_PROVISIONALLY_AVAILABLE = 0x03, -} MTR_PROVISIONALLY_AVAILABLE; + MTRColorControlMoveModeStop MTR_NEWLY_AVAILABLE = 0x00, + MTRColorControlMoveModeUp MTR_NEWLY_AVAILABLE = 0x01, + MTRColorControlMoveModeDown MTR_NEWLY_AVAILABLE = 0x03, +} MTR_NEWLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRColorControlHueMoveMode) { + MTRColorControlHueMoveModeStop MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlMoveModeStop") + = 0x00, + MTRColorControlHueMoveModeUp MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlMoveModeUp") + = 0x01, + MTRColorControlHueMoveModeDown MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlMoveModeDown") + = 0x03, +} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlMoveMode"); typedef NS_ENUM(uint8_t, MTRColorControlStepMode) { - MTRColorControlStepModeUp MTR_PROVISIONALLY_AVAILABLE = 0x01, - MTRColorControlStepModeDown MTR_PROVISIONALLY_AVAILABLE = 0x03, -} MTR_PROVISIONALLY_AVAILABLE; + MTRColorControlStepModeUp MTR_NEWLY_AVAILABLE = 0x01, + MTRColorControlStepModeDown MTR_NEWLY_AVAILABLE = 0x03, +} MTR_NEWLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRColorControlHueStepMode) { + MTRColorControlHueStepModeUp MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlStepModeUp") + = 0x01, + MTRColorControlHueStepModeDown MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlStepModeDown") + = 0x03, +} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlStepMode"); typedef NS_OPTIONS(uint16_t, MTRColorControlColorCapabilitiesBitmap) { - MTRColorControlColorCapabilitiesBitmapHueSaturation MTR_PROVISIONALLY_AVAILABLE = 0x1, - MTRColorControlColorCapabilitiesBitmapEnhancedHue MTR_PROVISIONALLY_AVAILABLE = 0x2, - MTRColorControlColorCapabilitiesBitmapColorLoop MTR_PROVISIONALLY_AVAILABLE = 0x4, - MTRColorControlColorCapabilitiesBitmapXY MTR_PROVISIONALLY_AVAILABLE = 0x8, - MTRColorControlColorCapabilitiesBitmapColorTemperature MTR_PROVISIONALLY_AVAILABLE = 0x10, -} MTR_PROVISIONALLY_AVAILABLE; + MTRColorControlColorCapabilitiesBitmapHueSaturation MTR_NEWLY_AVAILABLE = 0x1, + MTRColorControlColorCapabilitiesBitmapEnhancedHue MTR_NEWLY_AVAILABLE = 0x2, + MTRColorControlColorCapabilitiesBitmapColorLoop MTR_NEWLY_AVAILABLE = 0x4, + MTRColorControlColorCapabilitiesBitmapXY MTR_NEWLY_AVAILABLE = 0x8, + MTRColorControlColorCapabilitiesBitmapColorTemperature MTR_NEWLY_AVAILABLE = 0x10, +} MTR_NEWLY_AVAILABLE; + +typedef NS_OPTIONS(uint16_t, MTRColorControlColorCapabilities) { + MTRColorControlColorCapabilitiesHueSaturationSupported MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlColorCapabilitiesBitmapHueSaturation") + = 0x1, + MTRColorControlColorCapabilitiesEnhancedHueSupported MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlColorCapabilitiesBitmapEnhancedHue") + = 0x2, + MTRColorControlColorCapabilitiesColorLoopSupported MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlColorCapabilitiesBitmapColorLoop") + = 0x4, + MTRColorControlColorCapabilitiesXYAttributesSupported MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlColorCapabilitiesBitmapXY") + = 0x8, + MTRColorControlColorCapabilitiesColorTemperatureSupported MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlColorCapabilitiesBitmapColorTemperature") + = 0x10, +} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlColorCapabilitiesBitmap"); typedef NS_OPTIONS(uint32_t, MTRColorControlFeature) { MTRColorControlFeatureHueAndSaturation MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x1, @@ -20269,15 +20336,31 @@ typedef NS_OPTIONS(uint32_t, MTRColorControlFeature) { } MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); typedef NS_OPTIONS(uint8_t, MTRColorControlOptionsBitmap) { - MTRColorControlOptionsBitmapExecuteIfOff MTR_PROVISIONALLY_AVAILABLE = 0x1, -} MTR_PROVISIONALLY_AVAILABLE; + MTRColorControlOptionsBitmapExecuteIfOff MTR_NEWLY_AVAILABLE = 0x1, +} MTR_NEWLY_AVAILABLE; typedef NS_OPTIONS(uint8_t, MTRColorControlUpdateFlagsBitmap) { - MTRColorControlUpdateFlagsBitmapUpdateAction MTR_PROVISIONALLY_AVAILABLE = 0x1, - MTRColorControlUpdateFlagsBitmapUpdateDirection MTR_PROVISIONALLY_AVAILABLE = 0x2, - MTRColorControlUpdateFlagsBitmapUpdateTime MTR_PROVISIONALLY_AVAILABLE = 0x4, - MTRColorControlUpdateFlagsBitmapUpdateStartHue MTR_PROVISIONALLY_AVAILABLE = 0x8, -} MTR_PROVISIONALLY_AVAILABLE; + MTRColorControlUpdateFlagsBitmapUpdateAction MTR_NEWLY_AVAILABLE = 0x1, + MTRColorControlUpdateFlagsBitmapUpdateDirection MTR_NEWLY_AVAILABLE = 0x2, + MTRColorControlUpdateFlagsBitmapUpdateTime MTR_NEWLY_AVAILABLE = 0x4, + MTRColorControlUpdateFlagsBitmapUpdateStartHue MTR_NEWLY_AVAILABLE = 0x8, +} MTR_NEWLY_AVAILABLE; + +typedef NS_OPTIONS(uint8_t, MTRColorControlColorLoopUpdateFlags) { + MTRColorControlColorLoopUpdateFlagsUpdateAction MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlUpdateFlagsBitmapUpdateAction") + = 0x1, + MTRColorControlColorLoopUpdateFlagsUpdateDirection MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlUpdateFlagsBitmapUpdateDirection") + = 0x2, + MTRColorControlColorLoopUpdateFlagsUpdateTime MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlUpdateFlagsBitmapUpdateTime") + = 0x4, + MTRColorControlColorLoopUpdateFlagsUpdateStartHue MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlUpdateFlagsBitmapUpdateStartHue") + = 0x8, +} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlUpdateFlagsBitmap"); typedef NS_OPTIONS(uint8_t, MTRBallastConfigurationBallastStatusBitmap) { MTRBallastConfigurationBallastStatusBitmapBallastNonOperational MTR_PROVISIONALLY_AVAILABLE = 0x1, From dd8b002e7e65d3f6b1f1a95ef8a740607202ea38 Mon Sep 17 00:00:00 2001 From: Sharad Binjola <31142146+sharadb-amazon@users.noreply.github.com> Date: Wed, 21 Aug 2024 17:01:20 -0700 Subject: [PATCH 02/10] Re-route deprecated android casting APIs to new ones (#35136) --- .../android/App/app/build.gradle | 4 +- .../com/chip/casting/app/CastingContext.java | 2 + .../chip/casting/app/CertTestFragment.java | 12 +- .../app/CommissionerDiscoveryFragment.java | 6 +- .../chip/casting/app/ConnectionFragment.java | 10 +- .../casting/app/ContentLauncherFragment.java | 6 +- .../casting/app/MediaPlaybackFragment.java | 6 +- .../casting/app/SelectClusterFragment.java | 6 +- .../chip/casting/util/DACProviderStub.java | 2 + .../casting/util/GlobalCastingConstants.java | 11 + .../jni/com/chip/casting/AppParameters.java | 2 + .../chip/casting/CommissioningCallbacks.java | 2 + .../jni/com/chip/casting/ContentApp.java | 37 + .../chip/casting/ContentLauncherTypes.java | 2 + .../jni/com/chip/casting/DACProvider.java | 2 + .../com/chip/casting/DiscoveredNodeData.java | 26 +- .../jni/com/chip/casting/FailureCallback.java | 6 +- .../chip/casting/MatterCallbackHandler.java | 6 +- .../jni/com/chip/casting/MatterError.java | 9 + .../com/chip/casting/MediaPlaybackTypes.java | 2 + .../SubscriptionEstablishedCallback.java | 2 + .../jni/com/chip/casting/SuccessCallback.java | 2 + .../chip/casting/TargetNavigatorTypes.java | 2 + .../jni/com/chip/casting/TvCastingApp.java | 1327 ++++++++++ .../jni/com/chip/casting/VideoPlayer.java | 62 +- .../App/app/src/main/AndroidManifest.xml | 4 +- .../casting/util/GlobalCastingConstants.java | 11 - .../casting}/ChipTvCastingApplication.java | 2 +- .../app => matter/casting}/MainActivity.java | 16 +- .../chip/casting/NsdDiscoveryListener.java | 128 - .../com/chip/casting/NsdResolveListener.java | 165 -- .../jni/com/chip/casting/TvCastingApp.java | 608 ----- .../matter/casting/support/DataProvider.java | 4 +- .../App/app/src/main/jni/cpp/Constants.h | 74 - .../app/src/main/jni/cpp/ConversionUtils.cpp | 410 ---- .../app/src/main/jni/cpp/ConversionUtils.h | 36 - .../jni/cpp/MatterCallbackHandler-JNI.cpp | 419 ---- .../main/jni/cpp/MatterCallbackHandler-JNI.h | 293 --- .../app/src/main/jni/cpp/TvCastingApp-JNI.cpp | 2129 ----------------- .../app/src/main/jni/cpp/TvCastingApp-JNI.h | 162 -- .../src/main/jni/cpp/core/CastingApp-JNI.cpp | 15 +- .../cpp/core/CastingPlayerDiscovery-JNI.cpp | 1 - .../jni/cpp/core/MatterCastingPlayer-JNI.cpp | 1 - .../main/jni/cpp/core/MatterEndpoint-JNI.cpp | 1 - .../jni/cpp/{ => support}/JNIDACProvider.cpp | 8 + .../jni/cpp/{ => support}/JNIDACProvider.h | 8 + .../app/src/main/res/layout/activity_main.xml | 2 +- .../CommissionerDiscoveryListenerTest.java | 68 - examples/tv-casting-app/android/BUILD.gn | 46 +- .../tv-casting-common/core/CastingApp.cpp | 2 - 50 files changed, 1566 insertions(+), 4601 deletions(-) rename examples/tv-casting-app/android/App/app/src/{main => compat}/java/com/chip/casting/app/CastingContext.java (87%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/java/com/chip/casting/app/CertTestFragment.java (97%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/java/com/chip/casting/app/CommissionerDiscoveryFragment.java (98%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/java/com/chip/casting/app/ConnectionFragment.java (96%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/java/com/chip/casting/app/ContentLauncherFragment.java (94%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/java/com/chip/casting/app/MediaPlaybackFragment.java (97%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/java/com/chip/casting/app/SelectClusterFragment.java (95%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/java/com/chip/casting/util/DACProviderStub.java (98%) create mode 100644 examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/util/GlobalCastingConstants.java rename examples/tv-casting-app/android/App/app/src/{main => compat}/jni/com/chip/casting/AppParameters.java (97%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/jni/com/chip/casting/CommissioningCallbacks.java (97%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/jni/com/chip/casting/ContentApp.java (51%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/jni/com/chip/casting/ContentLauncherTypes.java (96%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/jni/com/chip/casting/DACProvider.java (92%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/jni/com/chip/casting/DiscoveredNodeData.java (88%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/jni/com/chip/casting/FailureCallback.java (85%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/jni/com/chip/casting/MatterCallbackHandler.java (85%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/jni/com/chip/casting/MatterError.java (84%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/jni/com/chip/casting/MediaPlaybackTypes.java (93%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/jni/com/chip/casting/SubscriptionEstablishedCallback.java (91%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/jni/com/chip/casting/SuccessCallback.java (91%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/jni/com/chip/casting/TargetNavigatorTypes.java (93%) create mode 100644 examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/TvCastingApp.java rename examples/tv-casting-app/android/App/app/src/{main => compat}/jni/com/chip/casting/VideoPlayer.java (81%) delete mode 100644 examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/util/GlobalCastingConstants.java rename examples/tv-casting-app/android/App/app/src/main/java/com/{chip/casting/app => matter/casting}/ChipTvCastingApplication.java (84%) rename examples/tv-casting-app/android/App/app/src/main/java/com/{chip/casting/app => matter/casting}/MainActivity.java (92%) delete mode 100644 examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/NsdDiscoveryListener.java delete mode 100644 examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/NsdResolveListener.java delete mode 100644 examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/TvCastingApp.java delete mode 100644 examples/tv-casting-app/android/App/app/src/main/jni/cpp/Constants.h delete mode 100644 examples/tv-casting-app/android/App/app/src/main/jni/cpp/ConversionUtils.cpp delete mode 100644 examples/tv-casting-app/android/App/app/src/main/jni/cpp/ConversionUtils.h delete mode 100644 examples/tv-casting-app/android/App/app/src/main/jni/cpp/MatterCallbackHandler-JNI.cpp delete mode 100644 examples/tv-casting-app/android/App/app/src/main/jni/cpp/MatterCallbackHandler-JNI.h delete mode 100644 examples/tv-casting-app/android/App/app/src/main/jni/cpp/TvCastingApp-JNI.cpp delete mode 100644 examples/tv-casting-app/android/App/app/src/main/jni/cpp/TvCastingApp-JNI.h rename examples/tv-casting-app/android/App/app/src/main/jni/cpp/{ => support}/JNIDACProvider.cpp (98%) rename examples/tv-casting-app/android/App/app/src/main/jni/cpp/{ => support}/JNIDACProvider.h (94%) delete mode 100644 examples/tv-casting-app/android/App/app/src/test/java/com/chip/casting/dnssd/CommissionerDiscoveryListenerTest.java diff --git a/examples/tv-casting-app/android/App/app/build.gradle b/examples/tv-casting-app/android/App/app/build.gradle index 3dcdad715e6393..757e6a6522f5da 100644 --- a/examples/tv-casting-app/android/App/app/build.gradle +++ b/examples/tv-casting-app/android/App/app/build.gradle @@ -7,7 +7,7 @@ android { defaultConfig { applicationId "com.chip.casting" - minSdk 24 + minSdk 26 targetSdk 30 versionCode 1 versionName "1.0" @@ -47,6 +47,8 @@ android { java.srcDirs = [ 'src/main/java', 'src/main/jni', + 'src/compat/java', + 'src/compat/jni', ] // uncomment this code to debug diff --git a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/CastingContext.java b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/CastingContext.java similarity index 87% rename from examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/CastingContext.java rename to examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/CastingContext.java index acab829034bd56..b089e92b8faf0f 100644 --- a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/CastingContext.java +++ b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/CastingContext.java @@ -5,6 +5,8 @@ import androidx.fragment.app.FragmentActivity; import com.R; +/** @deprecated Use the APIs described in /examples/tv-casting-app/APIs.md instead. */ +@Deprecated public class CastingContext { private FragmentActivity fragmentActivity; diff --git a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/CertTestFragment.java b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/CertTestFragment.java similarity index 97% rename from examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/CertTestFragment.java rename to examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/CertTestFragment.java index 7ee9fa3c46a0ae..27f00aab8e9325 100644 --- a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/CertTestFragment.java +++ b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/CertTestFragment.java @@ -313,7 +313,17 @@ private void runCertTests(Activity activity) { "messages_presentMessages", successFailureCallback, () -> { - tvCastingApp.messages_presentMessages(kTVApp, "CastingAppTestMessage", callback); + final byte[] messageID = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5}; + tvCastingApp.messages_presentMessages( + kTVApp, + messageID, + 0, + 0, + (long) 0, + (long) 60 * 1000, + "CastingAppTestMessage", + Optional.empty(), + callback); }); runAndWait( diff --git a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/CommissionerDiscoveryFragment.java b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/CommissionerDiscoveryFragment.java similarity index 98% rename from examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/CommissionerDiscoveryFragment.java rename to examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/CommissionerDiscoveryFragment.java index 3a119940b64839..c7aa931d9f00a1 100644 --- a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/CommissionerDiscoveryFragment.java +++ b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/CommissionerDiscoveryFragment.java @@ -28,7 +28,11 @@ import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; -/** A {@link Fragment} to discover commissioners on the network */ +/** + * @deprecated Refer to com.matter.casting.DiscoveryExampleFragment. + *

A {@link Fragment} to discover commissioners on the network + */ +@Deprecated public class CommissionerDiscoveryFragment extends Fragment { private static final String TAG = CommissionerDiscoveryFragment.class.getSimpleName(); private static final long DISCOVERY_POLL_INTERVAL_MS = 15000; diff --git a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/ConnectionFragment.java b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/ConnectionFragment.java similarity index 96% rename from examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/ConnectionFragment.java rename to examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/ConnectionFragment.java index 09ba31b2c8776c..dcd681d7cbc70d 100644 --- a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/ConnectionFragment.java +++ b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/ConnectionFragment.java @@ -21,9 +21,14 @@ import com.chip.casting.util.GlobalCastingConstants; import java.util.concurrent.Executors; -/** A {@link Fragment} to get the TV Casting App commissioned / connected. */ +/** + * @deprecated Refer to com.matter.casting.ConnectionExampleFragment. + *

A {@link Fragment} to get the TV Casting App commissioned / connected + */ +@Deprecated public class ConnectionFragment extends Fragment { private static final String TAG = ConnectionFragment.class.getSimpleName(); + private static final Integer targetContentAppVendorId = 65521; private final TvCastingApp tvCastingApp; private final DiscoveredNodeData selectedCommissioner; @@ -189,7 +194,8 @@ public void handle(MatterError error) { + " port: " + selectedCommissioner.getPort()); - this.sendUdcSuccess = tvCastingApp.sendCommissioningRequest(selectedCommissioner); + this.sendUdcSuccess = + tvCastingApp.sendCommissioningRequest(selectedCommissioner, targetContentAppVendorId); updateUiOnConnectionSuccess(); } } else { diff --git a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/ContentLauncherFragment.java b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/ContentLauncherFragment.java similarity index 94% rename from examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/ContentLauncherFragment.java rename to examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/ContentLauncherFragment.java index d1c3c9f957f394..14bcfcae1568f8 100644 --- a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/ContentLauncherFragment.java +++ b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/ContentLauncherFragment.java @@ -15,7 +15,11 @@ import com.chip.casting.MatterError; import com.chip.casting.TvCastingApp; -/** A {@link Fragment} to send Content Launcher commands from the TV Casting App. */ +/** + * @deprecated Refer to com.matter.casting.ContentLauncherLaunchURLExampleFragment. + *

A {@link Fragment} to send Content Launcher commands from the TV Casting App. + */ +@Deprecated public class ContentLauncherFragment extends Fragment { private static final String TAG = ContentLauncherFragment.class.getSimpleName(); diff --git a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/MediaPlaybackFragment.java b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/MediaPlaybackFragment.java similarity index 97% rename from examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/MediaPlaybackFragment.java rename to examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/MediaPlaybackFragment.java index a9c38443a7d91e..b48dcd277122a4 100644 --- a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/MediaPlaybackFragment.java +++ b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/MediaPlaybackFragment.java @@ -18,7 +18,11 @@ import com.chip.casting.SuccessCallback; import com.chip.casting.TvCastingApp; -/** A {@link Fragment} for the Media Playback cluster */ +/** + * @deprecated Refer to com.matter.casting.MediaPlaybackSubscribeToCurrentStateExampleFragment. + *

A {@link Fragment} for the Media Playback cluster + */ +@Deprecated public class MediaPlaybackFragment extends Fragment { private static final String TAG = MediaPlaybackFragment.class.getSimpleName(); diff --git a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/SelectClusterFragment.java b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/SelectClusterFragment.java similarity index 95% rename from examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/SelectClusterFragment.java rename to examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/SelectClusterFragment.java index f89fc36009e404..47cc4728f96cfb 100644 --- a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/SelectClusterFragment.java +++ b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/SelectClusterFragment.java @@ -10,7 +10,11 @@ import com.R; import com.chip.casting.TvCastingApp; -/** An interstitial {@link Fragment} to select one of the supported media actions to perform */ +/** + * @deprecated Refer to com.matter.casting.ActionSelectorFragment. + *

An interstitial {@link Fragment} to select one of the supported media actions to perform + */ +@Deprecated public class SelectClusterFragment extends Fragment { private static final String TAG = SelectClusterFragment.class.getSimpleName(); diff --git a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/util/DACProviderStub.java b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/util/DACProviderStub.java similarity index 98% rename from examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/util/DACProviderStub.java rename to examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/util/DACProviderStub.java index 9dbae27c6e5982..2a91c055dcb47a 100644 --- a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/util/DACProviderStub.java +++ b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/util/DACProviderStub.java @@ -11,6 +11,8 @@ import java.security.spec.ECParameterSpec; import java.security.spec.ECPrivateKeySpec; +/** @deprecated Refer to com.matter.casting.DACProviderStub. */ +@Deprecated public class DACProviderStub implements DACProvider { private String kDevelopmentDAC_Cert_FFF1_8001 = diff --git a/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/util/GlobalCastingConstants.java b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/util/GlobalCastingConstants.java new file mode 100644 index 00000000000000..526bbb07401845 --- /dev/null +++ b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/util/GlobalCastingConstants.java @@ -0,0 +1,11 @@ +package com.chip.casting.util; + +public class GlobalCastingConstants { + public static final int CommissioningWindowDurationSecs = 3 * 60; + public static final int SetupPasscode = 20202021; + public static final int Discriminator = 0xF00; + + // set to true, to demo the simplified casting APIs. + // Otherwise, the deprecated casting APIs are invoked + public static final boolean ChipCastingSimplified = true; +} diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/AppParameters.java b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/AppParameters.java similarity index 97% rename from examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/AppParameters.java rename to examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/AppParameters.java index 18c9a351f0e41a..3d72b38f72eb84 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/AppParameters.java +++ b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/AppParameters.java @@ -22,6 +22,8 @@ import java.math.BigInteger; import java.util.Arrays; +/** @deprecated Use the APIs described in /examples/tv-casting-app/APIs.md instead. */ +@Deprecated public class AppParameters { private static final String TAG = AppParameters.class.getSimpleName(); public static final int MIN_ROTATING_DEVICE_ID_UNIQUE_ID_LENGTH = 16; diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/CommissioningCallbacks.java b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/CommissioningCallbacks.java similarity index 97% rename from examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/CommissioningCallbacks.java rename to examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/CommissioningCallbacks.java index 9a44aba792f18b..20599a4f07352a 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/CommissioningCallbacks.java +++ b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/CommissioningCallbacks.java @@ -17,6 +17,8 @@ */ package com.chip.casting; +/** @deprecated Use the APIs described in /examples/tv-casting-app/APIs.md instead. */ +@Deprecated public class CommissioningCallbacks { /** * This is called when the PBKDFParamRequest is received and indicates the start of the session diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/ContentApp.java b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/ContentApp.java similarity index 51% rename from examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/ContentApp.java rename to examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/ContentApp.java index 80efc22ef52024..1c20a40b66251a 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/ContentApp.java +++ b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/ContentApp.java @@ -17,10 +17,16 @@ */ package com.chip.casting; +import chip.devicecontroller.ChipClusters; +import com.matter.casting.core.Endpoint; +import java.util.ArrayList; import java.util.List; import java.util.Objects; +/** @deprecated Use the APIs described in /examples/tv-casting-app/APIs.md instead. */ +@Deprecated public class ContentApp { + private Endpoint endpoint; private short endpointId; private List clusterIds; @@ -32,6 +38,33 @@ public ContentApp(short endpointId, List clusterIds) { this.isInitialized = true; } + ContentApp(Endpoint endpoint) { + this.endpoint = endpoint; + this.endpointId = (short) endpoint.getId(); + this.clusterIds = new ArrayList<>(); + if (endpoint.getCluster(ChipClusters.ApplicationBasicCluster.class) != null) { + this.clusterIds.add((int) ChipClusters.ApplicationBasicCluster.CLUSTER_ID); + } + if (endpoint.getCluster(ChipClusters.ApplicationLauncherCluster.class) != null) { + this.clusterIds.add((int) ChipClusters.ApplicationLauncherCluster.CLUSTER_ID); + } + if (endpoint.getCluster(ChipClusters.ContentLauncherCluster.class) != null) { + this.clusterIds.add((int) ChipClusters.ContentLauncherCluster.CLUSTER_ID); + } + if (endpoint.getCluster(ChipClusters.KeypadInputCluster.class) != null) { + this.clusterIds.add((int) ChipClusters.KeypadInputCluster.CLUSTER_ID); + } + if (endpoint.getCluster(ChipClusters.MediaPlaybackCluster.class) != null) { + this.clusterIds.add((int) ChipClusters.MediaPlaybackCluster.CLUSTER_ID); + } + if (endpoint.getCluster(ChipClusters.OnOffCluster.class) != null) { + this.clusterIds.add((int) ChipClusters.OnOffCluster.CLUSTER_ID); + } + if (endpoint.getCluster(ChipClusters.TargetNavigatorCluster.class) != null) { + this.clusterIds.add((int) ChipClusters.TargetNavigatorCluster.CLUSTER_ID); + } + } + public boolean equals(Object object) { if (this == object) return true; if (object == null || getClass() != object.getClass()) return false; @@ -49,6 +82,10 @@ public java.lang.String toString() { return "endpointId=" + endpointId; } + Endpoint getEndpoint() { + return endpoint; + } + public short getEndpointId() { return endpointId; } diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/ContentLauncherTypes.java b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/ContentLauncherTypes.java similarity index 96% rename from examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/ContentLauncherTypes.java rename to examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/ContentLauncherTypes.java index bc4ee6a6a24bdf..b6d7c3402989d9 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/ContentLauncherTypes.java +++ b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/ContentLauncherTypes.java @@ -20,6 +20,8 @@ import java.util.ArrayList; import java.util.Optional; +/** @deprecated Use the APIs described in /examples/tv-casting-app/APIs.md instead. */ +@Deprecated public class ContentLauncherTypes { public static class AdditionalInfo { public String name; diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/DACProvider.java b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/DACProvider.java similarity index 92% rename from examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/DACProvider.java rename to examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/DACProvider.java index c49d73ab98c86e..7c6ac281e61568 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/DACProvider.java +++ b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/DACProvider.java @@ -17,6 +17,8 @@ */ package com.chip.casting; +/** @deprecated Use the APIs described in /examples/tv-casting-app/APIs.md instead. */ +@Deprecated public interface DACProvider { byte[] GetCertificationDeclaration(); diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/DiscoveredNodeData.java b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/DiscoveredNodeData.java similarity index 88% rename from examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/DiscoveredNodeData.java rename to examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/DiscoveredNodeData.java index a66d48a57c0e2a..39b9113c94a836 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/DiscoveredNodeData.java +++ b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/DiscoveredNodeData.java @@ -19,6 +19,7 @@ import android.net.nsd.NsdServiceInfo; import android.util.Log; +import com.matter.casting.core.CastingPlayer; import java.net.InetAddress; import java.nio.charset.StandardCharsets; import java.util.Arrays; @@ -26,15 +27,18 @@ import java.util.Map; import java.util.Objects; +/** @deprecated Use the APIs described in /examples/tv-casting-app/APIs.md instead. */ +@Deprecated public class DiscoveredNodeData { private static final String TAG = DiscoveredNodeData.class.getSimpleName(); - private static final int MAX_IP_ADDRESSES = 5; private static final int MAX_ROTATING_ID_LEN = 50; private static final String KEY_DEVICE_NAME = "DN"; private static final String KEY_DEVICE_TYPE = "DT"; private static final String KEY_VENDOR_PRODUCT = "VP"; + private CastingPlayer castingPlayer; + private String hostName; private String instanceName; private long longDiscriminator; @@ -119,10 +123,30 @@ public DiscoveredNodeData(VideoPlayer player) { this.port = player.getPort(); } + DiscoveredNodeData(CastingPlayer castingPlayer) { + this.castingPlayer = castingPlayer; + this.deviceName = castingPlayer.getDeviceName(); + this.ipAddresses = castingPlayer.getIpAddresses(); + this.numIPs = + castingPlayer.getIpAddresses() != null ? castingPlayer.getIpAddresses().size() : 0; + this.deviceType = castingPlayer.getDeviceType(); + this.hostName = castingPlayer.getHostName(); + this.vendorId = castingPlayer.getVendorId(); + this.productId = castingPlayer.getProductId(); + this.instanceName = castingPlayer.getInstanceName(); + if (castingPlayer.isConnected()) { + this.connectableVideoPlayer = new VideoPlayer(castingPlayer); + } + } + void setConnectableVideoPlayer(VideoPlayer videoPlayer) { this.connectableVideoPlayer = videoPlayer; } + CastingPlayer getCastingPlayer() { + return castingPlayer; + } + public boolean isPreCommissioned() { return connectableVideoPlayer != null; } diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/FailureCallback.java b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/FailureCallback.java similarity index 85% rename from examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/FailureCallback.java rename to examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/FailureCallback.java index 2ad3b9fc7222fe..5e07e9d526b1c4 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/FailureCallback.java +++ b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/FailureCallback.java @@ -19,14 +19,16 @@ import android.util.Log; +/** @deprecated Use the APIs described in /examples/tv-casting-app/APIs.md instead. */ +@Deprecated public abstract class FailureCallback { private static final String TAG = FailureCallback.class.getSimpleName(); public abstract void handle(MatterError err); - protected final void handleInternal(int errorCode, String errorMessage) { + protected final void handleInternal(MatterError err) { try { - handle(new MatterError(errorCode, errorMessage)); + handle(err); } catch (Throwable t) { Log.e(TAG, "FailureCallback::Caught an unhandled Throwable from the client: " + t); } diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/MatterCallbackHandler.java b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/MatterCallbackHandler.java similarity index 85% rename from examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/MatterCallbackHandler.java rename to examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/MatterCallbackHandler.java index 493635beb692f1..7f1efd056e2e23 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/MatterCallbackHandler.java +++ b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/MatterCallbackHandler.java @@ -19,14 +19,16 @@ import android.util.Log; +/** @deprecated Use the APIs described in /examples/tv-casting-app/APIs.md instead. */ +@Deprecated public abstract class MatterCallbackHandler { private static final String TAG = MatterCallbackHandler.class.getSimpleName(); public abstract void handle(MatterError err); - protected final void handleInternal(int errorCode, String errorMessage) { + protected final void handleInternal(MatterError err) { try { - handle(new MatterError(errorCode, errorMessage)); + handle(err); } catch (Throwable t) { Log.e(TAG, "MatterCallbackHandler::Caught an unhandled Throwable from the client: " + t); } diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/MatterError.java b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/MatterError.java similarity index 84% rename from examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/MatterError.java rename to examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/MatterError.java index ac12eaccd28977..e281bdd8b63735 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/MatterError.java +++ b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/MatterError.java @@ -19,6 +19,8 @@ import java.util.Objects; +/** @deprecated Use the APIs described in /examples/tv-casting-app/APIs.md instead. */ +@Deprecated public class MatterError { private long errorCode; private String errorMessage; @@ -26,8 +28,15 @@ public class MatterError { public static final MatterError DISCOVERY_SERVICE_LOST = new MatterError(4L, "Discovery service was lost."); + public static final MatterError MATTER_INTERNAL_ERROR = new MatterError(0xac, "Internal error."); + public static final MatterError NO_ERROR = new MatterError(0, null); + MatterError(com.matter.casting.support.MatterError err) { + this.errorCode = err.getErrorCode(); + this.errorMessage = err.getErrorMessage(); + } + public MatterError(long errorCode, String errorMessage) { this.errorCode = errorCode; this.errorMessage = errorMessage; diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/MediaPlaybackTypes.java b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/MediaPlaybackTypes.java similarity index 93% rename from examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/MediaPlaybackTypes.java rename to examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/MediaPlaybackTypes.java index 7bf37b5d1cd8e4..fc01b02dea23da 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/MediaPlaybackTypes.java +++ b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/MediaPlaybackTypes.java @@ -17,6 +17,8 @@ */ package com.chip.casting; +/** @deprecated Use the APIs described in /examples/tv-casting-app/APIs.md instead. */ +@Deprecated public class MediaPlaybackTypes { public enum PlaybackStateEnum { Playing, diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/SubscriptionEstablishedCallback.java b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/SubscriptionEstablishedCallback.java similarity index 91% rename from examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/SubscriptionEstablishedCallback.java rename to examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/SubscriptionEstablishedCallback.java index aab9dcd9306fd7..dd5eab2ec66556 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/SubscriptionEstablishedCallback.java +++ b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/SubscriptionEstablishedCallback.java @@ -19,6 +19,8 @@ import android.util.Log; +/** @deprecated Use the APIs described in /examples/tv-casting-app/APIs.md instead. */ +@Deprecated public abstract class SubscriptionEstablishedCallback { private static final String TAG = SubscriptionEstablishedCallback.class.getSimpleName(); diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/SuccessCallback.java b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/SuccessCallback.java similarity index 91% rename from examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/SuccessCallback.java rename to examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/SuccessCallback.java index b82845567d8276..d1194d46f3eef0 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/SuccessCallback.java +++ b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/SuccessCallback.java @@ -19,6 +19,8 @@ import android.util.Log; +/** @deprecated Use the APIs described in /examples/tv-casting-app/APIs.md instead. */ +@Deprecated public abstract class SuccessCallback { private static final String TAG = SuccessCallback.class.getSimpleName(); diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/TargetNavigatorTypes.java b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/TargetNavigatorTypes.java similarity index 93% rename from examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/TargetNavigatorTypes.java rename to examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/TargetNavigatorTypes.java index 88f71bb796ceaf..832101c9564fe7 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/TargetNavigatorTypes.java +++ b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/TargetNavigatorTypes.java @@ -17,6 +17,8 @@ */ package com.chip.casting; +/** @deprecated Use the APIs described in /examples/tv-casting-app/APIs.md instead. */ +@Deprecated public class TargetNavigatorTypes { public static class TargetInfo { public Integer identifier; diff --git a/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/TvCastingApp.java b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/TvCastingApp.java new file mode 100644 index 00000000000000..cd965905065bee --- /dev/null +++ b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/TvCastingApp.java @@ -0,0 +1,1327 @@ +/* + * Copyright (c) 2022 Project CHIP Authors + * All rights reserved. + * + * 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. + * + */ +package com.chip.casting; + +import android.content.Context; +import android.util.Log; +import androidx.annotation.Nullable; +import chip.devicecontroller.ChipClusters; +import chip.devicecontroller.ChipStructs; +import com.matter.casting.core.CastingApp; +import com.matter.casting.core.CastingPlayer; +import com.matter.casting.core.CastingPlayerDiscovery; +import com.matter.casting.core.Endpoint; +import com.matter.casting.core.MatterCastingPlayerDiscovery; +import com.matter.casting.support.AppParameters; +import com.matter.casting.support.CommissionableData; +import com.matter.casting.support.ConnectionCallbacks; +import com.matter.casting.support.DACProvider; +import com.matter.casting.support.IdentificationDeclarationOptions; +import com.matter.casting.support.MatterCallback; +import com.matter.casting.support.MatterError; +import com.matter.casting.support.TargetAppInfo; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; + +/** @deprecated Use the APIs described in /examples/tv-casting-app/APIs.md instead. */ +@Deprecated +public class TvCastingApp { + private static final String TAG = TvCastingApp.class.getSimpleName(); + + private com.chip.casting.AppParameters appParametersCompat; + private int commissioningWindowTimeout; + private CommissioningCallbacks commissioningCallbacks; + private SuccessCallback onConnectionSuccess; + private FailureCallback onConnectionFailure; + private SuccessCallback onNewOrUpdatedEndpointCallback; + private CastingPlayer targetCastingPlayer; + + private abstract class CastingPlayerChangeListenerAdapter + extends CastingPlayerDiscovery.CastingPlayerChangeListener { + public abstract void initialize(SuccessCallback discoverySuccessCallback); + } + + private CastingPlayerChangeListenerAdapter castingPlayerDiscoveryChangeListener = + new CastingPlayerChangeListenerAdapter() { + private SuccessCallback discoverySuccessCallbackCompat; + + @Override + public void initialize(SuccessCallback discoverySuccessCallback) { + this.discoverySuccessCallbackCompat = discoverySuccessCallback; + } + + @Override + public void onAdded(CastingPlayer castingPlayer) { + if (discoverySuccessCallbackCompat == null) { + Log.e(TAG, "discoverySuccessCallbackCompat not set"); + return; + } + discoverySuccessCallbackCompat.handleInternal(new DiscoveredNodeData((castingPlayer))); + } + + @Override + public void onChanged(CastingPlayer castingPlayer) { + if (discoverySuccessCallbackCompat == null) { + Log.e(TAG, "discoverySuccessCallbackCompat not set"); + return; + } + discoverySuccessCallbackCompat.handleInternal(new DiscoveredNodeData((castingPlayer))); + } + + @Override + public void onRemoved(CastingPlayer castingPlayer) { + Log.e(TAG, "CastingPlayerChangeListener.onRemoved() not implemented"); + } + }; + + private interface DACProviderAdapter extends DACProvider { + void initialize(com.chip.casting.DACProvider dacProviderCompat); + } + + private DACProviderAdapter dacProvider = + new DACProviderAdapter() { + private com.chip.casting.DACProvider dacProviderCompat; + + public void initialize(com.chip.casting.DACProvider dacProviderCompat) { + this.dacProviderCompat = dacProviderCompat; + } + + @Override + public byte[] GetCertificationDeclaration() { + if (dacProviderCompat == null) { + Log.e(TAG, "dacProviderCompat not set"); + return null; + } + return dacProviderCompat.GetCertificationDeclaration(); + } + + @Override + public byte[] GetFirmwareInformation() { + if (dacProviderCompat == null) { + Log.e(TAG, "dacProviderCompat not set"); + return null; + } + return dacProviderCompat.GetFirmwareInformation(); + } + + @Override + public byte[] GetDeviceAttestationCert() { + if (dacProviderCompat == null) { + Log.e(TAG, "dacProviderCompat not set"); + return null; + } + return dacProviderCompat.GetDeviceAttestationCert(); + } + + @Override + public byte[] GetProductAttestationIntermediateCert() { + if (dacProviderCompat == null) { + Log.e(TAG, "dacProviderCompat not set"); + return null; + } + return dacProviderCompat.GetProductAttestationIntermediateCert(); + } + + @Override + public byte[] SignWithDeviceAttestationKey(byte[] message) { + if (dacProviderCompat == null) { + Log.e(TAG, "dacProviderCompat not set"); + return null; + } + return dacProviderCompat.SignWithDeviceAttestationKey(message); + } + }; + + private static final List DISCOVERY_TARGET_DEVICE_TYPE_FILTER = + Arrays.asList(35L); // Matter Casting Video player = 35; + + private static TvCastingApp sInstance; + + private TvCastingApp() {} + + public static TvCastingApp getInstance() { + if (sInstance == null) { + sInstance = new TvCastingApp(); + } + return sInstance; + } + + public boolean initApp( + Context applicationContext, com.chip.casting.AppParameters appParametersCompat) { + if (applicationContext == null + || appParametersCompat == null + || appParametersCompat.getConfigurationManager() == null) { + return false; + } + + this.appParametersCompat = appParametersCompat; + + AppParameters appParameters = + new AppParameters( + applicationContext, + () -> appParametersCompat.getConfigurationManager(), + () -> appParametersCompat.getRotatingDeviceIdUniqueId(), + () -> { + CommissionableData commissionableData = + new CommissionableData( + appParametersCompat.getSetupPasscode(), + appParametersCompat.getDiscriminator()); + commissionableData.setSpake2pIterationCount( + appParametersCompat.getSpake2pIterationCount()); + commissionableData.setSpake2pSaltBase64(appParametersCompat.getSpake2pSaltBase64()); + commissionableData.setSpake2pVerifierBase64( + appParametersCompat.getSpake2pVerifierBase64()); + return commissionableData; + }, + this.dacProvider); + + // Initialize the SDK using the appParameters and check if it returns successfully + MatterError err = CastingApp.getInstance().initialize(appParameters); + if (err.hasError()) { + Log.e(TAG, "Failed to initialize Matter CastingApp. Err: " + err); + return false; + } + + err = CastingApp.getInstance().start(); + if (err.hasError()) { + Log.e(TAG, "Failed to start Matter CastingApp. Err: " + err); + return false; + } + return true; + } + + public void setDACProvider(com.chip.casting.DACProvider dacProviderCompat) { + this.dacProvider.initialize(dacProviderCompat); + } + + public void discoverVideoPlayerCommissioners( + SuccessCallback discoverySuccessCallback, + FailureCallback discoveryFailureCallback) { + + // stop before starting another discovery session + stopVideoPlayerDiscovery(); + + castingPlayerDiscoveryChangeListener.initialize(discoverySuccessCallback); + MatterError err = + MatterCastingPlayerDiscovery.getInstance() + .addCastingPlayerChangeListener(castingPlayerDiscoveryChangeListener); + if (err.hasError()) { + Log.e(TAG, "addCastingPlayerChangeListener before starting discovery failed. Err: " + err); + discoveryFailureCallback.handleInternal(new com.chip.casting.MatterError(err)); + return; + } + + err = + MatterCastingPlayerDiscovery.getInstance() + .startDiscovery(DISCOVERY_TARGET_DEVICE_TYPE_FILTER.get(0)); + if (err.hasError()) { + Log.e(TAG, "startDiscovery failed. Err: " + err); + discoveryFailureCallback.handleInternal(new com.chip.casting.MatterError(err)); + } + } + + public void stopVideoPlayerDiscovery() { + MatterError err = MatterCastingPlayerDiscovery.getInstance().stopDiscovery(); + if (err.hasError()) { + Log.e(TAG, "stopDiscovery failed. Err: " + err); + return; + } + + err = + MatterCastingPlayerDiscovery.getInstance() + .removeCastingPlayerChangeListener(castingPlayerDiscoveryChangeListener); + if (err.hasError()) { + Log.e(TAG, "removeCastingPlayerChangeListener failed. Err: " + err); + } + } + + public boolean openBasicCommissioningWindow( + int commissioningWindowTimeout, + CommissioningCallbacks commissioningCallbacks, + SuccessCallback onConnectionSuccess, + FailureCallback onConnectionFailure, + SuccessCallback onNewOrUpdatedEndpointCallback) { + this.commissioningWindowTimeout = commissioningWindowTimeout; + this.commissioningCallbacks = commissioningCallbacks; + this.onConnectionSuccess = onConnectionSuccess; + this.onConnectionFailure = onConnectionFailure; + this.onNewOrUpdatedEndpointCallback = onNewOrUpdatedEndpointCallback; + return true; + } + + public boolean sendCommissioningRequest(DiscoveredNodeData commissioner, Integer vendorId) { + if (commissioningCallbacks == null + || onConnectionSuccess == null + || onConnectionFailure == null + || onNewOrUpdatedEndpointCallback == null) { + Log.e(TAG, "Commissioning/connection callbacks not set"); + return false; + } + + this.targetCastingPlayer = commissioner.getCastingPlayer(); + + IdentificationDeclarationOptions idOptions = new IdentificationDeclarationOptions(); + idOptions.addTargetAppInfo(new TargetAppInfo(vendorId, null)); + + MatterError err = + targetCastingPlayer.verifyOrEstablishConnection( + new ConnectionCallbacks( + new MatterCallback() { + @Override + public void handle(Void response) { + ((MatterCallbackHandler) commissioningCallbacks.getCommissioningComplete()) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + onConnectionSuccess.handleInternal(new VideoPlayer(targetCastingPlayer)); + + List endpoints = targetCastingPlayer.getEndpoints(); + if (endpoints != null) { + for (Endpoint endpoint : endpoints) { + onNewOrUpdatedEndpointCallback.handleInternal(new ContentApp(endpoint)); + } + } + } + }, + new MatterCallback() { + @Override + public void handle(MatterError err) { + onConnectionFailure.handleInternal(new com.chip.casting.MatterError(err)); + } + }, + null), + (short) this.commissioningWindowTimeout, + idOptions); + + if (err.hasError()) { + Log.e( + TAG, "sendCommissioningRequest failed to call verifyOrEstablishConnection. Err: " + err); + return false; + } + + return true; + } + + public boolean verifyOrEstablishConnection( + VideoPlayer targetVideoPlayer, + SuccessCallback onConnectionSuccess, + FailureCallback onConnectionFailure, + SuccessCallback onNewOrUpdatedEndpointCallback) { + Log.e(TAG, "verifyOrEstablishConnection is unsupported"); + return false; + } + + public void shutdownAllSubscriptions() { + MatterError err = CastingApp.getInstance().shutdownAllSubscriptions(); + if (err.hasError()) { + Log.e(TAG, "shutdownAllSubscriptions failed. Err: " + err); + } + } + + public void disconnect() { + if (targetCastingPlayer != null) { + targetCastingPlayer.disconnect(); + } + } + + public boolean purgeCache() { + MatterError err = CastingApp.getInstance().clearCache(); + if (err.hasError()) { + Log.e(TAG, "purgeCache failed. Err: " + err); + return false; + } + return true; + } + + private Endpoint getTargetEndpoint(ContentApp contentApp) { + if (targetCastingPlayer == null || targetCastingPlayer.getEndpoints() == null) { + return null; + } + + for (Endpoint endpoint : targetCastingPlayer.getEndpoints()) { + if (endpoint.getId() == contentApp.getEndpointId()) { + return endpoint; + } + } + + return null; + } + + public boolean contentLauncherLaunchURL( + ContentApp contentApp, String contentUrl, String contentDisplayStr, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.ContentLauncherCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.ContentLauncherCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.launchURL( + new ChipClusters.ContentLauncherCluster.LauncherResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "LauncherResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }, + contentUrl, + Optional.of(contentDisplayStr), + Optional.empty()); + + return true; + } + + public boolean contentLauncher_launchContent( + ContentApp contentApp, + ContentLauncherTypes.ContentSearch searchCompat, + boolean autoPlay, + String data, + Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.ContentLauncherCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.ContentLauncherCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + // translate searchCompat + ArrayList parameterList = null; + if (searchCompat.parameterList != null) { + parameterList = new ArrayList<>(); + for (ContentLauncherTypes.Parameter parameterCompat : searchCompat.parameterList) { + ArrayList externalIDList = null; + if (parameterCompat.externalIDList != null && parameterCompat.externalIDList.isPresent()) { + externalIDList = new ArrayList<>(); + for (ContentLauncherTypes.AdditionalInfo additionalInfoCompat : + parameterCompat.externalIDList.get()) { + externalIDList.add( + new ChipStructs.ContentLauncherClusterAdditionalInfoStruct( + additionalInfoCompat.name, additionalInfoCompat.value)); + } + } + parameterList.add( + new ChipStructs.ContentLauncherClusterParameterStruct( + parameterCompat.type, + parameterCompat.value, + externalIDList != null ? Optional.of(externalIDList) : Optional.empty())); + } + } + ChipStructs.ContentLauncherClusterContentSearchStruct search = + new ChipStructs.ContentLauncherClusterContentSearchStruct(parameterList); + + cluster.launchContent( + new ChipClusters.ContentLauncherCluster.LauncherResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "LauncherResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }, + search, + autoPlay, + data != null ? Optional.of(data) : Optional.empty(), + Optional.empty(), + Optional.empty()); + return true; + } + + public boolean mediaPlayback_play(ContentApp contentApp, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.MediaPlaybackCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.MediaPlaybackCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.play( + new ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "PlaybackResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }); + return true; + } + + public boolean mediaPlayback_pause(ContentApp contentApp, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.MediaPlaybackCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.MediaPlaybackCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.pause( + new ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "PlaybackResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }); + return true; + } + + public boolean mediaPlayback_stopPlayback(ContentApp contentApp, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.MediaPlaybackCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.MediaPlaybackCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.stop( + new ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "PlaybackResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }); + return true; + } + + public boolean mediaPlayback_next(ContentApp contentApp, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.MediaPlaybackCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.MediaPlaybackCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.next( + new ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "PlaybackResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }); + return true; + } + + public boolean mediaPlayback_previous(ContentApp contentApp, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.MediaPlaybackCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.MediaPlaybackCluster.class) : null; + + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.previous( + new ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "PlaybackResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }); + return true; + } + + public boolean mediaPlayback_rewind(ContentApp contentApp, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.MediaPlaybackCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.MediaPlaybackCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.rewind( + new ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "PlaybackResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }, + Optional.empty()); + return true; + } + + public boolean mediaPlayback_fastForward(ContentApp contentApp, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.MediaPlaybackCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.MediaPlaybackCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.fastForward( + new ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "PlaybackResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }, + Optional.empty()); + return true; + } + + public boolean mediaPlayback_startOver(ContentApp contentApp, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.MediaPlaybackCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.MediaPlaybackCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.startOver( + new ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "PlaybackResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }); + return true; + } + + public boolean mediaPlayback_seek(ContentApp contentApp, long position, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.MediaPlaybackCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.MediaPlaybackCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.seek( + new ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "PlaybackResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }, + position); + return true; + } + + public boolean mediaPlayback_skipForward( + ContentApp contentApp, long deltaPositionMilliseconds, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.MediaPlaybackCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.MediaPlaybackCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.skipForward( + new ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "PlaybackResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }, + deltaPositionMilliseconds); + return true; + } + + public boolean mediaPlayback_skipBackward( + ContentApp contentApp, long deltaPositionMilliseconds, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.MediaPlaybackCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.MediaPlaybackCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.skipBackward( + new ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "PlaybackResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }, + deltaPositionMilliseconds); + return true; + } + + public boolean mediaPlayback_subscribeToCurrentState( + ContentApp contentApp, + SuccessCallback readSuccessHandler, + FailureCallback readFailureHandler, + int minInterval, + int maxInterval, + SubscriptionEstablishedCallback subscriptionEstablishedHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.MediaPlaybackCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.MediaPlaybackCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.subscribeCurrentStateAttribute( + new ChipClusters.IntegerAttributeCallback() { + @Override + public void onSuccess(int value) { + readSuccessHandler.handleInternal(MediaPlaybackTypes.PlaybackStateEnum.values()[value]); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "IntegerAttributeCallback.onError: " + error); + readFailureHandler.handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + + @Override + public void onSubscriptionEstablished(long subscriptionId) { + subscriptionEstablishedHandler.handleInternal(); + } + }, + minInterval, + maxInterval); + return true; + } + + public boolean applicationLauncher_launchApp( + ContentApp contentApp, + short catalogVendorId, + String applicationId, + byte[] data, + Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.ApplicationLauncherCluster cluster = + endpoint != null + ? endpoint.getCluster(ChipClusters.ApplicationLauncherCluster.class) + : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + // translate to application + Optional application = + Optional.empty(); + if (applicationId != null) { + application = + Optional.of( + new ChipStructs.ApplicationLauncherClusterApplicationStruct( + (int) catalogVendorId, applicationId)); + } + + cluster.launchApp( + new ChipClusters.ApplicationLauncherCluster.LauncherResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "LauncherResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }, + application, + data != null ? Optional.of(data) : Optional.empty()); + return true; + } + + public boolean applicationLauncher_stopApp( + ContentApp contentApp, short catalogVendorId, String applicationId, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.ApplicationLauncherCluster cluster = + endpoint != null + ? endpoint.getCluster(ChipClusters.ApplicationLauncherCluster.class) + : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + // translate to application + Optional application = + Optional.empty(); + if (applicationId != null) { + application = + Optional.of( + new ChipStructs.ApplicationLauncherClusterApplicationStruct( + (int) catalogVendorId, applicationId)); + } + + cluster.stopApp( + new ChipClusters.ApplicationLauncherCluster.LauncherResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "LauncherResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }, + application); + return true; + } + + public boolean applicationLauncher_hideApp( + ContentApp contentApp, short catalogVendorId, String applicationId, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.ApplicationLauncherCluster cluster = + endpoint != null + ? endpoint.getCluster(ChipClusters.ApplicationLauncherCluster.class) + : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + // translate to application + Optional application = + Optional.empty(); + if (applicationId != null) { + application = + Optional.of( + new ChipStructs.ApplicationLauncherClusterApplicationStruct( + (int) catalogVendorId, applicationId)); + } + + cluster.hideApp( + new ChipClusters.ApplicationLauncherCluster.LauncherResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "LauncherResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }, + application); + return true; + } + + public boolean targetNavigator_navigateTarget( + ContentApp contentApp, byte target, String data, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.TargetNavigatorCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.TargetNavigatorCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.navigateTarget( + new ChipClusters.TargetNavigatorCluster.NavigateTargetResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "NavigateTargetResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }, + (int) target, + data != null ? Optional.of(data) : Optional.empty()); + return true; + } + + public boolean targetNavigator_subscribeToTargetList( + ContentApp contentApp, + SuccessCallback readSuccessHandler, + FailureCallback readFailureHandler, + int minInterval, + int maxInterval, + SubscriptionEstablishedCallback subscriptionEstablishedHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.TargetNavigatorCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.TargetNavigatorCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.subscribeTargetListAttribute( + new ChipClusters.TargetNavigatorCluster.TargetListAttributeCallback() { + @Override + public void onSuccess( + List targetInfoList) { + List targetInfoListCompat = null; + if (targetInfoList != null) { + targetInfoListCompat = new ArrayList<>(); + for (ChipStructs.TargetNavigatorClusterTargetInfoStruct targetInfo : targetInfoList) { + targetInfoListCompat.add( + new TargetNavigatorTypes.TargetInfo(targetInfo.identifier, targetInfo.name)); + } + } + readSuccessHandler.handleInternal(targetInfoListCompat); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "TargetListAttributeCallback.onError: " + error); + readFailureHandler.handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + + @Override + public void onSubscriptionEstablished(long subscriptionId) { + subscriptionEstablishedHandler.handleInternal(); + } + }, + minInterval, + maxInterval); + return true; + } + + public boolean keypadInput_sendKey(ContentApp contentApp, byte keyCode, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.KeypadInputCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.KeypadInputCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.sendKey( + new ChipClusters.KeypadInputCluster.SendKeyResponseCallback() { + @Override + public void onSuccess(Integer status) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "LauncherResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }, + (int) keyCode); + return true; + } + + public boolean applicationBasic_readVendorName( + ContentApp contentApp, + SuccessCallback readSuccessHandler, + FailureCallback readFailureHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.ApplicationBasicCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.ApplicationBasicCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.readVendorNameAttribute( + new ChipClusters.CharStringAttributeCallback() { + @Override + public void onSuccess(String value) { + readSuccessHandler.handleInternal(value); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "CharStringAttributeCallback.onError: " + error); + readFailureHandler.handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }); + return true; + } + + public boolean applicationBasic_readVendorID( + ContentApp contentApp, + SuccessCallback readSuccessHandler, + FailureCallback readFailureHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.ApplicationBasicCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.ApplicationBasicCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.readVendorIDAttribute( + new ChipClusters.IntegerAttributeCallback() { + @Override + public void onSuccess(int value) { + readSuccessHandler.handleInternal(value); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "IntegerAttributeCallback.onError: " + error); + readFailureHandler.handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }); + return true; + } + + public boolean applicationBasic_readApplicationName( + ContentApp contentApp, + SuccessCallback readSuccessHandler, + FailureCallback readFailureHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.ApplicationBasicCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.ApplicationBasicCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.readApplicationNameAttribute( + new ChipClusters.CharStringAttributeCallback() { + @Override + public void onSuccess(String value) { + readSuccessHandler.handleInternal(value); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "CharStringAttributeCallback.onError: " + error); + readFailureHandler.handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }); + return true; + } + + public boolean applicationBasic_readProductID( + ContentApp contentApp, + SuccessCallback readSuccessHandler, + FailureCallback readFailureHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.ApplicationBasicCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.ApplicationBasicCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.readProductIDAttribute( + new ChipClusters.IntegerAttributeCallback() { + @Override + public void onSuccess(int value) { + readSuccessHandler.handleInternal(value); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "IntegerAttributeCallback.onError: " + error); + readFailureHandler.handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }); + return true; + } + + public boolean applicationBasic_readApplicationVersion( + ContentApp contentApp, + SuccessCallback readSuccessHandler, + FailureCallback readFailureHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.ApplicationBasicCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.ApplicationBasicCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.readApplicationVersionAttribute( + new ChipClusters.CharStringAttributeCallback() { + @Override + public void onSuccess(String value) { + readSuccessHandler.handleInternal(value); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "CharStringAttributeCallback.onError: " + error); + readFailureHandler.handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }); + return true; + } + + public boolean onOff_on(ContentApp contentApp, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.OnOffCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.OnOffCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.on( + new ChipClusters.DefaultClusterCallback() { + @Override + public void onSuccess() { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "DefaultClusterCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }); + return true; + } + + public boolean onOff_off(ContentApp contentApp, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.OnOffCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.OnOffCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.off( + new ChipClusters.DefaultClusterCallback() { + @Override + public void onSuccess() { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "DefaultClusterCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }); + return true; + } + + public boolean onOff_toggle(ContentApp contentApp, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.OnOffCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.OnOffCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.toggle( + new ChipClusters.DefaultClusterCallback() { + @Override + public void onSuccess() { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "DefaultClusterCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }); + return true; + } + + public boolean messages_presentMessages( + ContentApp contentApp, + byte[] messageID, + Integer priority, + Integer messageControl, + @Nullable Long startTime, + @Nullable Long duration, + String messageText, + Optional> responses, + Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.MessagesCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.MessagesCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.presentMessagesRequest( + new ChipClusters.DefaultClusterCallback() { + @Override + public void onSuccess() { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "DefaultClusterCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }, + messageID, + priority, + messageControl, + startTime, + duration, + messageText, + responses); + return true; + } +} diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/VideoPlayer.java b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/VideoPlayer.java similarity index 81% rename from examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/VideoPlayer.java rename to examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/VideoPlayer.java index fab9b027a78cc4..1933e28979f8a6 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/VideoPlayer.java +++ b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/VideoPlayer.java @@ -17,15 +17,19 @@ */ package com.chip.casting; +import com.matter.casting.core.CastingPlayer; +import com.matter.casting.core.Endpoint; import java.net.InetAddress; -import java.util.HashSet; +import java.util.ArrayList; import java.util.List; import java.util.Objects; -import java.util.Set; +/** @deprecated Use the APIs described in /examples/tv-casting-app/APIs.md instead. */ +@Deprecated public class VideoPlayer { private static final String TAG = VideoPlayer.class.getSimpleName(); + private CastingPlayer castingPlayer; private long nodeId; private byte fabricIndex; private String deviceName; @@ -82,41 +86,25 @@ public VideoPlayer( this.isInitialized = true; } - public boolean isSameAs(DiscoveredNodeData discoveredNodeData) { - // return false because 'this' VideoPlayer is not null - if (discoveredNodeData == null) { - return false; - } - - // return true if hostNames match - if (Objects.equals(hostName, discoveredNodeData.getHostName())) { - return true; - } - - // return false because deviceNames are different - if (Objects.equals(deviceName, discoveredNodeData.getDeviceName()) == false) { - return false; - } - - // return false because not even a single IP Address matches - if (ipAddresses != null) { - boolean matchFound = false; - Set discoveredNodeDataIpAddressSet = - new HashSet(discoveredNodeData.getIpAddresses()); - for (InetAddress videoPlayerIpAddress : ipAddresses) { - if (discoveredNodeDataIpAddressSet.contains(videoPlayerIpAddress)) { - matchFound = true; - break; - } - } - - if (!matchFound) { - return false; + public VideoPlayer(CastingPlayer castingPlayer) { + this.castingPlayer = castingPlayer; + this.deviceType = (int) castingPlayer.getDeviceType(); + this.deviceName = castingPlayer.getDeviceName(); + this.hostName = castingPlayer.getHostName(); + this.ipAddresses = castingPlayer.getIpAddresses(); + this.numIPs = + castingPlayer.getIpAddresses() != null ? castingPlayer.getIpAddresses().size() : 0; + this.isConnected = castingPlayer.isConnected(); + this.productId = castingPlayer.getProductId(); + this.vendorId = castingPlayer.getVendorId(); + List endpoints = castingPlayer.getEndpoints(); + if (endpoints != null) { + this.contentApps = new ArrayList<>(); + for (Endpoint endpoint : endpoints) { + contentApps.add(new ContentApp(endpoint)); } } - - // otherwise, return true - return true; + this.isInitialized = true; } public boolean equals(Object object) { @@ -175,6 +163,10 @@ public String toString() { + '}'; } + CastingPlayer getCastingPlayer() { + return castingPlayer; + } + public long getNodeId() { return nodeId; } diff --git a/examples/tv-casting-app/android/App/app/src/main/AndroidManifest.xml b/examples/tv-casting-app/android/App/app/src/main/AndroidManifest.xml index e551de818eb5b0..b47ec80a86b0d9 100644 --- a/examples/tv-casting-app/android/App/app/src/main/AndroidManifest.xml +++ b/examples/tv-casting-app/android/App/app/src/main/AndroidManifest.xml @@ -18,9 +18,9 @@ android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" - android:name=".chip.casting.app.ChipTvCastingApplication" + android:name=".matter.casting.ChipTvCastingApplication" android:theme="@style/Theme.CHIPTVCastingApp"> - diff --git a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/util/GlobalCastingConstants.java b/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/util/GlobalCastingConstants.java deleted file mode 100644 index 483f1efedb1b46..00000000000000 --- a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/util/GlobalCastingConstants.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.chip.casting.util; - -public class GlobalCastingConstants { - public static final String CommissionerServiceType = "_matterd._udp."; - public static final int CommissioningWindowDurationSecs = 3 * 60; - public static final int SetupPasscode = 20202021; - public static final int Discriminator = 0xF00; - public static final boolean ChipCastingSimplified = - true; // set to true, to demo the simplified casting APIs. Otherwise, the older deprecated - // APIs are invoked -} diff --git a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/ChipTvCastingApplication.java b/examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/ChipTvCastingApplication.java similarity index 84% rename from examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/ChipTvCastingApplication.java rename to examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/ChipTvCastingApplication.java index 4986cc28e49c01..bea5b88a310158 100644 --- a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/ChipTvCastingApplication.java +++ b/examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/ChipTvCastingApplication.java @@ -1,4 +1,4 @@ -package com.chip.casting.app; +package com.matter.casting; import android.app.Application; diff --git a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/MainActivity.java b/examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/MainActivity.java similarity index 92% rename from examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/MainActivity.java rename to examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/MainActivity.java index 685dbf2fb6426e..53908322d10155 100644 --- a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/MainActivity.java +++ b/examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/MainActivity.java @@ -1,4 +1,4 @@ -package com.chip.casting.app; +package com.matter.casting; import android.os.Bundle; import android.util.Log; @@ -9,15 +9,13 @@ import com.chip.casting.AppParameters; import com.chip.casting.DiscoveredNodeData; import com.chip.casting.TvCastingApp; +import com.chip.casting.app.CertTestFragment; +import com.chip.casting.app.CommissionerDiscoveryFragment; +import com.chip.casting.app.ConnectionFragment; +import com.chip.casting.app.ContentLauncherFragment; +import com.chip.casting.app.MediaPlaybackFragment; +import com.chip.casting.app.SelectClusterFragment; import com.chip.casting.util.GlobalCastingConstants; -import com.matter.casting.ActionSelectorFragment; -import com.matter.casting.ApplicationBasicReadVendorIDExampleFragment; -import com.matter.casting.ConnectionExampleFragment; -import com.matter.casting.ContentLauncherLaunchURLExampleFragment; -import com.matter.casting.DiscoveryExampleFragment; -import com.matter.casting.InitializationExample; -import com.matter.casting.MediaPlaybackSubscribeToCurrentStateExampleFragment; -import com.matter.casting.PreferencesConfigurationManager; import com.matter.casting.core.CastingPlayer; import java.util.Random; diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/NsdDiscoveryListener.java b/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/NsdDiscoveryListener.java deleted file mode 100644 index 1a9556e5fdb6d2..00000000000000 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/NsdDiscoveryListener.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (c) 2022 Project CHIP Authors - * All rights reserved. - * - * 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. - * - */ -package com.chip.casting; - -import android.net.nsd.NsdManager; -import android.net.nsd.NsdServiceInfo; -import android.util.Log; -import chip.platform.NsdManagerServiceResolver; -import java.util.List; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - -public class NsdDiscoveryListener implements NsdManager.DiscoveryListener { - private static final String TAG = NsdDiscoveryListener.class.getSimpleName(); - - private final NsdManager nsdManager; - private final String targetServiceType; - private final List deviceTypeFilter; - private final List preCommissionedVideoPlayers; - private final SuccessCallback successCallback; - private final FailureCallback failureCallback; - private final NsdManagerServiceResolver.NsdManagerResolverAvailState nsdManagerResolverAvailState; - private final ExecutorService resolutionExecutor; - - public NsdDiscoveryListener( - NsdManager nsdManager, - String targetServiceType, - List deviceTypeFilter, - List preCommissionedVideoPlayers, - SuccessCallback successCallback, - FailureCallback failureCallback, - NsdManagerServiceResolver.NsdManagerResolverAvailState nsdManagerResolverAvailState) { - this.nsdManager = nsdManager; - this.targetServiceType = targetServiceType; - this.deviceTypeFilter = deviceTypeFilter; - this.preCommissionedVideoPlayers = preCommissionedVideoPlayers; - this.successCallback = successCallback; - this.failureCallback = failureCallback; - this.nsdManagerResolverAvailState = nsdManagerResolverAvailState; - this.resolutionExecutor = Executors.newSingleThreadExecutor(); - } - - @Override - public void onDiscoveryStarted(String regType) { - Log.d(TAG, "Service discovery started. regType: " + regType); - } - - @Override - public void onServiceFound(NsdServiceInfo service) { - this.resolutionExecutor.execute( - new Runnable() { - @Override - public void run() { - Log.d(TAG, "Service discovery success. " + service); - if (service.getServiceType().equals(targetServiceType)) { - if (nsdManagerResolverAvailState != null) { - nsdManagerResolverAvailState.acquireResolver(); - } - - Log.d(TAG, "Calling NsdManager.resolveService for " + service); - nsdManager.resolveService( - service, - new NsdResolveListener( - nsdManager, - deviceTypeFilter, - preCommissionedVideoPlayers, - successCallback, - failureCallback, - nsdManagerResolverAvailState, - 1)); - } else { - Log.d(TAG, "Ignoring discovered service: " + service.toString()); - } - } - }); - } - - @Override - public void onServiceLost(NsdServiceInfo service) { - // When the network service is no longer available. - // Internal bookkeeping code goes here. - Log.e(TAG, "Service lost: " + service); - failureCallback.handle(MatterError.DISCOVERY_SERVICE_LOST); - } - - @Override - public void onDiscoveryStopped(String serviceType) { - Log.i(TAG, "Discovery stopped: " + serviceType); - if (nsdManagerResolverAvailState != null) { - nsdManagerResolverAvailState.signalFree(); - } - } - - @Override - public void onStartDiscoveryFailed(String serviceType, int errorCode) { - Log.e(TAG, "Discovery failed to start: Error code:" + errorCode); - TvCastingApp.getInstance().resetDiscoveryState(); - failureCallback.handle( - new MatterError( - 3, "NsdDiscoveryListener Discovery failed to start: Nsd Error code:" + errorCode)); - } - - @Override - public void onStopDiscoveryFailed(String serviceType, int errorCode) { - Log.e(TAG, "Discovery failed to stop: Error code:" + errorCode); - if (nsdManagerResolverAvailState != null) { - nsdManagerResolverAvailState.signalFree(); - } - failureCallback.handle( - new MatterError( - 3, "NsdDiscoveryListener Discovery failed to stop: Nsd Error code:" + errorCode)); - } -} diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/NsdResolveListener.java b/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/NsdResolveListener.java deleted file mode 100644 index 638425675dc99b..00000000000000 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/NsdResolveListener.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright (c) 2022 Project CHIP Authors - * All rights reserved. - * - * 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. - * - */ -package com.chip.casting; - -import android.net.nsd.NsdManager; -import android.net.nsd.NsdServiceInfo; -import android.util.Log; -import chip.platform.NsdManagerServiceResolver; -import java.util.List; -import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; - -public class NsdResolveListener implements NsdManager.ResolveListener { - - private static final String TAG = NsdResolveListener.class.getSimpleName(); - - private static final int MAX_RESOLUTION_ATTEMPTS = 5; - private static final int RESOLUTION_ATTEMPT_DELAY_SECS = 1; - - private final NsdManager nsdManager; - private final List deviceTypeFilter; - private final List preCommissionedVideoPlayers; - private final SuccessCallback successCallback; - private final FailureCallback failureCallback; - private final NsdManagerServiceResolver.NsdManagerResolverAvailState nsdManagerResolverAvailState; - private final int resolutionAttemptNumber; - - public NsdResolveListener( - NsdManager nsdManager, - List deviceTypeFilter, - List preCommissionedVideoPlayers, - SuccessCallback successCallback, - FailureCallback failureCallback, - NsdManagerServiceResolver.NsdManagerResolverAvailState nsdManagerResolverAvailState, - int resolutionAttemptNumber) { - this.nsdManager = nsdManager; - this.deviceTypeFilter = deviceTypeFilter; - this.preCommissionedVideoPlayers = preCommissionedVideoPlayers; - if (preCommissionedVideoPlayers != null) { - for (VideoPlayer videoPlayer : preCommissionedVideoPlayers) { - Log.d(TAG, "Precommissioned video player: " + videoPlayer); - } - } - this.successCallback = successCallback; - this.failureCallback = failureCallback; - this.nsdManagerResolverAvailState = nsdManagerResolverAvailState; - this.resolutionAttemptNumber = resolutionAttemptNumber; - } - - @Override - public void onServiceResolved(NsdServiceInfo serviceInfo) { - DiscoveredNodeData discoveredNodeData = new DiscoveredNodeData(serviceInfo); - Log.d(TAG, "DiscoveredNodeData resolved: " + discoveredNodeData); - - if (nsdManagerResolverAvailState != null) { - nsdManagerResolverAvailState.signalFree(); - } - - if (isPassingDeviceTypeFilter(discoveredNodeData)) { - addCommissioningInfo(discoveredNodeData); - successCallback.handle(discoveredNodeData); - } else { - Log.d( - TAG, - "DiscoveredNodeData ignored because it did not pass the device type filter " - + discoveredNodeData); - } - } - - @Override - public void onResolveFailed(NsdServiceInfo serviceInfo, int errorCode) { - if (nsdManagerResolverAvailState != null) { - if (errorCode != NsdManager.FAILURE_ALREADY_ACTIVE - || resolutionAttemptNumber >= MAX_RESOLUTION_ATTEMPTS) { - nsdManagerResolverAvailState.signalFree(); - } - } - - switch (errorCode) { - case NsdManager.FAILURE_ALREADY_ACTIVE: - Log.e(TAG, "NsdResolveListener FAILURE_ALREADY_ACTIVE - Service: " + serviceInfo); - if (resolutionAttemptNumber < MAX_RESOLUTION_ATTEMPTS) { - Log.d(TAG, "NsdResolveListener Scheduling a retry to resolve service " + serviceInfo); - Executors.newSingleThreadScheduledExecutor() - .schedule( - new Runnable() { - @Override - public void run() { - nsdManager.resolveService( - serviceInfo, - new NsdResolveListener( - nsdManager, - deviceTypeFilter, - preCommissionedVideoPlayers, - successCallback, - failureCallback, - nsdManagerResolverAvailState, - resolutionAttemptNumber + 1)); - } - }, - RESOLUTION_ATTEMPT_DELAY_SECS, - TimeUnit.SECONDS); - } else { // giving up - failureCallback.handle( - new MatterError( - 3, "NsdResolveListener FAILURE_ALREADY_ACTIVE - Service: " + serviceInfo)); - } - break; - case NsdManager.FAILURE_INTERNAL_ERROR: - Log.e(TAG, "NsdResolveListener FAILURE_INTERNAL_ERROR - Service: " + serviceInfo); - failureCallback.handle( - new MatterError( - 3, "NsdResolveListener FAILURE_INTERNAL_ERROR - Service: " + serviceInfo)); - break; - case NsdManager.FAILURE_MAX_LIMIT: - Log.e(TAG, "NsdResolveListener FAILURE_MAX_LIMIT - Service: " + serviceInfo); - failureCallback.handle( - new MatterError(19, "NsdResolveListener FAILURE_MAX_LIMIT - Service: " + serviceInfo)); - break; - } - } - - private boolean isPassingDeviceTypeFilter(DiscoveredNodeData discoveredNodeData) { - return deviceTypeFilter == null - || deviceTypeFilter.isEmpty() - || deviceTypeFilter.contains(discoveredNodeData.getDeviceType()); - } - - private void addCommissioningInfo(DiscoveredNodeData discoveredNodeData) { - if (preCommissionedVideoPlayers != null) { - long currentUnixTimeMS = System.currentTimeMillis(); - for (VideoPlayer videoPlayer : preCommissionedVideoPlayers) { - if (videoPlayer.isSameAs(discoveredNodeData)) { - Log.d( - TAG, - "Matching Video Player with the following information found for DiscoveredNodeData" - + videoPlayer); - Log.d(TAG, "Updating discovery timestamp for VideoPlayer to " + currentUnixTimeMS); - videoPlayer.setLastDiscoveredMs(currentUnixTimeMS); - discoveredNodeData.setConnectableVideoPlayer(videoPlayer); - return; - } - } - } - Log.d( - TAG, - "No matching VideoPlayers found from the cache for new DiscoveredNodeData: " - + discoveredNodeData); - } -} diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/TvCastingApp.java b/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/TvCastingApp.java deleted file mode 100644 index 9dd0fa500d9e2b..00000000000000 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/TvCastingApp.java +++ /dev/null @@ -1,608 +0,0 @@ -/* - * Copyright (c) 2022 Project CHIP Authors - * All rights reserved. - * - * 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. - * - */ -package com.chip.casting; - -import android.content.Context; -import android.net.nsd.NsdManager; -import android.net.wifi.WifiManager; -import android.util.Log; -import chip.appserver.ChipAppServer; -import chip.platform.AndroidBleManager; -import chip.platform.AndroidChipPlatform; -import chip.platform.ChipMdnsCallbackImpl; -import chip.platform.DiagnosticDataProviderImpl; -import chip.platform.NsdManagerServiceBrowser; -import chip.platform.NsdManagerServiceResolver; -import chip.platform.PreferencesKeyValueStoreManager; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.TimeUnit; -import java.util.function.Predicate; - -public class TvCastingApp { - private static final String TAG = TvCastingApp.class.getSimpleName(); - private static final String DISCOVERY_TARGET_SERVICE_TYPE = "_matterd._udp."; - private static final List DISCOVERY_TARGET_DEVICE_TYPE_FILTER = - Arrays.asList(35L); // Video player = 35; - - // delay before which we assume undiscovered cached players may be in STR mode - private static final long CHIP_DEVICE_CONFIG_STR_DISCOVERY_DELAY_SEC = 5; - - private static TvCastingApp sInstance; - private Context applicationContext; - private ChipAppServer chipAppServer; - private NsdManagerServiceResolver.NsdManagerResolverAvailState nsdManagerResolverAvailState; - private boolean discoveryStarted = false; - private Object discoveryLock = new Object(); - - private List discoveredPlayers; - private ScheduledFuture reportSleepingVideoPlayerCommissionersFuture; - - private WifiManager.MulticastLock multicastLock; - private NsdManager nsdManager; - private NsdDiscoveryListener nsdDiscoveryListener; - - private TvCastingApp() {} - - public static TvCastingApp getInstance() { - if (sInstance == null) { - sInstance = new TvCastingApp(); - } - return sInstance; - } - - public boolean initApp(Context applicationContext, AppParameters appParameters) { - if (applicationContext == null - || appParameters == null - || appParameters.getConfigurationManager() == null) { - return false; - } - - this.applicationContext = applicationContext; - nsdManagerResolverAvailState = new NsdManagerServiceResolver.NsdManagerResolverAvailState(); - NsdManagerServiceResolver nsdManagerServiceResolver = - new NsdManagerServiceResolver(applicationContext, nsdManagerResolverAvailState); - - AndroidChipPlatform chipPlatform = - new AndroidChipPlatform( - new AndroidBleManager(), - new PreferencesKeyValueStoreManager(applicationContext), - appParameters.getConfigurationManager(), - nsdManagerServiceResolver, - new NsdManagerServiceBrowser(applicationContext), - new ChipMdnsCallbackImpl(), - new DiagnosticDataProviderImpl(applicationContext)); - - boolean ret = - chipPlatform.updateCommissionableDataProviderData( - appParameters.getSpake2pVerifierBase64(), - appParameters.getSpake2pSaltBase64(), - appParameters.getSpake2pIterationCount(), - appParameters.getSetupPasscode(), - appParameters.getDiscriminator()); - if (!ret) { - Log.e( - TAG, - "TvCastingApp.initApp failed to updateCommissionableDataProviderData on chipPlatform"); - return ret; - } - - ret = preInitJni(appParameters); - if (!ret) { - Log.e(TAG, "TvCastingApp.initApp failed in preInitJni"); - return ret; - } - - chipAppServer = new ChipAppServer(); - ret = chipAppServer.startApp(); - if (!ret) { - Log.e(TAG, "TvCastingApp.initApp failed in start chipAppServer"); - return ret; - } - - return initJni(appParameters); - } - - public native void setDACProvider(DACProvider provider); - - private native boolean preInitJni(AppParameters appParameters); - - private native boolean initJni(AppParameters appParameters); - - public void discoverVideoPlayerCommissioners( - SuccessCallback discoverySuccessCallback, - FailureCallback discoveryFailureCallback) { - synchronized (discoveryLock) { - Log.d(TAG, "TvCastingApp.discoverVideoPlayerCommissioners called"); - - if (this.discoveryStarted) { - Log.d(TAG, "Discovery already started, stopping before starting again"); - stopVideoPlayerDiscovery(); - } - - List preCommissionedVideoPlayers = readCachedVideoPlayers(); - - WifiManager wifiManager = - (WifiManager) applicationContext.getSystemService(Context.WIFI_SERVICE); - multicastLock = wifiManager.createMulticastLock("multicastLock"); - multicastLock.setReferenceCounted(true); - multicastLock.acquire(); - - nsdManager = (NsdManager) applicationContext.getSystemService(Context.NSD_SERVICE); - discoveredPlayers = new ArrayList<>(); - nsdDiscoveryListener = - new NsdDiscoveryListener( - nsdManager, - DISCOVERY_TARGET_SERVICE_TYPE, - DISCOVERY_TARGET_DEVICE_TYPE_FILTER, - preCommissionedVideoPlayers, - new SuccessCallback() { - @Override - public void handle(DiscoveredNodeData commissioner) { - Log.d(TAG, "Discovered commissioner added " + commissioner); - discoveredPlayers.add(commissioner); - discoverySuccessCallback.handle(commissioner); - } - }, - discoveryFailureCallback, - nsdManagerResolverAvailState); - - nsdManager.discoverServices( - DISCOVERY_TARGET_SERVICE_TYPE, NsdManager.PROTOCOL_DNS_SD, nsdDiscoveryListener); - Log.d(TAG, "TvCastingApp.discoverVideoPlayerCommissioners started"); - - /** - * Surface players (as DiscoveredNodeData objects on discoverySuccessCallback) that we - * previously connected to and received their WakeOnLAN MACAddress, but could not discover - * over DNS-SD this time in CHIP_DEVICE_CONFIG_STR_DISCOVERY_DELAY_SEC. This API will also - * ensure that the reported players were previously discoverable within - * CHIP_DEVICE_CONFIG_STR_CACHE_LAST_DISCOVERED_HOURS. - * - *

The DiscoveredNodeData object for such players will have the IsAsleep attribute set to - * true, which can optionally be used for any special UX treatment when displaying them. - * - *

Surfacing such players as discovered will allow displaying them to the user, who may - * want to cast to them. In such a case, the VerifyOrEstablishConnection API will turn them on - * over WakeOnLan. - */ - this.reportSleepingVideoPlayerCommissionersFuture = - Executors.newScheduledThreadPool(1) - .schedule( - () -> { - Log.d( - TAG, - "Scheduling reportSleepingCommissioners with commissioner count " - + (preCommissionedVideoPlayers != null - ? preCommissionedVideoPlayers.size() - : 0)); - reportSleepingVideoPlayerCommissioners( - preCommissionedVideoPlayers, discoverySuccessCallback); - }, - CHIP_DEVICE_CONFIG_STR_DISCOVERY_DELAY_SEC * 1000, - TimeUnit.MILLISECONDS); - - this.discoveryStarted = true; - } - } - - private void reportSleepingVideoPlayerCommissioners( - List cachedVideoPlayers, - SuccessCallback discoverySuccessCallback) { - Log.d( - TAG, - "TvCastingApp.reportSleepingVideoPlayerCommissioners called with commissioner count " - + (cachedVideoPlayers != null ? cachedVideoPlayers.size() : 0)); - if (cachedVideoPlayers == null) { - Log.d(TAG, "No cached video players available."); - return; - } - - for (VideoPlayer player : cachedVideoPlayers) { - Log.d(TAG, "Cached Video Player: " + player); - // do NOT surface this cached Player if we don't have its MACAddress - if (player.getMACAddress() == null) { - Log.d( - TAG, - "TvCastingApp.reportSleepingVideoPlayerCommissioners Skipping Player with hostName" - + player.getHostName() - + " but no MACAddress"); - continue; - } - - // do NOT surface this cached Player if it has not been discoverable recently (in - // CHIP_DEVICE_CONFIG_STR_CACHE_LAST_DISCOVERED_HOURS) - if (!WasRecentlyDiscoverable(player)) { - Log.d( - TAG, - "TvCastingApp.reportSleepingVideoPlayerCommissioners Skipping Player with hostName" - + player.getHostName() - + " that has not been discovered recently"); - continue; - } - - // do NOT surface this cached Player if it was just discovered right now (in this discovery - // call) - boolean justDiscovered = - discoveredPlayers - .stream() - .anyMatch( - new Predicate() { - @Override - public boolean test(DiscoveredNodeData discoveredNodeData) { - return player.getHostName().equals(discoveredNodeData.getHostName()); - } - }); - if (justDiscovered) { - Log.d( - TAG, - "TvCastingApp.reportSleepingVideoPlayerCommissioners Skipping Player with hostName" - + player.getHostName() - + " that was just discovered"); - continue; - } - - // DO surface this cached Player (as asleep) - Log.d(TAG, "Reporting sleeping player with hostName " + player.getHostName()); - player.setIsAsleep(true); - discoverySuccessCallback.handle(new DiscoveredNodeData(player)); - } - } - - private native boolean WasRecentlyDiscoverable(VideoPlayer player); - - public void stopVideoPlayerDiscovery() { - synchronized (discoveryLock) { - Log.d(TAG, "TvCastingApp trying to stop video player discovery"); - if (this.discoveryStarted - && nsdManager != null - && multicastLock != null - && nsdDiscoveryListener != null) { - Log.d(TAG, "TvCastingApp stopping Video Player commissioner discovery"); - try { - nsdManager.stopServiceDiscovery(nsdDiscoveryListener); - } catch (IllegalArgumentException e) { - Log.w( - TAG, - "TvCastingApp received exception on calling nsdManager.stopServiceDiscovery() " - + e.getMessage()); - } - - if (multicastLock.isHeld()) { - multicastLock.release(); - } - - if (reportSleepingVideoPlayerCommissionersFuture != null) { - reportSleepingVideoPlayerCommissionersFuture.cancel(false); - } - this.discoveryStarted = false; - } - } - } - - void resetDiscoveryState() { - synchronized (discoveryLock) { - Log.d(TAG, "TvCastingApp resetting discovery state"); - this.discoveryStarted = false; - this.nsdDiscoveryListener = null; - if (multicastLock != null && multicastLock.isHeld()) { - multicastLock.release(); - } - } - } - - public native boolean openBasicCommissioningWindow( - int duration, - CommissioningCallbacks commissioningCallbacks, - SuccessCallback onConnectionSuccess, - FailureCallback onConnectionFailure, - SuccessCallback onNewOrUpdatedEndpointCallback); - - public native boolean sendCommissioningRequest(DiscoveredNodeData commissioner); - - /** @Deprecated Use sendCommissioningRequest(DiscoveredNodeData) instead */ - private native boolean sendUserDirectedCommissioningRequest(String address, int port); - - public native List readCachedVideoPlayers(); - - public native boolean verifyOrEstablishConnection( - VideoPlayer targetVideoPlayer, - SuccessCallback onConnectionSuccess, - FailureCallback onConnectionFailure, - SuccessCallback onNewOrUpdatedEndpointCallback); - - public native void shutdownAllSubscriptions(); - - public native void disconnect(); - - public native List getActiveTargetVideoPlayers(); - - public native boolean purgeCache(); - - /* - * CONTENT LAUNCHER CLUSTER - * - * TODO: Add API to subscribe to AcceptHeader - */ - public native boolean contentLauncherLaunchURL( - ContentApp contentApp, String contentUrl, String contentDisplayStr, Object launchURLHandler); - - public native boolean contentLauncher_launchContent( - ContentApp contentApp, - ContentLauncherTypes.ContentSearch search, - boolean autoPlay, - String data, - Object responseHandler); - - public native boolean contentLauncher_subscribeToSupportedStreamingProtocols( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - /* - * LEVEL CONTROL CLUSTER - */ - public native boolean levelControl_step( - ContentApp contentApp, - byte stepMode, - byte stepSize, - short transitionTime, - byte optionMask, - byte optionOverridem, - Object responseHandler); - - public native boolean levelControl_moveToLevel( - ContentApp contentApp, - byte level, - short transitionTime, - byte optionMask, - byte optionOverridem, - Object responseHandler); - - public native boolean levelControl_subscribeToCurrentLevel( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - public native boolean levelControl_subscribeToMinLevel( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - public native boolean levelControl_subscribeToMaxLevel( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - /* - * MEDIA PLAYBACK CLUSTER - */ - public native boolean mediaPlayback_play(ContentApp contentApp, Object responseHandler); - - public native boolean mediaPlayback_pause(ContentApp contentApp, Object responseHandler); - - public native boolean mediaPlayback_stopPlayback(ContentApp contentApp, Object responseHandler); - - public native boolean mediaPlayback_next(ContentApp contentApp, Object responseHandler); - - public native boolean mediaPlayback_previous(ContentApp contentApp, Object responseHandler); - - public native boolean mediaPlayback_rewind(ContentApp contentApp, Object responseHandler); - - public native boolean mediaPlayback_fastForward(ContentApp contentApp, Object responseHandler); - - public native boolean mediaPlayback_startOver(ContentApp contentApp, Object responseHandler); - - public native boolean mediaPlayback_seek( - ContentApp contentApp, long position, Object responseHandler); - - public native boolean mediaPlayback_skipForward( - ContentApp contentApp, long deltaPositionMilliseconds, Object responseHandler); - - public native boolean mediaPlayback_skipBackward( - ContentApp contentApp, long deltaPositionMilliseconds, Object responseHandler); - - public native boolean mediaPlayback_subscribeToCurrentState( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - public native boolean mediaPlayback_subscribeToDuration( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - public native boolean mediaPlayback_subscribeToSampledPosition( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - public native boolean mediaPlayback_subscribeToPlaybackSpeed( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - public native boolean mediaPlayback_subscribeToSeekRangeEnd( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - public native boolean mediaPlayback_subscribeToSeekRangeStart( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - /* - * APPLICATION LAUNCHER CLUSTER - */ - public native boolean applicationLauncher_launchApp( - ContentApp contentApp, - short catalogVendorId, - String applicationId, - byte[] data, - Object responseHandler); - - public native boolean applicationLauncher_stopApp( - ContentApp contentApp, short catalogVendorId, String applicationId, Object responseHandler); - - public native boolean applicationLauncher_hideApp( - ContentApp contentApp, short catalogVendorId, String applicationId, Object responseHandler); - - /* - * TARGET NAVIGATOR CLUSTER - */ - public native boolean targetNavigator_navigateTarget( - ContentApp contentApp, byte target, String data, Object responseHandler); - - public native boolean targetNavigator_subscribeToCurrentTarget( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - public native boolean targetNavigator_subscribeToTargetList( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - /* - * KEYPAD INPUT CLUSTER - */ - public native boolean keypadInput_sendKey( - ContentApp contentApp, byte keyCode, Object responseHandler); - - /** - * APPLICATION BASIC - * - *

TODO: Add APIs to subscribe to & read Application, Status and AllowedVendorList - */ - public native boolean applicationBasic_subscribeToVendorName( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - public native boolean applicationBasic_subscribeToVendorID( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - public native boolean applicationBasic_subscribeToApplicationName( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - public native boolean applicationBasic_subscribeToProductID( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - public native boolean applicationBasic_subscribeToApplicationVersion( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - public native boolean applicationBasic_readVendorName( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler); - - public native boolean applicationBasic_readVendorID( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler); - - public native boolean applicationBasic_readApplicationName( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler); - - public native boolean applicationBasic_readProductID( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler); - - public native boolean applicationBasic_readApplicationVersion( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler); - - public native boolean onOff_on(ContentApp contentApp, Object responseHandler); - - public native boolean onOff_off(ContentApp contentApp, Object responseHandler); - - public native boolean onOff_toggle(ContentApp contentApp, Object responseHandler); - - public native boolean messages_presentMessages( - ContentApp contentApp, String messageText, Object responseHandler); - - static { - System.loadLibrary("TvCastingApp"); - } -} diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/support/DataProvider.java b/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/support/DataProvider.java index 854cf76ce8aca8..63e8da3d31b609 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/support/DataProvider.java +++ b/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/support/DataProvider.java @@ -20,7 +20,7 @@ import android.util.Log; public interface DataProvider { - public static final String TAG = DataProvider.class.getSimpleName(); + String TAG = DataProvider.class.getSimpleName(); default T _get() { T val = null; @@ -32,5 +32,5 @@ default T _get() { return val; } - public abstract T get(); + T get(); } diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/Constants.h b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/Constants.h deleted file mode 100644 index 735cabf2375f51..00000000000000 --- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/Constants.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2022 Project CHIP Authors - * All rights reserved. - * - * 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. - * - */ -#pragma once - -enum MediaCommandName -{ - ContentLauncher_LaunchURL, - ContentLauncher_LaunchContent, - LevelControl_Step, - LevelControl_MoveToLevel, - OnOff_On, - OnOff_Off, - OnOff_Toggle, - MediaPlayback_Play, - MediaPlayback_Pause, - MediaPlayback_StopPlayback, - MediaPlayback_Next, - MediaPlayback_Previous, - MediaPlayback_Rewind, - MediaPlayback_FastForward, - MediaPlayback_StartOver, - MediaPlayback_Seek, - MediaPlayback_SkipForward, - MediaPlayback_SkipBackward, - Messages_PresentMessagesRequest, - ApplicationLauncher_LaunchApp, - ApplicationLauncher_StopApp, - ApplicationLauncher_HideApp, - TargetNavigator_NavigateTarget, - KeypadInput_SendKey, - - MEDIA_COMMAND_COUNT -}; - -enum MediaAttributeName -{ - ContentLauncher_SupportedStreamingProtocols, - ContentLauncher_AcceptHeader, - LevelControl_CurrentLevel, - LevelControl_MinLevel, - LevelControl_MaxLevel, - MediaPlayback_CurrentState, - MediaPlayback_StartTime, - MediaPlayback_Duration, - MediaPlayback_SampledPosition, - MediaPlayback_PlaybackSpeed, - MediaPlayback_SeekRangeEnd, - MediaPlayback_SeekRangeStart, - ApplicationLauncher_CurrentApp, - TargetNavigator_TargetList, - TargetNavigator_CurrentTarget, - ApplicationBasic_VendorName, - ApplicationBasic_VendorID, - ApplicationBasic_ApplicationName, - ApplicationBasic_ProductID, - ApplicationBasic_ApplicationVersion, - - MEDIA_ATTRIBUTE_COUNT -}; diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/ConversionUtils.cpp b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/ConversionUtils.cpp deleted file mode 100644 index c8a38942e60234..00000000000000 --- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/ConversionUtils.cpp +++ /dev/null @@ -1,410 +0,0 @@ -/* - * - * 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. - */ -#include "ConversionUtils.h" - -#include -#include -#include -#include -#include -#include -#include - -CHIP_ERROR convertJAppParametersToCppAppParams(jobject appParameters, AppParams & outAppParams) -{ - ChipLogProgress(AppServer, "convertJAppParametersToCppAppParams called"); - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - VerifyOrReturnError(appParameters != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - - jclass jAppParametersClass; - ReturnErrorOnFailure( - chip::JniReferences::GetInstance().GetLocalClassRef(env, "com/chip/casting/AppParameters", jAppParametersClass)); - - jmethodID getRotatingDeviceIdUniqueIdMethod = env->GetMethodID(jAppParametersClass, "getRotatingDeviceIdUniqueId", "()[B"); - if (getRotatingDeviceIdUniqueIdMethod == nullptr) - { - ChipLogError(Zcl, "Failed to access AppParameters 'getRotatingDeviceIdUniqueId' method"); - env->ExceptionClear(); - } - - jobject jRotatingDeviceIdUniqueId = (jobject) env->CallObjectMethod(appParameters, getRotatingDeviceIdUniqueIdMethod); - if (env->ExceptionCheck()) - { - ChipLogError(Zcl, "Java exception in AppParameters::getRotatingDeviceIdUniqueId"); - env->ExceptionDescribe(); - env->ExceptionClear(); - return CHIP_ERROR_INCORRECT_STATE; - } - - if (jRotatingDeviceIdUniqueId != nullptr) - { - chip::JniByteArray * jniRotatingDeviceIdUniqueIdByteArray = - new chip::JniByteArray(env, static_cast(jRotatingDeviceIdUniqueId)); - outAppParams.SetRotatingDeviceIdUniqueId(MakeOptional(jniRotatingDeviceIdUniqueIdByteArray->byteSpan())); - } - - return CHIP_NO_ERROR; -} - -CHIP_ERROR convertJContentAppToTargetEndpointInfo(jobject contentApp, TargetEndpointInfo & outTargetEndpointInfo) -{ - ChipLogProgress(AppServer, "convertJContentAppToTargetEndpointInfo called"); - VerifyOrReturnError(contentApp != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - - jclass jContentAppClass; - ReturnErrorOnFailure(chip::JniReferences::GetInstance().GetLocalClassRef(env, "com/chip/casting/ContentApp", jContentAppClass)); - - jfieldID jEndpointIdField = env->GetFieldID(jContentAppClass, "endpointId", "S"); - jshort jEndpointId = env->GetShortField(contentApp, jEndpointIdField); - outTargetEndpointInfo.Initialize(static_cast(jEndpointId)); - - jfieldID jclusterIdsField = env->GetFieldID(jContentAppClass, "clusterIds", "Ljava/util/List;"); - jobject jClusterIds = env->GetObjectField(contentApp, jclusterIdsField); - if (jClusterIds == nullptr) - { - return CHIP_NO_ERROR; - } - - jobject jIterator = env->CallObjectMethod( - jClusterIds, env->GetMethodID(env->GetObjectClass(jClusterIds), "iterator", "()Ljava/util/Iterator;")); - jmethodID jNextMid = env->GetMethodID(env->GetObjectClass(jIterator), "next", "()Ljava/lang/Object;"); - jmethodID jHasNextMid = env->GetMethodID(env->GetObjectClass(jIterator), "hasNext", "()Z"); - - while (env->CallBooleanMethod(jIterator, jHasNextMid)) - { - jobject jClusterId = env->CallObjectMethod(jIterator, jNextMid); - jclass jIntegerClass = env->FindClass("java/lang/Integer"); - jmethodID jIntValueMid = env->GetMethodID(jIntegerClass, "intValue", "()I"); - outTargetEndpointInfo.AddCluster(static_cast(env->CallIntMethod(jClusterId, jIntValueMid))); - } - - return CHIP_NO_ERROR; -} - -CHIP_ERROR convertTargetEndpointInfoToJContentApp(TargetEndpointInfo * targetEndpointInfo, jobject & outContentApp) -{ - ChipLogProgress(AppServer, "convertTargetEndpointInfoToJContentApp called"); - if (targetEndpointInfo != nullptr && targetEndpointInfo->IsInitialized()) - { - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - - jclass jContentAppClass; - ReturnErrorOnFailure( - chip::JniReferences::GetInstance().GetLocalClassRef(env, "com/chip/casting/ContentApp", jContentAppClass)); - jmethodID jContentAppConstructor = env->GetMethodID(jContentAppClass, "", "(SLjava/util/List;)V"); - chip::ClusterId * clusters = targetEndpointInfo->GetClusters(); - jobject jClustersArrayList = nullptr; - if (clusters != nullptr) - { - chip::JniReferences::GetInstance().CreateArrayList(jClustersArrayList); - for (size_t i = 0; i < kMaxNumberOfClustersPerEndpoint && clusters[i] != chip::kInvalidClusterId; i++) - { - jobject jCluster = nullptr; - jint jniclusterId = static_cast(clusters[i]); - chip::JniReferences::GetInstance().CreateBoxedObject("java/lang/Integer", "(I)V", jniclusterId, jCluster); - chip::JniReferences::GetInstance().AddToList(jClustersArrayList, jCluster); - } - } - outContentApp = - env->NewObject(jContentAppClass, jContentAppConstructor, targetEndpointInfo->GetEndpointId(), jClustersArrayList); - } - return CHIP_NO_ERROR; -} - -CHIP_ERROR convertJVideoPlayerToTargetVideoPlayerInfo(jobject videoPlayer, TargetVideoPlayerInfo & outTargetVideoPlayerInfo) -{ - ChipLogProgress(AppServer, "convertJVideoPlayerToTargetVideoPlayerInfo called"); - VerifyOrReturnError(videoPlayer != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - - jclass jVideoPlayerClass; - ReturnErrorOnFailure( - chip::JniReferences::GetInstance().GetLocalClassRef(env, "com/chip/casting/VideoPlayer", jVideoPlayerClass)); - - jfieldID jNodeIdField = env->GetFieldID(jVideoPlayerClass, "nodeId", "J"); - chip::NodeId nodeId = static_cast(env->GetLongField(videoPlayer, jNodeIdField)); - - jfieldID jFabricIndexField = env->GetFieldID(jVideoPlayerClass, "fabricIndex", "B"); - chip::FabricIndex fabricIndex = static_cast(env->GetByteField(videoPlayer, jFabricIndexField)); - - jfieldID jVendorIdField = env->GetFieldID(jVideoPlayerClass, "vendorId", "I"); - uint16_t vendorId = static_cast(env->GetIntField(videoPlayer, jVendorIdField)); - - jfieldID jProductIdField = env->GetFieldID(jVideoPlayerClass, "productId", "I"); - uint16_t productId = static_cast(env->GetIntField(videoPlayer, jProductIdField)); - - jfieldID jDeviceType = env->GetFieldID(jVideoPlayerClass, "deviceType", "I"); - uint16_t deviceType = static_cast(env->GetIntField(videoPlayer, jDeviceType)); - - jfieldID getDeviceNameField = env->GetFieldID(jVideoPlayerClass, "deviceName", "Ljava/lang/String;"); - jstring jDeviceName = static_cast(env->GetObjectField(videoPlayer, getDeviceNameField)); - const char * deviceName = env->GetStringUTFChars(jDeviceName, 0); - - jfieldID getHostNameField = env->GetFieldID(jVideoPlayerClass, "hostName", "Ljava/lang/String;"); - jstring jHostName = static_cast(env->GetObjectField(videoPlayer, getHostNameField)); - const char * hostName = env->GetStringUTFChars(jHostName, 0); - - jfieldID jPort = env->GetFieldID(jVideoPlayerClass, "port", "I"); - uint16_t port = static_cast(env->GetIntField(videoPlayer, jPort)); - - jfieldID getInstanceNameField = env->GetFieldID(jVideoPlayerClass, "instanceName", "Ljava/lang/String;"); - jstring jInstanceName = static_cast(env->GetObjectField(videoPlayer, getInstanceNameField)); - const char * instanceName = {}; - if (jInstanceName != nullptr) - { - instanceName = env->GetStringUTFChars(jInstanceName, 0); - } - - jfieldID jLastDiscoveredMs = env->GetFieldID(jVideoPlayerClass, "lastDiscoveredMs", "J"); - long lastDiscoveredMs = static_cast(env->GetLongField(videoPlayer, jLastDiscoveredMs)); - - jfieldID getMACAddressField = env->GetFieldID(jVideoPlayerClass, "MACAddress", "Ljava/lang/String;"); - jstring jMACAddress = static_cast(env->GetObjectField(videoPlayer, getMACAddressField)); - const char * MACAddress = jMACAddress == nullptr ? nullptr : env->GetStringUTFChars(jMACAddress, 0); - - jfieldID jIsAsleep = env->GetFieldID(jVideoPlayerClass, "isAsleep", "Z"); - bool isAsleep = static_cast(env->GetBooleanField(videoPlayer, jIsAsleep)); - - outTargetVideoPlayerInfo.Initialize(nodeId, fabricIndex, nullptr, nullptr, vendorId, productId, deviceType, deviceName, - hostName, 0, nullptr, port, instanceName, chip::System::Clock::Timestamp(lastDiscoveredMs)); - - if (MACAddress != nullptr) - { - chip::CharSpan MACAddressSpan(MACAddress, 2 * 2 * chip::DeviceLayer::ConfigurationManager::kPrimaryMACAddressLength); - outTargetVideoPlayerInfo.SetMACAddress(MACAddressSpan); - } - - outTargetVideoPlayerInfo.SetIsAsleep(isAsleep); - - jfieldID jContentAppsField = env->GetFieldID(jVideoPlayerClass, "contentApps", "Ljava/util/List;"); - jobject jContentApps = env->GetObjectField(videoPlayer, jContentAppsField); - if (jContentApps == nullptr) - { - return CHIP_NO_ERROR; - } - - jobject jIterator = env->CallObjectMethod( - jContentApps, env->GetMethodID(env->GetObjectClass(jContentApps), "iterator", "()Ljava/util/Iterator;")); - jmethodID jNextMid = env->GetMethodID(env->GetObjectClass(jIterator), "next", "()Ljava/lang/Object;"); - jmethodID jHasNextMid = env->GetMethodID(env->GetObjectClass(jIterator), "hasNext", "()Z"); - - while (env->CallBooleanMethod(jIterator, jHasNextMid)) - { - jobject jContentApp = env->CallObjectMethod(jIterator, jNextMid); - - jclass jContentAppClass; - ReturnErrorOnFailure( - chip::JniReferences::GetInstance().GetLocalClassRef(env, "com/chip/casting/ContentApp", jContentAppClass)); - jfieldID jEndpointIdField = env->GetFieldID(jContentAppClass, "endpointId", "S"); - chip::EndpointId endpointId = static_cast(env->GetShortField(jContentApp, jEndpointIdField)); - TargetEndpointInfo * endpoint = outTargetVideoPlayerInfo.GetOrAddEndpoint(endpointId); - - ReturnErrorOnFailure(convertJContentAppToTargetEndpointInfo(jContentApp, *endpoint)); - } - - return CHIP_NO_ERROR; -} - -CHIP_ERROR convertTargetVideoPlayerInfoToJVideoPlayer(TargetVideoPlayerInfo * targetVideoPlayerInfo, jobject & outVideoPlayer) -{ - ChipLogProgress(AppServer, "convertTargetVideoPlayerInfoToJVideoPlayer called"); - if (targetVideoPlayerInfo != nullptr && targetVideoPlayerInfo->IsInitialized()) - { - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - - jclass jVideoPlayerClass; - ReturnErrorOnFailure( - chip::JniReferences::GetInstance().GetLocalClassRef(env, "com/chip/casting/VideoPlayer", jVideoPlayerClass)); - jmethodID jVideoPlayerConstructor = env->GetMethodID(jVideoPlayerClass, "", - "(JBLjava/lang/String;IIILjava/util/List;ILjava/util/List;Ljava/lang/" - "String;Ljava/lang/String;IJLjava/lang/String;ZZ)V"); - - jobject jContentAppList = nullptr; - TargetEndpointInfo * endpoints = targetVideoPlayerInfo->GetEndpoints(); - if (endpoints != nullptr) - { - chip::JniReferences::GetInstance().CreateArrayList(jContentAppList); - for (size_t i = 0; i < kMaxNumberOfEndpoints && endpoints[i].IsInitialized(); i++) - { - jobject contentApp = nullptr; - ReturnErrorOnFailure(convertTargetEndpointInfoToJContentApp(&endpoints[i], contentApp)); - chip::JniReferences::GetInstance().AddToList(jContentAppList, contentApp); - } - } - - jstring deviceName = - targetVideoPlayerInfo->GetDeviceName() == nullptr ? nullptr : env->NewStringUTF(targetVideoPlayerInfo->GetDeviceName()); - - jstring hostName = - targetVideoPlayerInfo->GetHostName() == nullptr ? nullptr : env->NewStringUTF(targetVideoPlayerInfo->GetHostName()); - - jstring instanceName = targetVideoPlayerInfo->GetInstanceName() == nullptr - ? nullptr - : env->NewStringUTF(targetVideoPlayerInfo->GetInstanceName()); - - jstring MACAddress = nullptr; - if (targetVideoPlayerInfo->GetMACAddress() != nullptr && targetVideoPlayerInfo->GetMACAddress()->data() != nullptr) - { - char MACAddressWithNil[2 * chip::DeviceLayer::ConfigurationManager::kPrimaryMACAddressLength + 1]; - memcpy(MACAddressWithNil, targetVideoPlayerInfo->GetMACAddress()->data(), - targetVideoPlayerInfo->GetMACAddress()->size()); - MACAddressWithNil[targetVideoPlayerInfo->GetMACAddress()->size()] = '\0'; - MACAddress = env->NewStringUTF(MACAddressWithNil); - } - - jobject jIPAddressList = nullptr; - const chip::Inet::IPAddress * ipAddresses = targetVideoPlayerInfo->GetIpAddresses(); - if (ipAddresses != nullptr) - { - chip::JniReferences::GetInstance().CreateArrayList(jIPAddressList); - for (size_t i = 0; i < targetVideoPlayerInfo->GetNumIPs() && i < chip::Dnssd::CommonResolutionData::kMaxIPAddresses; - i++) - { - char addrCString[chip::Inet::IPAddress::kMaxStringLength]; - ipAddresses[i].ToString(addrCString, chip::Inet::IPAddress::kMaxStringLength); - jstring jIPAddressStr = env->NewStringUTF(addrCString); - - jclass jIPAddressClass; - ReturnErrorOnFailure( - chip::JniReferences::GetInstance().GetLocalClassRef(env, "java/net/InetAddress", jIPAddressClass)); - jmethodID jGetByNameMid = - env->GetStaticMethodID(jIPAddressClass, "getByName", "(Ljava/lang/String;)Ljava/net/InetAddress;"); - jobject jIPAddress = env->CallStaticObjectMethod(jIPAddressClass, jGetByNameMid, jIPAddressStr); - - chip::JniReferences::GetInstance().AddToList(jIPAddressList, jIPAddress); - } - } - - outVideoPlayer = env->NewObject( - jVideoPlayerClass, jVideoPlayerConstructor, targetVideoPlayerInfo->GetNodeId(), targetVideoPlayerInfo->GetFabricIndex(), - deviceName, targetVideoPlayerInfo->GetVendorId(), targetVideoPlayerInfo->GetProductId(), - targetVideoPlayerInfo->GetDeviceType(), jContentAppList, targetVideoPlayerInfo->GetNumIPs(), jIPAddressList, hostName, - instanceName, targetVideoPlayerInfo->GetPort(), targetVideoPlayerInfo->GetLastDiscovered().count(), MACAddress, - targetVideoPlayerInfo->IsAsleep(), targetVideoPlayerInfo->GetOperationalDeviceProxy() != nullptr); - } - return CHIP_NO_ERROR; -} - -CHIP_ERROR convertJDiscoveredNodeDataToCppDiscoveredNodeData(jobject jDiscoveredNodeData, - chip::Dnssd::CommissionNodeData & outCppDiscoveredNodeData) -{ - ChipLogProgress(AppServer, "convertJDiscoveredNodeDataToCppDiscoveredNodeData called"); - VerifyOrReturnError(jDiscoveredNodeData != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - - jclass jDiscoveredNodeDataClass; - ReturnErrorOnFailure( - chip::JniReferences::GetInstance().GetLocalClassRef(env, "com/chip/casting/DiscoveredNodeData", jDiscoveredNodeDataClass)); - - jfieldID getHostNameField = env->GetFieldID(jDiscoveredNodeDataClass, "hostName", "Ljava/lang/String;"); - jstring jHostName = static_cast(env->GetObjectField(jDiscoveredNodeData, getHostNameField)); - if (jHostName != nullptr) - { - chip::Platform::CopyString(outCppDiscoveredNodeData.hostName, chip::Dnssd::kHostNameMaxLength + 1, - env->GetStringUTFChars(jHostName, 0)); - } - - jfieldID getInstanceNameField = env->GetFieldID(jDiscoveredNodeDataClass, "instanceName", "Ljava/lang/String;"); - jstring jInstanceName = static_cast(env->GetObjectField(jDiscoveredNodeData, getInstanceNameField)); - if (jInstanceName != nullptr) - { - chip::Platform::CopyString(outCppDiscoveredNodeData.instanceName, chip::Dnssd::Commission::kInstanceNameMaxLength + 1, - env->GetStringUTFChars(jInstanceName, 0)); - } - - jfieldID jLongDiscriminatorField = env->GetFieldID(jDiscoveredNodeDataClass, "longDiscriminator", "J"); - outCppDiscoveredNodeData.vendorId = static_cast(env->GetLongField(jDiscoveredNodeData, jLongDiscriminatorField)); - - jfieldID jVendorIdField = env->GetFieldID(jDiscoveredNodeDataClass, "vendorId", "J"); - outCppDiscoveredNodeData.vendorId = static_cast(env->GetLongField(jDiscoveredNodeData, jVendorIdField)); - - jfieldID jProductIdField = env->GetFieldID(jDiscoveredNodeDataClass, "productId", "J"); - outCppDiscoveredNodeData.productId = static_cast(env->GetLongField(jDiscoveredNodeData, jProductIdField)); - - jfieldID jCommissioningModeField = env->GetFieldID(jDiscoveredNodeDataClass, "commissioningMode", "B"); - outCppDiscoveredNodeData.commissioningMode = - static_cast(env->GetByteField(jDiscoveredNodeData, jCommissioningModeField)); - - jfieldID jDeviceTypeField = env->GetFieldID(jDiscoveredNodeDataClass, "deviceType", "J"); - outCppDiscoveredNodeData.deviceType = static_cast(env->GetLongField(jDiscoveredNodeData, jDeviceTypeField)); - - jfieldID getDeviceNameField = env->GetFieldID(jDiscoveredNodeDataClass, "deviceName", "Ljava/lang/String;"); - jstring jDeviceName = static_cast(env->GetObjectField(jDiscoveredNodeData, getDeviceNameField)); - if (jDeviceName != nullptr) - { - chip::Platform::CopyString(outCppDiscoveredNodeData.deviceName, chip::Dnssd::kMaxDeviceNameLen + 1, - env->GetStringUTFChars(jDeviceName, 0)); - } - - // TODO: map rotating ID - jfieldID jRotatingIdLenField = env->GetFieldID(jDiscoveredNodeDataClass, "rotatingIdLen", "I"); - outCppDiscoveredNodeData.rotatingIdLen = static_cast(env->GetIntField(jDiscoveredNodeData, jRotatingIdLenField)); - - jfieldID jPairingHintField = env->GetFieldID(jDiscoveredNodeDataClass, "pairingHint", "S"); - outCppDiscoveredNodeData.pairingHint = static_cast(env->GetShortField(jDiscoveredNodeData, jPairingHintField)); - - jfieldID getPairingInstructionField = env->GetFieldID(jDiscoveredNodeDataClass, "pairingInstruction", "Ljava/lang/String;"); - jstring jPairingInstruction = static_cast(env->GetObjectField(jDiscoveredNodeData, getPairingInstructionField)); - if (jPairingInstruction != nullptr) - { - chip::Platform::CopyString(outCppDiscoveredNodeData.pairingInstruction, chip::Dnssd::kMaxPairingInstructionLen + 1, - env->GetStringUTFChars(jPairingInstruction, 0)); - } - - jfieldID jPortField = env->GetFieldID(jDiscoveredNodeDataClass, "port", "I"); - outCppDiscoveredNodeData.port = static_cast(env->GetIntField(jDiscoveredNodeData, jPortField)); - - jfieldID jNumIpsField = env->GetFieldID(jDiscoveredNodeDataClass, "numIPs", "I"); - outCppDiscoveredNodeData.numIPs = static_cast(env->GetIntField(jDiscoveredNodeData, jNumIpsField)); - - jfieldID jIPAddressesField = env->GetFieldID(jDiscoveredNodeDataClass, "ipAddresses", "Ljava/util/List;"); - jobject jIPAddresses = env->GetObjectField(jDiscoveredNodeData, jIPAddressesField); - if (jIPAddresses == nullptr && outCppDiscoveredNodeData.numIPs > 0) - { - return CHIP_ERROR_INVALID_ARGUMENT; - } - - jobject jIterator = env->CallObjectMethod( - jIPAddresses, env->GetMethodID(env->GetObjectClass(jIPAddresses), "iterator", "()Ljava/util/Iterator;")); - jmethodID jNextMid = env->GetMethodID(env->GetObjectClass(jIterator), "next", "()Ljava/lang/Object;"); - jmethodID jHasNextMid = env->GetMethodID(env->GetObjectClass(jIterator), "hasNext", "()Z"); - - size_t ipAddressCount = 0; - while (env->CallBooleanMethod(jIterator, jHasNextMid)) - { - jobject jIPAddress = env->CallObjectMethod(jIterator, jNextMid); - jclass jIPAddressClass; - ReturnErrorOnFailure(chip::JniReferences::GetInstance().GetLocalClassRef(env, "java/net/InetAddress", jIPAddressClass)); - jmethodID jGetHostAddressMid = env->GetMethodID(jIPAddressClass, "getHostAddress", "()Ljava/lang/String;"); - jstring jIPAddressStr = static_cast(env->CallObjectMethod(jIPAddress, jGetHostAddressMid)); - - chip::Inet::IPAddress addressInet; - chip::JniUtfString addressJniString(env, jIPAddressStr); - VerifyOrReturnError(chip::Inet::IPAddress::FromString(addressJniString.c_str(), addressInet), CHIP_ERROR_INVALID_ARGUMENT); - outCppDiscoveredNodeData.ipAddress[ipAddressCount] = addressInet; - - if (ipAddressCount == 0) - { - outCppDiscoveredNodeData.interfaceId = chip::Inet::InterfaceId::FromIPAddress(addressInet); - } - ipAddressCount++; - } - - return CHIP_NO_ERROR; -} diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/ConversionUtils.h b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/ConversionUtils.h deleted file mode 100644 index 28f5a1abd28c5a..00000000000000 --- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/ConversionUtils.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * 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. - */ -#pragma once - -#include "AppParams.h" -#include "TargetEndpointInfo.h" -#include "TargetVideoPlayerInfo.h" - -#include - -CHIP_ERROR convertJAppParametersToCppAppParams(jobject appParameters, AppParams & outAppParams); - -CHIP_ERROR convertJContentAppToTargetEndpointInfo(jobject contentApp, TargetEndpointInfo & outTargetEndpointInfo); - -CHIP_ERROR convertTargetEndpointInfoToJContentApp(TargetEndpointInfo * targetEndpointInfo, jobject & outContentApp); - -CHIP_ERROR convertJVideoPlayerToTargetVideoPlayerInfo(jobject videoPlayer, TargetVideoPlayerInfo & targetVideoPlayerInfo); - -CHIP_ERROR convertTargetVideoPlayerInfoToJVideoPlayer(TargetVideoPlayerInfo * targetVideoPlayerInfo, jobject & outVideoPlayer); - -CHIP_ERROR convertJDiscoveredNodeDataToCppDiscoveredNodeData(jobject jDiscoveredNodeData, - chip::Dnssd::CommissionNodeData & cppDiscoveredNodeData); diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/MatterCallbackHandler-JNI.cpp b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/MatterCallbackHandler-JNI.cpp deleted file mode 100644 index ca62ba5f37ee22..00000000000000 --- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/MatterCallbackHandler-JNI.cpp +++ /dev/null @@ -1,419 +0,0 @@ -/* - * - * Copyright (c) 2022 Project CHIP Authors - * All rights reserved. - * - * 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. - */ - -#include "MatterCallbackHandler-JNI.h" - -#include - -using namespace chip; - -CHIP_ERROR CallbackBaseJNI::SetUp(JNIEnv * env, jobject inHandler) -{ - ChipLogProgress(AppServer, "CallbackBaseJNI::SetUp called"); - CHIP_ERROR err = CHIP_NO_ERROR; - - VerifyOrExit(mObject.Init(inHandler) == CHIP_NO_ERROR, ChipLogError(AppServer, "Failed to Init mObject")); - - mClazz = env->GetObjectClass(mObject.ObjectRef()); - VerifyOrExit(mClazz != nullptr, ChipLogError(AppServer, "Failed to get handler Java class")); - - mSuperClazz = env->GetSuperclass(mClazz); - VerifyOrExit(mSuperClazz != nullptr, ChipLogError(AppServer, "Failed to get handler's parent's Java class")); - - mMethod = env->GetMethodID(mSuperClazz, "handleInternal", mMethodSignature); - if (mMethod == nullptr) - { - ChipLogError(AppServer, "Failed to access 'handleInternal' method with signature %s", mMethodSignature); - env->ExceptionClear(); - } - -exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "CallbackBaseJNI::SetUp error: %s", err.AsString()); - return err; - } - - return err; -} - -void FailureHandlerJNI::Handle(CHIP_ERROR callbackErr) -{ - ChipLogProgress(AppServer, "Handle(CHIP_ERROR) called"); - - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - UtfString jniCallbackErrString(env, callbackErr.AsString()); - - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - VerifyOrExit(mObject.HasValidObjectRef(), err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(mMethod != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - env->CallVoidMethod(mObject.ObjectRef(), mMethod, static_cast(callbackErr.AsInteger()), jniCallbackErrString.jniValue()); -exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "Handle(CHIP_ERROR) status error: %s", err.AsString()); - } -} - -void SubscriptionEstablishedHandlerJNI::Handle() -{ - ChipLogProgress(AppServer, "SubscriptionEstablishedHandlerJNI::Handle called"); - - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - VerifyOrExit(mObject.HasValidObjectRef(), err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(mMethod != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - - env->CallVoidMethod(mObject.ObjectRef(), mMethod); -exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "SubscriptionEstablishedHandlerJNI::Handle status error: %s", err.AsString()); - } -} - -jobject ConvertToLongJObject(uint64_t responseData) -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - - jclass responseTypeClass = env->FindClass("java/lang/Long"); - if (responseTypeClass == nullptr) - { - ChipLogError(AppServer, "ConvertToJObject: Class for Response Type not found!"); - return nullptr; - } - - jmethodID constructor = env->GetMethodID(responseTypeClass, "", "(J)V"); - return env->NewObject(responseTypeClass, constructor, responseData); -} - -jobject ConvertToFloatJObject(float responseData) -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - - jclass responseTypeClass = env->FindClass("java/lang/Float"); - if (responseTypeClass == nullptr) - { - ChipLogError(AppServer, "ConvertToJObject: Class for Response Type not found!"); - return nullptr; - } - - jmethodID constructor = env->GetMethodID(responseTypeClass, "", "(F)V"); - return env->NewObject(responseTypeClass, constructor, responseData); -} - -jobject ConvertToShortJObject(uint16_t responseData) -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - - jclass responseTypeClass = env->FindClass("java/lang/Short"); - if (responseTypeClass == nullptr) - { - ChipLogError(AppServer, "ConvertToJObject: Class for Response Type not found!"); - return nullptr; - } - - jmethodID constructor = env->GetMethodID(responseTypeClass, "", "(S)V"); - return env->NewObject(responseTypeClass, constructor, responseData); -} - -jobject ConvertToByteJObject(uint8_t responseData) -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - - jclass responseTypeClass = env->FindClass("java/lang/Byte"); - if (responseTypeClass == nullptr) - { - ChipLogError(AppServer, "ConvertToJObject: Class for Response Type not found!"); - return nullptr; - } - - jmethodID constructor = env->GetMethodID(responseTypeClass, "", "(B)V"); - return env->NewObject(responseTypeClass, constructor, responseData); -} - -jstring ConvertToJString(chip::CharSpan responseData) -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - - return env->NewStringUTF(std::string(responseData.data(), responseData.size()).c_str()); -} - -jobject ConvertToIntegerJObject(uint32_t responseData) -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - - jclass responseTypeClass = env->FindClass("java/lang/Integer"); - if (responseTypeClass == nullptr) - { - ChipLogError(AppServer, "ConvertToJObject: Class for Response Type not found!"); - return nullptr; - } - - jmethodID constructor = env->GetMethodID(responseTypeClass, "", "(I)V"); - return env->NewObject(responseTypeClass, constructor, responseData); -} - -// COMMISSIONING AND CONNECTION -jobject OnConnectionSuccessHandlerJNI::ConvertToJObject(TargetVideoPlayerInfo * targetVideoPlayerInfo) -{ - ChipLogProgress(AppServer, "OnConnectionSuccessHandlerJNI::ConvertToJObject called"); - jobject videoPlayer = nullptr; - CHIP_ERROR err = convertTargetVideoPlayerInfoToJVideoPlayer(targetVideoPlayerInfo, videoPlayer); - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "OnConnectionSuccessHandlerJNI::ConvertToJObject failed with %" CHIP_ERROR_FORMAT, err.Format()); - } - return videoPlayer; -} - -jobject OnNewOrUpdatedEndpointHandlerJNI::ConvertToJObject(TargetEndpointInfo * targetEndpointInfo) -{ - ChipLogProgress(AppServer, "OnNewOrUpdatedEndpointHandlerJNI::ConvertToJObject called"); - jobject contentApp = nullptr; - CHIP_ERROR err = convertTargetEndpointInfoToJContentApp(targetEndpointInfo, contentApp); - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "OnNewOrUpdatedEndpointHandlerJNI::ConvertToJObject failed with %" CHIP_ERROR_FORMAT, err.Format()); - } - return contentApp; -} - -// MEDIA PLAYBACK -jobject CurrentStateSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::MediaPlayback::Attributes::CurrentState::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "CurrentStateSuccessHandlerJNI::ConvertToJObject called"); - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - VerifyOrReturnValue(env != nullptr, nullptr); - JniLocalReferenceScope scope(env); - - jclass enumClass = nullptr; - CHIP_ERROR err = - JniReferences::GetInstance().GetLocalClassRef(env, "com/chip/casting/MediaPlaybackTypes$PlaybackStateEnum", enumClass); - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "ConvertToJObject: Class for Response Type not found!"); - return nullptr; - } - - jfieldID enumType = nullptr; - switch (responseData) - { - case chip::app::Clusters::MediaPlayback::PlaybackStateEnum::kPlaying: - enumType = env->GetStaticFieldID(enumClass, "Playing", "Lcom/chip/casting/MediaPlaybackTypes$PlaybackStateEnum;"); - break; - case chip::app::Clusters::MediaPlayback::PlaybackStateEnum::kPaused: - enumType = env->GetStaticFieldID(enumClass, "Paused", "Lcom/chip/casting/MediaPlaybackTypes$PlaybackStateEnum;"); - break; - case chip::app::Clusters::MediaPlayback::PlaybackStateEnum::kNotPlaying: - enumType = env->GetStaticFieldID(enumClass, "NotPlaying", "Lcom/chip/casting/MediaPlaybackTypes$PlaybackStateEnum;"); - break; - case chip::app::Clusters::MediaPlayback::PlaybackStateEnum::kBuffering: - enumType = env->GetStaticFieldID(enumClass, "Buffering", "Lcom/chip/casting/MediaPlaybackTypes$PlaybackStateEnum;"); - break; - default: - enumType = env->GetStaticFieldID(enumClass, "Unknown", "Lcom/chip/casting/MediaPlaybackTypes$PlaybackStateEnum;"); - break; - } - - if (enumType != nullptr) - { - return env->GetStaticObjectField(enumClass, enumType); - } - return nullptr; -} - -jobject DurationSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::MediaPlayback::Attributes::Duration::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "DurationSuccessHandlerJNI::ConvertToJObject called"); - return responseData.IsNull() ? nullptr : ConvertToLongJObject(responseData.Value()); -} - -jobject SampledPositionSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::MediaPlayback::Attributes::SampledPosition::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "SampledPositionSuccessHandlerJNI::ConvertToJObject called"); - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - VerifyOrReturnValue(env != nullptr, nullptr); - JniLocalReferenceScope scope(env); - - jobject jSampledPosition = nullptr; - if (!responseData.IsNull()) - { - const chip::app::Clusters::MediaPlayback::Structs::PlaybackPositionStruct::DecodableType & playbackPosition = - responseData.Value(); - - jclass responseTypeClass = nullptr; - CHIP_ERROR err = JniReferences::GetInstance().GetLocalClassRef( - env, "com/chip/casting/MediaPlaybackTypes$PlaybackPositionStruct", responseTypeClass); - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "ConvertToJObject: Class for Response Type not found!"); - return nullptr; - } - - if (playbackPosition.position.IsNull()) - { - jmethodID constructor = env->GetMethodID(responseTypeClass, "", "(Ljava/lang/Long;)V"); - jSampledPosition = env->NewObject(responseTypeClass, constructor, playbackPosition.updatedAt); - } - else - { - jmethodID constructor = env->GetMethodID(responseTypeClass, "", "(Ljava/lang/Long;java/lang/Long;)V"); - jSampledPosition = - env->NewObject(responseTypeClass, constructor, playbackPosition.updatedAt, playbackPosition.position.Value()); - } - } - - return jSampledPosition; -} - -jobject PlaybackSpeedSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::MediaPlayback::Attributes::PlaybackSpeed::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "PlaybackSpeedSuccessHandlerJNI::ConvertToJObject called"); - return ConvertToFloatJObject(responseData); -} - -jobject SeekRangeEndSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::MediaPlayback::Attributes::SeekRangeEnd::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "SeekRangeEndSuccessHandlerJNI::ConvertToJObject called"); - return responseData.IsNull() ? nullptr : ConvertToLongJObject(responseData.Value()); -} - -jobject SeekRangeStartSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::MediaPlayback::Attributes::SeekRangeStart::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "SeekRangeStartSuccessHandlerJNI::ConvertToJObject called"); - return responseData.IsNull() ? nullptr : ConvertToLongJObject(responseData.Value()); -} - -// TARGET NAVIGATOR -jobject CurrentTargetSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::TargetNavigator::Attributes::CurrentTarget::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "CurrentTargetSuccessHandlerJNI::ConvertToJObject called"); - return ConvertToByteJObject(responseData); -} - -jobject TargetListSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::TargetNavigator::Attributes::TargetList::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "TargetListSuccessHandlerJNI::ConvertToJObject called"); - - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - VerifyOrReturnValue(env != nullptr, nullptr); - JniLocalReferenceScope scope(env); - - jobject jArrayList; - chip::JniReferences::GetInstance().CreateArrayList(jArrayList); - auto iter = responseData.begin(); - while (iter.Next()) - { - const chip::app::Clusters::TargetNavigator::Structs::TargetInfoStruct::DecodableType & targetInfo = iter.GetValue(); - - jclass responseTypeClass = nullptr; - CHIP_ERROR err = JniReferences::GetInstance().GetLocalClassRef(env, "com/chip/casting/TargetNavigatorTypes$TargetInfo", - responseTypeClass); - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "ConvertToJObject: Class for Response Type not found!"); - return nullptr; - } - - jmethodID constructor = env->GetMethodID(responseTypeClass, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); - chip::UtfString targetInfoName(env, targetInfo.name); - jobject jTargetInfo = env->NewObject(responseTypeClass, constructor, ConvertToIntegerJObject(targetInfo.identifier), - targetInfoName.jniValue()); - - chip::JniReferences::GetInstance().AddToList(jArrayList, jTargetInfo); - } - return jArrayList; -} - -// LEVEL CONTROL -jobject CurrentLevelSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::LevelControl::Attributes::CurrentLevel::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "CurrentLevelSuccessHandlerJNI::ConvertToJObject called"); - return responseData.IsNull() ? nullptr : ConvertToByteJObject(responseData.Value()); -} - -jobject MinLevelSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::LevelControl::Attributes::MinLevel::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "MinLevelSuccessHandlerJNI::ConvertToJObject called"); - return ConvertToByteJObject(responseData); -} - -jobject MaxLevelSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::LevelControl::Attributes::MaxLevel::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "MaxLevelSuccessHandlerJNI::ConvertToJObject called"); - return ConvertToByteJObject(responseData); -} - -// CONTENT LAUNCHER -jobject SupportedStreamingProtocolsSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::ContentLauncher::Attributes::SupportedStreamingProtocols::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "SupportedStreamingProtocolsSuccessHandlerJNI::ConvertToJObject called"); - return ConvertToIntegerJObject(responseData.Raw()); -} - -// APPLICATION BASIC -jobject VendorNameSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::ApplicationBasic::Attributes::VendorName::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "VendorNameSuccessHandlerJNI::ConvertToJObject called"); - return ConvertToJString(responseData); -} - -jobject VendorIDSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::ApplicationBasic::Attributes::VendorID::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "VendorIDSuccessHandlerJNI::ConvertToJObject called"); - return ConvertToIntegerJObject(responseData); -} - -jobject ApplicationNameSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::ApplicationBasic::Attributes::ApplicationName::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "ApplicationNameSuccessHandlerJNI::ConvertToJObject called"); - return ConvertToJString(responseData); -} - -jobject ProductIDSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::ApplicationBasic::Attributes::ProductID::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "ProductIDSuccessHandlerJNI::ConvertToJObject called"); - return ConvertToIntegerJObject(responseData); -} - -jobject ApplicationVersionSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::ApplicationBasic::Attributes::ApplicationVersion::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "ApplicationVersionSuccessHandlerJNI::ConvertToJObject called"); - return ConvertToJString(responseData); -} diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/MatterCallbackHandler-JNI.h b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/MatterCallbackHandler-JNI.h deleted file mode 100644 index 152dac59737532..00000000000000 --- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/MatterCallbackHandler-JNI.h +++ /dev/null @@ -1,293 +0,0 @@ -/* - * - * Copyright (c) 2022 Project CHIP Authors - * All rights reserved. - * - * 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. - */ - -#pragma once - -#include "ConversionUtils.h" -#include "TargetEndpointInfo.h" -#include "TargetVideoPlayerInfo.h" - -#include -#include -#include -#include -#include - -#include - -class CallbackBaseJNI -{ -public: - CallbackBaseJNI(const char * methodSignature) { mMethodSignature = methodSignature; } - CHIP_ERROR SetUp(JNIEnv * env, jobject inHandler); - -protected: - chip::JniGlobalReference mObject; - jclass mClazz = nullptr; - jclass mSuperClazz = nullptr; - jmethodID mMethod = nullptr; - const char * mMethodSignature = nullptr; -}; - -class FailureHandlerJNI : public CallbackBaseJNI -{ -public: - FailureHandlerJNI() : CallbackBaseJNI("(ILjava/lang/String;)V") {} - void Handle(CHIP_ERROR err); -}; - -class MatterCallbackHandlerJNI : public FailureHandlerJNI -{ -}; - -class SubscriptionEstablishedHandlerJNI : public CallbackBaseJNI -{ -public: - SubscriptionEstablishedHandlerJNI() : CallbackBaseJNI("()V") {} - void Handle(); -}; - -// helper functions for conversions -jobject ConvertToLongJObject(uint64_t responseData); -jobject ConvertToFloatJObject(float responseData); -jobject ConvertToShortJObject(uint8_t responseData); -jobject ConvertToByteJObject(uint8_t responseData); -jobject ConvertToIntegerJObject(uint32_t responseData); -jstring ConvertToJString(chip::CharSpan responseData); - -template -class SuccessHandlerJNI : public CallbackBaseJNI -{ -public: - SuccessHandlerJNI(const char * methodSignature) : CallbackBaseJNI(methodSignature) {} - - virtual ~SuccessHandlerJNI() = 0; - - virtual jobject ConvertToJObject(T responseData) = 0; - - void Handle(T responseData) - { - ChipLogProgress(AppServer, "SuccessHandlerJNI::Handle called"); - - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject jResponseData = ConvertToJObject(responseData); - - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - VerifyOrExit(mObject.HasValidObjectRef(), err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(mMethod != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - env->CallVoidMethod(mObject.ObjectRef(), mMethod, jResponseData); - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "SuccessHandlerJNI::Handle status error: %s", err.AsString()); - } - } -}; - -template -SuccessHandlerJNI::~SuccessHandlerJNI(){}; - -// COMMISSIONING AND CONNECTION -class SessionEstablishmentStartedHandlerJNI : public SuccessHandlerJNI -{ -public: - SessionEstablishmentStartedHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Object;)V") {} - jobject ConvertToJObject(void * responseData) - { - // return nullptr because the Java callback extends SuccessCallback and its handle() expects a Void param. - // It expects a Void becauase no value is passed as part of this callback. - return nullptr; - } -}; - -class SessionEstablishedHandlerJNI : public SuccessHandlerJNI -{ -public: - SessionEstablishedHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Object;)V") {} - jobject ConvertToJObject(void * responseData) - { - // return nullptr because the Java callback extends SuccessCallback and its handle() expects a Void param. - // It expects a Void becauase no value is passed as part of this callback. - return nullptr; - } -}; - -class OnConnectionSuccessHandlerJNI : public SuccessHandlerJNI -{ -public: - OnConnectionSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Object;)V") {} - jobject ConvertToJObject(TargetVideoPlayerInfo * responseData); -}; - -class OnNewOrUpdatedEndpointHandlerJNI : public SuccessHandlerJNI -{ -public: - OnNewOrUpdatedEndpointHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Object;)V") {} - jobject ConvertToJObject(TargetEndpointInfo * responseData); -}; - -// MEDIA PLAYBACK -class CurrentStateSuccessHandlerJNI - : public SuccessHandlerJNI -{ -public: - CurrentStateSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Object;)V") {} - jobject ConvertToJObject(chip::app::Clusters::MediaPlayback::Attributes::CurrentState::TypeInfo::DecodableArgType responseData); -}; - -class DurationSuccessHandlerJNI - : public SuccessHandlerJNI -{ -public: - DurationSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Long;)V") {} - jobject ConvertToJObject(chip::app::Clusters::MediaPlayback::Attributes::Duration::TypeInfo::DecodableArgType responseData); -}; - -class SampledPositionSuccessHandlerJNI - : public SuccessHandlerJNI -{ -public: - SampledPositionSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Object;)V") {} - jobject - ConvertToJObject(chip::app::Clusters::MediaPlayback::Attributes::SampledPosition::TypeInfo::DecodableArgType responseData); -}; - -class PlaybackSpeedSuccessHandlerJNI - : public SuccessHandlerJNI -{ -public: - PlaybackSpeedSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Float;)V") {} - jobject - ConvertToJObject(chip::app::Clusters::MediaPlayback::Attributes::PlaybackSpeed::TypeInfo::DecodableArgType responseData); -}; - -class SeekRangeEndSuccessHandlerJNI - : public SuccessHandlerJNI -{ -public: - SeekRangeEndSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Long;)V") {} - jobject ConvertToJObject(chip::app::Clusters::MediaPlayback::Attributes::SeekRangeEnd::TypeInfo::DecodableArgType responseData); -}; - -class SeekRangeStartSuccessHandlerJNI - : public SuccessHandlerJNI -{ -public: - SeekRangeStartSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Long;)V") {} - jobject - ConvertToJObject(chip::app::Clusters::MediaPlayback::Attributes::SeekRangeStart::TypeInfo::DecodableArgType responseData); -}; - -// TARGET NAVIGATOR -class CurrentTargetSuccessHandlerJNI - : public SuccessHandlerJNI -{ -public: - CurrentTargetSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Byte;)V") {} - jobject - ConvertToJObject(chip::app::Clusters::TargetNavigator::Attributes::CurrentTarget::TypeInfo::DecodableArgType responseData); -}; - -class TargetListSuccessHandlerJNI - : public SuccessHandlerJNI -{ -public: - TargetListSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Object;)V") {} - jobject ConvertToJObject(chip::app::Clusters::TargetNavigator::Attributes::TargetList::TypeInfo::DecodableArgType responseData); -}; - -// LEVEL CONTROL -class CurrentLevelSuccessHandlerJNI - : public SuccessHandlerJNI -{ -public: - CurrentLevelSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Byte;)V") {} - jobject ConvertToJObject(chip::app::Clusters::LevelControl::Attributes::CurrentLevel::TypeInfo::DecodableArgType responseData); -}; - -class MinLevelSuccessHandlerJNI - : public SuccessHandlerJNI -{ -public: - MinLevelSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Byte;)V") {} - jobject ConvertToJObject(chip::app::Clusters::LevelControl::Attributes::MinLevel::TypeInfo::DecodableArgType responseData); -}; - -class MaxLevelSuccessHandlerJNI - : public SuccessHandlerJNI -{ -public: - MaxLevelSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Byte;)V") {} - jobject ConvertToJObject(chip::app::Clusters::LevelControl::Attributes::MaxLevel::TypeInfo::DecodableArgType responseData); -}; - -// CONTENT LAUNCHER -class SupportedStreamingProtocolsSuccessHandlerJNI - : public SuccessHandlerJNI< - chip::app::Clusters::ContentLauncher::Attributes::SupportedStreamingProtocols::TypeInfo::DecodableArgType> -{ -public: - SupportedStreamingProtocolsSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Integer;)V") {} - jobject ConvertToJObject( - chip::app::Clusters::ContentLauncher::Attributes::SupportedStreamingProtocols::TypeInfo::DecodableArgType responseData); -}; - -// APPLICATION BASIC -class VendorNameSuccessHandlerJNI - : public SuccessHandlerJNI -{ -public: - VendorNameSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/String;)V") {} - jobject - ConvertToJObject(chip::app::Clusters::ApplicationBasic::Attributes::VendorName::TypeInfo::DecodableArgType responseData); -}; - -class VendorIDSuccessHandlerJNI - : public SuccessHandlerJNI -{ -public: - VendorIDSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Integer;)V") {} - jobject ConvertToJObject(chip::app::Clusters::ApplicationBasic::Attributes::VendorID::TypeInfo::DecodableArgType responseData); -}; - -class ApplicationNameSuccessHandlerJNI - : public SuccessHandlerJNI -{ -public: - ApplicationNameSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/String;)V") {} - jobject - ConvertToJObject(chip::app::Clusters::ApplicationBasic::Attributes::ApplicationName::TypeInfo::DecodableArgType responseData); -}; - -class ProductIDSuccessHandlerJNI - : public SuccessHandlerJNI -{ -public: - ProductIDSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Integer;)V") {} - jobject ConvertToJObject(chip::app::Clusters::ApplicationBasic::Attributes::ProductID::TypeInfo::DecodableArgType responseData); -}; - -class ApplicationVersionSuccessHandlerJNI - : public SuccessHandlerJNI -{ -public: - ApplicationVersionSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/String;)V") {} - jobject ConvertToJObject( - chip::app::Clusters::ApplicationBasic::Attributes::ApplicationVersion::TypeInfo::DecodableArgType responseData); -}; diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/TvCastingApp-JNI.cpp b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/TvCastingApp-JNI.cpp deleted file mode 100644 index f2e0d5b79fc53c..00000000000000 --- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/TvCastingApp-JNI.cpp +++ /dev/null @@ -1,2129 +0,0 @@ -/* - * Copyright (c) 2022 Project CHIP Authors - * All rights reserved. - * - * 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. - * - */ - -#include "TvCastingApp-JNI.h" -#include "CastingServer.h" -#include "Constants.h" -#include "ConversionUtils.h" -#include "JNIDACProvider.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace chip; - -#define JNI_METHOD(RETURN, METHOD_NAME) extern "C" JNIEXPORT RETURN JNICALL Java_com_chip_casting_TvCastingApp_##METHOD_NAME - -TvCastingAppJNI TvCastingAppJNI::sInstance; - -jint JNI_OnLoad(JavaVM * jvm, void * reserved) -{ - return AndroidAppServerJNI_OnLoad(jvm, reserved); -} - -void JNI_OnUnload(JavaVM * jvm, void * reserved) -{ - return AndroidAppServerJNI_OnUnload(jvm, reserved); -} - -JNI_METHOD(jboolean, preInitJni)(JNIEnv *, jobject, jobject jAppParameters) -{ - chip::DeviceLayer::StackLock lock; - ChipLogProgress(AppServer, "JNI_METHOD preInitJni called"); - - CHIP_ERROR err = CHIP_NO_ERROR; - if (jAppParameters == nullptr) - { - err = CastingServer::GetInstance()->PreInit(); - } - else - { - AppParams appParams; - err = convertJAppParametersToCppAppParams(jAppParameters, appParams); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion of AppParameters from jobject to Cpp type failed: %" CHIP_ERROR_FORMAT, - err.Format())); - err = CastingServer::GetInstance()->PreInit(&appParams); - } - VerifyOrExit( - err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Call to CastingServer::GetInstance()->PreInit() failed: %" CHIP_ERROR_FORMAT, err.Format())); -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, initJni)(JNIEnv *, jobject, jobject jAppParameters) -{ - chip::DeviceLayer::StackLock lock; - ChipLogProgress(AppServer, "JNI_METHOD initJni called"); - - CHIP_ERROR err = CHIP_NO_ERROR; - if (jAppParameters == nullptr) - { - err = CastingServer::GetInstance()->Init(); - } - else - { - AppParams appParams; - err = convertJAppParametersToCppAppParams(jAppParameters, appParams); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion of AppParameters from jobject to Cpp type failed: %" CHIP_ERROR_FORMAT, - err.Format())); - err = CastingServer::GetInstance()->Init(&appParams); - } - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Call to CastingServer::GetInstance()->Init() failed: %" CHIP_ERROR_FORMAT, err.Format())); -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(void, setDACProvider)(JNIEnv *, jobject, jobject provider) -{ - chip::DeviceLayer::StackLock lock; - ChipLogProgress(AppServer, "JNI_METHOD setDACProvider called"); - - JNIDACProvider * p = new JNIDACProvider(provider); - chip::Credentials::SetDeviceAttestationCredentialsProvider(p); -} - -JNI_METHOD(jboolean, openBasicCommissioningWindow) -(JNIEnv * env, jobject, jint duration, jobject jCommissioningCallbacks, jobject jOnConnectionSuccessHandler, - jobject jOnConnectionFailureHandler, jobject jOnNewOrUpdatedEndpointHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD openBasicCommissioningWindow called with duration %d", duration); - - CHIP_ERROR err = CHIP_NO_ERROR; - - CommissioningCallbacks commissioningCallbacks; - jclass jCommissioningCallbacksClass; - chip::JniReferences::GetInstance().GetLocalClassRef(env, "com/chip/casting/CommissioningCallbacks", - jCommissioningCallbacksClass); - - jfieldID jCommissioningCompleteField = - env->GetFieldID(jCommissioningCallbacksClass, "commissioningComplete", "Ljava/lang/Object;"); - jobject jCommissioningComplete = env->GetObjectField(jCommissioningCallbacks, jCommissioningCompleteField); - if (jCommissioningComplete != nullptr) - { - err = TvCastingAppJNIMgr().getCommissioningCompleteHandler().SetUp(env, jCommissioningComplete); - VerifyOrReturnValue(err == CHIP_NO_ERROR, false, - ChipLogError(AppServer, "MatterCallbackHandlerJNI::SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - commissioningCallbacks.commissioningComplete = [](CHIP_ERROR err) { - TvCastingAppJNIMgr().getCommissioningCompleteHandler().Handle(err); - }; - } - - jfieldID jSessionEstablishmentStartedField = - env->GetFieldID(jCommissioningCallbacksClass, "sessionEstablishmentStarted", "Lcom/chip/casting/SuccessCallback;"); - jobject jSessionEstablishmentStarted = env->GetObjectField(jCommissioningCallbacks, jSessionEstablishmentStartedField); - if (jSessionEstablishmentStarted != nullptr) - { - err = TvCastingAppJNIMgr().getSessionEstablishmentStartedHandler().SetUp(env, jSessionEstablishmentStarted); - VerifyOrReturnValue( - err == CHIP_NO_ERROR, false, - ChipLogError(AppServer, "SessionEstablishmentStartedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - commissioningCallbacks.sessionEstablishmentStarted = []() { - TvCastingAppJNIMgr().getSessionEstablishmentStartedHandler().Handle(nullptr); - }; - } - - jfieldID jSessionEstablishedField = - env->GetFieldID(jCommissioningCallbacksClass, "sessionEstablished", "Lcom/chip/casting/SuccessCallback;"); - jobject jSessionEstablished = env->GetObjectField(jCommissioningCallbacks, jSessionEstablishedField); - if (jSessionEstablished != nullptr) - { - err = TvCastingAppJNIMgr().getSessionEstablishedHandler().SetUp(env, jSessionEstablished); - VerifyOrReturnValue(err == CHIP_NO_ERROR, false, - ChipLogError(AppServer, "SessionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - commissioningCallbacks.sessionEstablished = []() { TvCastingAppJNIMgr().getSessionEstablishedHandler().Handle(nullptr); }; - } - - jfieldID jSessionEstablishmentErrorField = - env->GetFieldID(jCommissioningCallbacksClass, "sessionEstablishmentError", "Lcom/chip/casting/FailureCallback;"); - jobject jSessionEstablishmentError = env->GetObjectField(jCommissioningCallbacks, jSessionEstablishmentErrorField); - if (jSessionEstablishmentError != nullptr) - { - err = TvCastingAppJNIMgr().getSessionEstablishmentErrorHandler().SetUp(env, jSessionEstablishmentError); - VerifyOrReturnValue(err == CHIP_NO_ERROR, false); - commissioningCallbacks.sessionEstablishmentError = [](CHIP_ERROR err) { - TvCastingAppJNIMgr().getSessionEstablishmentErrorHandler().Handle(err); - }; - } - - jfieldID jSessionEstablishmentStoppedField = - env->GetFieldID(jCommissioningCallbacksClass, "sessionEstablishmentStopped", "Lcom/chip/casting/FailureCallback;"); - jobject jSessionEstablishmentStopped = env->GetObjectField(jCommissioningCallbacks, jSessionEstablishmentStoppedField); - if (jSessionEstablishmentStopped != nullptr) - { - err = TvCastingAppJNIMgr().getSessionEstablishmentStoppedHandler().SetUp(env, jSessionEstablishmentStopped); - VerifyOrReturnValue( - err == CHIP_NO_ERROR, false, - ChipLogError(AppServer, "SessionEstablishmentStoppedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - commissioningCallbacks.sessionEstablishmentStopped = []() { - TvCastingAppJNIMgr().getSessionEstablishmentStoppedHandler().Handle(CHIP_NO_ERROR); - }; - } - - err = TvCastingAppJNIMgr().getOnConnectionSuccessHandler(false).SetUp(env, jOnConnectionSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "OnConnectionSuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getOnConnectionFailureHandler(false).SetUp(env, jOnConnectionFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "OnConnectionFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getOnNewOrUpdatedEndpointHandler(false).SetUp(env, jOnNewOrUpdatedEndpointHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "OnNewOrUpdatedEndpointHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->OpenBasicCommissioningWindow( - commissioningCallbacks, - [](TargetVideoPlayerInfo * videoPlayer) { TvCastingAppJNIMgr().getOnConnectionSuccessHandler(false).Handle(videoPlayer); }, - [](CHIP_ERROR err) { TvCastingAppJNIMgr().getOnConnectionFailureHandler(false).Handle(err); }, - [](TargetEndpointInfo * endpoint) { TvCastingAppJNIMgr().getOnNewOrUpdatedEndpointHandler(false).Handle(endpoint); }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer::OpenBasicCommissioningWindow failed: %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jobject, readCachedVideoPlayers)(JNIEnv * env, jobject) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD readCachedVideoPlayers called"); - - jobject jVideoPlayerList = nullptr; - TargetVideoPlayerInfo * targetVideoPlayerInfoList = CastingServer::GetInstance()->ReadCachedTargetVideoPlayerInfos(); - if (targetVideoPlayerInfoList != nullptr) - { - chip::JniReferences::GetInstance().CreateArrayList(jVideoPlayerList); - for (size_t i = 0; targetVideoPlayerInfoList[i].IsInitialized(); i++) - { - jobject jVideoPlayer = nullptr; - CHIP_ERROR err = convertTargetVideoPlayerInfoToJVideoPlayer(&targetVideoPlayerInfoList[i], jVideoPlayer); - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, - "Conversion from TargetVideoPlayerInfo * to jobject VideoPlayer failed: %" CHIP_ERROR_FORMAT, - err.Format()); - continue; - } - chip::JniReferences::GetInstance().AddToList(jVideoPlayerList, jVideoPlayer); - } - } - - return jVideoPlayerList; -} - -JNI_METHOD(jboolean, verifyOrEstablishConnection) -(JNIEnv * env, jobject, jobject videoPlayer, jobject jOnConnectionSuccessHandler, jobject jOnConnectionFailureHandler, - jobject jOnNewOrUpdatedEndpointHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD verifyOrEstablishConnection called"); - - TargetVideoPlayerInfo targetVideoPlayerInfo; - CHIP_ERROR err = convertJVideoPlayerToTargetVideoPlayerInfo(videoPlayer, targetVideoPlayerInfo); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, - "Conversion from jobject VideoPlayer to TargetVideoPlayerInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getOnConnectionSuccessHandler(true).SetUp(env, jOnConnectionSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "OnConnectionSuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getOnConnectionFailureHandler(true).SetUp(env, jOnConnectionFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "OnConnectionFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getOnNewOrUpdatedEndpointHandler(true).SetUp(env, jOnNewOrUpdatedEndpointHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "OnNewOrUpdatedEndpointHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->VerifyOrEstablishConnection( - targetVideoPlayerInfo, - [](TargetVideoPlayerInfo * videoPlayer) { TvCastingAppJNIMgr().getOnConnectionSuccessHandler(true).Handle(videoPlayer); }, - [](CHIP_ERROR err) { TvCastingAppJNIMgr().getOnConnectionFailureHandler(true).Handle(err); }, - [](TargetEndpointInfo * endpoint) { TvCastingAppJNIMgr().getOnNewOrUpdatedEndpointHandler(true).Handle(endpoint); }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer::verifyOrEstablishConnection failed: %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, WasRecentlyDiscoverable) -(JNIEnv * env, jobject, jobject videoPlayer) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD WasRecentlyDiscoverable called"); - - TargetVideoPlayerInfo targetVideoPlayerInfo; - CHIP_ERROR err = convertJVideoPlayerToTargetVideoPlayerInfo(videoPlayer, targetVideoPlayerInfo); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, - "Conversion from jobject VideoPlayer to TargetVideoPlayerInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - return targetVideoPlayerInfo.WasRecentlyDiscoverable(); - -exit: - return false; // default to false -} - -JNI_METHOD(void, shutdownAllSubscriptions)(JNIEnv * env, jobject) -{ - chip::DeviceLayer::StackLock lock; - ChipLogProgress(AppServer, "JNI_METHOD shutdownAllSubscriptions called"); - - CastingServer::GetInstance()->ShutdownAllSubscriptions(); -} - -JNI_METHOD(void, disconnect)(JNIEnv * env, jobject) -{ - chip::DeviceLayer::StackLock lock; - ChipLogProgress(AppServer, "JNI_METHOD disconnect called"); - CastingServer::GetInstance()->Disconnect(); -} - -JNI_METHOD(jobject, getActiveTargetVideoPlayers)(JNIEnv * env, jobject) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD getActiveTargetVideoPlayers called"); - - jobject jVideoPlayerList = nullptr; - TargetVideoPlayerInfo * targetVideoPlayerInfo = CastingServer::GetInstance()->GetActiveTargetVideoPlayer(); - if (targetVideoPlayerInfo != nullptr) - { - chip::JniReferences::GetInstance().CreateArrayList(jVideoPlayerList); - jobject jVideoPlayer = nullptr; - CHIP_ERROR err = convertTargetVideoPlayerInfoToJVideoPlayer(targetVideoPlayerInfo, jVideoPlayer); - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "Conversion from TargetVideoPlayerInfo * to jobject VideoPlayer failed: %" CHIP_ERROR_FORMAT, - err.Format()); - } - else - { - chip::JniReferences::GetInstance().AddToList(jVideoPlayerList, jVideoPlayer); - } - } - return jVideoPlayerList; -} - -JNI_METHOD(jboolean, sendUserDirectedCommissioningRequest)(JNIEnv * env, jobject, jstring addressJStr, jint port) -{ - chip::DeviceLayer::StackLock lock; - ChipLogProgress(AppServer, "JNI_METHOD sendUserDirectedCommissioningRequest called with port %d", port); - Inet::IPAddress addressInet; - JniUtfString addressJniString(env, addressJStr); - if (Inet::IPAddress::FromString(addressJniString.c_str(), addressInet) == false) - { - ChipLogError(AppServer, "Failed to parse IP address"); - return false; - } - - chip::Inet::InterfaceId interfaceId = chip::Inet::InterfaceId::FromIPAddress(addressInet); - chip::Transport::PeerAddress peerAddress = - chip::Transport::PeerAddress::UDP(addressInet, static_cast(port), interfaceId); - CHIP_ERROR err = CastingServer::GetInstance()->SendUserDirectedCommissioningRequest(peerAddress); - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "TVCastingApp-JNI::sendUserDirectedCommissioningRequest failed: %" CHIP_ERROR_FORMAT, err.Format()); - return false; - } - return true; -} - -JNI_METHOD(jboolean, sendCommissioningRequest)(JNIEnv * env, jobject, jobject jDiscoveredNodeData) -{ - chip::DeviceLayer::StackLock lock; - ChipLogProgress(AppServer, "JNI_METHOD sendCommissioningRequest called"); - - chip::Dnssd::CommissionNodeData commissioner; - CHIP_ERROR err = convertJDiscoveredNodeDataToCppDiscoveredNodeData(jDiscoveredNodeData, commissioner); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, - "Conversion from jobject DiscoveredNodeData to Cpp DiscoveredNodeData failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = CastingServer::GetInstance()->SendUserDirectedCommissioningRequest(&commissioner); - -exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "TVCastingApp-JNI::sendCommissioningRequest failed: %" CHIP_ERROR_FORMAT, err.Format()); - return false; - } - return true; -} - -JNI_METHOD(jboolean, purgeCache)(JNIEnv * env, jobject) -{ - chip::DeviceLayer::StackLock lock; - ChipLogProgress(AppServer, "JNI_METHOD purgeCache called"); - - CHIP_ERROR err = CastingServer::GetInstance()->PurgeCache(); - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "TVCastingApp-JNI::purgeCache failed: %" CHIP_ERROR_FORMAT, err.Format()); - return false; - } - return true; -} - -JNI_METHOD(jboolean, contentLauncherLaunchURL) -(JNIEnv * env, jobject, jobject contentApp, jstring contentUrl, jstring contentDisplayStr, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD contentLauncherLaunchURL called"); - const char * nativeContentUrl = env->GetStringUTFChars(contentUrl, 0); - const char * nativeContentDisplayStr = env->GetStringUTFChars(contentDisplayStr, 0); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(ContentLauncher_LaunchURL).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI::SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->ContentLauncherLaunchURL( - &endpoint, nativeContentUrl, nativeContentDisplayStr, - [](CHIP_ERROR err) { TvCastingAppJNIMgr().getMediaCommandResponseHandler(ContentLauncher_LaunchURL).Handle(err); }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer::ContentLauncherLaunchURL failed %" CHIP_ERROR_FORMAT, err.Format())); - - env->ReleaseStringUTFChars(contentUrl, nativeContentUrl); - env->ReleaseStringUTFChars(contentDisplayStr, nativeContentDisplayStr); - -exit: - return (err == CHIP_NO_ERROR); -} - -CHIP_ERROR CreateParameter(JNIEnv * env, jobject jParameter, - chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type & parameter) -{ - jclass jParameterClass = env->GetObjectClass(jParameter); - - jfieldID jTypeField = env->GetFieldID(jParameterClass, "type", "Ljava/lang/Integer;"); - jobject jTypeObj = env->GetObjectField(jParameter, jTypeField); - jclass jIntegerClass = env->FindClass("java/lang/Integer"); - jmethodID jIntValueMid = env->GetMethodID(jIntegerClass, "intValue", "()I"); - parameter.type = static_cast(env->CallIntMethod(jTypeObj, jIntValueMid)); - - jfieldID jValueField = env->GetFieldID(jParameterClass, "value", "Ljava/lang/String;"); - jstring jValueObj = (jstring) env->GetObjectField(jParameter, jValueField); - const char * nativeValue = env->GetStringUTFChars(jValueObj, 0); - parameter.value = CharSpan::fromCharString(nativeValue); - return CHIP_NO_ERROR; -} - -CHIP_ERROR CreateContentSearch(JNIEnv * env, jobject jSearch, - chip::app::Clusters::ContentLauncher::Structs::ContentSearchStruct::Type & search, - ListFreer & listFreer) -{ - jclass jContentSearchClass; - ReturnErrorOnFailure(JniReferences::GetInstance().GetLocalClassRef(env, "com/chip/casting/ContentLauncherTypes$ContentSearch", - jContentSearchClass)); - - jfieldID jParameterListField = env->GetFieldID(jContentSearchClass, "parameterList", "Ljava/util/ArrayList;"); - jobject jParameterList = env->GetObjectField(jSearch, jParameterListField); - ReturnErrorOnFailure(jParameterList != nullptr ? CHIP_NO_ERROR : CHIP_ERROR_INVALID_ARGUMENT); - - jclass jArrayListClass = env->FindClass("java/util/ArrayList"); - jmethodID sizeMid = env->GetMethodID(jArrayListClass, "size", "()I"); - size_t parameterListSize = static_cast(env->CallIntMethod(jParameterList, sizeMid)); - - jobject jIterator = env->CallObjectMethod( - jParameterList, env->GetMethodID(env->GetObjectClass(jParameterList), "iterator", "()Ljava/util/Iterator;")); - jmethodID jNextMid = env->GetMethodID(env->GetObjectClass(jIterator), "next", "()Ljava/lang/Object;"); - jmethodID jHasNextMid = env->GetMethodID(env->GetObjectClass(jIterator), "hasNext", "()Z"); - - auto * parameterListHolder = - new ListHolder(parameterListSize); - listFreer.add(parameterListHolder); - int parameterIndex = 0; - while (env->CallBooleanMethod(jIterator, jHasNextMid)) - { - jobject jParameter = env->CallObjectMethod(jIterator, jNextMid); - chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type parameter; - ReturnErrorOnFailure(CreateParameter(env, jParameter, parameter)); - parameterListHolder->mList[parameterIndex].type = parameter.type; - parameterListHolder->mList[parameterIndex].value = parameter.value; - parameterListHolder->mList[parameterIndex].externalIDList = parameter.externalIDList; - parameterIndex++; - } - search.parameterList = chip::app::DataModel::List( - parameterListHolder->mList, parameterListSize); - - return CHIP_NO_ERROR; -} - -JNI_METHOD(jboolean, contentLauncher_1launchContent) -(JNIEnv * env, jobject, jobject contentApp, jobject jSearch, jboolean jAutoplay, jstring jData, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD contentLauncher_1launchContent called"); - - // prepare arguments - bool autoplay = static_cast(jAutoplay); - - const char * nativeData = env->GetStringUTFChars(jData, 0); - chip::Optional data = MakeOptional(CharSpan::fromCharString(nativeData)); - - ListFreer listFreer; - chip::app::Clusters::ContentLauncher::Structs::ContentSearchStruct::Type search; - CHIP_ERROR err = CreateContentSearch(env, jSearch, search, listFreer); - - TargetEndpointInfo endpoint; - err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, - "contentLauncher_1launchContent::Could not create ContentSearch object %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(ContentLauncher_LaunchContent).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI::SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->ContentLauncher_LaunchContent(&endpoint, search, autoplay, data, [](CHIP_ERROR err) { - TvCastingAppJNIMgr().getMediaCommandResponseHandler(ContentLauncher_LaunchContent).Handle(err); - }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer::ContentLauncher_LaunchContent failed %" CHIP_ERROR_FORMAT, err.Format())); - - env->ReleaseStringUTFChars(jData, nativeData); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, contentLauncher_1subscribeToSupportedStreamingProtocols) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD ContentLauncher_subscribeToSupportedStreamingProtocols called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getSupportedStreamingProtocolsSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr() - .getSubscriptionReadFailureHandler(ContentLauncher_SupportedStreamingProtocols) - .SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr() - .getSubscriptionEstablishedHandler(ContentLauncher_SupportedStreamingProtocols) - .SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->ContentLauncher_SubscribeToSupportedStreamingProtocols( - &endpoint, nullptr, - [](void * context, - chip::app::Clusters::ContentLauncher::Attributes::SupportedStreamingProtocols::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getSupportedStreamingProtocolsSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(ContentLauncher_SupportedStreamingProtocols).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(ContentLauncher_SupportedStreamingProtocols).Handle(); - }); - - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, - "CastingServer.ContentLauncher_SubscribeToSupportedStreamingProtocols failed %" CHIP_ERROR_FORMAT, - err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, levelControl_1step) -(JNIEnv * env, jobject, jobject contentApp, jbyte stepMode, jbyte stepSize, jshort transitionTime, jbyte optionMask, - jbyte optionOverride, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD levelControl_step called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(LevelControl_Step).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->LevelControl_Step( - &endpoint, static_cast(stepMode), static_cast(stepSize), - static_cast(transitionTime), static_cast(optionMask), static_cast(optionOverride), - [](CHIP_ERROR err) { TvCastingAppJNIMgr().getMediaCommandResponseHandler(LevelControl_Step).Handle(err); }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.LevelControl_Step failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, levelControl_1moveToLevel) -(JNIEnv * env, jobject, jobject contentApp, jbyte level, jshort transitionTime, jbyte optionMask, jbyte optionOverride, - jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD levelControl_moveToLevel called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(LevelControl_MoveToLevel).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->LevelControl_MoveToLevel( - &endpoint, static_cast(level), static_cast(transitionTime), static_cast(optionMask), - static_cast(optionOverride), - [](CHIP_ERROR err) { TvCastingAppJNIMgr().getMediaCommandResponseHandler(LevelControl_MoveToLevel).Handle(err); }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.LevelControl_MoveToLevel failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, levelControl_1subscribeToCurrentLevel) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD levelControl_subscribeToCurrentLevel called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getCurrentLevelSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(LevelControl_CurrentLevel).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr() - .getSubscriptionEstablishedHandler(LevelControl_CurrentLevel) - .SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->LevelControl_SubscribeToCurrentLevel( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::LevelControl::Attributes::CurrentLevel::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getCurrentLevelSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(LevelControl_CurrentLevel).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(LevelControl_CurrentLevel).Handle(); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.LevelControl_SubscribeToCurrentLevel failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, levelControl_1subscribeToMinLevel) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD levelControl_subscribeToMinLevel called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMinLevelSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(LevelControl_MinLevel).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(LevelControl_MinLevel).SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->LevelControl_SubscribeToMinLevel( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::LevelControl::Attributes::MinLevel::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getMinLevelSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(LevelControl_MinLevel).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(LevelControl_MinLevel).Handle(); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.LevelControl_SubscribeToMinLevel failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, levelControl_1subscribeToMaxLevel) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD levelControl_subscribeToMaxLevel called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMaxLevelSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(LevelControl_MaxLevel).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(LevelControl_MaxLevel).SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->LevelControl_SubscribeToMaxLevel( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::LevelControl::Attributes::MaxLevel::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getMaxLevelSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(LevelControl_MaxLevel).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(LevelControl_MaxLevel).Handle(); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.LevelControl_SubscribeToMaxLevel failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, onOff_1on) -(JNIEnv * env, jobject, jobject contentApp, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD onOff_on called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(OnOff_On).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->OnOff_On( - &endpoint, [](CHIP_ERROR err) { TvCastingAppJNIMgr().getMediaCommandResponseHandler(OnOff_On).Handle(err); }); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "CastingServer.OnOff_On failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, onOff_1off) -(JNIEnv * env, jobject, jobject contentApp, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD onOff_off called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(OnOff_Off).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->OnOff_Off( - &endpoint, [](CHIP_ERROR err) { TvCastingAppJNIMgr().getMediaCommandResponseHandler(OnOff_Off).Handle(err); }); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "CastingServer.OnOff_Off failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, onOff_1toggle) -(JNIEnv * env, jobject, jobject contentApp, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD onOff_toggle called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(OnOff_Toggle).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->OnOff_Toggle( - &endpoint, [](CHIP_ERROR err) { TvCastingAppJNIMgr().getMediaCommandResponseHandler(OnOff_Toggle).Handle(err); }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.OnOff_Toggle failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, messages_1presentMessages) -(JNIEnv * env, jobject, jobject contentApp, jstring messageText, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD messages_presentMessages called"); - const char * nativeMessageText = env->GetStringUTFChars(messageText, 0); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(Messages_PresentMessagesRequest).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->Messages_PresentMessagesRequest(&endpoint, nativeMessageText, [](CHIP_ERROR err) { - TvCastingAppJNIMgr().getMediaCommandResponseHandler(Messages_PresentMessagesRequest).Handle(err); - }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.Messages_PresentMessagesRequest failed %" CHIP_ERROR_FORMAT, err.Format())); - - env->ReleaseStringUTFChars(messageText, nativeMessageText); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, mediaPlayback_1play) -(JNIEnv * env, jobject, jobject contentApp, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD mediaPlayback_play called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_Play).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->MediaPlayback_Play( - &endpoint, [](CHIP_ERROR err) { TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_Play).Handle(err); }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.MediaPlayback_Play failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, mediaPlayback_1pause) -(JNIEnv * env, jobject, jobject contentApp, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD mediaPlayback_pause called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_Pause).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->MediaPlayback_Pause( - &endpoint, [](CHIP_ERROR err) { TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_Pause).Handle(err); }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.MediaPlayback_Pause failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, mediaPlayback_1stopPlayback) -(JNIEnv * env, jobject, jobject contentApp, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD mediaPlayback_stopPlayback called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_StopPlayback).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->MediaPlayback_StopPlayback(&endpoint, [](CHIP_ERROR err) { - TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_StopPlayback).Handle(err); - }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.MediaPlayback_StopPlayback failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, mediaPlayback_1next) -(JNIEnv * env, jobject, jobject contentApp, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD mediaPlayback_next called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_Next).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->MediaPlayback_Next( - &endpoint, [](CHIP_ERROR err) { TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_Next).Handle(err); }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.MediaPlayback_Next failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, mediaPlayback_1seek) -(JNIEnv * env, jobject, jobject contentApp, jlong position, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD mediaPlayback_seek called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_Seek).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->MediaPlayback_Seek(&endpoint, static_cast(position), [](CHIP_ERROR err) { - TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_Seek).Handle(err); - }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.MediaPlayback_Seek failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, mediaPlayback_1skipForward) -(JNIEnv * env, jobject, jobject contentApp, jlong deltaPositionMilliseconds, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD mediaPlayback_skipForward called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_SkipForward).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->MediaPlayback_SkipForward( - &endpoint, static_cast(deltaPositionMilliseconds), - [](CHIP_ERROR err) { TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_SkipForward).Handle(err); }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.MediaPlayback_SkipForward failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, mediaPlayback_1skipBackward) -(JNIEnv * env, jobject, jobject contentApp, jlong deltaPositionMilliseconds, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD mediaPlayback_skipBackward called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_SkipBackward).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->MediaPlayback_SkipBackward( - &endpoint, static_cast(deltaPositionMilliseconds), - [](CHIP_ERROR err) { TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_SkipBackward).Handle(err); }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.MediaPlayback_SkipBackward failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, mediaPlayback_1previous) -(JNIEnv * env, jobject, jobject contentApp, jobject jResponseHandler) -{ - return TvCastingAppJNIMgr().runCastingServerCommand( - env, contentApp, jResponseHandler, "MediaPlayback_Previous", MediaPlayback_Previous, - [](TargetEndpointInfo endpoint) -> CHIP_ERROR { - return CastingServer::GetInstance()->MediaPlayback_Previous(&endpoint, [](CHIP_ERROR err) { - TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_Previous).Handle(err); - }); - }); -} - -JNI_METHOD(jboolean, mediaPlayback_1rewind) -(JNIEnv * env, jobject, jobject contentApp, jobject jResponseHandler) -{ - return TvCastingAppJNIMgr().runCastingServerCommand( - env, contentApp, jResponseHandler, "MediaPlayback_Rewind", MediaPlayback_Rewind, - [](TargetEndpointInfo endpoint) -> CHIP_ERROR { - return CastingServer::GetInstance()->MediaPlayback_Rewind(&endpoint, [](CHIP_ERROR err) { - TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_Rewind).Handle(err); - }); - }); -} - -JNI_METHOD(jboolean, mediaPlayback_1fastForward) -(JNIEnv * env, jobject, jobject contentApp, jobject jResponseHandler) -{ - return TvCastingAppJNIMgr().runCastingServerCommand( - env, contentApp, jResponseHandler, "MediaPlayback_FastForward", MediaPlayback_FastForward, - [](TargetEndpointInfo endpoint) -> CHIP_ERROR { - return CastingServer::GetInstance()->MediaPlayback_FastForward(&endpoint, [](CHIP_ERROR err) { - TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_FastForward).Handle(err); - }); - }); -} - -JNI_METHOD(jboolean, mediaPlayback_1startOver) -(JNIEnv * env, jobject, jobject contentApp, jobject jResponseHandler) -{ - return TvCastingAppJNIMgr().runCastingServerCommand( - env, contentApp, jResponseHandler, "MediaPlayback_StartOver", MediaPlayback_StartOver, - [](TargetEndpointInfo endpoint) -> CHIP_ERROR { - return CastingServer::GetInstance()->MediaPlayback_StartOver(&endpoint, [](CHIP_ERROR err) { - TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_StartOver).Handle(err); - }); - }); -} - -jboolean TvCastingAppJNI::runCastingServerCommand(JNIEnv * env, jobject contentApp, jobject jResponseHandler, - const char * commandName, MediaCommandName command, - const std::function & commandRunner) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD %s called", commandName); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(command).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = commandRunner(endpoint); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.%s failed %" CHIP_ERROR_FORMAT, commandName, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, mediaPlayback_1subscribeToCurrentState) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD mediaPlayback_subscribeToCurrentState called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getCurrentStateSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(MediaPlayback_CurrentState).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr() - .getSubscriptionEstablishedHandler(MediaPlayback_CurrentState) - .SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->MediaPlayback_SubscribeToCurrentState( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::MediaPlayback::Attributes::CurrentState::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getCurrentStateSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(MediaPlayback_CurrentState).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(MediaPlayback_CurrentState).Handle(); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.MediaPlayback_SubscribeToCurrentState failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, mediaPlayback_1subscribeToDuration) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD mediaPlayback_1subscribeToDuration called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getDurationSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(MediaPlayback_Duration).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(MediaPlayback_Duration).SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->MediaPlayback_SubscribeToDuration( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::MediaPlayback::Attributes::Duration::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getDurationSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(MediaPlayback_Duration).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(MediaPlayback_Duration).Handle(); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.mediaPlayback_subscribeToDuration failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, mediaPlayback_1subscribeToSampledPosition) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD mediaPlayback_1subscribeToSampledPosition called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getSampledPositionSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(MediaPlayback_SampledPosition).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr() - .getSubscriptionEstablishedHandler(MediaPlayback_SampledPosition) - .SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->MediaPlayback_SubscribeToSampledPosition( - &endpoint, nullptr, - [](void * context, - chip::app::Clusters::MediaPlayback::Attributes::SampledPosition::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getSampledPositionSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(MediaPlayback_SampledPosition).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(MediaPlayback_SampledPosition).Handle(); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.mediaPlayback_subscribeToSampledPosition failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, mediaPlayback_1subscribeToPlaybackSpeed) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD mediaPlayback_1subscribeToPlaybackSpeed called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getPlaybackSpeedSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(MediaPlayback_PlaybackSpeed).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr() - .getSubscriptionEstablishedHandler(MediaPlayback_PlaybackSpeed) - .SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->MediaPlayback_SubscribeToPlaybackSpeed( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::MediaPlayback::Attributes::PlaybackSpeed::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getPlaybackSpeedSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(MediaPlayback_PlaybackSpeed).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(MediaPlayback_PlaybackSpeed).Handle(); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.mediaPlayback_subscribeToPlaybackSpeed failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, mediaPlayback_1subscribeToSeekRangeEnd) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD mediaPlayback_1subscribeToSeekRangeEnd called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getSeekRangeEndSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(MediaPlayback_SeekRangeEnd).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr() - .getSubscriptionEstablishedHandler(MediaPlayback_SeekRangeEnd) - .SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->MediaPlayback_SubscribeToSeekRangeEnd( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::MediaPlayback::Attributes::SeekRangeEnd::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getSeekRangeEndSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(MediaPlayback_SeekRangeEnd).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(MediaPlayback_SeekRangeEnd).Handle(); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.mediaPlayback_subscribeToSeekRangeEnd failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, mediaPlayback_1subscribeToSeekRangeStart) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD mediaPlayback_1subscribeToSeekRangeStart called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getSeekRangeStartSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(MediaPlayback_SeekRangeStart).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr() - .getSubscriptionEstablishedHandler(MediaPlayback_SeekRangeStart) - .SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->MediaPlayback_SubscribeToSeekRangeStart( - &endpoint, nullptr, - [](void * context, - chip::app::Clusters::MediaPlayback::Attributes::SeekRangeStart::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getSeekRangeStartSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(MediaPlayback_SeekRangeStart).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(MediaPlayback_SeekRangeStart).Handle(); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.mediaPlayback_subscribeToSeekRangeStart failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, applicationLauncher_1launchApp) -(JNIEnv * env, jobject, jobject contentApp, jshort catalogVendorId, jstring applicationId, jbyteArray data, - jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD applicationLauncher_launchApp called"); - - chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type application; - application.catalogVendorID = static_cast(catalogVendorId); - const char * nativeApplicationId = env->GetStringUTFChars(applicationId, 0); - application.applicationID = CharSpan::fromCharString(nativeApplicationId); - JniByteArray dataByteArray(env, data); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(ApplicationLauncher_LaunchApp).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->ApplicationLauncher_LaunchApp( - &endpoint, application, chip::MakeOptional(dataByteArray.byteSpan()), - [](CHIP_ERROR err) { TvCastingAppJNIMgr().getMediaCommandResponseHandler(ApplicationLauncher_LaunchApp).Handle(err); }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.ApplicationLauncher_LaunchApp failed %" CHIP_ERROR_FORMAT, err.Format())); - - env->ReleaseStringUTFChars(applicationId, nativeApplicationId); -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, applicationLauncher_1stopApp) -(JNIEnv * env, jobject, jobject contentApp, jshort catalogVendorId, jstring applicationId, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD applicationLauncher_stopApp called"); - - chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type application; - application.catalogVendorID = static_cast(catalogVendorId); - const char * nativeApplicationId = env->GetStringUTFChars(applicationId, 0); - application.applicationID = CharSpan::fromCharString(nativeApplicationId); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(ApplicationLauncher_StopApp).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->ApplicationLauncher_StopApp(&endpoint, application, [&](CHIP_ERROR err) { - TvCastingAppJNIMgr().getMediaCommandResponseHandler(ApplicationLauncher_StopApp).Handle(err); - }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.ApplicationLauncher_StopApp failed %" CHIP_ERROR_FORMAT, err.Format())); - - env->ReleaseStringUTFChars(applicationId, nativeApplicationId); -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, applicationLauncher_1hideApp) -(JNIEnv * env, jobject, jobject contentApp, jshort catalogVendorId, jstring applicationId, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD applicationLauncher_hideApp called"); - - chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type application; - application.catalogVendorID = static_cast(catalogVendorId); - const char * nativeApplicationId = env->GetStringUTFChars(applicationId, 0); - application.applicationID = CharSpan::fromCharString(nativeApplicationId); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(ApplicationLauncher_HideApp).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->ApplicationLauncher_HideApp(&endpoint, application, [](CHIP_ERROR err) { - TvCastingAppJNIMgr().getMediaCommandResponseHandler(ApplicationLauncher_HideApp).Handle(err); - }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.ApplicationLauncher_HideApp failed %" CHIP_ERROR_FORMAT, err.Format())); - - env->ReleaseStringUTFChars(applicationId, nativeApplicationId); -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, targetNavigator_1navigateTarget) -(JNIEnv * env, jobject, jobject contentApp, jbyte target, jstring data, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD targetNavigator_navigateTarget called"); - - const char * nativeData = (data != nullptr ? env->GetStringUTFChars(data, 0) : nullptr); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(TargetNavigator_NavigateTarget).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->TargetNavigator_NavigateTarget( - &endpoint, static_cast(target), - (nativeData != nullptr ? chip::MakeOptional(CharSpan::fromCharString(nativeData)) : chip::NullOptional), - [](CHIP_ERROR err) { TvCastingAppJNIMgr().getMediaCommandResponseHandler(TargetNavigator_NavigateTarget).Handle(err); }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.TargetNavigator_NavigateTarget failed %" CHIP_ERROR_FORMAT, err.Format())); - - if (nativeData != nullptr) - { - env->ReleaseStringUTFChars(data, nativeData); - } -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, targetNavigator_1subscribeToCurrentTarget) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD targetNavigator_1subscribeToCurrentTarget called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getCurrentTargetSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(TargetNavigator_CurrentTarget).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr() - .getSubscriptionEstablishedHandler(TargetNavigator_CurrentTarget) - .SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->TargetNavigator_SubscribeToCurrentTarget( - &endpoint, nullptr, - [](void * context, - chip::app::Clusters::TargetNavigator::Attributes::CurrentTarget::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getCurrentTargetSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(TargetNavigator_CurrentTarget).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(TargetNavigator_CurrentTarget).Handle(); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.targetNavigator_subscribeToCurrentTarget failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, targetNavigator_1subscribeToTargetList) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD targetNavigator_1subscribeToTargetList called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getTargetListSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(TargetNavigator_TargetList).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr() - .getSubscriptionEstablishedHandler(TargetNavigator_TargetList) - .SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->TargetNavigator_SubscribeToTargetList( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::TargetNavigator::Attributes::TargetList::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getTargetListSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(TargetNavigator_TargetList).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(TargetNavigator_TargetList).Handle(); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.targetNavigator_subscribeToTargetList failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, keypadInput_1sendKey) -(JNIEnv * env, jobject, jobject contentApp, jbyte keyCode, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD keypadInput_sendKey called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(KeypadInput_SendKey).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->KeypadInput_SendKey( - &endpoint, static_cast(keyCode), - [](CHIP_ERROR err) { TvCastingAppJNIMgr().getMediaCommandResponseHandler(KeypadInput_SendKey).Handle(err); }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.KeypadInput_SendKey failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -// APPLICATION BASIC -JNI_METHOD(jboolean, applicationBasic_1subscribeToVendorName) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD applicationBasic_1subscribeToVendorName called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getVendorNameSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(ApplicationBasic_VendorName).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr() - .getSubscriptionEstablishedHandler(ApplicationBasic_VendorName) - .SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->ApplicationBasic_SubscribeToVendorName( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::ApplicationBasic::Attributes::VendorName::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getVendorNameSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(ApplicationBasic_VendorName).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(ApplicationBasic_VendorName).Handle(); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.applicationBasic_subscribeToVendorName failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, applicationBasic_1subscribeToVendorID) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD applicationBasic_1subscribeToVendorID called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getVendorIDSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(ApplicationBasic_VendorID).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr() - .getSubscriptionEstablishedHandler(ApplicationBasic_VendorID) - .SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->ApplicationBasic_SubscribeToVendorID( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::ApplicationBasic::Attributes::VendorID::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getVendorIDSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(ApplicationBasic_VendorID).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(ApplicationBasic_VendorID).Handle(); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.applicationBasic_subscribeToVendorID failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, applicationBasic_1subscribeToApplicationName) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD applicationBasic_1subscribeToApplicationName called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getApplicationNameSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(ApplicationBasic_ApplicationName).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr() - .getSubscriptionEstablishedHandler(ApplicationBasic_ApplicationName) - .SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->ApplicationBasic_SubscribeToApplicationName( - &endpoint, nullptr, - [](void * context, - chip::app::Clusters::ApplicationBasic::Attributes::ApplicationName::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getApplicationNameSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(ApplicationBasic_ApplicationName).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(ApplicationBasic_ApplicationName).Handle(); - }); - - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.applicationBasic_subscribeToApplicationName failed %" CHIP_ERROR_FORMAT, - err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, applicationBasic_1subscribeToProductID) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD applicationBasic_1subscribeToProductID called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getProductIDSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(ApplicationBasic_ProductID).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr() - .getSubscriptionEstablishedHandler(ApplicationBasic_ProductID) - .SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->ApplicationBasic_SubscribeToProductID( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::ApplicationBasic::Attributes::ProductID::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getProductIDSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(ApplicationBasic_ProductID).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(ApplicationBasic_ProductID).Handle(); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.applicationBasic_subscribeToProductID failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, applicationBasic_1subscribeToApplicationVersion) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD applicationBasic_1subscribeToApplicationVersion called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getApplicationVersionSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(ApplicationBasic_ApplicationVersion).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr() - .getSubscriptionEstablishedHandler(ApplicationBasic_ApplicationVersion) - .SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->ApplicationBasic_SubscribeToApplicationVersion( - &endpoint, nullptr, - [](void * context, - chip::app::Clusters::ApplicationBasic::Attributes::ApplicationVersion::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getApplicationVersionSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(ApplicationBasic_ApplicationVersion).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(ApplicationBasic_ApplicationVersion).Handle(); - }); - - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.applicationBasic_subscribeToApplicationVersion failed %" CHIP_ERROR_FORMAT, - err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, applicationBasic_1readVendorName) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD applicationBasic_1readVendorName called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getReadVendorNameSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getReadFailureHandler(ApplicationBasic_VendorName).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "ReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->ApplicationBasic_ReadVendorName( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::ApplicationBasic::Attributes::VendorName::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getReadVendorNameSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getReadFailureHandler(ApplicationBasic_VendorName).Handle(err); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.applicationBasic_1readVendorName failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, applicationBasic_1readVendorID) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD applicationBasic_1readVendorID called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getReadVendorIDSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getReadFailureHandler(ApplicationBasic_VendorID).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "ReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->ApplicationBasic_ReadVendorID( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::ApplicationBasic::Attributes::VendorID::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getReadVendorIDSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { TvCastingAppJNIMgr().getReadFailureHandler(ApplicationBasic_VendorID).Handle(err); }); - - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.applicationBasic_ReadVendorID failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, applicationBasic_1readApplicationName) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD applicationBasic_1readApplicationName called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getReadApplicationNameSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getReadFailureHandler(ApplicationBasic_ApplicationName).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "ReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->ApplicationBasic_ReadApplicationName( - &endpoint, nullptr, - [](void * context, - chip::app::Clusters::ApplicationBasic::Attributes::ApplicationName::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getReadApplicationNameSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getReadFailureHandler(ApplicationBasic_ApplicationName).Handle(err); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.applicationBasic_ReadApplicationName failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, applicationBasic_1readProductID) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD applicationBasic_1readProductID called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getReadProductIDSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getReadFailureHandler(ApplicationBasic_ProductID).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "ReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->ApplicationBasic_ReadProductID( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::ApplicationBasic::Attributes::ProductID::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getReadProductIDSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { TvCastingAppJNIMgr().getReadFailureHandler(ApplicationBasic_ProductID).Handle(err); }); - - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.applicationBasic_ReadProductID failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, applicationBasic_1readApplicationVersion) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD applicationBasic_1readApplicationVersion called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getReadApplicationVersionSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getReadFailureHandler(ApplicationBasic_ApplicationVersion).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "ReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->ApplicationBasic_ReadApplicationVersion( - &endpoint, nullptr, - [](void * context, - chip::app::Clusters::ApplicationBasic::Attributes::ApplicationVersion::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getReadApplicationVersionSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getReadFailureHandler(ApplicationBasic_ApplicationVersion).Handle(err); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.applicationBasic_ReadApplicationVersion failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/TvCastingApp-JNI.h b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/TvCastingApp-JNI.h deleted file mode 100644 index 863e2691c44a52..00000000000000 --- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/TvCastingApp-JNI.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - * - * Copyright (c) 2022 Project CHIP Authors - * All rights reserved. - * - * 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. - */ - -#pragma once - -#include - -#include "Constants.h" -#include "MatterCallbackHandler-JNI.h" - -class TvCastingAppJNI -{ -public: - MatterCallbackHandlerJNI & getCommissioningCompleteHandler() { return mCommissioningCompleteHandler; } - - SessionEstablishmentStartedHandlerJNI & getSessionEstablishmentStartedHandler() { return mSessionEstablishmentStartedHandler; } - - SessionEstablishedHandlerJNI & getSessionEstablishedHandler() { return mSessionEstablishedHandler; } - - FailureHandlerJNI & getSessionEstablishmentErrorHandler() { return mSessionEstablishmentErrorHandler; } - - FailureHandlerJNI & getSessionEstablishmentStoppedHandler() { return mSessionEstablishmentStoppedHandler; } - - OnConnectionSuccessHandlerJNI & getOnConnectionSuccessHandler(bool preCommissioned) - { - return preCommissioned ? mPreCommissionedOnConnectionSuccessHandler : mCommissioningOnConnectionSuccessHandler; - } - - FailureHandlerJNI & getOnConnectionFailureHandler(bool preCommissioned) - { - return preCommissioned ? mPreCommissionedOnConnectionFailureHandler : mCommissioningOnConnectionFailureHandler; - } - OnNewOrUpdatedEndpointHandlerJNI & getOnNewOrUpdatedEndpointHandler(bool preCommissioned) - { - return preCommissioned ? mPreCommissionedOnNewOrUpdatedEndpointHandler : mCommissioningOnNewOrUpdatedEndpointHandler; - } - - MatterCallbackHandlerJNI & getMediaCommandResponseHandler(enum MediaCommandName name) - { - return mMediaCommandResponseHandler[name]; - } - - FailureHandlerJNI & getReadFailureHandler(enum MediaAttributeName name) { return mReadFailureHandler[name]; } - - FailureHandlerJNI & getSubscriptionReadFailureHandler(enum MediaAttributeName name) - { - return mSubscriptionReadFailureHandler[name]; - } - - SubscriptionEstablishedHandlerJNI & getSubscriptionEstablishedHandler(enum MediaAttributeName name) - { - return mSubscriptionEstablishedHandler[name]; - } - - CurrentStateSuccessHandlerJNI & getCurrentStateSuccessHandler() { return mCurrentStateSuccessHandlerJNI; } - DurationSuccessHandlerJNI & getDurationSuccessHandler() { return mDurationSuccessHandlerJNI; } - SampledPositionSuccessHandlerJNI & getSampledPositionSuccessHandler() { return mSampledPositionSuccessHandlerJNI; } - PlaybackSpeedSuccessHandlerJNI & getPlaybackSpeedSuccessHandler() { return mPlaybackSpeedSuccessHandlerJNI; } - SeekRangeEndSuccessHandlerJNI & getSeekRangeEndSuccessHandler() { return mSeekRangeEndSuccessHandlerJNI; } - SeekRangeStartSuccessHandlerJNI & getSeekRangeStartSuccessHandler() { return mSeekRangeStartSuccessHandlerJNI; } - - CurrentTargetSuccessHandlerJNI & getCurrentTargetSuccessHandler() { return mCurrentTargetSuccessHandlerJNI; } - TargetListSuccessHandlerJNI & getTargetListSuccessHandler() { return mTargetListSuccessHandlerJNI; } - - CurrentLevelSuccessHandlerJNI & getCurrentLevelSuccessHandler() { return mCurrentLevelSuccessHandlerJNI; } - MinLevelSuccessHandlerJNI & getMinLevelSuccessHandler() { return mMinLevelSuccessHandlerJNI; } - MaxLevelSuccessHandlerJNI & getMaxLevelSuccessHandler() { return mMaxLevelSuccessHandlerJNI; } - - SupportedStreamingProtocolsSuccessHandlerJNI & getSupportedStreamingProtocolsSuccessHandler() - { - return mSupportedStreamingProtocolsSuccessHandlerJNI; - } - - VendorNameSuccessHandlerJNI & getVendorNameSuccessHandler() { return mVendorNameSuccessHandlerJNI; } - VendorIDSuccessHandlerJNI & getVendorIDSuccessHandler() { return mVendorIDSuccessHandlerJNI; } - ApplicationNameSuccessHandlerJNI & getApplicationNameSuccessHandler() { return mApplicationNameSuccessHandlerJNI; } - ProductIDSuccessHandlerJNI & getProductIDSuccessHandler() { return mProductIDSuccessHandlerJNI; } - ApplicationVersionSuccessHandlerJNI & getApplicationVersionSuccessHandler() { return mApplicationVersionSuccessHandlerJNI; } - - VendorNameSuccessHandlerJNI & getReadVendorNameSuccessHandler() { return mReadVendorNameSuccessHandlerJNI; } - VendorIDSuccessHandlerJNI & getReadVendorIDSuccessHandler() { return mReadVendorIDSuccessHandlerJNI; } - ApplicationNameSuccessHandlerJNI & getReadApplicationNameSuccessHandler() { return mReadApplicationNameSuccessHandlerJNI; } - ProductIDSuccessHandlerJNI & getReadProductIDSuccessHandler() { return mReadProductIDSuccessHandlerJNI; } - ApplicationVersionSuccessHandlerJNI & getReadApplicationVersionSuccessHandler() - { - return mReadApplicationVersionSuccessHandlerJNI; - } - - jboolean runCastingServerCommand(JNIEnv * env, jobject contentApp, jobject jResponseHandler, const char * commandName, - MediaCommandName command, const std::function & commandRunner); - -private: - friend TvCastingAppJNI & TvCastingAppJNIMgr(); - - static TvCastingAppJNI sInstance; - - MatterCallbackHandlerJNI mCommissioningCompleteHandler; - SessionEstablishmentStartedHandlerJNI mSessionEstablishmentStartedHandler; - SessionEstablishedHandlerJNI mSessionEstablishedHandler; - FailureHandlerJNI mSessionEstablishmentErrorHandler; - FailureHandlerJNI mSessionEstablishmentStoppedHandler; - OnConnectionSuccessHandlerJNI mCommissioningOnConnectionSuccessHandler; - FailureHandlerJNI mCommissioningOnConnectionFailureHandler; - OnNewOrUpdatedEndpointHandlerJNI mCommissioningOnNewOrUpdatedEndpointHandler; - - OnConnectionSuccessHandlerJNI mPreCommissionedOnConnectionSuccessHandler; - FailureHandlerJNI mPreCommissionedOnConnectionFailureHandler; - OnNewOrUpdatedEndpointHandlerJNI mPreCommissionedOnNewOrUpdatedEndpointHandler; - - MatterCallbackHandlerJNI mMediaCommandResponseHandler[MEDIA_COMMAND_COUNT]; - FailureHandlerJNI mSubscriptionReadFailureHandler[MEDIA_ATTRIBUTE_COUNT]; - SubscriptionEstablishedHandlerJNI mSubscriptionEstablishedHandler[MEDIA_ATTRIBUTE_COUNT]; - FailureHandlerJNI mReadFailureHandler[MEDIA_ATTRIBUTE_COUNT]; - - CurrentStateSuccessHandlerJNI mCurrentStateSuccessHandlerJNI; - DurationSuccessHandlerJNI mDurationSuccessHandlerJNI; - SampledPositionSuccessHandlerJNI mSampledPositionSuccessHandlerJNI; - PlaybackSpeedSuccessHandlerJNI mPlaybackSpeedSuccessHandlerJNI; - SeekRangeEndSuccessHandlerJNI mSeekRangeEndSuccessHandlerJNI; - SeekRangeStartSuccessHandlerJNI mSeekRangeStartSuccessHandlerJNI; - - CurrentTargetSuccessHandlerJNI mCurrentTargetSuccessHandlerJNI; - TargetListSuccessHandlerJNI mTargetListSuccessHandlerJNI; - - CurrentLevelSuccessHandlerJNI mCurrentLevelSuccessHandlerJNI; - MinLevelSuccessHandlerJNI mMinLevelSuccessHandlerJNI; - MaxLevelSuccessHandlerJNI mMaxLevelSuccessHandlerJNI; - - SupportedStreamingProtocolsSuccessHandlerJNI mSupportedStreamingProtocolsSuccessHandlerJNI; - - VendorNameSuccessHandlerJNI mVendorNameSuccessHandlerJNI; - VendorIDSuccessHandlerJNI mVendorIDSuccessHandlerJNI; - ApplicationNameSuccessHandlerJNI mApplicationNameSuccessHandlerJNI; - ProductIDSuccessHandlerJNI mProductIDSuccessHandlerJNI; - ApplicationVersionSuccessHandlerJNI mApplicationVersionSuccessHandlerJNI; - - VendorNameSuccessHandlerJNI mReadVendorNameSuccessHandlerJNI; - VendorIDSuccessHandlerJNI mReadVendorIDSuccessHandlerJNI; - ApplicationNameSuccessHandlerJNI mReadApplicationNameSuccessHandlerJNI; - ProductIDSuccessHandlerJNI mReadProductIDSuccessHandlerJNI; - ApplicationVersionSuccessHandlerJNI mReadApplicationVersionSuccessHandlerJNI; -}; - -inline class TvCastingAppJNI & TvCastingAppJNIMgr() -{ - return TvCastingAppJNI::sInstance; -} diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingApp-JNI.cpp b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingApp-JNI.cpp index ce8e8c0e1b77a6..2242619df27431 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingApp-JNI.cpp +++ b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingApp-JNI.cpp @@ -18,8 +18,8 @@ #include "CastingApp-JNI.h" -#include "../JNIDACProvider.h" #include "../support/Converters-JNI.h" +#include "../support/JNIDACProvider.h" #include "../support/RotatingDeviceIdUniqueIdProvider-JNI.h" // from tv-casting-common @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -37,6 +38,16 @@ using namespace chip; #define JNI_METHOD(RETURN, METHOD_NAME) extern "C" JNIEXPORT RETURN JNICALL Java_com_matter_casting_core_CastingApp_##METHOD_NAME +jint JNI_OnLoad(JavaVM * jvm, void * reserved) +{ + return AndroidAppServerJNI_OnLoad(jvm, reserved); +} + +void JNI_OnUnload(JavaVM * jvm, void * reserved) +{ + return AndroidAppServerJNI_OnUnload(jvm, reserved); +} + namespace matter { namespace casting { namespace core { @@ -73,7 +84,7 @@ JNI_METHOD(jobject, finishInitialization)(JNIEnv *, jobject, jobject jAppParamet VerifyOrReturnValue(jDACProvider != nullptr, support::convertMatterErrorFromCppToJava(CHIP_ERROR_INCORRECT_STATE)); // set the DACProvider - JNIDACProvider * dacProvider = new JNIDACProvider(jDACProvider); + support::JNIDACProvider * dacProvider = new support::JNIDACProvider(jDACProvider); chip::Credentials::SetDeviceAttestationCredentialsProvider(dacProvider); return support::convertMatterErrorFromCppToJava(CHIP_NO_ERROR); diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingPlayerDiscovery-JNI.cpp b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingPlayerDiscovery-JNI.cpp index 26526dfdac8f07..0dd0a351b7a679 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingPlayerDiscovery-JNI.cpp +++ b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingPlayerDiscovery-JNI.cpp @@ -18,7 +18,6 @@ #include "CastingPlayerDiscovery-JNI.h" -#include "../JNIDACProvider.h" #include "../support/Converters-JNI.h" #include "../support/RotatingDeviceIdUniqueIdProvider-JNI.h" #include "core/CastingApp.h" // from tv-casting-common diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/MatterCastingPlayer-JNI.cpp b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/MatterCastingPlayer-JNI.cpp index b718682a17124b..5219dbca3a88af 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/MatterCastingPlayer-JNI.cpp +++ b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/MatterCastingPlayer-JNI.cpp @@ -18,7 +18,6 @@ #include "MatterCastingPlayer-JNI.h" -#include "../JNIDACProvider.h" #include "../support/Converters-JNI.h" #include "../support/RotatingDeviceIdUniqueIdProvider-JNI.h" #include "core/CastingApp.h" // from tv-casting-common diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/MatterEndpoint-JNI.cpp b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/MatterEndpoint-JNI.cpp index e0c41ebc92d260..685be549856981 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/MatterEndpoint-JNI.cpp +++ b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/MatterEndpoint-JNI.cpp @@ -18,7 +18,6 @@ #include "MatterEndpoint-JNI.h" -#include "../JNIDACProvider.h" #include "../support/MatterCallback-JNI.h" #include "../support/RotatingDeviceIdUniqueIdProvider-JNI.h" #include "clusters/Clusters.h" // from tv-casting-common diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/JNIDACProvider.cpp b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/support/JNIDACProvider.cpp similarity index 98% rename from examples/tv-casting-app/android/App/app/src/main/jni/cpp/JNIDACProvider.cpp rename to examples/tv-casting-app/android/App/app/src/main/jni/cpp/support/JNIDACProvider.cpp index 363a629db2c9e5..1fbbfd1402dda8 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/JNIDACProvider.cpp +++ b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/support/JNIDACProvider.cpp @@ -29,6 +29,10 @@ using namespace chip; +namespace matter { +namespace casting { +namespace support { + JNIDACProvider::JNIDACProvider(jobject provider) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -174,3 +178,7 @@ CHIP_ERROR JNIDACProvider::SignWithDeviceAttestationKey(const ByteSpan & message return chip::Crypto::EcdsaAsn1SignatureToRaw(32, ByteSpan(asn1_signature_buffer.data(), asn1_signature_buffer.size()), out_signature_buffer); } + +}; // namespace support +}; // namespace casting +}; // namespace matter diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/JNIDACProvider.h b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/support/JNIDACProvider.h similarity index 94% rename from examples/tv-casting-app/android/App/app/src/main/jni/cpp/JNIDACProvider.h rename to examples/tv-casting-app/android/App/app/src/main/jni/cpp/support/JNIDACProvider.h index d8d774f41f3061..bb7902f600848c 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/JNIDACProvider.h +++ b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/support/JNIDACProvider.h @@ -21,6 +21,10 @@ #include #include +namespace matter { +namespace casting { +namespace support { + class JNIDACProvider : public chip::Credentials::DeviceAttestationCredentialsProvider { public: @@ -42,3 +46,7 @@ class JNIDACProvider : public chip::Credentials::DeviceAttestationCredentialsPro jmethodID mGetProductAttestationIntermediateCertMethod = nullptr; jmethodID mSignWithDeviceAttestationKeyMethod = nullptr; }; + +}; // namespace support +}; // namespace casting +}; // namespace matter diff --git a/examples/tv-casting-app/android/App/app/src/main/res/layout/activity_main.xml b/examples/tv-casting-app/android/App/app/src/main/res/layout/activity_main.xml index ff56873cb23c22..8e3724ec39dd48 100644 --- a/examples/tv-casting-app/android/App/app/src/main/res/layout/activity_main.xml +++ b/examples/tv-casting-app/android/App/app/src/main/res/layout/activity_main.xml @@ -4,7 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context=".chip.casting.app.MainActivity"> + tools:context=".matter.casting.MainActivity"> ShutdownAllSubscriptions(); return CHIP_NO_ERROR; From 4aac314416bc579e1d3aa89128fed7ccbe96974f Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 22 Aug 2024 00:16:07 -0400 Subject: [PATCH 03/10] Remove subscription establishment bits from the MTRDevice base class. (#35139) _setupSubscriptionWithReason was only called from _reattemptSubscriptionNowIfNeededWithReason. _reattemptSubscriptionNowIfNeededWithReason was only called from: * _handleUnsolicitedMessageFromPublisher, which is only called in callbacks set up by _setupSubscriptionWithReason. * _triggerResubscribeWithReason, which only calls it when _reattemptingSubscription is YES. But that's only set to YES in _doHandleSubscriptionReset, see next item. * _doHandleSubscriptionReset, called from: * _handleSubscriptionReset: only called from callbacks set up by _setupSubscriptionWithReason. * _resetSubscriptionWithReasonString: called from unitTestResetSubscription and us detecting persisted data corruption in _clusterDataForPath. But we don't actually have persisted data in the MTRDevice base class anymore, so that's not reachable. So _setupSubscriptionWithReason is not reachable and can be removed. And unitTestResetSubscription can be made a no-op on the base MTRDevice. And we can remove the _resetSubscriptionWithReasonString call in _clusterDataForPath. Once those are done, the following become unreachable: * _handleSubscriptionReset * _handleSubscriptionError * Writing a nonzero value to _unitTestAttributesReportedSinceLastCheck * _markDeviceAsUnreachableIfNeverSubscribed * _handleResubscriptionNeededWithDelay * _handleSubscriptionEstablished * _handleUnsolicitedMessageFromPublisher * _createDataVersionFilterListFromDictionary * _setupConnectivityMonitoring * _resetSubscriptionWithReasonString Once those have been removed, the following become unreachable: * HadSubscriptionEstablishedOnce * _stopConnectivityMonitoring * _doHandleSubscriptionError * _doHandleSubscriptionReset Once those have been removed, the following become unreachable: * _setLastSubscriptionAttemptWait * Setting _lastSubscriptionFailureTime to non-nil * _clearSubscriptionPoolWork * _scheduleSubscriptionPoolWork * Use of _initialSubscribeStart * _storePersistedDeviceData * Use of _connectivityMonitor * Use of _lastSubscriptionFailureTimeForDescription * Any code depending on reattemptingSubscription being YES. * Use of _lastSubscriptionAttemptWait * Use of _lastSubscriptionAttemptWaitForDescription Once those have been removed, _reattemptSubscriptionNowIfNeededWithReason is unreachable and can be removed. At this point _currentReadClient and _currentSubscriptionCallback are always nil, so all code conditioned on those can be removed. Once that's done, _triggerResubscribeWithReason is a no-op, so it and all calls to it can be removed. Since _lastSubscriptionFailureTime is always nil, all code guarded on it not being nil can be removed, so _readThroughSkipped becomes a no-op and _lastSubscriptionFailureTime can be removed. At this point, the following are not reachable: * NeedToStartSubscriptionSetup * _changeInternalState Once those are removed, _internalDeviceStateForDescription is unused, and _internalDeviceState is always MTRInternalDeviceStateUnsubscribed. So HaveSubscriptionEstablishedRightNow() always returns NO and can be removed. At this point SubscriptionCallback is unused and can also be removed. --- src/darwin/Framework/CHIP/MTRDevice.mm | 1044 +----------------------- 1 file changed, 4 insertions(+), 1040 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index f17e6d5c90f6eb..d4027f7725ddeb 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -22,7 +22,6 @@ #import "MTRAttributeSpecifiedCheck.h" #import "MTRBaseClusters.h" #import "MTRBaseDevice_Internal.h" -#import "MTRBaseSubscriptionCallback.h" #import "MTRCluster.h" #import "MTRClusterConstants.h" #import "MTRCommandTimedCheck.h" @@ -43,16 +42,8 @@ #import "zap-generated/MTRCommandPayloads_Internal.h" #import "lib/core/CHIPError.h" -#import "lib/core/DataModelTypes.h" -#import -#import - -#import -#import -#import -#import + #import -#import typedef void (^MTRDeviceAttributeReportHandler)(NSArray * _Nonnull); @@ -113,68 +104,13 @@ - (void)_deviceInternalStateChanged:(MTRDevice *)device; /* END DRAGONS */ -#pragma mark - SubscriptionCallback class declaration using namespace chip; using namespace chip::app; using namespace chip::Protocols::InteractionModel; using namespace chip::Tracing::DarwinFramework; -typedef void (^FirstReportHandler)(void); - -namespace { - -class SubscriptionCallback final : public MTRBaseSubscriptionCallback { -public: - SubscriptionCallback(DataReportCallback attributeReportCallback, DataReportCallback eventReportCallback, - ErrorCallback errorCallback, MTRDeviceResubscriptionScheduledHandler resubscriptionCallback, - SubscriptionEstablishedHandler subscriptionEstablishedHandler, OnDoneHandler onDoneHandler, - UnsolicitedMessageFromPublisherHandler unsolicitedMessageFromPublisherHandler, ReportBeginHandler reportBeginHandler, - ReportEndHandler reportEndHandler) - : MTRBaseSubscriptionCallback(attributeReportCallback, eventReportCallback, errorCallback, resubscriptionCallback, - subscriptionEstablishedHandler, onDoneHandler, unsolicitedMessageFromPublisherHandler, reportBeginHandler, - reportEndHandler) - { - } - - // Used to reset Resubscription backoff on events that indicate likely availability of device to come back online - void ResetResubscriptionBackoff() { mResubscriptionNumRetries = 0; } - -private: - void OnEventData(const EventHeader & aEventHeader, TLV::TLVReader * apData, const StatusIB * apStatus) override; - - void OnAttributeData(const ConcreteDataAttributePath & aPath, TLV::TLVReader * apData, const StatusIB & aStatus) override; - - CHIP_ERROR OnResubscriptionNeeded(chip::app::ReadClient * apReadClient, CHIP_ERROR aTerminationCause) override; - - // Copied from ReadClient and customized for MTRDevice resubscription time reset - uint32_t ComputeTimeTillNextSubscription(); - uint32_t mResubscriptionNumRetries = 0; -}; - -} // anonymous namespace - #pragma mark - MTRDevice -// Utility methods for working with MTRInternalDeviceState, located near the -// enum so it's easier to notice that they need to stay in sync. -namespace { -bool HadSubscriptionEstablishedOnce(MTRInternalDeviceState state) -{ - return state >= MTRInternalDeviceStateInitialSubscriptionEstablished; -} - -bool NeedToStartSubscriptionSetup(MTRInternalDeviceState state) -{ - return state <= MTRInternalDeviceStateUnsubscribed; -} - -bool HaveSubscriptionEstablishedRightNow(MTRInternalDeviceState state) -{ - return state == MTRInternalDeviceStateInitialSubscriptionEstablished || state == MTRInternalDeviceStateLaterSubscriptionEstablished; -} - -} // anonymous namespace - typedef NS_ENUM(NSUInteger, MTRDeviceExpectedValueFieldIndex) { MTRDeviceExpectedValueFieldExpirationTimeIndex = 0, MTRDeviceExpectedValueFieldValueIndex = 1, @@ -338,13 +274,6 @@ @interface MTRDevice () #define MTRDEVICE_SUBSCRIPTION_ATTEMPT_MAX_WAIT_SECONDS (3600) @property (nonatomic) uint32_t lastSubscriptionAttemptWait; -/** - * If reattemptingSubscription is true, that means that we have failed to get a - * CASE session for the publisher and are now waiting to try again. In this - * state we never have subscriptionActive true or a non-null currentReadClient. - */ -@property (nonatomic) BOOL reattemptingSubscription; - // Expected value cache is attributePath => NSArray of [NSDate of expiration time, NSDictionary of value, expected value ID] // - See MTRDeviceExpectedValueFieldIndex for the definitions of indices into this array. // See MTRDeviceResponseHandler definition for value dictionary details. @@ -362,14 +291,6 @@ @interface MTRDevice () @property (nonatomic) NSMutableDictionary * temporaryMetaDataCache; -/** - * If currentReadClient is non-null, that means that we successfully - * called SendAutoResubscribeRequest on the ReadClient and have not yet gotten - * an OnDone for that ReadClient. - */ -@property (nonatomic) ReadClient * currentReadClient; -@property (nonatomic) SubscriptionCallback * currentSubscriptionCallback; // valid when and only when currentReadClient is valid - @end // Declaring selector so compiler won't complain about testing and calling it in _handleReportEnd @@ -389,10 +310,6 @@ - (BOOL)unitTestSuppressTimeBasedReachabilityChanges:(MTRDevice *)device; #endif @implementation MTRDevice { -#ifdef DEBUG - NSUInteger _unitTestAttributesReportedSinceLastCheck; -#endif - // _deviceCachePrimed is true if we have the data that comes from an initial // subscription priming report (whether it came from storage or from our // subscription). @@ -410,26 +327,10 @@ @implementation MTRDevice { // right now (because they have been evicted). NSMutableSet * _persistedClusters; - // When we last failed to subscribe to the device (either via - // _setupSubscriptionWithReason or via the auto-resubscribe behavior - // of the ReadClient). Nil if we have had no such failures. - NSDate * _Nullable _lastSubscriptionFailureTime; - MTRDeviceConnectivityMonitor * _connectivityMonitor; - // This boolean keeps track of any device configuration changes received in an attribute report. // If this is true when the report ends, we notify the delegate. BOOL _deviceConfigurationChanged; - // The completion block is set when the subscription / resubscription work is enqueued, and called / cleared when any of the following happen: - // 1. Subscription establishes - // 2. OnResubscriptionNeeded is called - // 3. Subscription reset (including when getSessionForNode fails) - MTRAsyncWorkCompletionBlock _subscriptionPoolWorkCompletionBlock; - - // Tracking of initial subscribe latency. When _initialSubscribeStart is - // nil, we are not tracking the latency. - NSDate * _Nullable _initialSubscribeStart; - // Storage behavior configuration and variables to keep track of the logic // _clusterDataPersistenceFirstScheduledTime is used to track the start time of the delay between // report and persistence. @@ -459,14 +360,8 @@ @implementation MTRDevice { // _allNetworkFeatures is a bitwise or of the feature maps of all network commissioning clusters // present on the device, or nil if there aren't any. NSNumber * _Nullable _allNetworkFeatures; - // Copy of _internalDeviceState that is safe to use in description. - MTRInternalDeviceState _internalDeviceStateForDescription; - // Copy of _lastSubscriptionAttemptWait that is safe to use in description. - uint32_t _lastSubscriptionAttemptWaitForDescription; // Most recent entry in _mostRecentReportTimes, if any. NSDate * _Nullable _mostRecentReportTimeForDescription; - // Copy of _lastSubscriptionFailureTime that is safe to use in description. - NSDate * _Nullable _lastSubscriptionFailureTimeForDescription; } - (instancetype)initForSubclassesWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceController *)controller @@ -496,7 +391,6 @@ - (instancetype)initWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceControlle _asyncWorkQueue = [[MTRAsyncWorkQueue alloc] initWithContext:self]; _state = MTRDeviceStateUnknown; _internalDeviceState = MTRInternalDeviceStateUnsubscribed; - _internalDeviceStateForDescription = MTRInternalDeviceStateUnsubscribed; if (controller.controllerDataStore) { _persistedClusterData = [[NSCache alloc] init]; } else { @@ -861,51 +755,6 @@ - (void)nodeMayBeAdvertisingOperational assertChipStackLockedByCurrentThread(); MTR_LOG("%@ saw new operational advertisement", self); - - [self _triggerResubscribeWithReason:@"operational advertisement seen" - nodeLikelyReachable:YES]; -} - -// Trigger a resubscribe as needed. nodeLikelyReachable should be YES if we -// have reason to suspect the node is now reachable, NO if we have no idea -// whether it might be. -- (void)_triggerResubscribeWithReason:(NSString *)reason nodeLikelyReachable:(BOOL)nodeLikelyReachable -{ - MTR_LOG("%@ _triggerResubscribeWithReason called with reason %@", self, reason); - assertChipStackLockedByCurrentThread(); - - // We might want to trigger a resubscribe on our existing ReadClient. Do - // that outside the scope of our lock, so we're not calling arbitrary code - // we don't control with the lock held. This is safe, because we are - // running on he Matter queue and the ReadClient can't get destroyed while - // we are on that queue. - ReadClient * readClientToResubscribe = nullptr; - SubscriptionCallback * subscriptionCallback = nullptr; - - os_unfair_lock_lock(&self->_lock); - - // Don't change state to MTRDeviceStateReachable, since the device might not - // in fact be reachable yet; we won't know until we have managed to - // establish a CASE session. And at that point, our subscription will - // trigger the state change as needed. - if (self.reattemptingSubscription) { - [self _reattemptSubscriptionNowIfNeededWithReason:reason]; - } else { - readClientToResubscribe = self->_currentReadClient; - subscriptionCallback = self->_currentSubscriptionCallback; - } - os_unfair_lock_unlock(&self->_lock); - - if (readClientToResubscribe) { - if (nodeLikelyReachable) { - // If we have reason to suspect the node is now reachable, reset the - // backoff timer, so that if this attempt fails we'll try again - // quickly; it's possible we'll just catch the node at a bad time - // here (e.g. still booting up), but should try again reasonably quickly. - subscriptionCallback->ResetResubscriptionBackoff(); - } - readClientToResubscribe->TriggerResubscribeIfScheduled(reason.UTF8String); - } } // Return YES if we are in a state where, apart from communication issues with @@ -941,41 +790,6 @@ - (BOOL)_subscriptionAbleToReport // Notification that read-through was skipped for an attribute read. - (void)_readThroughSkipped { - std::lock_guard lock(_lock); - if (_state == MTRDeviceStateReachable) { - // We're getting reports from the device, so there's nothing else to be - // done here. We could skip this check, because our "try to - // resubscribe" code would be a no-op in this case, but then we'd have - // an extra dispatch in the common case of read-while-subscribed, which - // is not great for peformance. - return; - } - - if (_lastSubscriptionFailureTime == nil) { - // No need to try to do anything here, because we have never failed a - // subscription attempt (so we might be in the middle of one now, and no - // need to prod things along). - return; - } - - if ([[NSDate now] timeIntervalSinceDate:_lastSubscriptionFailureTime] < MTRDEVICE_MIN_RESUBSCRIBE_DUE_TO_READ_INTERVAL_SECONDS) { - // Not enough time has passed since we last tried. Don't create extra - // network traffic. - // - // TODO: Do we need to worry about this being too spammy in the log if - // we keep getting reads while not subscribed? We could add another - // backoff timer or counter for the log line... - MTR_LOG_DEBUG("%@ skipping resubscribe from skipped read-through: not enough time has passed since %@", self, _lastSubscriptionFailureTime); - return; - } - - // Do the remaining work on the Matter queue, because we may want to touch - // ReadClient in there. If the dispatch fails, that's fine; it means our - // controller has shut down, so nothing to be done. - [_deviceController asyncDispatchToMatterQueue:^{ - [self _triggerResubscribeWithReason:@"read-through skipped while not subscribed" nodeLikelyReachable:NO]; - } - errorHandler:nil]; } - (BOOL)_delegateExists @@ -1090,29 +904,6 @@ - (void)_changeState:(MTRDeviceState)state } } -- (void)_changeInternalState:(MTRInternalDeviceState)state -{ - os_unfair_lock_assert_owner(&self->_lock); - MTRInternalDeviceState lastState = _internalDeviceState; - _internalDeviceState = state; - { - std::lock_guard lock(_descriptionLock); - _internalDeviceStateForDescription = _internalDeviceState; - } - if (lastState != state) { - MTR_LOG("%@ internal state change %lu => %lu", self, static_cast(lastState), static_cast(state)); - - /* BEGIN DRAGONS: This is a huge hack for a specific use case, do not rename, remove or modify behavior here */ - // TODO: This should only be called for thread devices - [self _callDelegatesWithBlock:^(id delegate) { - if ([delegate respondsToSelector:@selector(_deviceInternalStateChanged:)]) { - [delegate _deviceInternalStateChanged:self]; - } - }]; - /* END DRAGONS */ - } -} - #ifdef DEBUG - (MTRInternalDeviceState)_getInternalState { @@ -1121,71 +912,6 @@ - (MTRInternalDeviceState)_getInternalState } #endif -// First Time Sync happens 2 minutes after reachability (this can be changed in the future) -#define MTR_DEVICE_TIME_UPDATE_INITIAL_WAIT_TIME_SEC (60 * 2) -- (void)_handleSubscriptionEstablished -{ - os_unfair_lock_lock(&self->_lock); - - // If subscription had reset since this handler was scheduled, do not execute "established" logic below - if (!HaveSubscriptionEstablishedRightNow(_internalDeviceState)) { - MTR_LOG("%@ _handleSubscriptionEstablished run with internal state %lu - skipping subscription establishment logic", self, static_cast(_internalDeviceState)); - return; - } - - // We have completed the subscription work - remove from the subscription pool. - [self _clearSubscriptionPoolWork]; - - // No need to monitor connectivity after subscription establishment - [self _stopConnectivityMonitoring]; - - // reset subscription attempt wait time when subscription succeeds - [self _setLastSubscriptionAttemptWait:0]; - - auto initialSubscribeStart = _initialSubscribeStart; - // We no longer need to track subscribe latency for this device. - _initialSubscribeStart = nil; - - if (initialSubscribeStart != nil) { - // We want time interval from initialSubscribeStart to now, not the other - // way around. - NSTimeInterval subscriptionLatency = -[initialSubscribeStart timeIntervalSinceNow]; - if (_estimatedSubscriptionLatency == nil) { - _estimatedSubscriptionLatency = @(subscriptionLatency); - } else { - NSTimeInterval newSubscriptionLatencyEstimate = MTRDEVICE_SUBSCRIPTION_LATENCY_NEW_VALUE_WEIGHT * subscriptionLatency + (1 - MTRDEVICE_SUBSCRIPTION_LATENCY_NEW_VALUE_WEIGHT) * _estimatedSubscriptionLatency.doubleValue; - _estimatedSubscriptionLatency = @(newSubscriptionLatencyEstimate); - } - [self _storePersistedDeviceData]; - } - - os_unfair_lock_unlock(&self->_lock); - - os_unfair_lock_lock(&self->_timeSyncLock); - - if (!self.timeUpdateScheduled) { - [self _scheduleNextUpdate:MTR_DEVICE_TIME_UPDATE_INITIAL_WAIT_TIME_SEC]; - } - - os_unfair_lock_unlock(&self->_timeSyncLock); -} - -- (void)_handleSubscriptionError:(NSError *)error -{ - std::lock_guard lock(_lock); - [self _doHandleSubscriptionError:error]; -} - -- (void)_doHandleSubscriptionError:(NSError *)error -{ - os_unfair_lock_assert_owner(&_lock); - - [self _changeInternalState:MTRInternalDeviceStateUnsubscribed]; - _unreportedEvents = nil; - - [self _changeState:MTRDeviceStateUnreachable]; -} - - (BOOL)deviceUsesThread { std::lock_guard lock(_lock); @@ -1229,253 +955,6 @@ - (BOOL)_deviceUsesThread return (networkCommissioningClusterFeatureMapValue & MTRNetworkCommissioningFeatureThreadNetworkInterface) != 0 ? YES : NO; } -- (void)_clearSubscriptionPoolWork -{ - os_unfair_lock_assert_owner(&self->_lock); - MTRAsyncWorkCompletionBlock completion = self->_subscriptionPoolWorkCompletionBlock; - if (completion) { -#ifdef DEBUG - [self _callDelegatesWithBlock:^(id testDelegate) { - if ([testDelegate respondsToSelector:@selector(unitTestSubscriptionPoolWorkComplete:)]) { - [testDelegate unitTestSubscriptionPoolWorkComplete:self]; - } - }]; -#endif - self->_subscriptionPoolWorkCompletionBlock = nil; - completion(MTRAsyncWorkComplete); - } -} - -- (void)_scheduleSubscriptionPoolWork:(dispatch_block_t)workBlock inNanoseconds:(int64_t)inNanoseconds description:(NSString *)description -{ - os_unfair_lock_assert_owner(&self->_lock); - - // Sanity check we are not scheduling for this device multiple times in the pool - if (_subscriptionPoolWorkCompletionBlock) { - MTR_LOG("%@ already scheduled in subscription pool for this device - ignoring: %@", self, description); - return; - } - - // Wait the required amount of time, then put it in the subscription pool to wait additionally for a spot, if needed - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, inNanoseconds), dispatch_get_main_queue(), ^{ - // In the case where a resubscription triggering event happened and already established, running the work block should result in a no-op - MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.queue]; - [workItem setReadyHandler:^(id _Nonnull context, NSInteger retryCount, MTRAsyncWorkCompletionBlock _Nonnull completion) { - MTR_LOG("%@ - work item is ready to attempt pooled subscription", self); - os_unfair_lock_lock(&self->_lock); -#ifdef DEBUG - [self _callDelegatesWithBlock:^(id testDelegate) { - if ([testDelegate respondsToSelector:@selector(unitTestSubscriptionPoolDequeue:)]) { - [testDelegate unitTestSubscriptionPoolDequeue:self]; - } - }]; -#endif - if (self->_subscriptionPoolWorkCompletionBlock) { - // This means a resubscription triggering event happened and is now in-progress - MTR_LOG("%@ timer fired but already running in subscription pool - ignoring: %@", self, description); - os_unfair_lock_unlock(&self->_lock); - - // call completion as complete to remove from queue - completion(MTRAsyncWorkComplete); - return; - } - - // Otherwise, save the completion block - self->_subscriptionPoolWorkCompletionBlock = completion; - os_unfair_lock_unlock(&self->_lock); - - workBlock(); - }]; - [self->_deviceController.concurrentSubscriptionPool enqueueWorkItem:workItem description:description]; - MTR_LOG("%@ - enqueued in the subscription pool", self); - }); -} - -- (void)_handleResubscriptionNeededWithDelay:(NSNumber *)resubscriptionDelayMs -{ - BOOL deviceUsesThread; - - os_unfair_lock_lock(&self->_lock); - - [self _changeState:MTRDeviceStateUnknown]; - [self _changeInternalState:MTRInternalDeviceStateResubscribing]; - - // If we are here, then the ReadClient either just detected a subscription - // drop or just tried again and failed. Either way, count it as "tried and - // failed to subscribe": in the latter case it's actually true, and in the - // former case we recently had a subscription and do not want to be forcing - // retries immediately. - _lastSubscriptionFailureTime = [NSDate now]; - { - std::lock_guard lock(_descriptionLock); - _lastSubscriptionFailureTimeForDescription = _lastSubscriptionFailureTime; - } - - deviceUsesThread = [self _deviceUsesThread]; - - // If a previous resubscription failed, remove the item from the subscription pool. - [self _clearSubscriptionPoolWork]; - - os_unfair_lock_unlock(&self->_lock); - - // Use the existing _triggerResubscribeWithReason mechanism, which does the right checks when - // this block is run -- if other triggering events had happened, this would become a no-op. - auto resubscriptionBlock = ^{ - [self->_deviceController asyncDispatchToMatterQueue:^{ - [self _triggerResubscribeWithReason:@"ResubscriptionNeeded timer fired" nodeLikelyReachable:NO]; - } errorHandler:^(NSError * _Nonnull error) { - // If controller is not running, clear work item from the subscription queue - MTR_LOG_ERROR("%@ could not dispatch to matter queue for resubscription - error %@", self, error); - std::lock_guard lock(self->_lock); - [self _clearSubscriptionPoolWork]; - }]; - }; - - int64_t resubscriptionDelayNs = static_cast(resubscriptionDelayMs.unsignedIntValue * NSEC_PER_MSEC); - if (deviceUsesThread) { - std::lock_guard lock(_lock); - // For Thread-enabled devices, schedule the _triggerResubscribeWithReason call to run in the subscription pool - [self _scheduleSubscriptionPoolWork:resubscriptionBlock inNanoseconds:resubscriptionDelayNs description:@"ReadClient resubscription"]; - } else { - // For non-Thread-enabled devices, just call the resubscription block after the specified time - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, resubscriptionDelayNs), self.queue, resubscriptionBlock); - } - - // Set up connectivity monitoring in case network routability changes for the positive, to accelerate resubscription - [self _setupConnectivityMonitoring]; -} - -- (void)_handleSubscriptionReset:(NSNumber * _Nullable)retryDelay -{ - std::lock_guard lock(_lock); - [self _doHandleSubscriptionReset:retryDelay]; -} - -- (void)_setLastSubscriptionAttemptWait:(uint32_t)lastSubscriptionAttemptWait -{ - os_unfair_lock_assert_owner(&_lock); - _lastSubscriptionAttemptWait = lastSubscriptionAttemptWait; - - std::lock_guard lock(_descriptionLock); - _lastSubscriptionAttemptWaitForDescription = lastSubscriptionAttemptWait; -} - -- (void)_doHandleSubscriptionReset:(NSNumber * _Nullable)retryDelay -{ - os_unfair_lock_assert_owner(&_lock); - - // If we are here, then either we failed to establish initial CASE, or we - // failed to send the initial SubscribeRequest message, or our ReadClient - // has given up completely. Those all count as "we have tried and failed to - // subscribe". - _lastSubscriptionFailureTime = [NSDate now]; - { - std::lock_guard lock(_descriptionLock); - _lastSubscriptionFailureTimeForDescription = _lastSubscriptionFailureTime; - } - - // if there is no delegate then also do not retry - if (![self _delegateExists]) { - // NOTE: Do not log anything here: we have been invalidated, and the - // Matter stack might already be torn down. - return; - } - - // don't schedule multiple retries - if (self.reattemptingSubscription) { - return; - } - - self.reattemptingSubscription = YES; - - NSTimeInterval secondsToWait; - if (_lastSubscriptionAttemptWait < MTRDEVICE_SUBSCRIPTION_ATTEMPT_MIN_WAIT_SECONDS) { - _lastSubscriptionAttemptWait = MTRDEVICE_SUBSCRIPTION_ATTEMPT_MIN_WAIT_SECONDS; - secondsToWait = _lastSubscriptionAttemptWait; - } else if (retryDelay != nil) { - // The device responded but is currently busy. Reset our backoff - // counter, so that we don't end up waiting for a long time if the next - // attempt fails for some reason, and retry after whatever time period - // the device told us to use. - [self _setLastSubscriptionAttemptWait:0]; - secondsToWait = retryDelay.doubleValue; - MTR_LOG("%@ resetting resubscribe attempt counter, and delaying by the server-provided delay: %f", - self, secondsToWait); - } else { - auto lastSubscriptionAttemptWait = _lastSubscriptionAttemptWait * 2; - if (lastSubscriptionAttemptWait > MTRDEVICE_SUBSCRIPTION_ATTEMPT_MAX_WAIT_SECONDS) { - lastSubscriptionAttemptWait = MTRDEVICE_SUBSCRIPTION_ATTEMPT_MAX_WAIT_SECONDS; - } - [self _setLastSubscriptionAttemptWait:lastSubscriptionAttemptWait]; - secondsToWait = lastSubscriptionAttemptWait; - } - - MTR_LOG("%@ scheduling to reattempt subscription in %f seconds", self, secondsToWait); - - // If we started subscription or session establishment but failed, remove item from the subscription pool so we can re-queue. - [self _clearSubscriptionPoolWork]; - - // Call _reattemptSubscriptionNowIfNeededWithReason when timer fires - if subscription is - // in a better state at that time this will be a no-op. - auto resubscriptionBlock = ^{ - std::lock_guard lock(self->_lock); - [self _reattemptSubscriptionNowIfNeededWithReason:@"got subscription reset"]; - }; - - int64_t resubscriptionDelayNs = static_cast(secondsToWait * NSEC_PER_SEC); - if ([self _deviceUsesThread]) { - // For Thread-enabled devices, schedule the _reattemptSubscriptionNowIfNeededWithReason call to run in the subscription pool - [self _scheduleSubscriptionPoolWork:resubscriptionBlock inNanoseconds:resubscriptionDelayNs description:@"MTRDevice resubscription"]; - } else { - // For non-Thread-enabled devices, just call the resubscription block after the specified time - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, resubscriptionDelayNs), self.queue, resubscriptionBlock); - } -} - -- (void)_reattemptSubscriptionNowIfNeededWithReason:(NSString *)reason -{ - os_unfair_lock_assert_owner(&self->_lock); - if (!self.reattemptingSubscription) { - return; - } - - MTR_LOG("%@ reattempting subscription with reason %@", self, reason); - self.reattemptingSubscription = NO; - [self _setupSubscriptionWithReason:reason]; -} - -- (void)_handleUnsolicitedMessageFromPublisher -{ - std::lock_guard lock(_lock); - - [self _changeState:MTRDeviceStateReachable]; - - [self _callDelegatesWithBlock:^(id delegate) { - if ([delegate respondsToSelector:@selector(deviceBecameActive:)]) { - [delegate deviceBecameActive:self]; - } - }]; - - // in case this is called during exponential back off of subscription - // reestablishment, this starts the attempt right away - // TODO: This doesn't really make sense. If we _don't_ have a live - // ReadClient how did we get this notification and if we _do_ have an active - // ReadClient, this call or _setupSubscriptionWithReason would be no-ops. - [self _reattemptSubscriptionNowIfNeededWithReason:@"got unsolicited message from publisher"]; -} - -- (void)_markDeviceAsUnreachableIfNeverSubscribed -{ - os_unfair_lock_assert_owner(&self->_lock); - - if (HadSubscriptionEstablishedOnce(_internalDeviceState)) { - return; - } - - MTR_LOG("%@ still not subscribed, marking the device as unreachable", self); - [self _changeState:MTRDeviceStateUnreachable]; -} - - (void)_handleReportBegin { std::lock_guard lock(_lock); @@ -1487,7 +966,7 @@ - (void)_handleReportBegin // If we currently don't have an established subscription, this must be a // priming report. - _receivingPrimingReport = !HaveSubscriptionEstablishedRightNow(_internalDeviceState); + _receivingPrimingReport = YES; } - (NSDictionary *)_clusterDataToPersistSnapshot @@ -2136,8 +1615,6 @@ - (nullable MTRDeviceClusterData *)_clusterDataForPath:(MTRClusterPath *)cluster // First make sure _persistedClusters is consistent with storage, so repeated calls don't immediately re-trigger this [self _reconcilePersistedClustersWithStorage]; - - [self _resetSubscriptionWithReasonString:[NSString stringWithFormat:@"Data store has no data for cluster %@", clusterPath]]; } return data; @@ -2243,352 +1720,16 @@ - (void)_removeCachedAttribute:(NSNumber *)attributeID fromCluster:(MTRClusterPa [clusterData removeValueForAttribute:attributeID]; } -- (void)_createDataVersionFilterListFromDictionary:(NSDictionary *)dataVersions dataVersionFilterList:(DataVersionFilter **)dataVersionFilterList count:(size_t *)count -{ - size_t dataVersionFilterSize = dataVersions.count; - - // Check if any filter list should be generated - if (dataVersionFilterSize == 0) { - *count = 0; - *dataVersionFilterList = nullptr; - return; - } - - DataVersionFilter * dataVersionFilterArray = new DataVersionFilter[dataVersionFilterSize]; - size_t i = 0; - for (MTRClusterPath * path in dataVersions) { - NSNumber * dataVersionNumber = dataVersions[path]; - dataVersionFilterArray[i++] = DataVersionFilter(static_cast(path.endpoint.unsignedShortValue), static_cast(path.cluster.unsignedLongValue), static_cast(dataVersionNumber.unsignedLongValue)); - } - - *dataVersionFilterList = dataVersionFilterArray; - *count = dataVersionFilterSize; -} - -- (void)_setupConnectivityMonitoring -{ -#if ENABLE_CONNECTIVITY_MONITORING - // Dispatch to own queue because we used to need to do that to get the compressedFabricID, but - // at this point that's not really needed anymore. - dispatch_async(self.queue, ^{ - // Get the required info before setting up the connectivity monitor - NSNumber * compressedFabricID = [self->_deviceController compressedFabricID]; - if (!compressedFabricID) { - MTR_LOG_ERROR("%@ could not get compressed fabricID", self); - return; - } - - // Now lock for _connectivityMonitor - std::lock_guard lock(self->_lock); - if (self->_connectivityMonitor) { - // already monitoring - return; - } - - self->_connectivityMonitor = [[MTRDeviceConnectivityMonitor alloc] initWithCompressedFabricID:compressedFabricID nodeID:self.nodeID]; - [self->_connectivityMonitor startMonitoringWithHandler:^{ - [self->_deviceController asyncDispatchToMatterQueue:^{ - [self _triggerResubscribeWithReason:@"device connectivity changed" nodeLikelyReachable:YES]; - } - errorHandler:nil]; - } queue:self.queue]; - }); -#endif -} - -- (void)_stopConnectivityMonitoring -{ - os_unfair_lock_assert_owner(&_lock); - - if (_connectivityMonitor) { - [_connectivityMonitor stopMonitoring]; - _connectivityMonitor = nil; - } -} - -- (void)_resetSubscriptionWithReasonString:(NSString *)reasonString -{ - os_unfair_lock_assert_owner(&self->_lock); - MTR_LOG_ERROR("%@ %@ - resetting subscription", self, reasonString); - - [_deviceController asyncDispatchToMatterQueue:^{ - MTR_LOG("%@ subscription reset disconnecting ReadClient and SubscriptionCallback", self); - - std::lock_guard lock(self->_lock); - self->_currentReadClient = nullptr; - if (self->_currentSubscriptionCallback) { - delete self->_currentSubscriptionCallback; - } - self->_currentSubscriptionCallback = nullptr; - - [self _doHandleSubscriptionError:nil]; - // Use nil reset delay so that this keeps existing backoff timing - [self _doHandleSubscriptionReset:nil]; - } - errorHandler:nil]; -} - #ifdef DEBUG - (void)unitTestResetSubscription { - std::lock_guard lock(self->_lock); - [self _resetSubscriptionWithReasonString:@"Unit test reset subscription"]; } #endif -// assume lock is held -- (void)_setupSubscriptionWithReason:(NSString *)reason -{ - // TODO: XPC: This is not really called anymore in this class. Should - // remove this function and anything only reachable from it. - os_unfair_lock_assert_owner(&self->_lock); - - if (![self _subscriptionsAllowed]) { - MTR_LOG("%@ _setupSubscription: Subscriptions not allowed. Do not set up subscription (reason: %@)", self, reason); - return; - } - -#ifdef DEBUG - __block NSNumber * delegateMin = nil; - Optional maxIntervalOverride; - [self _callFirstDelegateSynchronouslyWithBlock:^(id testDelegate) { - if ([testDelegate respondsToSelector:@selector(unitTestMaxIntervalOverrideForSubscription:)]) { - delegateMin = [testDelegate unitTestMaxIntervalOverrideForSubscription:self]; - } - }]; - if (delegateMin) { - maxIntervalOverride.Emplace(delegateMin.unsignedIntValue); - } -#endif - - // for now just subscribe once - if (!NeedToStartSubscriptionSetup(_internalDeviceState)) { - MTR_LOG("%@ setupSubscription: no need to subscribe due to internal state %lu (reason: %@)", self, static_cast(_internalDeviceState), reason); - return; - } - - [self _changeInternalState:MTRInternalDeviceStateSubscribing]; - - MTR_LOG("%@ setting up subscription with reason: %@", self, reason); - - __block bool markUnreachableAfterWait = true; -#ifdef DEBUG - [self _callFirstDelegateSynchronouslyWithBlock:^(id testDelegate) { - if ([testDelegate respondsToSelector:@selector(unitTestSuppressTimeBasedReachabilityChanges:)]) { - markUnreachableAfterWait = ![testDelegate unitTestSuppressTimeBasedReachabilityChanges:self]; - } - }]; -#endif - - if (markUnreachableAfterWait) { - // Set up a timer to mark as not reachable if it takes too long to set up a subscription - mtr_weakify(self); - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, static_cast(kSecondsToWaitBeforeMarkingUnreachableAfterSettingUpSubscription) * static_cast(NSEC_PER_SEC)), self.queue, ^{ - mtr_strongify(self); - if (self != nil) { - std::lock_guard lock(self->_lock); - [self _markDeviceAsUnreachableIfNeverSubscribed]; - } - }); - } - - // This marks begin of initial subscription to the device (before CASE is established). The end is only marked after successfully setting - // up the subscription since it is always retried as long as the MTRDevice is kept running. - MATTER_LOG_METRIC_BEGIN(kMetricMTRDeviceInitialSubscriptionSetup); - - // Call directlyGetSessionForNode because the subscription setup already goes through the subscription pool queue - [_deviceController - directlyGetSessionForNode:_nodeID.unsignedLongLongValue - completion:^(chip::Messaging::ExchangeManager * _Nullable exchangeManager, - const chip::Optional & session, NSError * _Nullable error, - NSNumber * _Nullable retryDelay) { - if (error != nil) { - MTR_LOG_ERROR("%@ getSessionForNode error %@", self, error); - dispatch_async(self.queue, ^{ - [self _handleSubscriptionError:error]; - [self _handleSubscriptionReset:retryDelay]; - }); - return; - } - - auto callback = std::make_unique( - ^(NSArray * value) { - MTR_LOG("%@ got attribute report %@", self, value); - dispatch_async(self.queue, ^{ - // OnAttributeData - [self _handleAttributeReport:value fromSubscription:YES]; -#ifdef DEBUG - self->_unitTestAttributesReportedSinceLastCheck += value.count; -#endif - }); - }, - ^(NSArray * value) { - MTR_LOG("%@ got event report %@", self, value); - dispatch_async(self.queue, ^{ - // OnEventReport - [self _handleEventReport:value]; - }); - }, - ^(NSError * error) { - MTR_LOG_ERROR("%@ got subscription error %@", self, error); - dispatch_async(self.queue, ^{ - // OnError - [self _handleSubscriptionError:error]; - }); - }, - ^(NSError * error, NSNumber * resubscriptionDelayMs) { - MTR_LOG_ERROR("%@ got resubscription error %@ delay %@", self, error, resubscriptionDelayMs); - dispatch_async(self.queue, ^{ - // OnResubscriptionNeeded - [self _handleResubscriptionNeededWithDelay:resubscriptionDelayMs]; - }); - }, - ^(void) { - MTR_LOG("%@ got subscription established", self); - std::lock_guard lock(self->_lock); - - // First synchronously change state - if (HadSubscriptionEstablishedOnce(self->_internalDeviceState)) { - [self _changeInternalState:MTRInternalDeviceStateLaterSubscriptionEstablished]; - } else { - MATTER_LOG_METRIC_END(kMetricMTRDeviceInitialSubscriptionSetup, CHIP_NO_ERROR); - [self _changeInternalState:MTRInternalDeviceStateInitialSubscriptionEstablished]; - } - - [self _changeState:MTRDeviceStateReachable]; - - // Then async work that shouldn't be performed on the matter queue - dispatch_async(self.queue, ^{ - // OnSubscriptionEstablished - [self _handleSubscriptionEstablished]; - }); - }, - ^(void) { - MTR_LOG("%@ got subscription done", self); - // Drop our pointer to the ReadClient immediately, since - // it's about to be destroyed and we don't want to be - // holding a dangling pointer. - std::lock_guard lock(self->_lock); - self->_currentReadClient = nullptr; - self->_currentSubscriptionCallback = nullptr; - - dispatch_async(self.queue, ^{ - // OnDone - [self _handleSubscriptionReset:nil]; - }); - }, - ^(void) { - MTR_LOG("%@ got unsolicited message from publisher", self); - dispatch_async(self.queue, ^{ - // OnUnsolicitedMessageFromPublisher - [self _handleUnsolicitedMessageFromPublisher]; - }); - }, - ^(void) { - MTR_LOG("%@ got report begin", self); - dispatch_async(self.queue, ^{ - [self _handleReportBegin]; - }); - }, - ^(void) { - MTR_LOG("%@ got report end", self); - dispatch_async(self.queue, ^{ - [self _handleReportEnd]; - }); - }); - - // Set up a cluster state cache. We just want this for the logic it has for - // tracking data versions and event numbers so we minimize the amount of data we - // request on resubscribes, so tell it not to store data. - auto clusterStateCache = std::make_unique(*callback.get(), - /* highestReceivedEventNumber = */ NullOptional, - /* cacheData = */ false); - auto readClient = std::make_unique(InteractionModelEngine::GetInstance(), exchangeManager, - clusterStateCache->GetBufferedCallback(), ReadClient::InteractionType::Subscribe); - - // Wildcard endpoint, cluster, attribute, event. - auto attributePath = std::make_unique(); - auto eventPath = std::make_unique(); - // We want to get event reports at the minInterval, not the maxInterval. - eventPath->mIsUrgentEvent = true; - ReadPrepareParams readParams(session.Value()); - - readParams.mMinIntervalFloorSeconds = 0; - // Select a max interval based on the device's claimed idle sleep interval. - auto idleSleepInterval = std::chrono::duration_cast( - session.Value()->GetRemoteMRPConfig().mIdleRetransTimeout); - - auto maxIntervalCeilingMin = System::Clock::Seconds32(MTR_DEVICE_SUBSCRIPTION_MAX_INTERVAL_MIN); - if (idleSleepInterval < maxIntervalCeilingMin) { - idleSleepInterval = maxIntervalCeilingMin; - } - - auto maxIntervalCeilingMax = System::Clock::Seconds32(MTR_DEVICE_SUBSCRIPTION_MAX_INTERVAL_MAX); - if (idleSleepInterval > maxIntervalCeilingMax) { - idleSleepInterval = maxIntervalCeilingMax; - } -#ifdef DEBUG - if (maxIntervalOverride.HasValue()) { - idleSleepInterval = maxIntervalOverride.Value(); - } -#endif - readParams.mMaxIntervalCeilingSeconds = static_cast(idleSleepInterval.count()); - - readParams.mpAttributePathParamsList = attributePath.get(); - readParams.mAttributePathParamsListSize = 1; - readParams.mpEventPathParamsList = eventPath.get(); - readParams.mEventPathParamsListSize = 1; - readParams.mKeepSubscriptions = true; - readParams.mIsFabricFiltered = false; - - // Subscribe with data version filter list from our cache. - size_t dataVersionFilterListSize = 0; - DataVersionFilter * dataVersionFilterList; - [self _createDataVersionFilterListFromDictionary:[self _getCachedDataVersions] dataVersionFilterList:&dataVersionFilterList count:&dataVersionFilterListSize]; - - readParams.mDataVersionFilterListSize = dataVersionFilterListSize; - readParams.mpDataVersionFilterList = dataVersionFilterList; - attributePath.release(); - eventPath.release(); - - // TODO: Change from local filter list generation to rehydrating ClusterStateCache to take advantage of existing filter list sorting algorithm - - // SendAutoResubscribeRequest cleans up the params, even on failure. - CHIP_ERROR err = readClient->SendAutoResubscribeRequest(std::move(readParams)); - if (err != CHIP_NO_ERROR) { - NSError * error = [MTRError errorForCHIPErrorCode:err logContext:self]; - MTR_LOG_ERROR("%@ SendAutoResubscribeRequest error %@", self, error); - dispatch_async(self.queue, ^{ - [self _handleSubscriptionError:error]; - [self _handleSubscriptionReset:nil]; - }); - - return; - } - - MTR_LOG("%@ Subscribe with data version list size %lu", self, static_cast(dataVersionFilterListSize)); - - // Callback and ClusterStateCache and ReadClient will be deleted - // when OnDone is called. - os_unfair_lock_lock(&self->_lock); - self->_currentReadClient = readClient.get(); - self->_currentSubscriptionCallback = callback.get(); - os_unfair_lock_unlock(&self->_lock); - callback->AdoptReadClient(std::move(readClient)); - callback->AdoptClusterStateCache(std::move(clusterStateCache)); - callback.release(); - }]; - - // Set up connectivity monitoring in case network becomes routable after any part of the subscription process goes into backoff retries. - [self _setupConnectivityMonitoring]; -} - #ifdef DEBUG - (NSUInteger)unitTestAttributesReportedSinceLastCheck { - NSUInteger attributesReportedSinceLastCheck = _unitTestAttributesReportedSinceLastCheck; - _unitTestAttributesReportedSinceLastCheck = 0; - return attributesReportedSinceLastCheck; + return 0; } - (NSUInteger)unitTestNonnullDelegateCount @@ -3472,13 +2613,6 @@ - (void)_pruneEndpointsIn:(MTRDeviceDataValueDictionary)previousPartsListValue } [self _removeClusters:clusterPathsToRemove doRemoveFromDataStore:NO]; [self.deviceController.controllerDataStore clearStoredClusterDataForNodeID:self.nodeID endpointID:endpoint]; - - [_deviceController asyncDispatchToMatterQueue:^{ - std::lock_guard lock(self->_lock); - if (self->_currentSubscriptionCallback) { - self->_currentSubscriptionCallback->ClearCachedAttributeState(static_cast(endpoint.unsignedLongLongValue)); - } - } errorHandler:nil]; } } @@ -3499,17 +2633,6 @@ - (void)_pruneClustersIn:(MTRDeviceDataValueDictionary)previousServerListValue } } [self _removeClusters:clusterPathsToRemove doRemoveFromDataStore:YES]; - - [_deviceController asyncDispatchToMatterQueue:^{ - std::lock_guard lock(self->_lock); - if (self->_currentSubscriptionCallback) { - for (NSNumber * cluster in toBeRemovedClusters) { - ConcreteClusterPath clusterPath(static_cast(endpointID.unsignedLongLongValue), - static_cast(cluster.unsignedLongLongValue)); - self->_currentSubscriptionCallback->ClearCachedAttributeState(clusterPath); - } - } - } errorHandler:nil]; } - (void)_pruneAttributesIn:(MTRDeviceDataValueDictionary)previousAttributeListValue @@ -3523,18 +2646,6 @@ - (void)_pruneAttributesIn:(MTRDeviceDataValueDictionary)previousAttributeListVa [toBeRemovedAttributes minusSet:attributesStillInCluster]; [self _removeAttributes:toBeRemovedAttributes fromCluster:clusterPath]; - - [_deviceController asyncDispatchToMatterQueue:^{ - std::lock_guard lock(self->_lock); - if (self->_currentSubscriptionCallback) { - for (NSNumber * attribute in toBeRemovedAttributes) { - ConcreteAttributePath attributePath(static_cast(clusterPath.endpoint.unsignedLongLongValue), - static_cast(clusterPath.cluster.unsignedLongLongValue), - static_cast(attribute.unsignedLongLongValue)); - self->_currentSubscriptionCallback->ClearCachedAttributeState(attributePath); - } - } - } errorHandler:nil]; } - (void)_pruneStoredDataForPath:(MTRAttributePath *)attributePath @@ -3769,25 +2880,6 @@ - (void)setPersistedDeviceData:(NSDictionary *)data } } -- (void)_storePersistedDeviceData -{ - os_unfair_lock_assert_owner(&self->_lock); - - auto datastore = _deviceController.controllerDataStore; - if (datastore == nil) { - // No way to store. - return; - } - - // For now the only data we have is our initial subscribe latency. - NSMutableDictionary * data = [NSMutableDictionary dictionary]; - if (_estimatedSubscriptionLatency != nil) { - data[sLastInitialSubscribeLatencyKey] = _estimatedSubscriptionLatency; - } - - [datastore storeDeviceData:[data copy] forNodeID:self.nodeID]; -} - #ifdef DEBUG - (MTRDeviceClusterData *)unitTestGetClusterDataForPath:(MTRClusterPath *)path { @@ -4215,20 +3307,11 @@ @implementation MTRDevice (MatterPrivateForInternalDragonsDoNotFeed) - (BOOL)_deviceHasActiveSubscription { - std::lock_guard lock(_lock); - - // TODO: This should always return YES for thread devices - return HaveSubscriptionEstablishedRightNow(_internalDeviceState); + return NO; } - (void)_deviceMayBeReachable { - MTR_LOG("%@ _deviceMayBeReachable called", self); - // TODO: This should only be allowed for thread devices - [_deviceController asyncDispatchToMatterQueue:^{ - [self _triggerResubscribeWithReason:@"SPI client indicated the device may now be reachable" - nodeLikelyReachable:YES]; - } errorHandler:nil]; } /* END DRAGONS */ @@ -4264,122 +3347,3 @@ - (void)invokeCommandWithEndpointID:(NSNumber *)endpointID } @end - -#pragma mark - SubscriptionCallback -namespace { -void SubscriptionCallback::OnEventData(const EventHeader & aEventHeader, TLV::TLVReader * apData, const StatusIB * apStatus) -{ - if (mEventReports == nil) { - // Never got a OnReportBegin? Not much to do other than tear things down. - ReportError(CHIP_ERROR_INCORRECT_STATE); - return; - } - - MTREventPath * eventPath = [[MTREventPath alloc] initWithPath:aEventHeader.mPath]; - if (apStatus != nullptr) { - [mEventReports addObject:@ { MTREventPathKey : eventPath, MTRErrorKey : [MTRError errorForIMStatus:*apStatus] }]; - } else if (apData == nullptr) { - [mEventReports addObject:@ { - MTREventPathKey : eventPath, - MTRErrorKey : [MTRError errorForCHIPErrorCode:CHIP_ERROR_INVALID_ARGUMENT] - }]; - } else { - id value = MTRDecodeDataValueDictionaryFromCHIPTLV(apData); - if (value == nil) { - MTR_LOG_ERROR("Failed to decode event data for path %@", eventPath); - [mEventReports addObject:@ { - MTREventPathKey : eventPath, - MTRErrorKey : [MTRError errorForCHIPErrorCode:CHIP_ERROR_DECODE_FAILED], - }]; - } else { - [mEventReports addObject:[MTRBaseDevice eventReportForHeader:aEventHeader andData:value]]; - } - } - - QueueInterimReport(); -} - -void SubscriptionCallback::OnAttributeData( - const ConcreteDataAttributePath & aPath, TLV::TLVReader * apData, const StatusIB & aStatus) -{ - if (aPath.IsListItemOperation()) { - ReportError(CHIP_ERROR_INCORRECT_STATE); - return; - } - - if (mAttributeReports == nil) { - // Never got a OnReportBegin? Not much to do other than tear things down. - ReportError(CHIP_ERROR_INCORRECT_STATE); - return; - } - - MTRAttributePath * attributePath = [[MTRAttributePath alloc] initWithPath:aPath]; - if (aStatus.mStatus != Status::Success) { - [mAttributeReports addObject:@ { MTRAttributePathKey : attributePath, MTRErrorKey : [MTRError errorForIMStatus:aStatus] }]; - } else if (apData == nullptr) { - [mAttributeReports addObject:@ { - MTRAttributePathKey : attributePath, - MTRErrorKey : [MTRError errorForCHIPErrorCode:CHIP_ERROR_INVALID_ARGUMENT] - }]; - } else { - NSNumber * dataVersionNumber = aPath.mDataVersion.HasValue() ? @(aPath.mDataVersion.Value()) : nil; - NSDictionary * value = MTRDecodeDataValueDictionaryFromCHIPTLV(apData, dataVersionNumber); - if (value == nil) { - MTR_LOG_ERROR("Failed to decode attribute data for path %@", attributePath); - [mAttributeReports addObject:@ { - MTRAttributePathKey : attributePath, - MTRErrorKey : [MTRError errorForCHIPErrorCode:CHIP_ERROR_DECODE_FAILED], - }]; - } else { - [mAttributeReports addObject:@ { MTRAttributePathKey : attributePath, MTRDataKey : value }]; - } - } - - QueueInterimReport(); -} - -uint32_t SubscriptionCallback::ComputeTimeTillNextSubscription() -{ - uint32_t maxWaitTimeInMsec = 0; - uint32_t waitTimeInMsec = 0; - uint32_t minWaitTimeInMsec = 0; - - if (mResubscriptionNumRetries <= CHIP_RESUBSCRIBE_MAX_FIBONACCI_STEP_INDEX) { - maxWaitTimeInMsec = GetFibonacciForIndex(mResubscriptionNumRetries) * CHIP_RESUBSCRIBE_WAIT_TIME_MULTIPLIER_MS; - } else { - maxWaitTimeInMsec = CHIP_RESUBSCRIBE_MAX_RETRY_WAIT_INTERVAL_MS; - } - - if (maxWaitTimeInMsec != 0) { - minWaitTimeInMsec = (CHIP_RESUBSCRIBE_MIN_WAIT_TIME_INTERVAL_PERCENT_PER_STEP * maxWaitTimeInMsec) / 100; - waitTimeInMsec = minWaitTimeInMsec + (Crypto::GetRandU32() % (maxWaitTimeInMsec - minWaitTimeInMsec)); - } - - return waitTimeInMsec; -} - -CHIP_ERROR SubscriptionCallback::OnResubscriptionNeeded(ReadClient * apReadClient, CHIP_ERROR aTerminationCause) -{ - // No need to check ReadClient internal state is Idle because ReadClient only calls OnResubscriptionNeeded after calling ClearActiveSubscriptionState(), which sets the state to Idle. - - // This part is copied from ReadClient's DefaultResubscribePolicy: - auto timeTillNextResubscriptionMs = ComputeTimeTillNextSubscription(); - ChipLogProgress(DataManagement, - "Will try to resubscribe to %02x:" ChipLogFormatX64 " at retry index %" PRIu32 " after %" PRIu32 - "ms due to error %" CHIP_ERROR_FORMAT, - apReadClient->GetFabricIndex(), ChipLogValueX64(apReadClient->GetPeerNodeId()), mResubscriptionNumRetries, timeTillNextResubscriptionMs, - aTerminationCause.Format()); - - // Schedule a maximum time resubscription, to be triggered with TriggerResubscribeIfScheduled after a separate timer. - // This way the aReestablishCASE value is saved, and the sanity checks in ScheduleResubscription are observed and returned. - ReturnErrorOnFailure(apReadClient->ScheduleResubscription(UINT32_MAX, NullOptional, aTerminationCause == CHIP_ERROR_TIMEOUT)); - - // Not as good a place to increment as when resubscription timer fires, but as is, this should be as good, because OnResubscriptionNeeded is only called from ReadClient's Close() while Idle, and nothing should cause this to happen - mResubscriptionNumRetries++; - - auto error = [MTRError errorForCHIPErrorCode:aTerminationCause]; - CallResubscriptionScheduledHandler(error, @(timeTillNextResubscriptionMs)); - - return CHIP_NO_ERROR; -} -} // anonymous namespace From 72ee6eb2973c3b5aecb17e7b92dc90780ec6bf11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Tomkiel?= Date: Thu, 22 Aug 2024 08:51:25 +0200 Subject: [PATCH 04/10] Enhance chip-tool's formatting for some IDs (#35088) * Added logging functions * Modify ZAP template file generation * Updated files for CommandId support * Updated manual tests for the new formatting * Fixed variable name shadowing * Fixed typo * Added logging functions to fabric admin * Restyled by whitespace * Restyled by clang-format * Fixed linking * Fixed typo * Fixed CommandId logging * Updated ZAP generated files * Restyled by clang-format --------- Co-authored-by: Restyled.io --- examples/chip-tool/BUILD.gn | 1 + .../commands/clusters/DataModelLogger.h | 95 + .../logging/DataModelLogger-src.zapt | 12 + .../templates/logging/EntryToText-src.zapt | 84 + .../templates/logging/EntryToText.zapt | 13 + examples/chip-tool/templates/templates.json | 10 + .../commands/clusters/DataModelLogger.h | 95 + .../tv-casting-app/tv-casting-common/BUILD.gn | 1 + .../suites/certification/Test_TC_DEM_1_1.yaml | 54 +- .../certification/Test_TC_DESC_2_1.yaml | 178 +- .../suites/certification/Test_TC_IDM_2_2.yaml | 424 +- .../certification/Test_TC_WAKEONLAN_4_1.yaml | 8 +- .../cluster/logging/DataModelLogger.cpp | 773 +- .../cluster/logging/EntryToText.cpp | 6700 +++++++++++++++++ .../cluster/logging/EntryToText.h | 30 + 15 files changed, 7765 insertions(+), 713 deletions(-) create mode 100644 examples/chip-tool/templates/logging/EntryToText-src.zapt create mode 100644 examples/chip-tool/templates/logging/EntryToText.zapt create mode 100644 zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp create mode 100644 zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.h diff --git a/examples/chip-tool/BUILD.gn b/examples/chip-tool/BUILD.gn index 94e1eebbde7508..acacbc70e8bfad 100644 --- a/examples/chip-tool/BUILD.gn +++ b/examples/chip-tool/BUILD.gn @@ -53,6 +53,7 @@ static_library("chip-tool-utils") { "${chip_root}/src/controller/ExamplePersistentStorage.h", "${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp", "${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp", + "${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp", "commands/clusters/ModelCommand.cpp", "commands/clusters/ModelCommand.h", "commands/common/BDXDiagnosticLogsServerDelegate.cpp", diff --git a/examples/chip-tool/commands/clusters/DataModelLogger.h b/examples/chip-tool/commands/clusters/DataModelLogger.h index 1d9d1e1ccd6955..7186b833ff5153 100644 --- a/examples/chip-tool/commands/clusters/DataModelLogger.h +++ b/examples/chip-tool/commands/clusters/DataModelLogger.h @@ -28,6 +28,7 @@ #include #include #include +#include class DataModelLogger { @@ -157,6 +158,100 @@ class DataModelLogger return CHIP_NO_ERROR; } + static CHIP_ERROR LogClusterId(const char * label, size_t indent, + const chip::app::DataModel::DecodableList & value) + { + size_t count = 0; + ReturnErrorOnFailure(value.ComputeSize(&count)); + DataModelLogger::LogString(label, indent, std::to_string(count) + " entries"); + + auto iter = value.begin(); + size_t i = 0; + while (iter.Next()) + { + ++i; + std::string index = std::string("[") + std::to_string(i) + "]"; + std::string item = std::to_string(iter.GetValue()) + " (" + ClusterIdToText(iter.GetValue()) + ")"; + DataModelLogger::LogString(index, indent + 1, item); + } + if (iter.GetStatus() != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "List truncated due to invalid value"); + } + return iter.GetStatus(); + } + + static CHIP_ERROR LogAttributeId(const char * label, size_t indent, + const chip::app::DataModel::DecodableList & value, chip::ClusterId cluster) + { + size_t count = 0; + ReturnErrorOnFailure(value.ComputeSize(&count)); + DataModelLogger::LogString(label, indent, std::to_string(count) + " entries"); + + auto iter = value.begin(); + size_t i = 0; + while (iter.Next()) + { + ++i; + std::string index = std::string("[") + std::to_string(i) + "]"; + std::string item = std::to_string(iter.GetValue()) + " (" + AttributeIdToText(cluster, iter.GetValue()) + ")"; + DataModelLogger::LogString(index, indent + 1, item); + } + if (iter.GetStatus() != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "List truncated due to invalid value"); + } + return iter.GetStatus(); + } + + static CHIP_ERROR LogAcceptedCommandId(const char * label, size_t indent, + const chip::app::DataModel::DecodableList & value, + chip::ClusterId cluster) + { + size_t count = 0; + ReturnErrorOnFailure(value.ComputeSize(&count)); + DataModelLogger::LogString(label, indent, std::to_string(count) + " entries"); + + auto iter = value.begin(); + size_t i = 0; + while (iter.Next()) + { + ++i; + std::string index = std::string("[") + std::to_string(i) + "]"; + std::string item = std::to_string(iter.GetValue()) + " (" + AcceptedCommandIdToText(cluster, iter.GetValue()) + ")"; + DataModelLogger::LogString(index, indent + 1, item); + } + if (iter.GetStatus() != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "List truncated due to invalid value"); + } + return iter.GetStatus(); + } + + static CHIP_ERROR LogGeneratedCommandId(const char * label, size_t indent, + const chip::app::DataModel::DecodableList & value, + chip::ClusterId cluster) + { + size_t count = 0; + ReturnErrorOnFailure(value.ComputeSize(&count)); + DataModelLogger::LogString(label, indent, std::to_string(count) + " entries"); + + auto iter = value.begin(); + size_t i = 0; + while (iter.Next()) + { + ++i; + std::string index = std::string("[") + std::to_string(i) + "]"; + std::string item = std::to_string(iter.GetValue()) + " (" + GeneratedCommandIdToText(cluster, iter.GetValue()) + ")"; + DataModelLogger::LogString(index, indent + 1, item); + } + if (iter.GetStatus() != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "List truncated due to invalid value"); + } + return iter.GetStatus(); + } + #include static void LogString(size_t indent, const std::string string) { LogString("", indent, string); } diff --git a/examples/chip-tool/templates/logging/DataModelLogger-src.zapt b/examples/chip-tool/templates/logging/DataModelLogger-src.zapt index 0f41ff2e16b96a..3f76143ffab36c 100644 --- a/examples/chip-tool/templates/logging/DataModelLogger-src.zapt +++ b/examples/chip-tool/templates/logging/DataModelLogger-src.zapt @@ -75,7 +75,19 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP { {{zapTypeToDecodableClusterObjectType type ns=parent.name forceNotOptional=true}} value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); +{{#if (isEqual name "ServerList")}} + return DataModelLogger::LogClusterId("{{name}}", 1, value); +{{else if (isEqual name "ClientList")}} + return DataModelLogger::LogClusterId("{{name}}", 1, value); +{{else if (isEqual name "AttributeList")}} + return DataModelLogger::LogAttributeId("{{name}}", 1, value, {{asUpperCamelCase parent.name}}::Id); +{{else if (isEqual name "AcceptedCommandList")}} + return DataModelLogger::LogAcceptedCommandId("{{name}}", 1, value, {{asUpperCamelCase parent.name}}::Id); +{{else if (isEqual name "GeneratedCommandList")}} + return DataModelLogger::LogGeneratedCommandId("{{name}}", 1, value, {{asUpperCamelCase parent.name}}::Id); +{{else}} return DataModelLogger::LogValue("{{name}}", 1, value); +{{/if}} } {{#last}} } diff --git a/examples/chip-tool/templates/logging/EntryToText-src.zapt b/examples/chip-tool/templates/logging/EntryToText-src.zapt new file mode 100644 index 00000000000000..646ee2ad872eaf --- /dev/null +++ b/examples/chip-tool/templates/logging/EntryToText-src.zapt @@ -0,0 +1,84 @@ +{{> header}} + +#include +#include +#include + +char const * ClusterIdToText(chip::ClusterId id) { + switch(id) + { +{{#zcl_clusters}} + case chip::app::Clusters::{{asUpperCamelCase name}}::Id: return "{{asUpperCamelCase name}}"; +{{/zcl_clusters}} + default: return "Unknown"; + } +} + +char const * AttributeIdToText(chip::ClusterId cluster, chip::AttributeId id) { + switch(cluster) + { +{{#zcl_clusters}} +{{#zcl_attributes_server}} +{{#first}} + case chip::app::Clusters::{{asUpperCamelCase parent.name}}::Id: + { + switch(id) + { +{{/first}} + case chip::app::Clusters::{{asUpperCamelCase parent.name}}::Attributes::{{asUpperCamelCase name}}::Id: return "{{asUpperCamelCase name}}"; +{{#last}} + default: return "Unknown"; + } + } +{{/last}} +{{/zcl_attributes_server}} +{{/zcl_clusters}} + default: return "Unknown"; + } +} + +char const * AcceptedCommandIdToText(chip::ClusterId cluster, chip::CommandId id) { + switch(cluster) + { +{{#zcl_clusters}} +{{#zcl_commands_source_client}} +{{#first}} + case chip::app::Clusters::{{asUpperCamelCase parent.name}}::Id: + { + switch(id) + { +{{/first}} + case chip::app::Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::Id: return "{{asUpperCamelCase name}}"; +{{#last}} + default: return "Unknown"; + } + } +{{/last}} +{{/zcl_commands_source_client}} +{{/zcl_clusters}} + default: return "Unknown"; + } +} + +char const * GeneratedCommandIdToText(chip::ClusterId cluster, chip::CommandId id) { + switch(cluster) + { +{{#zcl_clusters}} +{{#zcl_commands_source_server}} +{{#first}} + case chip::app::Clusters::{{asUpperCamelCase parent.name}}::Id: + { + switch(id) + { +{{/first}} + case chip::app::Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::Id: return "{{asUpperCamelCase name}}"; +{{#last}} + default: return "Unknown"; + } + } +{{/last}} +{{/zcl_commands_source_server}} +{{/zcl_clusters}} + default: return "Unknown"; + } +} \ No newline at end of file diff --git a/examples/chip-tool/templates/logging/EntryToText.zapt b/examples/chip-tool/templates/logging/EntryToText.zapt new file mode 100644 index 00000000000000..d1a78f84dc218c --- /dev/null +++ b/examples/chip-tool/templates/logging/EntryToText.zapt @@ -0,0 +1,13 @@ +{{> header}} + +#include +#include +#include + +char const * ClusterIdToText(chip::ClusterId id); + +char const * AttributeIdToText(chip::ClusterId cluster, chip::AttributeId id); + +char const * AcceptedCommandIdToText(chip::ClusterId cluster, chip::CommandId id); + +char const * GeneratedCommandIdToText(chip::ClusterId cluster, chip::CommandId id); \ No newline at end of file diff --git a/examples/chip-tool/templates/templates.json b/examples/chip-tool/templates/templates.json index 528c7d266dcb97..9ced10b1372590 100644 --- a/examples/chip-tool/templates/templates.json +++ b/examples/chip-tool/templates/templates.json @@ -64,6 +64,16 @@ "path": "ComplexArgumentParser-src.zapt", "name": "Complex Argument Parser", "output": "cluster/ComplexArgumentParser.cpp" + }, + { + "path": "logging/EntryToText.zapt", + "name": "Entry To Text header", + "output": "cluster/logging/EntryToText.h" + }, + { + "path": "logging/EntryToText-src.zapt", + "name": "Entry To Text", + "output": "cluster/logging/EntryToText.cpp" } ] } diff --git a/examples/fabric-admin/commands/clusters/DataModelLogger.h b/examples/fabric-admin/commands/clusters/DataModelLogger.h index ee649755014906..36f53ba3811c24 100644 --- a/examples/fabric-admin/commands/clusters/DataModelLogger.h +++ b/examples/fabric-admin/commands/clusters/DataModelLogger.h @@ -28,6 +28,7 @@ #include #include #include +#include class DataModelLogger { @@ -157,6 +158,100 @@ class DataModelLogger return CHIP_NO_ERROR; } + static CHIP_ERROR LogClusterId(const char * label, size_t indent, + const chip::app::DataModel::DecodableList & value) + { + size_t count = 0; + ReturnErrorOnFailure(value.ComputeSize(&count)); + DataModelLogger::LogString(label, indent, std::to_string(count) + " entries"); + + auto iter = value.begin(); + size_t i = 0; + while (iter.Next()) + { + ++i; + std::string index = std::string("[") + std::to_string(i) + "]"; + std::string item = std::to_string(iter.GetValue()) + " (" + ClusterIdToText(iter.GetValue()) + ")"; + DataModelLogger::LogString(index, indent + 1, item); + } + if (iter.GetStatus() != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "List truncated due to invalid value"); + } + return iter.GetStatus(); + } + + static CHIP_ERROR LogAttributeId(const char * label, size_t indent, + const chip::app::DataModel::DecodableList & value, chip::ClusterId cluster) + { + size_t count = 0; + ReturnErrorOnFailure(value.ComputeSize(&count)); + DataModelLogger::LogString(label, indent, std::to_string(count) + " entries"); + + auto iter = value.begin(); + size_t i = 0; + while (iter.Next()) + { + ++i; + std::string index = std::string("[") + std::to_string(i) + "]"; + std::string item = std::to_string(iter.GetValue()) + " (" + AttributeIdToText(cluster, iter.GetValue()) + ")"; + DataModelLogger::LogString(index, indent + 1, item); + } + if (iter.GetStatus() != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "List truncated due to invalid value"); + } + return iter.GetStatus(); + } + + static CHIP_ERROR LogAcceptedCommandId(const char * label, size_t indent, + const chip::app::DataModel::DecodableList & value, + chip::ClusterId cluster) + { + size_t count = 0; + ReturnErrorOnFailure(value.ComputeSize(&count)); + DataModelLogger::LogString(label, indent, std::to_string(count) + " entries"); + + auto iter = value.begin(); + size_t i = 0; + while (iter.Next()) + { + ++i; + std::string index = std::string("[") + std::to_string(i) + "]"; + std::string item = std::to_string(iter.GetValue()) + " (" + AcceptedCommandIdToText(cluster, iter.GetValue()) + ")"; + DataModelLogger::LogString(index, indent + 1, item); + } + if (iter.GetStatus() != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "List truncated due to invalid value"); + } + return iter.GetStatus(); + } + + static CHIP_ERROR LogGeneratedCommandId(const char * label, size_t indent, + const chip::app::DataModel::DecodableList & value, + chip::ClusterId cluster) + { + size_t count = 0; + ReturnErrorOnFailure(value.ComputeSize(&count)); + DataModelLogger::LogString(label, indent, std::to_string(count) + " entries"); + + auto iter = value.begin(); + size_t i = 0; + while (iter.Next()) + { + ++i; + std::string index = std::string("[") + std::to_string(i) + "]"; + std::string item = std::to_string(iter.GetValue()) + " (" + GeneratedCommandIdToText(cluster, iter.GetValue()) + ")"; + DataModelLogger::LogString(index, indent + 1, item); + } + if (iter.GetStatus() != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "List truncated due to invalid value"); + } + return iter.GetStatus(); + } + #include static void LogString(size_t indent, const std::string string) { LogString("", indent, string); } diff --git a/examples/tv-casting-app/tv-casting-common/BUILD.gn b/examples/tv-casting-app/tv-casting-common/BUILD.gn index ee422e1b063db9..2c30080f027ee5 100644 --- a/examples/tv-casting-app/tv-casting-common/BUILD.gn +++ b/examples/tv-casting-app/tv-casting-common/BUILD.gn @@ -50,6 +50,7 @@ chip_data_model("tv-casting-common") { "${chip_root}/src/controller/ExamplePersistentStorage.h", "${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp", "${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp", + "${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp", "clusters/content-app-observer/ContentAppObserver.cpp", "clusters/content-app-observer/ContentAppObserver.h", "commands/clusters/ModelCommand.cpp", diff --git a/src/app/tests/suites/certification/Test_TC_DEM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DEM_1_1.yaml index 4d1a72392ab435..e69e5a62b0a820 100644 --- a/src/app/tests/suites/certification/Test_TC_DEM_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DEM_1_1.yaml @@ -62,21 +62,21 @@ tests: - Based on feature support:- 0x0005, 0x0006, 0x0007 Below mentioned log is based on the RPI implementation, Value may vary on real DUT - [1705649142.831039][6212:6214] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0098 Attribute 0x0000_FFFB DataVersion: 633673396 - [1705649142.831110][6212:6214] CHIP:TOO: AttributeList: 13 entries - [1705649142.831151][6212:6214] CHIP:TOO: [1]: 0 - [1705649142.831174][6212:6214] CHIP:TOO: [2]: 1 - [1705649142.831208][6212:6214] CHIP:TOO: [3]: 2 - [1705649142.831230][6212:6214] CHIP:TOO: [4]: 3 - [1705649142.831261][6212:6214] CHIP:TOO: [5]: 4 - [1705649142.831283][6212:6214] CHIP:TOO: [6]: 5 - [1705649142.831304][6212:6214] CHIP:TOO: [7]: 6 - [1705649142.831336][6212:6214] CHIP:TOO: [8]: 7 - [1705649142.831359][6212:6214] CHIP:TOO: [9]: 65528 - [1705649142.831390][6212:6214] CHIP:TOO: [10]: 65529 - [1705649142.831434][6212:6214] CHIP:TOO: [11]: 65531 - [1705649142.831458][6212:6214] CHIP:TOO: [12]: 65532 - [1705649142.831490][6212:6214] CHIP:TOO: [13]: 65533 + [1723642027.628] [328171:328173] [TOO] Endpoint: 1 Cluster: 0x0000_0098 Attribute 0x0000_FFFB DataVersion: 3122179410 + [1723642027.628] [328171:328173] [TOO] AttributeList: 13 entries + [1723642027.628] [328171:328173] [TOO] [1]: 0 (ESAType) + [1723642027.628] [328171:328173] [TOO] [2]: 1 (ESACanGenerate) + [1723642027.628] [328171:328173] [TOO] [3]: 2 (ESAState) + [1723642027.628] [328171:328173] [TOO] [4]: 3 (AbsMinPower) + [1723642027.628] [328171:328173] [TOO] [5]: 4 (AbsMaxPower) + [1723642027.628] [328171:328173] [TOO] [6]: 5 (PowerAdjustmentCapability) + [1723642027.628] [328171:328173] [TOO] [7]: 6 (Forecast) + [1723642027.628] [328171:328173] [TOO] [8]: 7 (OptOutState) + [1723642027.628] [328171:328173] [TOO] [9]: 65528 (GeneratedCommandList) + [1723642027.628] [328171:328173] [TOO] [10]: 65529 (AcceptedCommandList) + [1723642027.628] [328171:328173] [TOO] [11]: 65531 (AttributeList) + [1723642027.628] [328171:328173] [TOO] [12]: 65532 (FeatureMap) + [1723642027.628] [328171:328173] [TOO] [13]: 65533 (ClusterRevision) disabled: true - label: "Step 5*: TH reads from the DUT the EventList attribute." @@ -100,16 +100,16 @@ tests: On TH(chip-tool), Verify the AcceptedCommandList attribute that contains 7 entries: Below mentioned log is based on the RPI implementation, Value may vary on real DUT - [1705649342.947638][6221:6223] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0098 Attribute 0x0000_FFF9 DataVersion: 633673396 - [1705649342.947712][6221:6223] CHIP:TOO: AcceptedCommandList: 8 entries - [1705649342.947754][6221:6223] CHIP:TOO: [1]: 0 - [1705649342.947779][6221:6223] CHIP:TOO: [2]: 1 - [1705649342.947802][6221:6223] CHIP:TOO: [3]: 2 - [1705649342.947825][6221:6223] CHIP:TOO: [4]: 3 - [1705649342.947848][6221:6223] CHIP:TOO: [5]: 4 - [1705649342.947871][6221:6223] CHIP:TOO: [6]: 5 - [1705649342.947894][6221:6223] CHIP:TOO: [7]: 6 - [1705649342.947917][6221:6223] CHIP:TOO: [8]: 7 + [1705649342.947638][6221:6223] [TOO] Endpoint: 1 Cluster: 0x0000_0098 Attribute 0x0000_FFF9 DataVersion: 633673396 + [1705649342.947712][6221:6223] [TOO] AcceptedCommandList: 8 entries + [1705649342.947754][6221:6223] [TOO] [1]: 0 (PowerAdjustRequest) + [1705649342.947779][6221:6223] [TOO] [2]: 1 (CancelPowerAdjustRequest) + [1705649342.947802][6221:6223] [TOO] [3]: 2 (StartTimeAdjustRequest) + [1705649342.947825][6221:6223] [TOO] [4]: 3 (PauseRequest) + [1705649342.947848][6221:6223] [TOO] [5]: 4 (ResumeRequest) + [1705649342.947871][6221:6223] [TOO] [6]: 5 (ModifyForecastRequest) + [1705649342.947894][6221:6223] [TOO] [7]: 6 (RequestConstraintBasedForecast) + [1705649342.947917][6221:6223] [TOO] [8]: 7 (CancelRequest) disabled: true - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." @@ -118,6 +118,6 @@ tests: On TH(chip-tool), Verify the GeneratedCommandList attribute that contains 1 entries: - [1705567897.076935][7141:7143] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0098 Attribute 0x0000_FFF8 DataVersion: 1117764527 - [1705567897.076989][7141:7143] CHIP:TOO: GeneratedCommandList: 0 entries + [1705567897.076935][7141:7143] [TOO] Endpoint: 1 Cluster: 0x0000_0098 Attribute 0x0000_FFF8 DataVersion: 1117764527 + [1705567897.076989][7141:7143] [TOO] GeneratedCommandList: 0 entries disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DESC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_DESC_2_1.yaml index 2ce0e296bbc2d5..2afe448fa99f30 100644 --- a/src/app/tests/suites/certification/Test_TC_DESC_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DESC_2_1.yaml @@ -142,95 +142,95 @@ tests: Verify ServerList entries on the TH (Chip-tool) and below is the sample log provided for the raspi platform, - [1707996554.409850][20755:20757] CHIP:DMG: } - [1707996554.410814][20755:20757] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 3583190746 - [1707996554.410955][20755:20757] CHIP:TOO: ServerList: 71 entries - [1707996554.410990][20755:20757] CHIP:TOO: [1]: 3 - [1707996554.411002][20755:20757] CHIP:TOO: [2]: 4 - [1707996554.411013][20755:20757] CHIP:TOO: [3]: 6 - [1707996554.411024][20755:20757] CHIP:TOO: [4]: 7 - [1707996554.411034][20755:20757] CHIP:TOO: [5]: 8 - [1707996554.411045][20755:20757] CHIP:TOO: [6]: 15 - [1707996554.411056][20755:20757] CHIP:TOO: [7]: 29 - [1707996554.411067][20755:20757] CHIP:TOO: [8]: 30 - [1707996554.411078][20755:20757] CHIP:TOO: [9]: 37 - [1707996554.411092][20755:20757] CHIP:TOO: [10]: 47 - [1707996554.411103][20755:20757] CHIP:TOO: [11]: 59 - [1707996554.411113][20755:20757] CHIP:TOO: [12]: 64 - [1707996554.411124][20755:20757] CHIP:TOO: [13]: 65 - [1707996554.411135][20755:20757] CHIP:TOO: [14]: 69 - [1707996554.411146][20755:20757] CHIP:TOO: [15]: 72 - [1707996554.411156][20755:20757] CHIP:TOO: [16]: 73 - [1707996554.411167][20755:20757] CHIP:TOO: [17]: 74 - [1707996554.411177][20755:20757] CHIP:TOO: [18]: 80 - [1707996554.411188][20755:20757] CHIP:TOO: [19]: 81 - [1707996554.411199][20755:20757] CHIP:TOO: [20]: 82 - [1707996554.411209][20755:20757] CHIP:TOO: [21]: 83 - [1707996554.411220][20755:20757] CHIP:TOO: [22]: 84 - [1707996554.411231][20755:20757] CHIP:TOO: [23]: 85 - [1707996554.411240][20755:20757] CHIP:TOO: [24]: 86 - [1707996554.411251][20755:20757] CHIP:TOO: [25]: 87 - [1707996554.411261][20755:20757] CHIP:TOO: [26]: 89 - [1707996554.411271][20755:20757] CHIP:TOO: [27]: 91 - [1707996554.411282][20755:20757] CHIP:TOO: [28]: 92 - [1707996554.411293][20755:20757] CHIP:TOO: [29]: 93 - [1707996554.411303][20755:20757] CHIP:TOO: [30]: 94 - [1707996554.411313][20755:20757] CHIP:TOO: [31]: 96 - [1707996554.411323][20755:20757] CHIP:TOO: [32]: 97 - [1707996554.411334][20755:20757] CHIP:TOO: [33]: 98 - [1707996554.411345][20755:20757] CHIP:TOO: [34]: 113 - [1707996554.411355][20755:20757] CHIP:TOO: [35]: 114 - [1707996554.411367][20755:20757] CHIP:TOO: [36]: 128 - [1707996554.411376][20755:20757] CHIP:TOO: [37]: 129 - [1707996554.411387][20755:20757] CHIP:TOO: [38]: 144 - [1707996554.411396][20755:20757] CHIP:TOO: [39]: 145 - [1707996554.411406][20755:20757] CHIP:TOO: [40]: 152 - [1707996554.411417][20755:20757] CHIP:TOO: [41]: 153 - [1707996554.411427][20755:20757] CHIP:TOO: [42]: 157 - [1707996554.411437][20755:20757] CHIP:TOO: [43]: 159 - [1707996554.411449][20755:20757] CHIP:TOO: [44]: 258 - [1707996554.411459][20755:20757] CHIP:TOO: [45]: 259 - [1707996554.411469][20755:20757] CHIP:TOO: [46]: 512 - [1707996554.411480][20755:20757] CHIP:TOO: [47]: 513 - [1707996554.411490][20755:20757] CHIP:TOO: [48]: 514 - [1707996554.411500][20755:20757] CHIP:TOO: [49]: 516 - [1707996554.411511][20755:20757] CHIP:TOO: [50]: 768 - [1707996554.411521][20755:20757] CHIP:TOO: [51]: 769 - [1707996554.411532][20755:20757] CHIP:TOO: [52]: 1024 - [1707996554.411559][20755:20757] CHIP:TOO: [53]: 1026 - [1707996554.411562][20755:20757] CHIP:TOO: [54]: 1027 - [1707996554.411565][20755:20757] CHIP:TOO: [55]: 1028 - [1707996554.411568][20755:20757] CHIP:TOO: [56]: 1029 - [1707996554.411571][20755:20757] CHIP:TOO: [57]: 1030 - [1707996554.411575][20755:20757] CHIP:TOO: [58]: 1036 - [1707996554.411578][20755:20757] CHIP:TOO: [59]: 1037 - [1707996554.411581][20755:20757] CHIP:TOO: [60]: 1043 - [1707996554.411584][20755:20757] CHIP:TOO: [61]: 1045 - [1707996554.411587][20755:20757] CHIP:TOO: [62]: 1066 - [1707996554.411589][20755:20757] CHIP:TOO: [63]: 1067 - [1707996554.411592][20755:20757] CHIP:TOO: [64]: 1068 - [1707996554.411595][20755:20757] CHIP:TOO: [65]: 1069 - [1707996554.411598][20755:20757] CHIP:TOO: [66]: 1070 - [1707996554.411601][20755:20757] CHIP:TOO: [67]: 1071 - [1707996554.411604][20755:20757] CHIP:TOO: [68]: 1283 - [1707996554.411607][20755:20757] CHIP:TOO: [69]: 1288 - [1707996554.411610][20755:20757] CHIP:TOO: [70]: 2820 - [1707996554.411613][20755:20757] CHIP:TOO: [71]: 4294048773 + [1707996554.409850][20755:20757] [DMG] } + [1707996554.410814][20755:20757] [TOO] Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 3583190746 + [1707996554.410955][20755:20757] [TOO] ServerList: 71 entries + [1707996554.410990][20755:20757] [TOO] [1]: 3 (Identify) + [1707996554.411002][20755:20757] [TOO] [2]: 4 (Groups) + [1707996554.411013][20755:20757] [TOO] [3]: 6 (OnOff) + [1707996554.411024][20755:20757] [TOO] [4]: 7 (OnOffSwitchConfiguration) + [1707996554.411034][20755:20757] [TOO] [5]: 8 (LevelControl) + [1707996554.411045][20755:20757] [TOO] [6]: 15 (BinaryInputBasic) + [1707996554.411056][20755:20757] [TOO] [7]: 29 (Descriptor) + [1707996554.411067][20755:20757] [TOO] [8]: 30 (Binding) + [1707996554.411078][20755:20757] [TOO] [9]: 37 (Actions) + [1707996554.411092][20755:20757] [TOO] [10]: 47 (PowerSource) + [1707996554.411103][20755:20757] [TOO] [11]: 59 (Switch) + [1707996554.411113][20755:20757] [TOO] [12]: 64 (FixedLabel) + [1707996554.411124][20755:20757] [TOO] [13]: 65 (UserLabel) + [1707996554.411135][20755:20757] [TOO] [14]: 69 (BooleanState) + [1707996554.411146][20755:20757] [TOO] [15]: 72 (OvenCavityOperationalState) + [1707996554.411156][20755:20757] [TOO] [16]: 73 (OvenMode) + [1707996554.411167][20755:20757] [TOO] [17]: 74 (LaundryDryerControls) + [1707996554.411177][20755:20757] [TOO] [18]: 80 (ModeSelect) + [1707996554.411188][20755:20757] [TOO] [19]: 81 (LaundryWasherMode) + [1707996554.411199][20755:20757] [TOO] [20]: 82 (RefrigeratorAndTemperatureControlledCabinetMode) + [1707996554.411209][20755:20757] [TOO] [21]: 83 (LaundryWasherControls) + [1707996554.411220][20755:20757] [TOO] [22]: 84 (RvcRunMode) + [1707996554.411231][20755:20757] [TOO] [23]: 85 (RvcCleanMode) + [1707996554.411240][20755:20757] [TOO] [24]: 86 (TemperatureControl) + [1707996554.411251][20755:20757] [TOO] [25]: 87 (RefrigeratorAlarm) + [1707996554.411261][20755:20757] [TOO] [26]: 89 (DishwasherMode) + [1707996554.411271][20755:20757] [TOO] [27]: 91 (AirQuality) + [1707996554.411282][20755:20757] [TOO] [28]: 92 (SmokeCoAlarm) + [1707996554.411293][20755:20757] [TOO] [29]: 93 (DishwasherAlarm) + [1707996554.411303][20755:20757] [TOO] [30]: 94 (MicrowaveOvenMode) + [1707996554.411313][20755:20757] [TOO] [31]: 96 (OperationalState) + [1707996554.411323][20755:20757] [TOO] [32]: 97 (RvcOperationalState) + [1707996554.411334][20755:20757] [TOO] [33]: 98 (ScenesManagement) + [1707996554.411345][20755:20757] [TOO] [34]: 113 (HepaFilterMonitoring) + [1707996554.411355][20755:20757] [TOO] [35]: 114 (ActivatedCarbonFilterMonitoring) + [1707996554.411367][20755:20757] [TOO] [36]: 128 (BooleanStateConfiguration) + [1707996554.411376][20755:20757] [TOO] [37]: 129 (ValveConfigurationAndControl) + [1707996554.411387][20755:20757] [TOO] [38]: 144 (ElectricalPowerMeasurement) + [1707996554.411396][20755:20757] [TOO] [39]: 145 (ElectricalEnergyMeasurement) + [1707996554.411406][20755:20757] [TOO] [40]: 152 (DeviceEnergyManagement) + [1707996554.411417][20755:20757] [TOO] [41]: 153 (EnergyEvse) + [1707996554.411427][20755:20757] [TOO] [42]: 157 (EnergyEvseMode) + [1707996554.411437][20755:20757] [TOO] [43]: 159 (DeviceEnergyManagementMode) + [1707996554.411449][20755:20757] [TOO] [44]: 258 (WindowCovering) + [1707996554.411459][20755:20757] [TOO] [45]: 259 (BarrierControl) + [1707996554.411469][20755:20757] [TOO] [46]: 512 (PumpConfigurationAndControl) + [1707996554.411480][20755:20757] [TOO] [47]: 513 (Thermostat) + [1707996554.411490][20755:20757] [TOO] [48]: 514 (FanControl) + [1707996554.411500][20755:20757] [TOO] [49]: 516 (ThermostatUserInterfaceConfiguration) + [1707996554.411511][20755:20757] [TOO] [50]: 768 (ColorControl) + [1707996554.411521][20755:20757] [TOO] [51]: 769 (BallastConfiguration) + [1707996554.411532][20755:20757] [TOO] [52]: 1024 (IlluminanceMeasurement) + [1707996554.411559][20755:20757] [TOO] [53]: 1026 (TemperatureMeasurement) + [1707996554.411562][20755:20757] [TOO] [54]: 1027 (PressureMeasurement) + [1707996554.411565][20755:20757] [TOO] [55]: 1028 (FlowMeasurement) + [1707996554.411568][20755:20757] [TOO] [56]: 1029 (RelativeHumidityMeasurement) + [1707996554.411571][20755:20757] [TOO] [57]: 1030 (OccupancySensing) + [1707996554.411575][20755:20757] [TOO] [58]: 1036 (CarbonMonoxideConcentrationMeasurement) + [1707996554.411578][20755:20757] [TOO] [59]: 1037 (CarbonDioxideConcentrationMeasurement) + [1707996554.411581][20755:20757] [TOO] [60]: 1043 (NitrogenDioxideConcentrationMeasurement) + [1707996554.411584][20755:20757] [TOO] [61]: 1045 (OzoneConcentrationMeasurement) + [1707996554.411587][20755:20757] [TOO] [62]: 1066 (Pm25ConcentrationMeasurement) + [1707996554.411589][20755:20757] [TOO] [63]: 1067 (FormaldehydeConcentrationMeasurement) + [1707996554.411592][20755:20757] [TOO] [64]: 1068 (Pm1ConcentrationMeasurement) + [1707996554.411595][20755:20757] [TOO] [65]: 1069 (Pm10ConcentrationMeasurement) + [1707996554.411598][20755:20757] [TOO] [66]: 1070 (TotalVolatileOrganicCompoundsConcentrationMeasurement) + [1707996554.411601][20755:20757] [TOO] [67]: 1071 (RadonConcentrationMeasurement) + [1707996554.411604][20755:20757] [TOO] [68]: 1283 (WakeOnLan) + [1707996554.411607][20755:20757] [TOO] [69]: 1288 (LowPower) + [1707996554.411610][20755:20757] [TOO] [70]: 2820 (ElectricalMeasurement) + [1707996554.411613][20755:20757] [TOO] [71]: 4294048773 (UnitTesting) ./chip-tool descriptor read server-list 1 2 Verify ServerList entries on TH (Chip-tool) Log and below is the sample log provided for the raspi platform, Here ServerList entries are 7. - [1692618559.962829][31688:31690] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 1103199808 - [1692618559.962884][31688:31690] CHIP:TOO: ServerList: 7 entries - [1692618559.962910][31688:31690] CHIP:TOO: [1]: 3 - [1692618559.962922][31688:31690] CHIP:TOO: [2]: 4 - [1692618559.962933][31688:31690] CHIP:TOO: [3]: 5 - [1692618559.962945][31688:31690] CHIP:TOO: [4]: 6 - [1692618559.962955][31688:31690] CHIP:TOO: [5]: 29 - [1692618559.962966][31688:31690] CHIP:TOO: [6]: 47 - [1692618559.962978][31688:31690] CHIP:TOO: [7]: 1030 + [1692618559.962829][31688:31690] [TOO] Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 1103199808 + [1692618559.962884][31688:31690] [TOO] ServerList: 7 entries + [1692618559.962910][31688:31690] [TOO] [1]: 3 (Identify) + [1692618559.962922][31688:31690] [TOO] [2]: 4 (Groups) + [1692618559.962933][31688:31690] [TOO] [3]: 5 (Unknown) + [1692618559.962945][31688:31690] [TOO] [4]: 6 (OnOff) + [1692618559.962955][31688:31690] [TOO] [5]: 29 (Descriptor) + [1692618559.962966][31688:31690] [TOO] [6]: 47 (PowerSource) + [1692618559.962978][31688:31690] [TOO] [7]: 1030 (OccupancySensing) disabled: true - label: "Step 3: TH reads 'ClientList' attribute" @@ -244,17 +244,17 @@ tests: Verify client list entries on the TH (Chip-tool) and below is the sample log provided for the raspi platform, Here ClientList entries are 1. - [1676367470.160199][9805:9807] CHIP:DMG: } - [1676367470.160268][9805:9807] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0002 DataVersion: 3336430903 - [1676367470.160282][9805:9807] CHIP:TOO: ClientList: 1 entries - [1676367470.160289][9805:9807] CHIP:TOO: [1]: 6 + [1676367470.160199][9805:9807] [DMG] } + [1676367470.160268][9805:9807] [TOO] Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0002 DataVersion: 3336430903 + [1676367470.160282][9805:9807] [TOO] ClientList: 1 entries + [1676367470.160289][9805:9807] [TOO] [1]: 6 (OnOff) ./chip-tool descriptor read client-list 1 2 Verify client list entries on the TH (Chip-tool) and below is the sample log provided for the raspi platform, Here ClientList entries are 0. - [1660146160.390200][46818:46823] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_0002 DataVersion: 1051414887 - [1660146160.390211][46818:46823] CHIP:TOO: ClientList: 0 entries + [1660146160.390200][46818:46823] [TOO] Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_0002 DataVersion: 1051414887 + [1660146160.390211][46818:46823] [TOO] ClientList: 0 entries disabled: true - label: "Step 4: TH reads 'PartsList' attribute." diff --git a/src/app/tests/suites/certification/Test_TC_IDM_2_2.yaml b/src/app/tests/suites/certification/Test_TC_IDM_2_2.yaml index 6b4f2c7e7df9a9..7c00f74535fd7d 100644 --- a/src/app/tests/suites/certification/Test_TC_IDM_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_IDM_2_2.yaml @@ -81,33 +81,33 @@ tests: On the TH(chip-tool) verify the received report data message has only the attributes that the TH has privilege to. - [1655727546.354466][5286:5291] CHIP:DMG: - [1655727546.354512][5286:5291] CHIP:DMG: SuppressResponse = true, - [1655727546.354538][5286:5291] CHIP:DMG: InteractionModelRevision = 1 - [1655727546.354580][5286:5291] CHIP:DMG: } - [1655727546.355252][5286:5291] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_0000 DataVersion: 1545325355 - [1655727546.355324][5286:5291] CHIP:TOO: identify time: 0 - [1655727546.355386][5286:5291] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_0001 DataVersion: 1545325355 - [1655727546.355414][5286:5291] CHIP:TOO: identify type: 2 - [1655727546.355470][5286:5291] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFFC DataVersion: 1545325355 - [1655727546.355524][5286:5291] CHIP:TOO: FeatureMap: 0 - [1655727546.355606][5286:5291] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFFD DataVersion: 1545325355 - [1655727546.355635][5286:5291] CHIP:TOO: ClusterRevision: 4 - [1655727546.355788][5286:5291] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFF8 DataVersion: 1545325355 - [1655727546.355845][5286:5291] CHIP:TOO: GeneratedCommandList: 0 entries - [1655727546.356030][5286:5291] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFF9 DataVersion: 1545325355 - [1655727546.356087][5286:5291] CHIP:TOO: AcceptedCommandList: 2 entries - [1655727546.356117][5286:5291] CHIP:TOO: [1]: 0 - [1655727546.356143][5286:5291] CHIP:TOO: [2]: 64 - [1655727546.356552][5286:5291] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFFB DataVersion: 1545325355 - [1655727546.356590][5286:5291] CHIP:TOO: AttributeList: 7 entries - [1655727546.356617][5286:5291] CHIP:TOO: [1]: 0 - [1655727546.356642][5286:5291] CHIP:TOO: [2]: 1 - [1655727546.356667][5286:5291] CHIP:TOO: [3]: 65528 - [1655727546.356692][5286:5291] CHIP:TOO: [4]: 65529 - [1655727546.356716][5286:5291] CHIP:TOO: [5]: 65531 - [1655727546.356741][5286:5291] CHIP:TOO: [6]: 65532 - [1655727546.356766][5286:5291] CHIP:TOO: [7]: 65533 + [1723642164.392] [329152:329154] [DMG] + [1723642164.392] [329152:329154] [DMG] SuppressResponse = true, + [1723642164.392] [329152:329154] [DMG] InteractionModelRevision = 11 + [1723642164.392] [329152:329154] [DMG] } + [1723642164.392] [329152:329154] [TOO] Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_0000 DataVersion: 357555707 + [1723642164.392] [329152:329154] [TOO] IdentifyTime: 0 + [1723642164.392] [329152:329154] [TOO] Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_0001 DataVersion: 357555707 + [1723642164.392] [329152:329154] [TOO] IdentifyType: 2 + [1723642164.392] [329152:329154] [TOO] Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFFC DataVersion: 357555707 + [1723642164.392] [329152:329154] [TOO] FeatureMap: 0 + [1723642164.392] [329152:329154] [TOO] Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFFD DataVersion: 357555707 + [1723642164.392] [329152:329154] [TOO] ClusterRevision: 4 + [1723642164.393] [329152:329154] [TOO] Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFF8 DataVersion: 357555707 + [1723642164.393] [329152:329154] [TOO] GeneratedCommandList: 0 entries + [1723642164.393] [329152:329154] [TOO] Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFF9 DataVersion: 357555707 + [1723642164.393] [329152:329154] [TOO] AcceptedCommandList: 2 entries + [1723642164.393] [329152:329154] [TOO] [1]: 0 (Identify) + [1723642164.393] [329152:329154] [TOO] [2]: 64 (TriggerEffect) + [1723642164.393] [329152:329154] [TOO] Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFFB DataVersion: 357555707 + [1723642164.393] [329152:329154] [TOO] AttributeList: 7 entries + [1723642164.393] [329152:329154] [TOO] [1]: 0 (IdentifyTime) + [1723642164.393] [329152:329154] [TOO] [2]: 1 (IdentifyType) + [1723642164.393] [329152:329154] [TOO] [3]: 65528 (GeneratedCommandList) + [1723642164.393] [329152:329154] [TOO] [4]: 65529 (AcceptedCommandList) + [1723642164.393] [329152:329154] [TOO] [5]: 65531 (AttributeList) + [1723642164.393] [329152:329154] [TOO] [6]: 65532 (FeatureMap) + [1723642164.393] [329152:329154] [TOO] [7]: 65533 (ClusterRevision) disabled: true - label: @@ -272,7 +272,7 @@ tests: disabled: true - label: - "Step 7: TH sends the Read Request Message to the DUT to read all + "Step 7: TH sends the Read Requ`est Message to the DUT to read all attributes from a cluster at all Endpoints AttributePath = [[Cluster = Specific ClusterID]] On receipt of this message, DUT should send a report data action with the attribute value from all the Endpoints to @@ -284,52 +284,52 @@ tests: On the TH(chip-tool) verify the received report data message has all the right attribute values for above command - [1653629930.057852][8778:8783] CHIP:DMG: } - [1653629930.058739][8778:8783] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_0000 DataVersion: 2065044836 - [1653629930.058788][8778:8783] CHIP:TOO: identify time: 0 - [1653629930.058889][8778:8783] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_0001 DataVersion: 2065044836 - [1653629930.058919][8778:8783] CHIP:TOO: identify type: 2 - [1653629930.058980][8778:8783] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFFD DataVersion: 2065044836 - [1653629930.058998][8778:8783] CHIP:TOO: ClusterRevision: 4 - [1653629930.059191][8778:8783] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFF8 DataVersion: 2065044836 - [1653629930.059220][8778:8783] CHIP:TOO: GeneratedCommandList: 1 entries - [1653629930.059239][8778:8783] CHIP:TOO: [1]: 0 - [1653629930.059478][8778:8783] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFF9 DataVersion: 2065044836 - [1653629930.059503][8778:8783] CHIP:TOO: AcceptedCommandList: 3 entries - [1653629930.059519][8778:8783] CHIP:TOO: [1]: 0 - [1653629930.059532][8778:8783] CHIP:TOO: [2]: 1 - [1653629930.059546][8778:8783] CHIP:TOO: [3]: 64 - [1653629930.059945][8778:8783] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFFB DataVersion: 2065044836 - [1653629930.059974][8778:8783] CHIP:TOO: AttributeList: 6 entries - [1653629930.059989][8778:8783] CHIP:TOO: [1]: 0 - [1653629930.060002][8778:8783] CHIP:TOO: [2]: 1 - [1653629930.060015][8778:8783] CHIP:TOO: [3]: 65528 - [1653629930.060032][8778:8783] CHIP:TOO: [4]: 65529 - [1653629930.060048][8778:8783] CHIP:TOO: [5]: 65531 - [1653629930.060064][8778:8783] CHIP:TOO: [6]: 65533 - [1653629930.060077][8778:8783] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_0000 DataVersion: 3620435651 - [1653629930.060095][8778:8783] CHIP:TOO: identify time: 0 - [1653629930.060151][8778:8783] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_0001 DataVersion: 3620435651 - [1653629930.060167][8778:8783] CHIP:TOO: identify type: 2 - [1653629930.060224][8778:8783] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFFD DataVersion: 3620435651 - [1653629930.060240][8778:8783] CHIP:TOO: ClusterRevision: 4 - [1653629930.060411][8778:8783] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFF8 DataVersion: 3620435651 - [1653629930.060433][8778:8783] CHIP:TOO: GeneratedCommandList: 1 entries - [1653629930.060448][8778:8783] CHIP:TOO: [1]: 0 - [1653629930.060671][8778:8783] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFF9 DataVersion: 3620435651 - [1653629930.060695][8778:8783] CHIP:TOO: AcceptedCommandList: 3 entries - [1653629930.060710][8778:8783] CHIP:TOO: [1]: 0 - [1653629930.060722][8778:8783] CHIP:TOO: [2]: 1 - [1653629930.060735][8778:8783] CHIP:TOO: [3]: 64 - [1653629930.061086][8778:8783] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFFB DataVersion: 3620435651 - [1653629930.061114][8778:8783] CHIP:TOO: AttributeList: 6 entries - [1653629930.061129][8778:8783] CHIP:TOO: [1]: 0 - [1653629930.061141][8778:8783] CHIP:TOO: [2]: 1 - [1653629930.061154][8778:8783] CHIP:TOO: [3]: 65528 - [1653629930.061167][8778:8783] CHIP:TOO: [4]: 65529 - [1653629930.061184][8778:8783] CHIP:TOO: [5]: 65531 - [1653629930.061201][8778:8783] CHIP:TOO: [6]: 65533 - [1653629930.061435][8778:8783] CHIP:EM: Sending Standalone Ack for MessageCounter:5968688 on exchange 11683i + [1653629930.057] [8778:8783] [DMG] } + [1653629930.058] [8778:8783] [TOO] Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_0000 DataVersion: 2065044836 + [1653629930.058] [8778:8783] [TOO] identify time: 0 + [1653629930.058] [8778:8783] [TOO] Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_0001 DataVersion: 2065044836 + [1653629930.058] [8778:8783] [TOO] identify type: 2 + [1653629930.058] [8778:8783] [TOO] Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFFD DataVersion: 2065044836 + [1653629930.058] [8778:8783] [TOO] ClusterRevision: 4 + [1653629930.059] [8778:8783] [TOO] Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFF8 DataVersion: 2065044836 + [1653629930.059] [8778:8783] [TOO] GeneratedCommandList: 1 entries + [1653629930.059] [8778:8783] [TOO] [1]: 0 (Identify) + [1653629930.059] [8778:8783] [TOO] Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFF9 DataVersion: 2065044836 + [1653629930.059] [8778:8783] [TOO] AcceptedCommandList: 3 entries + [1653629930.059] [8778:8783] [TOO] [1]: 0 (Identify) + [1653629930.059] [8778:8783] [TOO] [2]: 1 (Unknown) + [1653629930.059] [8778:8783] [TOO] [3]: 64 (TriggerEffect) + [1653629930.059] [8778:8783] [TOO] Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFFB DataVersion: 2065044836 + [1653629930.059] [8778:8783] [TOO] AttributeList: 6 entries + [1653629930.059] [8778:8783] [TOO] [1]: 0 (IdentifyTime) + [1653629930.060] [8778:8783] [TOO] [2]: 1 (IdentifyType) + [1653629930.060] [8778:8783] [TOO] [3]: 65528 (GeneratedCommandList) + [1653629930.060] [8778:8783] [TOO] [4]: 65529 (AcceptedCommandList) + [1653629930.060] [8778:8783] [TOO] [5]: 65531 (AttributeList) + [1653629930.060] [8778:8783] [TOO] [6]: 65533 (ClusterRevision) + [1653629930.060] [8778:8783] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_0000 DataVersion: 3620435651 + [1653629930.060] [8778:8783] [TOO] identify time: 0 + [1653629930.060] [8778:8783] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_0001 DataVersion: 3620435651 + [1653629930.060] [8778:8783] [TOO] identify type: 2 + [1653629930.060] [8778:8783] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFFD DataVersion: 3620435651 + [1653629930.060] [8778:8783] [TOO] ClusterRevision: 4 + [1653629930.060] [8778:8783] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFF8 DataVersion: 3620435651 + [1653629930.060] [8778:8783] [TOO] GeneratedCommandList: 1 entries + [1653629930.060] [8778:8783] [TOO] [1]: 0 (Identify) + [1653629930.060] [8778:8783] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFF9 DataVersion: 3620435651 + [1653629930.060] [8778:8783] [TOO] AcceptedCommandList: 3 entries + [1653629930.060] [8778:8783] [TOO] [1]: 0 (Identify) + [1653629930.060] [8778:8783] [TOO] [2]: 1 (Unknown) + [1653629930.060] [8778:8783] [TOO] [3]: 64 (TriggerEffect) + [1653629930.061] [8778:8783] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFFB DataVersion: 3620435651 + [1653629930.061] [8778:8783] [TOO] AttributeList: 6 entries + [1653629930.061] [8778:8783] [TOO] [1]: 0 (IdentifyTime) + [1653629930.061] [8778:8783] [TOO] [2]: 1 (IdentifyType) + [1653629930.061] [8778:8783] [TOO] [3]: 65528 (GeneratedCommandList) + [1653629930.061] [8778:8783] [TOO] [4]: 65529 (AcceptedCommandList) + [1653629930.061] [8778:8783] [TOO] [5]: 65531 (AttributeList) + [1653629930.061] [8778:8783] [TOO] [6]: 65533 (ClusterRevision) + [1653629930.061] [8778:8783] [EM] Sending Standalone Ack for MessageCounter:5968688 on exchange 11683i disabled: true - label: @@ -825,30 +825,29 @@ tests: Verify on TH(chip-tool), DUT is responds right attribute value for below command - [1653633965.092996][9835:9840] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_0000 DataVersion: 3620435654 - [1653633965.093041][9835:9840] CHIP:TOO: identify time: 0 - [1653633965.093120][9835:9840] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_0001 DataVersion: 3620435654 - [1653633965.093140][9835:9840] CHIP:TOO: identify type: 2 - [1653633965.093202][9835:9840] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFFD DataVersion: 3620435654 - [1653633965.093221][9835:9840] CHIP:TOO: ClusterRevision: 4 - [1653633965.093411][9835:9840] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFF8 DataVersion: 3620435654 - [1653633965.093451][9835:9840] CHIP:TOO: GeneratedCommandList: 1 entries - [1653633965.093474][9835:9840] CHIP:TOO: [1]: 0 - [1653633965.093721][9835:9840] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFF9 DataVersion: 3620435654 - [1653633965.093748][9835:9840] CHIP:TOO: AcceptedCommandList: 3 entries - [1653633965.093767][9835:9840] CHIP:TOO: [1]: 0 - [1653633965.093784][9835:9840] CHIP:TOO: [2]: 1 - [1653633965.093800][9835:9840] CHIP:TOO: [3]: 64 - [1653633965.094169][9835:9840] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFFB DataVersion: 3620435654 - [1653633965.094200][9835:9840] CHIP:TOO: AttributeList: 6 entries - [1653633965.094218][9835:9840] CHIP:TOO: [1]: 0 - [1653633965.094235][9835:9840] CHIP:TOO: [2]: 1 - [1653633965.094252][9835:9840] CHIP:TOO: [3]: 65528 - [1653633965.094269][9835:9840] CHIP:TOO: [4]: 65529 - [1653633965.094286][9835:9840] CHIP:TOO: [5]: 65531 - [1653633965.094302][9835:9840] CHIP:TOO: [6]: 65533 - [1653633965.094449][9835:9840] CHIP:EM: Sending Standalone Ack for MessageCounter:14221655 on exchange 17356i - + [1653633965.092996][9835:9840] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_0000 DataVersion: 3620435654 + [1653633965.093041][9835:9840] [TOO] identify time: 0 + [1653633965.093120][9835:9840] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_0001 DataVersion: 3620435654 + [1653633965.093140][9835:9840] [TOO] identify type: 2 + [1653633965.093202][9835:9840] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFFD DataVersion: 3620435654 + [1653633965.093221][9835:9840] [TOO] ClusterRevision: 4 + [1653633965.093411][9835:9840] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFF8 DataVersion: 3620435654 + [1653633965.093451][9835:9840] [TOO] GeneratedCommandList: 1 entries + [1653633965.093474][9835:9840] [TOO] [1]: 0 (Identify) + [1653633965.093721][9835:9840] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFF9 DataVersion: 3620435654 + [1653633965.093748][9835:9840] [TOO] AcceptedCommandList: 3 entries + [1653633965.093767][9835:9840] [TOO] [1]: 0 (Identify) + [1653633965.093784][9835:9840] [TOO] [2]: 1 (Unknown) + [1653633965.093800][9835:9840] [TOO] [3]: 64 (TriggerEffect) + [1653633965.094169][9835:9840] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFFB DataVersion: 3620435654 + [1653633965.094200][9835:9840] [TOO] AttributeList: 6 entries + [1653633965.094218][9835:9840] [TOO] [1]: 0 (IdentifyTime) + [1653633965.094235][9835:9840] [TOO] [2]: 1 (IdentifyType) + [1653633965.094252][9835:9840] [TOO] [3]: 65528 (GeneratedCommandList) + [1653633965.094269][9835:9840] [TOO] [4]: 65529 (AcceptedCommandList) + [1653633965.094286][9835:9840] [TOO] [5]: 65531 (AttributeList) + [1653633965.094302][9835:9840] [TOO] [6]: 65533 (ClusterRevision) + [1653633965.094449][9835:9840] [EM] Sending Standalone Ack for MessageCounter:14221655 on exchange 17356i ./chip-tool any write-by-id 0x03 0x00 2 1 1 @@ -884,29 +883,29 @@ tests: ./chip-tool any read-by-id 0x03 0xFFFFFFFF 1 1 --data-version 0xd7cb76c6 - [1653634117.935268][9878:9883] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_0000 DataVersion: 3620435657 - [1653634117.935294][9878:9883] CHIP:TOO: identify time: 0 - [1653634117.935322][9878:9883] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_0001 DataVersion: 3620435657 - [1653634117.935331][9878:9883] CHIP:TOO: identify type: 2 - [1653634117.935357][9878:9883] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFFD DataVersion: 3620435657 - [1653634117.935366][9878:9883] CHIP:TOO: ClusterRevision: 4 - [1653634117.935452][9878:9883] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFF8 DataVersion: 3620435657 - [1653634117.935470][9878:9883] CHIP:TOO: GeneratedCommandList: 1 entries - [1653634117.935480][9878:9883] CHIP:TOO: [1]: 0 - [1653634117.935589][9878:9883] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFF9 DataVersion: 3620435657 - [1653634117.935601][9878:9883] CHIP:TOO: AcceptedCommandList: 3 entries - [1653634117.935609][9878:9883] CHIP:TOO: [1]: 0 - [1653634117.935616][9878:9883] CHIP:TOO: [2]: 1 - [1653634117.935623][9878:9883] CHIP:TOO: [3]: 64 - [1653634117.935788][9878:9883] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFFB DataVersion: 3620435657 - [1653634117.935802][9878:9883] CHIP:TOO: AttributeList: 6 entries - [1653634117.935809][9878:9883] CHIP:TOO: [1]: 0 - [1653634117.935817][9878:9883] CHIP:TOO: [2]: 1 - [1653634117.935824][9878:9883] CHIP:TOO: [3]: 65528 - [1653634117.935831][9878:9883] CHIP:TOO: [4]: 65529 - [1653634117.935838][9878:9883] CHIP:TOO: [5]: 65531 - [1653634117.935845][9878:9883] CHIP:TOO: [6]: 65533 - [1653634117.935910][9878:9883] CHIP:EM: Sending Standalone Ack for MessageCounter:531776 on exchange 45674i + [1653634117.935268][9878:9883] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_0000 DataVersion: 3620435657 + [1653634117.935294][9878:9883] [TOO] identify time: 0 + [1653634117.935322][9878:9883] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_0001 DataVersion: 3620435657 + [1653634117.935331][9878:9883] [TOO] identify type: 2 + [1653634117.935357][9878:9883] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFFD DataVersion: 3620435657 + [1653634117.935366][9878:9883] [TOO] ClusterRevision: 4 + [1653634117.935452][9878:9883] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFF8 DataVersion: 3620435657 + [1653634117.935470][9878:9883] [TOO] GeneratedCommandList: 1 entries + [1653634117.935480][9878:9883] [TOO] [1]: 0 (Identify) + [1653634117.935589][9878:9883] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFF9 DataVersion: 3620435657 + [1653634117.935601][9878:9883] [TOO] AcceptedCommandList: 3 entries + [1653634117.935609][9878:9883] [TOO] [1]: 0 (Identify) + [1653634117.935616][9878:9883] [TOO] [2]: 1 (Unknown) + [1653634117.935623][9878:9883] [TOO] [3]: 64 (TriggerEffect) + [1653634117.935788][9878:9883] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFFB DataVersion: 3620435657 + [1653634117.935802][9878:9883] [TOO] AttributeList: 6 entries + [1653634117.935809][9878:9883] [TOO] [1]: 0 (IdentifyTime) + [1653634117.935817][9878:9883] [TOO] [2]: 1 (IdentifyType) + [1653634117.935824][9878:9883] [TOO] [3]: 65528 (GeneratedCommandList) + [1653634117.935831][9878:9883] [TOO] [4]: 65529 (AcceptedCommandList) + [1653634117.935838][9878:9883] [TOO] [5]: 65531 (AttributeList) + [1653634117.935845][9878:9883] [TOO] [6]: 65533 (ClusterRevision) + [1653634117.935910][9878:9883] [EM] Sending Standalone Ack for MessageCounter:531776 on exchange 45674i disabled: true - label: @@ -1000,55 +999,55 @@ tests: ./chip-tool any read-by-id 0x03 0xFFFFFFFF 1 1 - [1653634446.678378][9962:9967] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_0000 DataVersion: 3620435660 - [1653634446.678404][9962:9967] CHIP:TOO: identify time: 0 - [1653634446.678437][9962:9967] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_0001 DataVersion: 3620435660 - [1653634446.678447][9962:9967] CHIP:TOO: identify type: 2 - [1653634446.678474][9962:9967] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFFD DataVersion: 3620435660 - [1653634446.678483][9962:9967] CHIP:TOO: ClusterRevision: 4 - [1653634446.678570][9962:9967] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFF8 DataVersion: 3620435660 - [1653634446.678584][9962:9967] CHIP:TOO: GeneratedCommandList: 1 entries - [1653634446.678594][9962:9967] CHIP:TOO: [1]: 0 - [1653634446.678767][9962:9967] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFF9 DataVersion: 3620435660 - [1653634446.678780][9962:9967] CHIP:TOO: AcceptedCommandList: 3 entries - [1653634446.678789][9962:9967] CHIP:TOO: [1]: 0 - [1653634446.678796][9962:9967] CHIP:TOO: [2]: 1 - [1653634446.678805][9962:9967] CHIP:TOO: [3]: 64 - [1653634446.678998][9962:9967] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFFB DataVersion: 3620435660 - [1653634446.679017][9962:9967] CHIP:TOO: AttributeList: 6 entries - [1653634446.679024][9962:9967] CHIP:TOO: [1]: 0 - [1653634446.679030][9962:9967] CHIP:TOO: [2]: 1 - [1653634446.679036][9962:9967] CHIP:TOO: [3]: 65528 - [1653634446.679042][9962:9967] CHIP:TOO: [4]: 65529 - [1653634446.679048][9962:9967] CHIP:TOO: [5]: 65531 - [1653634446.679055][9962:9967] CHIP:TOO: [6]: 65533 - [1653634446.679129][9962:9967] CHIP:EM: Sending Standalone Ack for MessageCounter:15830359 on exchange 10739i + [1653634446.678378] [9962:9967] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_0000 DataVersion: 3620435660 + [1653634446.678404] [9962:9967] [TOO] identify time: 0 + [1653634446.678437] [9962:9967] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_0001 DataVersion: 3620435660 + [1653634446.678447] [9962:9967] [TOO] identify type: 2 + [1653634446.678474] [9962:9967] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFFD DataVersion: 3620435660 + [1653634446.678483] [9962:9967] [TOO] ClusterRevision: 4 + [1653634446.678570] [9962:9967] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFF8 DataVersion: 3620435660 + [1653634446.678584] [9962:9967] [TOO] GeneratedCommandList: 1 entries + [1653634446.678594] [9962:9967] [TOO] [1]: 0 (Identify) + [1653634446.678767] [9962:9967] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFF9 DataVersion: 3620435660 + [1653634446.678780] [9962:9967] [TOO] AcceptedCommandList: 3 entries + [1653634446.678789] [9962:9967] [TOO] [1]: 0 (Identify) + [1653634446.678796] [9962:9967] [TOO] [2]: 1 (Unknown) + [1653634446.678805] [9962:9967] [TOO] [3]: 64 (TriggerEffect) + [1653634446.678998] [9962:9967] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFFB DataVersion: 3620435660 + [1653634446.679017] [9962:9967] [TOO] AttributeList: 6 entries + [1653634446.679024] [9962:9967] [TOO] [1]: 0 (IdentifyTime) + [1653634446.679030] [9962:9967] [TOO] [2]: 1 (IdentifyType) + [1653634446.679036] [9962:9967] [TOO] [3]: 65528 (GeneratedCommandList) + [1653634446.679042] [9962:9967] [TOO] [4]: 65529 (AcceptedCommandList) + [1653634446.679048] [9962:9967] [TOO] [5]: 65531 (AttributeList) + [1653634446.679055] [9962:9967] [TOO] [6]: 65533 (ClusterRevision) + [1653634446.679129] [9962:9967] [EM] Sending Standalone Ack for MessageCounter:15830359 on exchange 10739i ./chip-tool levelcontrol read-by-id 0xFFFFFFFF 1 1 --data-version 0xd7cb76cc (Here given data version received for identify cluster) - [1653634568.902390][9990:9995] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0008 Attribute 0x0000_FFFB DataVersion: 199562416 - [1653634568.902417][9990:9995] CHIP:TOO: AttributeList: 19 entries - [1653634568.902428][9990:9995] CHIP:TOO: [1]: 0 - [1653634568.902436][9990:9995] CHIP:TOO: [2]: 1 - [1653634568.902444][9990:9995] CHIP:TOO: [3]: 2 - [1653634568.902451][9990:9995] CHIP:TOO: [4]: 3 - [1653634568.902458][9990:9995] CHIP:TOO: [5]: 4 - [1653634568.902466][9990:9995] CHIP:TOO: [6]: 5 - [1653634568.902475][9990:9995] CHIP:TOO: [7]: 6 - [1653634568.902483][9990:9995] CHIP:TOO: [8]: 15 - [1653634568.902490][9990:9995] CHIP:TOO: [9]: 16 - [1653634568.902498][9990:9995] CHIP:TOO: [10]: 17 - [1653634568.902506][9990:9995] CHIP:TOO: [11]: 18 - [1653634568.902513][9990:9995] CHIP:TOO: [12]: 19 - [1653634568.902520][9990:9995] CHIP:TOO: [13]: 20 - [1653634568.902528][9990:9995] CHIP:TOO: [14]: 16384 - [1653634568.902535][9990:9995] CHIP:TOO: [15]: 65528 - [1653634568.902542][9990:9995] CHIP:TOO: [16]: 65529 - [1653634568.902550][9990:9995] CHIP:TOO: [17]: 65531 - [1653634568.902557][9990:9995] CHIP:TOO: [18]: 65532 - [1653634568.902565][9990:9995] CHIP:TOO: [19]: 65533 - [1653634568.902621][9990:9995] CHIP:EM: Sending Standalone Ack for MessageCounter:3712616 on exchange 9501 + [1653634568.902390] [9990:9995] [TOO] Endpoint: 1 Cluster: 0x0000_0008 Attribute 0x0000_FFFB DataVersion: 199562416 + [1653634568.902417] [9990:9995] [TOO] AttributeList: 19 entries + [1653634568.902428] [9990:9995] [TOO] [1]: 0 (CurrentLevel) + [1653634568.902436] [9990:9995] [TOO] [2]: 1 (RemainingTime) + [1653634568.902444] [9990:9995] [TOO] [3]: 2 (MinLevel) + [1653634568.902451] [9990:9995] [TOO] [4]: 3 (MaxLevel) + [1653634568.902458] [9990:9995] [TOO] [5]: 4 (CurrentFrequency) + [1653634568.902466] [9990:9995] [TOO] [6]: 5 (MinFrequency) + [1653634568.902475] [9990:9995] [TOO] [7]: 6 (MaxFrequency) + [1653634568.902483] [9990:9995] [TOO] [8]: 15 (Options) + [1653634568.902490] [9990:9995] [TOO] [9]: 16 (OnOffTransitionTime) + [1653634568.902498] [9990:9995] [TOO] [10]: 17 (OnLevel) + [1653634568.902506] [9990:9995] [TOO] [11]: 18 (OnTransitionTime) + [1653634568.902513] [9990:9995] [TOO] [12]: 19 (OffTransitionTime) + [1653634568.902520] [9990:9995] [TOO] [13]: 20 (DefaultMoveRate) + [1653634568.902528] [9990:9995] [TOO] [14]: 16384 (StartUpCurrentLevel) + [1653634568.902535] [9990:9995] [TOO] [15]: 65528 (GeneratedCommandList) + [1653634568.902542] [9990:9995] [TOO] [16]: 65529 (AcceptedCommandList) + [1653634568.902550] [9990:9995] [TOO] [17]: 65531 (AttributeList) + [1653634568.902557] [9990:9995] [TOO] [18]: 65532 (FeatureMap) + [1653634568.902565] [9990:9995] [TOO] [19]: 65533 (ClusterRevision) + [1653634568.902621] [9990:9995] [EM] Sending Standalone Ack for MessageCounter:3712616 on exchange 9501 disabled: true - label: @@ -1166,53 +1165,52 @@ tests: Verify that there are no errors sent back for attributes the TH has no access to. - [1659422360.478947][2049:2054] CHIP:DMG: } - [1659422360.479556][2049:2054] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0000 DataVersion: 3949809681 - [1659422360.479619][2049:2054] CHIP:TOO: ACL: 1 entries - [1659422360.479679][2049:2054] CHIP:TOO: [1]: { - [1659422360.479706][2049:2054] CHIP:TOO: Privilege: 5 - [1659422360.479729][2049:2054] CHIP:TOO: AuthMode: 2 - [1659422360.479768][2049:2054] CHIP:TOO: Subjects: 2 entries - [1659422360.479819][2049:2054] CHIP:TOO: [1]: 1 - [1659422360.479847][2049:2054] CHIP:TOO: [2]: 112233 - [1659422360.479876][2049:2054] CHIP:TOO: Targets: 1 entries - [1659422360.479925][2049:2054] CHIP:TOO: [1]: { - [1659422360.479969][2049:2054] CHIP:TOO: Cluster: 31 - [1659422360.479993][2049:2054] CHIP:TOO: Endpoint: 0 - [1659422360.480016][2049:2054] CHIP:TOO: DeviceType: null - [1659422360.480038][2049:2054] CHIP:TOO: } - [1659422360.480062][2049:2054] CHIP:TOO: FabricIndex: 1 - [1659422360.480085][2049:2054] CHIP:TOO: } - [1659422360.480165][2049:2054] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0001 DataVersion: 3949809681 - [1659422360.480197][2049:2054] CHIP:TOO: Extension: 0 entries - [1659422360.480225][2049:2054] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0002 DataVersion: 3949809681 - [1659422360.480251][2049:2054] CHIP:TOO: SubjectsPerAccessControlEntry: 4 - [1659422360.480311][2049:2054] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0003 DataVersion: 3949809681 - [1659422360.480337][2049:2054] CHIP:TOO: TargetsPerAccessControlEntry: 3 - [1659422360.480395][2049:2054] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0004 DataVersion: 3949809681 - [1659422360.480421][2049:2054] CHIP:TOO: AccessControlEntriesPerFabric: 3 - [1659422360.480479][2049:2054] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_FFFC DataVersion: 3949809681 - [1659422360.480505][2049:2054] CHIP:TOO: FeatureMap: 0 - [1659422360.480563][2049:2054] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_FFFD DataVersion: 3949809681 - [1659422360.480588][2049:2054] CHIP:TOO: ClusterRevision: 1 - [1659422360.480690][2049:2054] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_FFF8 DataVersion: 3949809681 - [1659422360.480721][2049:2054] CHIP:TOO: GeneratedCommandList: 0 entries - [1659422360.480789][2049:2054] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_FFF9 DataVersion: 3949809681 - [1659422360.480818][2049:2054] CHIP:TOO: AcceptedCommandList: 0 entries - [1659422360.481269][2049:2054] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_FFFB DataVersion: 3949809681 - [1659422360.481307][2049:2054] CHIP:TOO: AttributeList: 10 entries - [1659422360.481334][2049:2054] CHIP:TOO: [1]: 0 - [1659422360.481359][2049:2054] CHIP:TOO: [2]: 1 - [1659422360.481383][2049:2054] CHIP:TOO: [3]: 2 - [1659422360.481408][2049:2054] CHIP:TOO: [4]: 3 - [1659422360.481432][2049:2054] CHIP:TOO: [5]: 4 - [1659422360.481457][2049:2054] CHIP:TOO: [6]: 65528 - [1659422360.481482][2049:2054] CHIP:TOO: [7]: 65529 - [1659422360.481506][2049:2054] CHIP:TOO: [8]: 65531 - [1659422360.481531][2049:2054] CHIP:TOO: [9]: 65532 - [1659422360.481556][2049:2054] CHIP:TOO: [10]: 65533 - [1659422360.481706][2049:2054] CHIP:EM: Sending Standalone Ack for MessageCounter:183166533 on exchange 17693i - + [1659422360.478947][2049:2054] [DMG] } + [1659422360.479556][2049:2054] [TOO] Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0000 DataVersion: 3949809681 + [1659422360.479619][2049:2054] [TOO] ACL: 1 entries + [1659422360.479679][2049:2054] [TOO] [1]: { + [1659422360.479706][2049:2054] [TOO] Privilege: 5 + [1659422360.479729][2049:2054] [TOO] AuthMode: 2 + [1659422360.479768][2049:2054] [TOO] Subjects: 2 entries + [1659422360.479819][2049:2054] [TOO] [1]: 1 + [1659422360.479847][2049:2054] [TOO] [2]: 112233 + [1659422360.479876][2049:2054] [TOO] Targets: 1 entries + [1659422360.479925][2049:2054] [TOO] [1]: { + [1659422360.479969][2049:2054] [TOO] Cluster: 31 + [1659422360.479993][2049:2054] [TOO] Endpoint: 0 + [1659422360.480016][2049:2054] [TOO] DeviceType: null + [1659422360.480038][2049:2054] [TOO] } + [1659422360.480062][2049:2054] [TOO] FabricIndex: 1 + [1659422360.480085][2049:2054] [TOO] } + [1659422360.480165][2049:2054] [TOO] Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0001 DataVersion: 3949809681 + [1659422360.480197][2049:2054] [TOO] Extension: 0 entries + [1659422360.480225][2049:2054] [TOO] Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0002 DataVersion: 3949809681 + [1659422360.480251][2049:2054] [TOO] SubjectsPerAccessControlEntry: 4 + [1659422360.480311][2049:2054] [TOO] Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0003 DataVersion: 3949809681 + [1659422360.480337][2049:2054] [TOO] TargetsPerAccessControlEntry: 3 + [1659422360.480395][2049:2054] [TOO] Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0004 DataVersion: 3949809681 + [1659422360.480421][2049:2054] [TOO] AccessControlEntriesPerFabric: 3 + [1659422360.480479][2049:2054] [TOO] Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_FFFC DataVersion: 3949809681 + [1659422360.480505][2049:2054] [TOO] FeatureMap: 0 + [1659422360.480563][2049:2054] [TOO] Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_FFFD DataVersion: 3949809681 + [1659422360.480588][2049:2054] [TOO] ClusterRevision: 1 + [1659422360.480690][2049:2054] [TOO] Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_FFF8 DataVersion: 3949809681 + [1659422360.480721][2049:2054] [TOO] GeneratedCommandList: 0 entries + [1659422360.480789][2049:2054] [TOO] Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_FFF9 DataVersion: 3949809681 + [1659422360.480818][2049:2054] [TOO] AcceptedCommandList: 0 entries + [1659422360.481269][2049:2054] [TOO] Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_FFFB DataVersion: 3949809681 + [1659422360.481307][2049:2054] [TOO] AttributeList: 10 entries + [1659422360.481334][2049:2054] [TOO] [1]: 0 (NOCs) + [1659422360.481359][2049:2054] [TOO] [2]: 1 (Fabrics) + [1659422360.481383][2049:2054] [TOO] [3]: 2 (SupportedFabrics) + [1659422360.481408][2049:2054] [TOO] [4]: 3 (CommissionedFabrics) + [1659422360.481432][2049:2054] [TOO] [5]: 4 (TrustedRootCertificates) + [1659422360.481457][2049:2054] [TOO] [6]: 65528 (GeneratedCommandList) + [1659422360.481482][2049:2054] [TOO] [7]: 65529 (AcceptedCommandList) + [1659422360.481506][2049:2054] [TOO] [8]: 65531 (AttributeList) + [1659422360.481531][2049:2054] [TOO] [9]: 65532 (FeatureMap) + [1659422360.481556][2049:2054] [TOO] [10]: 65533 (ClusterRevision) + [1659422360.481706][2049:2054] [EM] Sending Standalone Ack for MessageCounter:183166533 on exchange 17693i With the above command, we are overwriting the default privilege that chip-tool has as an admin. After this test step you need to send below mentioned command to Grant access to all clusters again. diff --git a/src/app/tests/suites/certification/Test_TC_WAKEONLAN_4_1.yaml b/src/app/tests/suites/certification/Test_TC_WAKEONLAN_4_1.yaml index eb36c1a41801d4..fc3f6674683683 100644 --- a/src/app/tests/suites/certification/Test_TC_WAKEONLAN_4_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_WAKEONLAN_4_1.yaml @@ -55,10 +55,10 @@ tests: ./chip-tv-casting-app lowpower read accepted-command-list 1 1 On TH Verify that the DUT is no longer in a low-power state by sending above command - [1654248854.491911][3652:3657] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0508 Attribute 0x0000_FFF9 DataVersion: 2125568804 - [1654248854.491994][3652:3657] CHIP:TOO: AcceptedCommandList: 1 entries - [1654248854.492040][3652:3657] CHIP:TOO: [1]: 0 - [1654248854.492157][3652:3657] CHIP:EM: Sending Standalone Ack for MessageCounter:15063522 on exchange 51389i + [1654248854.491911][3652:3657] [TOO] Endpoint: 1 Cluster: 0x0000_0508 Attribute 0x0000_FFF9 DataVersion: 2125568804 + [1654248854.491994][3652:3657] [TOO] AcceptedCommandList: 1 entries + [1654248854.492040][3652:3657] [TOO] [1]: 0 (Sleep) + [1654248854.492157][3652:3657] [EM] Sending Standalone Ack for MessageCounter:15063522 on exchange 51389i cluster: "LogCommands" command: "UserPrompt" PICS: PICS_USER_PROMPT diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index 12382e3cb41495..3d40f3897e852b 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -8952,12 +8952,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Identify::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Identify::Id); } case Identify::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Identify::Id); } case Identify::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -8967,7 +8967,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Identify::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, Identify::Id); } case Identify::Attributes::FeatureMap::Id: { uint32_t value; @@ -8993,12 +8993,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Groups::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Groups::Id); } case Groups::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Groups::Id); } case Groups::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9008,7 +9008,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Groups::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, Groups::Id); } case Groups::Attributes::FeatureMap::Id: { uint32_t value; @@ -9054,12 +9054,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OnOff::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, OnOff::Id); } case OnOff::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, OnOff::Id); } case OnOff::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9069,7 +9069,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OnOff::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, OnOff::Id); } case OnOff::Attributes::FeatureMap::Id: { uint32_t value; @@ -9100,12 +9100,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OnOffSwitchConfiguration::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, OnOffSwitchConfiguration::Id); } case OnOffSwitchConfiguration::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, OnOffSwitchConfiguration::Id); } case OnOffSwitchConfiguration::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9115,7 +9115,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OnOffSwitchConfiguration::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, OnOffSwitchConfiguration::Id); } case OnOffSwitchConfiguration::Attributes::FeatureMap::Id: { uint32_t value; @@ -9206,12 +9206,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case LevelControl::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, LevelControl::Id); } case LevelControl::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, LevelControl::Id); } case LevelControl::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9221,7 +9221,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case LevelControl::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, LevelControl::Id); } case LevelControl::Attributes::FeatureMap::Id: { uint32_t value; @@ -9287,12 +9287,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case BinaryInputBasic::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, BinaryInputBasic::Id); } case BinaryInputBasic::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, BinaryInputBasic::Id); } case BinaryInputBasic::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9302,7 +9302,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case BinaryInputBasic::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, BinaryInputBasic::Id); } case BinaryInputBasic::Attributes::FeatureMap::Id: { uint32_t value; @@ -9323,12 +9323,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case PulseWidthModulation::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, PulseWidthModulation::Id); } case PulseWidthModulation::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, PulseWidthModulation::Id); } case PulseWidthModulation::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9338,7 +9338,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case PulseWidthModulation::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, PulseWidthModulation::Id); } case PulseWidthModulation::Attributes::FeatureMap::Id: { uint32_t value; @@ -9364,12 +9364,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Descriptor::Attributes::ServerList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ServerList", 1, value); + return DataModelLogger::LogClusterId("ServerList", 1, value); } case Descriptor::Attributes::ClientList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ClientList", 1, value); + return DataModelLogger::LogClusterId("ClientList", 1, value); } case Descriptor::Attributes::PartsList::Id: { chip::app::DataModel::DecodableList value; @@ -9384,12 +9384,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Descriptor::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Descriptor::Id); } case Descriptor::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Descriptor::Id); } case Descriptor::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9399,7 +9399,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Descriptor::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, Descriptor::Id); } case Descriptor::Attributes::FeatureMap::Id: { uint32_t value; @@ -9425,12 +9425,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Binding::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Binding::Id); } case Binding::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Binding::Id); } case Binding::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9440,7 +9440,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Binding::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, Binding::Id); } case Binding::Attributes::FeatureMap::Id: { uint32_t value; @@ -9504,12 +9504,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case AccessControl::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, AccessControl::Id); } case AccessControl::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, AccessControl::Id); } case AccessControl::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9519,7 +9519,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case AccessControl::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, AccessControl::Id); } case AccessControl::Attributes::FeatureMap::Id: { uint32_t value; @@ -9555,12 +9555,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Actions::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Actions::Id); } case Actions::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Actions::Id); } case Actions::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9570,7 +9570,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Actions::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, Actions::Id); } case Actions::Attributes::FeatureMap::Id: { uint32_t value; @@ -9706,12 +9706,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case BasicInformation::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, BasicInformation::Id); } case BasicInformation::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, BasicInformation::Id); } case BasicInformation::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9721,7 +9721,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case BasicInformation::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, BasicInformation::Id); } case BasicInformation::Attributes::FeatureMap::Id: { uint32_t value; @@ -9742,12 +9742,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OtaSoftwareUpdateProvider::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, OtaSoftwareUpdateProvider::Id); } case OtaSoftwareUpdateProvider::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, OtaSoftwareUpdateProvider::Id); } case OtaSoftwareUpdateProvider::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9757,7 +9757,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OtaSoftwareUpdateProvider::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, OtaSoftwareUpdateProvider::Id); } case OtaSoftwareUpdateProvider::Attributes::FeatureMap::Id: { uint32_t value; @@ -9800,12 +9800,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OtaSoftwareUpdateRequestor::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, OtaSoftwareUpdateRequestor::Id); } case OtaSoftwareUpdateRequestor::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, OtaSoftwareUpdateRequestor::Id); } case OtaSoftwareUpdateRequestor::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9815,7 +9815,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OtaSoftwareUpdateRequestor::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, OtaSoftwareUpdateRequestor::Id); } case OtaSoftwareUpdateRequestor::Attributes::FeatureMap::Id: { uint32_t value; @@ -9846,12 +9846,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case LocalizationConfiguration::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, LocalizationConfiguration::Id); } case LocalizationConfiguration::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, LocalizationConfiguration::Id); } case LocalizationConfiguration::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9861,7 +9861,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case LocalizationConfiguration::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, LocalizationConfiguration::Id); } case LocalizationConfiguration::Attributes::FeatureMap::Id: { uint32_t value; @@ -9897,12 +9897,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case TimeFormatLocalization::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, TimeFormatLocalization::Id); } case TimeFormatLocalization::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, TimeFormatLocalization::Id); } case TimeFormatLocalization::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9912,7 +9912,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case TimeFormatLocalization::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, TimeFormatLocalization::Id); } case TimeFormatLocalization::Attributes::FeatureMap::Id: { uint32_t value; @@ -9938,12 +9938,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case UnitLocalization::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, UnitLocalization::Id); } case UnitLocalization::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, UnitLocalization::Id); } case UnitLocalization::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9953,7 +9953,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case UnitLocalization::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, UnitLocalization::Id); } case UnitLocalization::Attributes::FeatureMap::Id: { uint32_t value; @@ -9979,12 +9979,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case PowerSourceConfiguration::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, PowerSourceConfiguration::Id); } case PowerSourceConfiguration::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, PowerSourceConfiguration::Id); } case PowerSourceConfiguration::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9994,7 +9994,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case PowerSourceConfiguration::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, PowerSourceConfiguration::Id); } case PowerSourceConfiguration::Attributes::FeatureMap::Id: { uint32_t value; @@ -10175,12 +10175,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case PowerSource::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, PowerSource::Id); } case PowerSource::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, PowerSource::Id); } case PowerSource::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -10190,7 +10190,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case PowerSource::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, PowerSource::Id); } case PowerSource::Attributes::FeatureMap::Id: { uint32_t value; @@ -10256,12 +10256,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case GeneralCommissioning::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, GeneralCommissioning::Id); } case GeneralCommissioning::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, GeneralCommissioning::Id); } case GeneralCommissioning::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -10271,7 +10271,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case GeneralCommissioning::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, GeneralCommissioning::Id); } case GeneralCommissioning::Attributes::FeatureMap::Id: { uint32_t value; @@ -10349,12 +10349,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case NetworkCommissioning::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, NetworkCommissioning::Id); } case NetworkCommissioning::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, NetworkCommissioning::Id); } case NetworkCommissioning::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -10364,7 +10364,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case NetworkCommissioning::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, NetworkCommissioning::Id); } case NetworkCommissioning::Attributes::FeatureMap::Id: { uint32_t value; @@ -10385,12 +10385,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case DiagnosticLogs::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, DiagnosticLogs::Id); } case DiagnosticLogs::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, DiagnosticLogs::Id); } case DiagnosticLogs::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -10400,7 +10400,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case DiagnosticLogs::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, DiagnosticLogs::Id); } case DiagnosticLogs::Attributes::FeatureMap::Id: { uint32_t value; @@ -10467,12 +10467,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case GeneralDiagnostics::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, GeneralDiagnostics::Id); } case GeneralDiagnostics::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, GeneralDiagnostics::Id); } case GeneralDiagnostics::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -10482,7 +10482,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case GeneralDiagnostics::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, GeneralDiagnostics::Id); } case GeneralDiagnostics::Attributes::FeatureMap::Id: { uint32_t value; @@ -10525,12 +10525,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case SoftwareDiagnostics::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, SoftwareDiagnostics::Id); } case SoftwareDiagnostics::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, SoftwareDiagnostics::Id); } case SoftwareDiagnostics::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -10540,7 +10540,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case SoftwareDiagnostics::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, SoftwareDiagnostics::Id); } case SoftwareDiagnostics::Attributes::FeatureMap::Id: { uint32_t value; @@ -10883,12 +10883,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ThreadNetworkDiagnostics::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ThreadNetworkDiagnostics::Id); } case ThreadNetworkDiagnostics::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ThreadNetworkDiagnostics::Id); } case ThreadNetworkDiagnostics::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -10898,7 +10898,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ThreadNetworkDiagnostics::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ThreadNetworkDiagnostics::Id); } case ThreadNetworkDiagnostics::Attributes::FeatureMap::Id: { uint32_t value; @@ -10984,12 +10984,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case WiFiNetworkDiagnostics::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, WiFiNetworkDiagnostics::Id); } case WiFiNetworkDiagnostics::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, WiFiNetworkDiagnostics::Id); } case WiFiNetworkDiagnostics::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -10999,7 +10999,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case WiFiNetworkDiagnostics::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, WiFiNetworkDiagnostics::Id); } case WiFiNetworkDiagnostics::Attributes::FeatureMap::Id: { uint32_t value; @@ -11065,12 +11065,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case EthernetNetworkDiagnostics::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, EthernetNetworkDiagnostics::Id); } case EthernetNetworkDiagnostics::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, EthernetNetworkDiagnostics::Id); } case EthernetNetworkDiagnostics::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -11080,7 +11080,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case EthernetNetworkDiagnostics::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, EthernetNetworkDiagnostics::Id); } case EthernetNetworkDiagnostics::Attributes::FeatureMap::Id: { uint32_t value; @@ -11170,12 +11170,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case TimeSynchronization::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, TimeSynchronization::Id); } case TimeSynchronization::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, TimeSynchronization::Id); } case TimeSynchronization::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -11185,7 +11185,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case TimeSynchronization::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, TimeSynchronization::Id); } case TimeSynchronization::Attributes::FeatureMap::Id: { uint32_t value; @@ -11291,12 +11291,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case BridgedDeviceBasicInformation::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, BridgedDeviceBasicInformation::Id); } case BridgedDeviceBasicInformation::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, BridgedDeviceBasicInformation::Id); } case BridgedDeviceBasicInformation::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -11306,7 +11306,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case BridgedDeviceBasicInformation::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, BridgedDeviceBasicInformation::Id); } case BridgedDeviceBasicInformation::Attributes::FeatureMap::Id: { uint32_t value; @@ -11342,12 +11342,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Switch::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Switch::Id); } case Switch::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Switch::Id); } case Switch::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -11357,7 +11357,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Switch::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, Switch::Id); } case Switch::Attributes::FeatureMap::Id: { uint32_t value; @@ -11393,12 +11393,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case AdministratorCommissioning::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, AdministratorCommissioning::Id); } case AdministratorCommissioning::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, AdministratorCommissioning::Id); } case AdministratorCommissioning::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -11408,7 +11408,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case AdministratorCommissioning::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, AdministratorCommissioning::Id); } case AdministratorCommissioning::Attributes::FeatureMap::Id: { uint32_t value; @@ -11462,12 +11462,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OperationalCredentials::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, OperationalCredentials::Id); } case OperationalCredentials::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, OperationalCredentials::Id); } case OperationalCredentials::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -11477,7 +11477,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OperationalCredentials::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, OperationalCredentials::Id); } case OperationalCredentials::Attributes::FeatureMap::Id: { uint32_t value; @@ -11520,12 +11520,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case GroupKeyManagement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, GroupKeyManagement::Id); } case GroupKeyManagement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, GroupKeyManagement::Id); } case GroupKeyManagement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -11535,7 +11535,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case GroupKeyManagement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, GroupKeyManagement::Id); } case GroupKeyManagement::Attributes::FeatureMap::Id: { uint32_t value; @@ -11561,12 +11561,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case FixedLabel::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, FixedLabel::Id); } case FixedLabel::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, FixedLabel::Id); } case FixedLabel::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -11576,7 +11576,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case FixedLabel::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, FixedLabel::Id); } case FixedLabel::Attributes::FeatureMap::Id: { uint32_t value; @@ -11602,12 +11602,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case UserLabel::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, UserLabel::Id); } case UserLabel::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, UserLabel::Id); } case UserLabel::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -11617,7 +11617,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case UserLabel::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, UserLabel::Id); } case UserLabel::Attributes::FeatureMap::Id: { uint32_t value; @@ -11638,12 +11638,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ProxyConfiguration::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ProxyConfiguration::Id); } case ProxyConfiguration::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ProxyConfiguration::Id); } case ProxyConfiguration::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -11653,7 +11653,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ProxyConfiguration::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ProxyConfiguration::Id); } case ProxyConfiguration::Attributes::FeatureMap::Id: { uint32_t value; @@ -11674,12 +11674,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ProxyDiscovery::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ProxyDiscovery::Id); } case ProxyDiscovery::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ProxyDiscovery::Id); } case ProxyDiscovery::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -11689,7 +11689,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ProxyDiscovery::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ProxyDiscovery::Id); } case ProxyDiscovery::Attributes::FeatureMap::Id: { uint32_t value; @@ -11710,12 +11710,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ProxyValid::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ProxyValid::Id); } case ProxyValid::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ProxyValid::Id); } case ProxyValid::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -11725,7 +11725,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ProxyValid::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ProxyValid::Id); } case ProxyValid::Attributes::FeatureMap::Id: { uint32_t value; @@ -11751,12 +11751,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case BooleanState::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, BooleanState::Id); } case BooleanState::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, BooleanState::Id); } case BooleanState::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -11766,7 +11766,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case BooleanState::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, BooleanState::Id); } case BooleanState::Attributes::FeatureMap::Id: { uint32_t value; @@ -11839,12 +11839,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case IcdManagement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, IcdManagement::Id); } case IcdManagement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, IcdManagement::Id); } case IcdManagement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -11854,7 +11854,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case IcdManagement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, IcdManagement::Id); } case IcdManagement::Attributes::FeatureMap::Id: { uint32_t value; @@ -11890,12 +11890,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Timer::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Timer::Id); } case Timer::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Timer::Id); } case Timer::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -11905,7 +11905,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Timer::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, Timer::Id); } case Timer::Attributes::FeatureMap::Id: { uint32_t value; @@ -11958,12 +11958,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OvenCavityOperationalState::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, OvenCavityOperationalState::Id); } case OvenCavityOperationalState::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, OvenCavityOperationalState::Id); } case OvenCavityOperationalState::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -11973,7 +11973,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OvenCavityOperationalState::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, OvenCavityOperationalState::Id); } case OvenCavityOperationalState::Attributes::FeatureMap::Id: { uint32_t value; @@ -12014,12 +12014,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OvenMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, OvenMode::Id); } case OvenMode::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, OvenMode::Id); } case OvenMode::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12029,7 +12029,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OvenMode::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, OvenMode::Id); } case OvenMode::Attributes::FeatureMap::Id: { uint32_t value; @@ -12060,12 +12060,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case LaundryDryerControls::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, LaundryDryerControls::Id); } case LaundryDryerControls::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, LaundryDryerControls::Id); } case LaundryDryerControls::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12075,7 +12075,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case LaundryDryerControls::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, LaundryDryerControls::Id); } case LaundryDryerControls::Attributes::FeatureMap::Id: { uint32_t value; @@ -12126,12 +12126,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ModeSelect::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ModeSelect::Id); } case ModeSelect::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ModeSelect::Id); } case ModeSelect::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12141,7 +12141,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ModeSelect::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ModeSelect::Id); } case ModeSelect::Attributes::FeatureMap::Id: { uint32_t value; @@ -12183,12 +12183,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case LaundryWasherMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, LaundryWasherMode::Id); } case LaundryWasherMode::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, LaundryWasherMode::Id); } case LaundryWasherMode::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12198,7 +12198,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case LaundryWasherMode::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, LaundryWasherMode::Id); } case LaundryWasherMode::Attributes::FeatureMap::Id: { uint32_t value; @@ -12241,12 +12241,14 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case RefrigeratorAndTemperatureControlledCabinetMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, + RefrigeratorAndTemperatureControlledCabinetMode::Id); } case RefrigeratorAndTemperatureControlledCabinetMode::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, + RefrigeratorAndTemperatureControlledCabinetMode::Id); } case RefrigeratorAndTemperatureControlledCabinetMode::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12256,7 +12258,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case RefrigeratorAndTemperatureControlledCabinetMode::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, RefrigeratorAndTemperatureControlledCabinetMode::Id); } case RefrigeratorAndTemperatureControlledCabinetMode::Attributes::FeatureMap::Id: { uint32_t value; @@ -12297,12 +12299,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case LaundryWasherControls::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, LaundryWasherControls::Id); } case LaundryWasherControls::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, LaundryWasherControls::Id); } case LaundryWasherControls::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12312,7 +12314,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case LaundryWasherControls::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, LaundryWasherControls::Id); } case LaundryWasherControls::Attributes::FeatureMap::Id: { uint32_t value; @@ -12343,12 +12345,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case RvcRunMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, RvcRunMode::Id); } case RvcRunMode::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, RvcRunMode::Id); } case RvcRunMode::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12358,7 +12360,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case RvcRunMode::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, RvcRunMode::Id); } case RvcRunMode::Attributes::FeatureMap::Id: { uint32_t value; @@ -12389,12 +12391,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case RvcCleanMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, RvcCleanMode::Id); } case RvcCleanMode::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, RvcCleanMode::Id); } case RvcCleanMode::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12404,7 +12406,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case RvcCleanMode::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, RvcCleanMode::Id); } case RvcCleanMode::Attributes::FeatureMap::Id: { uint32_t value; @@ -12455,12 +12457,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case TemperatureControl::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, TemperatureControl::Id); } case TemperatureControl::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, TemperatureControl::Id); } case TemperatureControl::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12470,7 +12472,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case TemperatureControl::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, TemperatureControl::Id); } case TemperatureControl::Attributes::FeatureMap::Id: { uint32_t value; @@ -12506,12 +12508,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case RefrigeratorAlarm::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, RefrigeratorAlarm::Id); } case RefrigeratorAlarm::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, RefrigeratorAlarm::Id); } case RefrigeratorAlarm::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12521,7 +12523,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case RefrigeratorAlarm::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, RefrigeratorAlarm::Id); } case RefrigeratorAlarm::Attributes::FeatureMap::Id: { uint32_t value; @@ -12563,12 +12565,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case DishwasherMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, DishwasherMode::Id); } case DishwasherMode::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, DishwasherMode::Id); } case DishwasherMode::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12578,7 +12580,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case DishwasherMode::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, DishwasherMode::Id); } case DishwasherMode::Attributes::FeatureMap::Id: { uint32_t value; @@ -12604,12 +12606,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case AirQuality::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, AirQuality::Id); } case AirQuality::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, AirQuality::Id); } case AirQuality::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12619,7 +12621,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case AirQuality::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, AirQuality::Id); } case AirQuality::Attributes::FeatureMap::Id: { uint32_t value; @@ -12705,12 +12707,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case SmokeCoAlarm::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, SmokeCoAlarm::Id); } case SmokeCoAlarm::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, SmokeCoAlarm::Id); } case SmokeCoAlarm::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12720,7 +12722,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case SmokeCoAlarm::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, SmokeCoAlarm::Id); } case SmokeCoAlarm::Attributes::FeatureMap::Id: { uint32_t value; @@ -12761,12 +12763,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case DishwasherAlarm::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, DishwasherAlarm::Id); } case DishwasherAlarm::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, DishwasherAlarm::Id); } case DishwasherAlarm::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12776,7 +12778,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case DishwasherAlarm::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, DishwasherAlarm::Id); } case DishwasherAlarm::Attributes::FeatureMap::Id: { uint32_t value; @@ -12808,12 +12810,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case MicrowaveOvenMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, MicrowaveOvenMode::Id); } case MicrowaveOvenMode::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, MicrowaveOvenMode::Id); } case MicrowaveOvenMode::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12823,7 +12825,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case MicrowaveOvenMode::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, MicrowaveOvenMode::Id); } case MicrowaveOvenMode::Attributes::FeatureMap::Id: { uint32_t value; @@ -12889,12 +12891,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case MicrowaveOvenControl::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, MicrowaveOvenControl::Id); } case MicrowaveOvenControl::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, MicrowaveOvenControl::Id); } case MicrowaveOvenControl::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12904,7 +12906,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case MicrowaveOvenControl::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, MicrowaveOvenControl::Id); } case MicrowaveOvenControl::Attributes::FeatureMap::Id: { uint32_t value; @@ -12957,12 +12959,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OperationalState::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, OperationalState::Id); } case OperationalState::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, OperationalState::Id); } case OperationalState::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12972,7 +12974,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OperationalState::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, OperationalState::Id); } case OperationalState::Attributes::FeatureMap::Id: { uint32_t value; @@ -13025,12 +13027,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case RvcOperationalState::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, RvcOperationalState::Id); } case RvcOperationalState::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, RvcOperationalState::Id); } case RvcOperationalState::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -13040,7 +13042,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case RvcOperationalState::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, RvcOperationalState::Id); } case RvcOperationalState::Attributes::FeatureMap::Id: { uint32_t value; @@ -13077,12 +13079,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ScenesManagement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ScenesManagement::Id); } case ScenesManagement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ScenesManagement::Id); } case ScenesManagement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -13092,7 +13094,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ScenesManagement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ScenesManagement::Id); } case ScenesManagement::Attributes::FeatureMap::Id: { uint32_t value; @@ -13145,12 +13147,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case HepaFilterMonitoring::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, HepaFilterMonitoring::Id); } case HepaFilterMonitoring::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, HepaFilterMonitoring::Id); } case HepaFilterMonitoring::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -13160,7 +13162,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case HepaFilterMonitoring::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, HepaFilterMonitoring::Id); } case HepaFilterMonitoring::Attributes::FeatureMap::Id: { uint32_t value; @@ -13213,12 +13215,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ActivatedCarbonFilterMonitoring::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ActivatedCarbonFilterMonitoring::Id); } case ActivatedCarbonFilterMonitoring::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ActivatedCarbonFilterMonitoring::Id); } case ActivatedCarbonFilterMonitoring::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -13228,7 +13230,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ActivatedCarbonFilterMonitoring::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ActivatedCarbonFilterMonitoring::Id); } case ActivatedCarbonFilterMonitoring::Attributes::FeatureMap::Id: { uint32_t value; @@ -13289,12 +13291,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case BooleanStateConfiguration::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, BooleanStateConfiguration::Id); } case BooleanStateConfiguration::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, BooleanStateConfiguration::Id); } case BooleanStateConfiguration::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -13304,7 +13306,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case BooleanStateConfiguration::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, BooleanStateConfiguration::Id); } case BooleanStateConfiguration::Attributes::FeatureMap::Id: { uint32_t value; @@ -13380,12 +13382,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ValveConfigurationAndControl::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ValveConfigurationAndControl::Id); } case ValveConfigurationAndControl::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ValveConfigurationAndControl::Id); } case ValveConfigurationAndControl::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -13395,7 +13397,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ValveConfigurationAndControl::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ValveConfigurationAndControl::Id); } case ValveConfigurationAndControl::Attributes::FeatureMap::Id: { uint32_t value; @@ -13519,12 +13521,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ElectricalPowerMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ElectricalPowerMeasurement::Id); } case ElectricalPowerMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ElectricalPowerMeasurement::Id); } case ElectricalPowerMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -13534,7 +13536,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ElectricalPowerMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ElectricalPowerMeasurement::Id); } case ElectricalPowerMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -13595,12 +13597,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ElectricalEnergyMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ElectricalEnergyMeasurement::Id); } case ElectricalEnergyMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ElectricalEnergyMeasurement::Id); } case ElectricalEnergyMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -13610,7 +13612,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ElectricalEnergyMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ElectricalEnergyMeasurement::Id); } case ElectricalEnergyMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -13661,12 +13663,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case WaterHeaterManagement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, WaterHeaterManagement::Id); } case WaterHeaterManagement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, WaterHeaterManagement::Id); } case WaterHeaterManagement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -13676,7 +13678,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case WaterHeaterManagement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, WaterHeaterManagement::Id); } case WaterHeaterManagement::Attributes::FeatureMap::Id: { uint32_t value; @@ -13743,12 +13745,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case DemandResponseLoadControl::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, DemandResponseLoadControl::Id); } case DemandResponseLoadControl::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, DemandResponseLoadControl::Id); } case DemandResponseLoadControl::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -13758,7 +13760,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case DemandResponseLoadControl::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, DemandResponseLoadControl::Id); } case DemandResponseLoadControl::Attributes::FeatureMap::Id: { uint32_t value; @@ -13789,12 +13791,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Messages::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Messages::Id); } case Messages::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Messages::Id); } case Messages::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -13804,7 +13806,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Messages::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, Messages::Id); } case Messages::Attributes::FeatureMap::Id: { uint32_t value; @@ -13868,12 +13870,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case DeviceEnergyManagement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, DeviceEnergyManagement::Id); } case DeviceEnergyManagement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, DeviceEnergyManagement::Id); } case DeviceEnergyManagement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -13883,7 +13885,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case DeviceEnergyManagement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, DeviceEnergyManagement::Id); } case DeviceEnergyManagement::Attributes::FeatureMap::Id: { uint32_t value; @@ -14019,12 +14021,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case EnergyEvse::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, EnergyEvse::Id); } case EnergyEvse::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, EnergyEvse::Id); } case EnergyEvse::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -14034,7 +14036,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case EnergyEvse::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, EnergyEvse::Id); } case EnergyEvse::Attributes::FeatureMap::Id: { uint32_t value; @@ -14080,12 +14082,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case EnergyPreference::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, EnergyPreference::Id); } case EnergyPreference::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, EnergyPreference::Id); } case EnergyPreference::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -14095,7 +14097,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case EnergyPreference::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, EnergyPreference::Id); } case EnergyPreference::Attributes::FeatureMap::Id: { uint32_t value; @@ -14126,12 +14128,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case PowerTopology::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, PowerTopology::Id); } case PowerTopology::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, PowerTopology::Id); } case PowerTopology::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -14141,7 +14143,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case PowerTopology::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, PowerTopology::Id); } case PowerTopology::Attributes::FeatureMap::Id: { uint32_t value; @@ -14183,12 +14185,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case EnergyEvseMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, EnergyEvseMode::Id); } case EnergyEvseMode::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, EnergyEvseMode::Id); } case EnergyEvseMode::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -14198,7 +14200,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case EnergyEvseMode::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, EnergyEvseMode::Id); } case EnergyEvseMode::Attributes::FeatureMap::Id: { uint32_t value; @@ -14240,12 +14242,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case WaterHeaterMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, WaterHeaterMode::Id); } case WaterHeaterMode::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, WaterHeaterMode::Id); } case WaterHeaterMode::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -14255,7 +14257,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case WaterHeaterMode::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, WaterHeaterMode::Id); } case WaterHeaterMode::Attributes::FeatureMap::Id: { uint32_t value; @@ -14298,12 +14300,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case DeviceEnergyManagementMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, DeviceEnergyManagementMode::Id); } case DeviceEnergyManagementMode::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, DeviceEnergyManagementMode::Id); } case DeviceEnergyManagementMode::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -14313,7 +14315,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case DeviceEnergyManagementMode::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, DeviceEnergyManagementMode::Id); } case DeviceEnergyManagementMode::Attributes::FeatureMap::Id: { uint32_t value; @@ -14559,12 +14561,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case DoorLock::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, DoorLock::Id); } case DoorLock::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, DoorLock::Id); } case DoorLock::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -14574,7 +14576,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case DoorLock::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, DoorLock::Id); } case DoorLock::Attributes::FeatureMap::Id: { uint32_t value; @@ -14705,12 +14707,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case WindowCovering::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, WindowCovering::Id); } case WindowCovering::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, WindowCovering::Id); } case WindowCovering::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -14720,7 +14722,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case WindowCovering::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, WindowCovering::Id); } case WindowCovering::Attributes::FeatureMap::Id: { uint32_t value; @@ -14791,12 +14793,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case BarrierControl::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, BarrierControl::Id); } case BarrierControl::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, BarrierControl::Id); } case BarrierControl::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -14806,7 +14808,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case BarrierControl::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, BarrierControl::Id); } case BarrierControl::Attributes::FeatureMap::Id: { uint32_t value; @@ -14857,12 +14859,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ServiceArea::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ServiceArea::Id); } case ServiceArea::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ServiceArea::Id); } case ServiceArea::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -14872,7 +14874,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ServiceArea::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ServiceArea::Id); } case ServiceArea::Attributes::FeatureMap::Id: { uint32_t value; @@ -15008,12 +15010,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case PumpConfigurationAndControl::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, PumpConfigurationAndControl::Id); } case PumpConfigurationAndControl::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, PumpConfigurationAndControl::Id); } case PumpConfigurationAndControl::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -15023,7 +15025,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case PumpConfigurationAndControl::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, PumpConfigurationAndControl::Id); } case PumpConfigurationAndControl::Attributes::FeatureMap::Id: { uint32_t value; @@ -15344,12 +15346,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Thermostat::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Thermostat::Id); } case Thermostat::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Thermostat::Id); } case Thermostat::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -15359,7 +15361,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Thermostat::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, Thermostat::Id); } case Thermostat::Attributes::FeatureMap::Id: { uint32_t value; @@ -15440,12 +15442,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case FanControl::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, FanControl::Id); } case FanControl::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, FanControl::Id); } case FanControl::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -15455,7 +15457,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case FanControl::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, FanControl::Id); } case FanControl::Attributes::FeatureMap::Id: { uint32_t value; @@ -15491,12 +15493,13 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ThermostatUserInterfaceConfiguration::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, + ThermostatUserInterfaceConfiguration::Id); } case ThermostatUserInterfaceConfiguration::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ThermostatUserInterfaceConfiguration::Id); } case ThermostatUserInterfaceConfiguration::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -15506,7 +15509,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ThermostatUserInterfaceConfiguration::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ThermostatUserInterfaceConfiguration::Id); } case ThermostatUserInterfaceConfiguration::Attributes::FeatureMap::Id: { uint32_t value; @@ -15787,12 +15790,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ColorControl::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ColorControl::Id); } case ColorControl::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ColorControl::Id); } case ColorControl::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -15802,7 +15805,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ColorControl::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ColorControl::Id); } case ColorControl::Attributes::FeatureMap::Id: { uint32_t value; @@ -15893,12 +15896,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case BallastConfiguration::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, BallastConfiguration::Id); } case BallastConfiguration::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, BallastConfiguration::Id); } case BallastConfiguration::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -15908,7 +15911,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case BallastConfiguration::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, BallastConfiguration::Id); } case BallastConfiguration::Attributes::FeatureMap::Id: { uint32_t value; @@ -15954,12 +15957,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case IlluminanceMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, IlluminanceMeasurement::Id); } case IlluminanceMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, IlluminanceMeasurement::Id); } case IlluminanceMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -15969,7 +15972,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case IlluminanceMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, IlluminanceMeasurement::Id); } case IlluminanceMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -16010,12 +16013,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case TemperatureMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, TemperatureMeasurement::Id); } case TemperatureMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, TemperatureMeasurement::Id); } case TemperatureMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -16025,7 +16028,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case TemperatureMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, TemperatureMeasurement::Id); } case TemperatureMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -16091,12 +16094,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case PressureMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, PressureMeasurement::Id); } case PressureMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, PressureMeasurement::Id); } case PressureMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -16106,7 +16109,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case PressureMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, PressureMeasurement::Id); } case PressureMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -16147,12 +16150,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case FlowMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, FlowMeasurement::Id); } case FlowMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, FlowMeasurement::Id); } case FlowMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -16162,7 +16165,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case FlowMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, FlowMeasurement::Id); } case FlowMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -16203,12 +16206,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case RelativeHumidityMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, RelativeHumidityMeasurement::Id); } case RelativeHumidityMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, RelativeHumidityMeasurement::Id); } case RelativeHumidityMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -16218,7 +16221,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case RelativeHumidityMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, RelativeHumidityMeasurement::Id); } case RelativeHumidityMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -16309,12 +16312,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OccupancySensing::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, OccupancySensing::Id); } case OccupancySensing::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, OccupancySensing::Id); } case OccupancySensing::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -16324,7 +16327,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OccupancySensing::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, OccupancySensing::Id); } case OccupancySensing::Attributes::FeatureMap::Id: { uint32_t value; @@ -16400,12 +16403,14 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case CarbonMonoxideConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, + CarbonMonoxideConcentrationMeasurement::Id); } case CarbonMonoxideConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, + CarbonMonoxideConcentrationMeasurement::Id); } case CarbonMonoxideConcentrationMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -16415,7 +16420,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, CarbonMonoxideConcentrationMeasurement::Id); } case CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -16491,12 +16496,14 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case CarbonDioxideConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, + CarbonDioxideConcentrationMeasurement::Id); } case CarbonDioxideConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, + CarbonDioxideConcentrationMeasurement::Id); } case CarbonDioxideConcentrationMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -16506,7 +16513,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, CarbonDioxideConcentrationMeasurement::Id); } case CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -16582,12 +16589,14 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case NitrogenDioxideConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, + NitrogenDioxideConcentrationMeasurement::Id); } case NitrogenDioxideConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, + NitrogenDioxideConcentrationMeasurement::Id); } case NitrogenDioxideConcentrationMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -16597,7 +16606,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, NitrogenDioxideConcentrationMeasurement::Id); } case NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -16673,12 +16682,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OzoneConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, OzoneConcentrationMeasurement::Id); } case OzoneConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, OzoneConcentrationMeasurement::Id); } case OzoneConcentrationMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -16688,7 +16697,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OzoneConcentrationMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, OzoneConcentrationMeasurement::Id); } case OzoneConcentrationMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -16764,12 +16773,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Pm25ConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Pm25ConcentrationMeasurement::Id); } case Pm25ConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Pm25ConcentrationMeasurement::Id); } case Pm25ConcentrationMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -16779,7 +16788,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Pm25ConcentrationMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, Pm25ConcentrationMeasurement::Id); } case Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -16855,12 +16864,13 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case FormaldehydeConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, + FormaldehydeConcentrationMeasurement::Id); } case FormaldehydeConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, FormaldehydeConcentrationMeasurement::Id); } case FormaldehydeConcentrationMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -16870,7 +16880,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, FormaldehydeConcentrationMeasurement::Id); } case FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -16946,12 +16956,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Pm1ConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Pm1ConcentrationMeasurement::Id); } case Pm1ConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Pm1ConcentrationMeasurement::Id); } case Pm1ConcentrationMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -16961,7 +16971,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Pm1ConcentrationMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, Pm1ConcentrationMeasurement::Id); } case Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -17037,12 +17047,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Pm10ConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Pm10ConcentrationMeasurement::Id); } case Pm10ConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Pm10ConcentrationMeasurement::Id); } case Pm10ConcentrationMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17052,7 +17062,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Pm10ConcentrationMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, Pm10ConcentrationMeasurement::Id); } case Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -17128,12 +17138,14 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Id); } case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Id); } case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17143,7 +17155,8 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Id); } case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -17219,12 +17232,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case RadonConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, RadonConcentrationMeasurement::Id); } case RadonConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, RadonConcentrationMeasurement::Id); } case RadonConcentrationMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17234,7 +17247,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case RadonConcentrationMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, RadonConcentrationMeasurement::Id); } case RadonConcentrationMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -17265,12 +17278,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case WiFiNetworkManagement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, WiFiNetworkManagement::Id); } case WiFiNetworkManagement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, WiFiNetworkManagement::Id); } case WiFiNetworkManagement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17280,7 +17293,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case WiFiNetworkManagement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, WiFiNetworkManagement::Id); } case WiFiNetworkManagement::Attributes::FeatureMap::Id: { uint32_t value; @@ -17331,12 +17344,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ThreadBorderRouterManagement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ThreadBorderRouterManagement::Id); } case ThreadBorderRouterManagement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ThreadBorderRouterManagement::Id); } case ThreadBorderRouterManagement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17346,7 +17359,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ThreadBorderRouterManagement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ThreadBorderRouterManagement::Id); } case ThreadBorderRouterManagement::Attributes::FeatureMap::Id: { uint32_t value; @@ -17384,12 +17397,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ThreadNetworkDirectory::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ThreadNetworkDirectory::Id); } case ThreadNetworkDirectory::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ThreadNetworkDirectory::Id); } case ThreadNetworkDirectory::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17399,7 +17412,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ThreadNetworkDirectory::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ThreadNetworkDirectory::Id); } case ThreadNetworkDirectory::Attributes::FeatureMap::Id: { uint32_t value; @@ -17430,12 +17443,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case WakeOnLan::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, WakeOnLan::Id); } case WakeOnLan::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, WakeOnLan::Id); } case WakeOnLan::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17445,7 +17458,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case WakeOnLan::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, WakeOnLan::Id); } case WakeOnLan::Attributes::FeatureMap::Id: { uint32_t value; @@ -17481,12 +17494,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Channel::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Channel::Id); } case Channel::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Channel::Id); } case Channel::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17496,7 +17509,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Channel::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, Channel::Id); } case Channel::Attributes::FeatureMap::Id: { uint32_t value; @@ -17528,12 +17541,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case TargetNavigator::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, TargetNavigator::Id); } case TargetNavigator::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, TargetNavigator::Id); } case TargetNavigator::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17543,7 +17556,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case TargetNavigator::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, TargetNavigator::Id); } case TargetNavigator::Attributes::FeatureMap::Id: { uint32_t value; @@ -17624,12 +17637,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case MediaPlayback::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, MediaPlayback::Id); } case MediaPlayback::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, MediaPlayback::Id); } case MediaPlayback::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17639,7 +17652,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case MediaPlayback::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, MediaPlayback::Id); } case MediaPlayback::Attributes::FeatureMap::Id: { uint32_t value; @@ -17670,12 +17683,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case MediaInput::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, MediaInput::Id); } case MediaInput::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, MediaInput::Id); } case MediaInput::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17685,7 +17698,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case MediaInput::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, MediaInput::Id); } case MediaInput::Attributes::FeatureMap::Id: { uint32_t value; @@ -17706,12 +17719,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case LowPower::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, LowPower::Id); } case LowPower::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, LowPower::Id); } case LowPower::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17721,7 +17734,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case LowPower::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, LowPower::Id); } case LowPower::Attributes::FeatureMap::Id: { uint32_t value; @@ -17742,12 +17755,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case KeypadInput::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, KeypadInput::Id); } case KeypadInput::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, KeypadInput::Id); } case KeypadInput::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17757,7 +17770,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case KeypadInput::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, KeypadInput::Id); } case KeypadInput::Attributes::FeatureMap::Id: { uint32_t value; @@ -17788,12 +17801,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ContentLauncher::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ContentLauncher::Id); } case ContentLauncher::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ContentLauncher::Id); } case ContentLauncher::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17803,7 +17816,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ContentLauncher::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ContentLauncher::Id); } case ContentLauncher::Attributes::FeatureMap::Id: { uint32_t value; @@ -17834,12 +17847,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case AudioOutput::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, AudioOutput::Id); } case AudioOutput::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, AudioOutput::Id); } case AudioOutput::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17849,7 +17862,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case AudioOutput::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, AudioOutput::Id); } case AudioOutput::Attributes::FeatureMap::Id: { uint32_t value; @@ -17881,12 +17894,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ApplicationLauncher::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ApplicationLauncher::Id); } case ApplicationLauncher::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ApplicationLauncher::Id); } case ApplicationLauncher::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17896,7 +17909,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ApplicationLauncher::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ApplicationLauncher::Id); } case ApplicationLauncher::Attributes::FeatureMap::Id: { uint32_t value; @@ -17957,12 +17970,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ApplicationBasic::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ApplicationBasic::Id); } case ApplicationBasic::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ApplicationBasic::Id); } case ApplicationBasic::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17972,7 +17985,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ApplicationBasic::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ApplicationBasic::Id); } case ApplicationBasic::Attributes::FeatureMap::Id: { uint32_t value; @@ -17993,12 +18006,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case AccountLogin::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, AccountLogin::Id); } case AccountLogin::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, AccountLogin::Id); } case AccountLogin::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -18008,7 +18021,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case AccountLogin::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, AccountLogin::Id); } case AccountLogin::Attributes::FeatureMap::Id: { uint32_t value; @@ -18071,12 +18084,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ContentControl::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ContentControl::Id); } case ContentControl::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ContentControl::Id); } case ContentControl::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -18086,7 +18099,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ContentControl::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ContentControl::Id); } case ContentControl::Attributes::FeatureMap::Id: { uint32_t value; @@ -18107,12 +18120,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ContentAppObserver::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ContentAppObserver::Id); } case ContentAppObserver::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ContentAppObserver::Id); } case ContentAppObserver::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -18122,7 +18135,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ContentAppObserver::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ContentAppObserver::Id); } case ContentAppObserver::Attributes::FeatureMap::Id: { uint32_t value; @@ -18162,12 +18175,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case EcosystemInformation::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, EcosystemInformation::Id); } case EcosystemInformation::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, EcosystemInformation::Id); } case EcosystemInformation::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -18177,7 +18190,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case EcosystemInformation::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, EcosystemInformation::Id); } case EcosystemInformation::Attributes::FeatureMap::Id: { uint32_t value; @@ -18203,12 +18216,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case CommissionerControl::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, CommissionerControl::Id); } case CommissionerControl::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, CommissionerControl::Id); } case CommissionerControl::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -18218,7 +18231,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case CommissionerControl::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, CommissionerControl::Id); } case CommissionerControl::Attributes::FeatureMap::Id: { uint32_t value; @@ -18879,12 +18892,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ElectricalMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ElectricalMeasurement::Id); } case ElectricalMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ElectricalMeasurement::Id); } case ElectricalMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -18894,7 +18907,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ElectricalMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ElectricalMeasurement::Id); } case ElectricalMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -19348,12 +19361,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case UnitTesting::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, UnitTesting::Id); } case UnitTesting::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, UnitTesting::Id); } case UnitTesting::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -19363,7 +19376,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case UnitTesting::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, UnitTesting::Id); } case UnitTesting::Attributes::FeatureMap::Id: { uint32_t value; @@ -19389,12 +19402,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case FaultInjection::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, FaultInjection::Id); } case FaultInjection::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, FaultInjection::Id); } case FaultInjection::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -19404,7 +19417,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case FaultInjection::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, FaultInjection::Id); } case FaultInjection::Attributes::FeatureMap::Id: { uint32_t value; @@ -19430,12 +19443,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case SampleMei::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, SampleMei::Id); } case SampleMei::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, SampleMei::Id); } case SampleMei::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -19445,7 +19458,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case SampleMei::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, SampleMei::Id); } case SampleMei::Attributes::FeatureMap::Id: { uint32_t value; diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp new file mode 100644 index 00000000000000..c97ff2590fa60b --- /dev/null +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp @@ -0,0 +1,6700 @@ +/* + * + * Copyright (c) 2022 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 +#include +#include + +char const * ClusterIdToText(chip::ClusterId id) +{ + switch (id) + { + case chip::app::Clusters::Identify::Id: + return "Identify"; + case chip::app::Clusters::Groups::Id: + return "Groups"; + case chip::app::Clusters::OnOff::Id: + return "OnOff"; + case chip::app::Clusters::OnOffSwitchConfiguration::Id: + return "OnOffSwitchConfiguration"; + case chip::app::Clusters::LevelControl::Id: + return "LevelControl"; + case chip::app::Clusters::BinaryInputBasic::Id: + return "BinaryInputBasic"; + case chip::app::Clusters::PulseWidthModulation::Id: + return "PulseWidthModulation"; + case chip::app::Clusters::Descriptor::Id: + return "Descriptor"; + case chip::app::Clusters::Binding::Id: + return "Binding"; + case chip::app::Clusters::AccessControl::Id: + return "AccessControl"; + case chip::app::Clusters::Actions::Id: + return "Actions"; + case chip::app::Clusters::BasicInformation::Id: + return "BasicInformation"; + case chip::app::Clusters::OtaSoftwareUpdateProvider::Id: + return "OtaSoftwareUpdateProvider"; + case chip::app::Clusters::OtaSoftwareUpdateRequestor::Id: + return "OtaSoftwareUpdateRequestor"; + case chip::app::Clusters::LocalizationConfiguration::Id: + return "LocalizationConfiguration"; + case chip::app::Clusters::TimeFormatLocalization::Id: + return "TimeFormatLocalization"; + case chip::app::Clusters::UnitLocalization::Id: + return "UnitLocalization"; + case chip::app::Clusters::PowerSourceConfiguration::Id: + return "PowerSourceConfiguration"; + case chip::app::Clusters::PowerSource::Id: + return "PowerSource"; + case chip::app::Clusters::GeneralCommissioning::Id: + return "GeneralCommissioning"; + case chip::app::Clusters::NetworkCommissioning::Id: + return "NetworkCommissioning"; + case chip::app::Clusters::DiagnosticLogs::Id: + return "DiagnosticLogs"; + case chip::app::Clusters::GeneralDiagnostics::Id: + return "GeneralDiagnostics"; + case chip::app::Clusters::SoftwareDiagnostics::Id: + return "SoftwareDiagnostics"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Id: + return "ThreadNetworkDiagnostics"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Id: + return "WiFiNetworkDiagnostics"; + case chip::app::Clusters::EthernetNetworkDiagnostics::Id: + return "EthernetNetworkDiagnostics"; + case chip::app::Clusters::TimeSynchronization::Id: + return "TimeSynchronization"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Id: + return "BridgedDeviceBasicInformation"; + case chip::app::Clusters::Switch::Id: + return "Switch"; + case chip::app::Clusters::AdministratorCommissioning::Id: + return "AdministratorCommissioning"; + case chip::app::Clusters::OperationalCredentials::Id: + return "OperationalCredentials"; + case chip::app::Clusters::GroupKeyManagement::Id: + return "GroupKeyManagement"; + case chip::app::Clusters::FixedLabel::Id: + return "FixedLabel"; + case chip::app::Clusters::UserLabel::Id: + return "UserLabel"; + case chip::app::Clusters::ProxyConfiguration::Id: + return "ProxyConfiguration"; + case chip::app::Clusters::ProxyDiscovery::Id: + return "ProxyDiscovery"; + case chip::app::Clusters::ProxyValid::Id: + return "ProxyValid"; + case chip::app::Clusters::BooleanState::Id: + return "BooleanState"; + case chip::app::Clusters::IcdManagement::Id: + return "IcdManagement"; + case chip::app::Clusters::Timer::Id: + return "Timer"; + case chip::app::Clusters::OvenCavityOperationalState::Id: + return "OvenCavityOperationalState"; + case chip::app::Clusters::OvenMode::Id: + return "OvenMode"; + case chip::app::Clusters::LaundryDryerControls::Id: + return "LaundryDryerControls"; + case chip::app::Clusters::ModeSelect::Id: + return "ModeSelect"; + case chip::app::Clusters::LaundryWasherMode::Id: + return "LaundryWasherMode"; + case chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id: + return "RefrigeratorAndTemperatureControlledCabinetMode"; + case chip::app::Clusters::LaundryWasherControls::Id: + return "LaundryWasherControls"; + case chip::app::Clusters::RvcRunMode::Id: + return "RvcRunMode"; + case chip::app::Clusters::RvcCleanMode::Id: + return "RvcCleanMode"; + case chip::app::Clusters::TemperatureControl::Id: + return "TemperatureControl"; + case chip::app::Clusters::RefrigeratorAlarm::Id: + return "RefrigeratorAlarm"; + case chip::app::Clusters::DishwasherMode::Id: + return "DishwasherMode"; + case chip::app::Clusters::AirQuality::Id: + return "AirQuality"; + case chip::app::Clusters::SmokeCoAlarm::Id: + return "SmokeCoAlarm"; + case chip::app::Clusters::DishwasherAlarm::Id: + return "DishwasherAlarm"; + case chip::app::Clusters::MicrowaveOvenMode::Id: + return "MicrowaveOvenMode"; + case chip::app::Clusters::MicrowaveOvenControl::Id: + return "MicrowaveOvenControl"; + case chip::app::Clusters::OperationalState::Id: + return "OperationalState"; + case chip::app::Clusters::RvcOperationalState::Id: + return "RvcOperationalState"; + case chip::app::Clusters::ScenesManagement::Id: + return "ScenesManagement"; + case chip::app::Clusters::HepaFilterMonitoring::Id: + return "HepaFilterMonitoring"; + case chip::app::Clusters::ActivatedCarbonFilterMonitoring::Id: + return "ActivatedCarbonFilterMonitoring"; + case chip::app::Clusters::BooleanStateConfiguration::Id: + return "BooleanStateConfiguration"; + case chip::app::Clusters::ValveConfigurationAndControl::Id: + return "ValveConfigurationAndControl"; + case chip::app::Clusters::ElectricalPowerMeasurement::Id: + return "ElectricalPowerMeasurement"; + case chip::app::Clusters::ElectricalEnergyMeasurement::Id: + return "ElectricalEnergyMeasurement"; + case chip::app::Clusters::WaterHeaterManagement::Id: + return "WaterHeaterManagement"; + case chip::app::Clusters::DemandResponseLoadControl::Id: + return "DemandResponseLoadControl"; + case chip::app::Clusters::Messages::Id: + return "Messages"; + case chip::app::Clusters::DeviceEnergyManagement::Id: + return "DeviceEnergyManagement"; + case chip::app::Clusters::EnergyEvse::Id: + return "EnergyEvse"; + case chip::app::Clusters::EnergyPreference::Id: + return "EnergyPreference"; + case chip::app::Clusters::PowerTopology::Id: + return "PowerTopology"; + case chip::app::Clusters::EnergyEvseMode::Id: + return "EnergyEvseMode"; + case chip::app::Clusters::WaterHeaterMode::Id: + return "WaterHeaterMode"; + case chip::app::Clusters::DeviceEnergyManagementMode::Id: + return "DeviceEnergyManagementMode"; + case chip::app::Clusters::DoorLock::Id: + return "DoorLock"; + case chip::app::Clusters::WindowCovering::Id: + return "WindowCovering"; + case chip::app::Clusters::BarrierControl::Id: + return "BarrierControl"; + case chip::app::Clusters::ServiceArea::Id: + return "ServiceArea"; + case chip::app::Clusters::PumpConfigurationAndControl::Id: + return "PumpConfigurationAndControl"; + case chip::app::Clusters::Thermostat::Id: + return "Thermostat"; + case chip::app::Clusters::FanControl::Id: + return "FanControl"; + case chip::app::Clusters::ThermostatUserInterfaceConfiguration::Id: + return "ThermostatUserInterfaceConfiguration"; + case chip::app::Clusters::ColorControl::Id: + return "ColorControl"; + case chip::app::Clusters::BallastConfiguration::Id: + return "BallastConfiguration"; + case chip::app::Clusters::IlluminanceMeasurement::Id: + return "IlluminanceMeasurement"; + case chip::app::Clusters::TemperatureMeasurement::Id: + return "TemperatureMeasurement"; + case chip::app::Clusters::PressureMeasurement::Id: + return "PressureMeasurement"; + case chip::app::Clusters::FlowMeasurement::Id: + return "FlowMeasurement"; + case chip::app::Clusters::RelativeHumidityMeasurement::Id: + return "RelativeHumidityMeasurement"; + case chip::app::Clusters::OccupancySensing::Id: + return "OccupancySensing"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Id: + return "CarbonMonoxideConcentrationMeasurement"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Id: + return "CarbonDioxideConcentrationMeasurement"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Id: + return "NitrogenDioxideConcentrationMeasurement"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Id: + return "OzoneConcentrationMeasurement"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Id: + return "Pm25ConcentrationMeasurement"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Id: + return "FormaldehydeConcentrationMeasurement"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Id: + return "Pm1ConcentrationMeasurement"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Id: + return "Pm10ConcentrationMeasurement"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Id: + return "TotalVolatileOrganicCompoundsConcentrationMeasurement"; + case chip::app::Clusters::RadonConcentrationMeasurement::Id: + return "RadonConcentrationMeasurement"; + case chip::app::Clusters::WiFiNetworkManagement::Id: + return "WiFiNetworkManagement"; + case chip::app::Clusters::ThreadBorderRouterManagement::Id: + return "ThreadBorderRouterManagement"; + case chip::app::Clusters::ThreadNetworkDirectory::Id: + return "ThreadNetworkDirectory"; + case chip::app::Clusters::WakeOnLan::Id: + return "WakeOnLan"; + case chip::app::Clusters::Channel::Id: + return "Channel"; + case chip::app::Clusters::TargetNavigator::Id: + return "TargetNavigator"; + case chip::app::Clusters::MediaPlayback::Id: + return "MediaPlayback"; + case chip::app::Clusters::MediaInput::Id: + return "MediaInput"; + case chip::app::Clusters::LowPower::Id: + return "LowPower"; + case chip::app::Clusters::KeypadInput::Id: + return "KeypadInput"; + case chip::app::Clusters::ContentLauncher::Id: + return "ContentLauncher"; + case chip::app::Clusters::AudioOutput::Id: + return "AudioOutput"; + case chip::app::Clusters::ApplicationLauncher::Id: + return "ApplicationLauncher"; + case chip::app::Clusters::ApplicationBasic::Id: + return "ApplicationBasic"; + case chip::app::Clusters::AccountLogin::Id: + return "AccountLogin"; + case chip::app::Clusters::ContentControl::Id: + return "ContentControl"; + case chip::app::Clusters::ContentAppObserver::Id: + return "ContentAppObserver"; + case chip::app::Clusters::EcosystemInformation::Id: + return "EcosystemInformation"; + case chip::app::Clusters::CommissionerControl::Id: + return "CommissionerControl"; + case chip::app::Clusters::ElectricalMeasurement::Id: + return "ElectricalMeasurement"; + case chip::app::Clusters::UnitTesting::Id: + return "UnitTesting"; + case chip::app::Clusters::FaultInjection::Id: + return "FaultInjection"; + case chip::app::Clusters::SampleMei::Id: + return "SampleMei"; + default: + return "Unknown"; + } +} + +char const * AttributeIdToText(chip::ClusterId cluster, chip::AttributeId id) +{ + switch (cluster) + { + case chip::app::Clusters::Identify::Id: { + switch (id) + { + case chip::app::Clusters::Identify::Attributes::IdentifyTime::Id: + return "IdentifyTime"; + case chip::app::Clusters::Identify::Attributes::IdentifyType::Id: + return "IdentifyType"; + case chip::app::Clusters::Identify::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::Identify::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::Identify::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::Identify::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::Identify::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::Identify::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Groups::Id: { + switch (id) + { + case chip::app::Clusters::Groups::Attributes::NameSupport::Id: + return "NameSupport"; + case chip::app::Clusters::Groups::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::Groups::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::Groups::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::Groups::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::Groups::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::Groups::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OnOff::Id: { + switch (id) + { + case chip::app::Clusters::OnOff::Attributes::OnOff::Id: + return "OnOff"; + case chip::app::Clusters::OnOff::Attributes::GlobalSceneControl::Id: + return "GlobalSceneControl"; + case chip::app::Clusters::OnOff::Attributes::OnTime::Id: + return "OnTime"; + case chip::app::Clusters::OnOff::Attributes::OffWaitTime::Id: + return "OffWaitTime"; + case chip::app::Clusters::OnOff::Attributes::StartUpOnOff::Id: + return "StartUpOnOff"; + case chip::app::Clusters::OnOff::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::OnOff::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::OnOff::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::OnOff::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::OnOff::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::OnOff::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OnOffSwitchConfiguration::Id: { + switch (id) + { + case chip::app::Clusters::OnOffSwitchConfiguration::Attributes::SwitchType::Id: + return "SwitchType"; + case chip::app::Clusters::OnOffSwitchConfiguration::Attributes::SwitchActions::Id: + return "SwitchActions"; + case chip::app::Clusters::OnOffSwitchConfiguration::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::OnOffSwitchConfiguration::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::OnOffSwitchConfiguration::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::OnOffSwitchConfiguration::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::OnOffSwitchConfiguration::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::OnOffSwitchConfiguration::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::LevelControl::Id: { + switch (id) + { + case chip::app::Clusters::LevelControl::Attributes::CurrentLevel::Id: + return "CurrentLevel"; + case chip::app::Clusters::LevelControl::Attributes::RemainingTime::Id: + return "RemainingTime"; + case chip::app::Clusters::LevelControl::Attributes::MinLevel::Id: + return "MinLevel"; + case chip::app::Clusters::LevelControl::Attributes::MaxLevel::Id: + return "MaxLevel"; + case chip::app::Clusters::LevelControl::Attributes::CurrentFrequency::Id: + return "CurrentFrequency"; + case chip::app::Clusters::LevelControl::Attributes::MinFrequency::Id: + return "MinFrequency"; + case chip::app::Clusters::LevelControl::Attributes::MaxFrequency::Id: + return "MaxFrequency"; + case chip::app::Clusters::LevelControl::Attributes::Options::Id: + return "Options"; + case chip::app::Clusters::LevelControl::Attributes::OnOffTransitionTime::Id: + return "OnOffTransitionTime"; + case chip::app::Clusters::LevelControl::Attributes::OnLevel::Id: + return "OnLevel"; + case chip::app::Clusters::LevelControl::Attributes::OnTransitionTime::Id: + return "OnTransitionTime"; + case chip::app::Clusters::LevelControl::Attributes::OffTransitionTime::Id: + return "OffTransitionTime"; + case chip::app::Clusters::LevelControl::Attributes::DefaultMoveRate::Id: + return "DefaultMoveRate"; + case chip::app::Clusters::LevelControl::Attributes::StartUpCurrentLevel::Id: + return "StartUpCurrentLevel"; + case chip::app::Clusters::LevelControl::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::LevelControl::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::LevelControl::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::LevelControl::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::LevelControl::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::LevelControl::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::BinaryInputBasic::Id: { + switch (id) + { + case chip::app::Clusters::BinaryInputBasic::Attributes::ActiveText::Id: + return "ActiveText"; + case chip::app::Clusters::BinaryInputBasic::Attributes::Description::Id: + return "Description"; + case chip::app::Clusters::BinaryInputBasic::Attributes::InactiveText::Id: + return "InactiveText"; + case chip::app::Clusters::BinaryInputBasic::Attributes::OutOfService::Id: + return "OutOfService"; + case chip::app::Clusters::BinaryInputBasic::Attributes::Polarity::Id: + return "Polarity"; + case chip::app::Clusters::BinaryInputBasic::Attributes::PresentValue::Id: + return "PresentValue"; + case chip::app::Clusters::BinaryInputBasic::Attributes::Reliability::Id: + return "Reliability"; + case chip::app::Clusters::BinaryInputBasic::Attributes::StatusFlags::Id: + return "StatusFlags"; + case chip::app::Clusters::BinaryInputBasic::Attributes::ApplicationType::Id: + return "ApplicationType"; + case chip::app::Clusters::BinaryInputBasic::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::BinaryInputBasic::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::BinaryInputBasic::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::BinaryInputBasic::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::BinaryInputBasic::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::BinaryInputBasic::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::PulseWidthModulation::Id: { + switch (id) + { + case chip::app::Clusters::PulseWidthModulation::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::PulseWidthModulation::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::PulseWidthModulation::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::PulseWidthModulation::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::PulseWidthModulation::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::PulseWidthModulation::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Descriptor::Id: { + switch (id) + { + case chip::app::Clusters::Descriptor::Attributes::DeviceTypeList::Id: + return "DeviceTypeList"; + case chip::app::Clusters::Descriptor::Attributes::ServerList::Id: + return "ServerList"; + case chip::app::Clusters::Descriptor::Attributes::ClientList::Id: + return "ClientList"; + case chip::app::Clusters::Descriptor::Attributes::PartsList::Id: + return "PartsList"; + case chip::app::Clusters::Descriptor::Attributes::TagList::Id: + return "TagList"; + case chip::app::Clusters::Descriptor::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::Descriptor::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::Descriptor::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::Descriptor::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::Descriptor::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::Descriptor::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Binding::Id: { + switch (id) + { + case chip::app::Clusters::Binding::Attributes::Binding::Id: + return "Binding"; + case chip::app::Clusters::Binding::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::Binding::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::Binding::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::Binding::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::Binding::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::Binding::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::AccessControl::Id: { + switch (id) + { + case chip::app::Clusters::AccessControl::Attributes::Acl::Id: + return "Acl"; + case chip::app::Clusters::AccessControl::Attributes::Extension::Id: + return "Extension"; + case chip::app::Clusters::AccessControl::Attributes::SubjectsPerAccessControlEntry::Id: + return "SubjectsPerAccessControlEntry"; + case chip::app::Clusters::AccessControl::Attributes::TargetsPerAccessControlEntry::Id: + return "TargetsPerAccessControlEntry"; + case chip::app::Clusters::AccessControl::Attributes::AccessControlEntriesPerFabric::Id: + return "AccessControlEntriesPerFabric"; + case chip::app::Clusters::AccessControl::Attributes::CommissioningARL::Id: + return "CommissioningARL"; + case chip::app::Clusters::AccessControl::Attributes::Arl::Id: + return "Arl"; + case chip::app::Clusters::AccessControl::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::AccessControl::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::AccessControl::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::AccessControl::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::AccessControl::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::AccessControl::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Actions::Id: { + switch (id) + { + case chip::app::Clusters::Actions::Attributes::ActionList::Id: + return "ActionList"; + case chip::app::Clusters::Actions::Attributes::EndpointLists::Id: + return "EndpointLists"; + case chip::app::Clusters::Actions::Attributes::SetupURL::Id: + return "SetupURL"; + case chip::app::Clusters::Actions::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::Actions::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::Actions::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::Actions::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::Actions::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::Actions::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::BasicInformation::Id: { + switch (id) + { + case chip::app::Clusters::BasicInformation::Attributes::DataModelRevision::Id: + return "DataModelRevision"; + case chip::app::Clusters::BasicInformation::Attributes::VendorName::Id: + return "VendorName"; + case chip::app::Clusters::BasicInformation::Attributes::VendorID::Id: + return "VendorID"; + case chip::app::Clusters::BasicInformation::Attributes::ProductName::Id: + return "ProductName"; + case chip::app::Clusters::BasicInformation::Attributes::ProductID::Id: + return "ProductID"; + case chip::app::Clusters::BasicInformation::Attributes::NodeLabel::Id: + return "NodeLabel"; + case chip::app::Clusters::BasicInformation::Attributes::Location::Id: + return "Location"; + case chip::app::Clusters::BasicInformation::Attributes::HardwareVersion::Id: + return "HardwareVersion"; + case chip::app::Clusters::BasicInformation::Attributes::HardwareVersionString::Id: + return "HardwareVersionString"; + case chip::app::Clusters::BasicInformation::Attributes::SoftwareVersion::Id: + return "SoftwareVersion"; + case chip::app::Clusters::BasicInformation::Attributes::SoftwareVersionString::Id: + return "SoftwareVersionString"; + case chip::app::Clusters::BasicInformation::Attributes::ManufacturingDate::Id: + return "ManufacturingDate"; + case chip::app::Clusters::BasicInformation::Attributes::PartNumber::Id: + return "PartNumber"; + case chip::app::Clusters::BasicInformation::Attributes::ProductURL::Id: + return "ProductURL"; + case chip::app::Clusters::BasicInformation::Attributes::ProductLabel::Id: + return "ProductLabel"; + case chip::app::Clusters::BasicInformation::Attributes::SerialNumber::Id: + return "SerialNumber"; + case chip::app::Clusters::BasicInformation::Attributes::LocalConfigDisabled::Id: + return "LocalConfigDisabled"; + case chip::app::Clusters::BasicInformation::Attributes::Reachable::Id: + return "Reachable"; + case chip::app::Clusters::BasicInformation::Attributes::UniqueID::Id: + return "UniqueID"; + case chip::app::Clusters::BasicInformation::Attributes::CapabilityMinima::Id: + return "CapabilityMinima"; + case chip::app::Clusters::BasicInformation::Attributes::ProductAppearance::Id: + return "ProductAppearance"; + case chip::app::Clusters::BasicInformation::Attributes::SpecificationVersion::Id: + return "SpecificationVersion"; + case chip::app::Clusters::BasicInformation::Attributes::MaxPathsPerInvoke::Id: + return "MaxPathsPerInvoke"; + case chip::app::Clusters::BasicInformation::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::BasicInformation::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::BasicInformation::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::BasicInformation::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::BasicInformation::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::BasicInformation::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OtaSoftwareUpdateProvider::Id: { + switch (id) + { + case chip::app::Clusters::OtaSoftwareUpdateProvider::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::OtaSoftwareUpdateProvider::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::OtaSoftwareUpdateProvider::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::OtaSoftwareUpdateProvider::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::OtaSoftwareUpdateProvider::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::OtaSoftwareUpdateProvider::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OtaSoftwareUpdateRequestor::Id: { + switch (id) + { + case chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::DefaultOTAProviders::Id: + return "DefaultOTAProviders"; + case chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::UpdatePossible::Id: + return "UpdatePossible"; + case chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::UpdateState::Id: + return "UpdateState"; + case chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::UpdateStateProgress::Id: + return "UpdateStateProgress"; + case chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::LocalizationConfiguration::Id: { + switch (id) + { + case chip::app::Clusters::LocalizationConfiguration::Attributes::ActiveLocale::Id: + return "ActiveLocale"; + case chip::app::Clusters::LocalizationConfiguration::Attributes::SupportedLocales::Id: + return "SupportedLocales"; + case chip::app::Clusters::LocalizationConfiguration::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::LocalizationConfiguration::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::LocalizationConfiguration::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::LocalizationConfiguration::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::LocalizationConfiguration::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::LocalizationConfiguration::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::TimeFormatLocalization::Id: { + switch (id) + { + case chip::app::Clusters::TimeFormatLocalization::Attributes::HourFormat::Id: + return "HourFormat"; + case chip::app::Clusters::TimeFormatLocalization::Attributes::ActiveCalendarType::Id: + return "ActiveCalendarType"; + case chip::app::Clusters::TimeFormatLocalization::Attributes::SupportedCalendarTypes::Id: + return "SupportedCalendarTypes"; + case chip::app::Clusters::TimeFormatLocalization::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::TimeFormatLocalization::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::TimeFormatLocalization::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::TimeFormatLocalization::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::TimeFormatLocalization::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::TimeFormatLocalization::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::UnitLocalization::Id: { + switch (id) + { + case chip::app::Clusters::UnitLocalization::Attributes::TemperatureUnit::Id: + return "TemperatureUnit"; + case chip::app::Clusters::UnitLocalization::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::UnitLocalization::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::UnitLocalization::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::UnitLocalization::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::UnitLocalization::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::UnitLocalization::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::PowerSourceConfiguration::Id: { + switch (id) + { + case chip::app::Clusters::PowerSourceConfiguration::Attributes::Sources::Id: + return "Sources"; + case chip::app::Clusters::PowerSourceConfiguration::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::PowerSourceConfiguration::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::PowerSourceConfiguration::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::PowerSourceConfiguration::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::PowerSourceConfiguration::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::PowerSourceConfiguration::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::PowerSource::Id: { + switch (id) + { + case chip::app::Clusters::PowerSource::Attributes::Status::Id: + return "Status"; + case chip::app::Clusters::PowerSource::Attributes::Order::Id: + return "Order"; + case chip::app::Clusters::PowerSource::Attributes::Description::Id: + return "Description"; + case chip::app::Clusters::PowerSource::Attributes::WiredAssessedInputVoltage::Id: + return "WiredAssessedInputVoltage"; + case chip::app::Clusters::PowerSource::Attributes::WiredAssessedInputFrequency::Id: + return "WiredAssessedInputFrequency"; + case chip::app::Clusters::PowerSource::Attributes::WiredCurrentType::Id: + return "WiredCurrentType"; + case chip::app::Clusters::PowerSource::Attributes::WiredAssessedCurrent::Id: + return "WiredAssessedCurrent"; + case chip::app::Clusters::PowerSource::Attributes::WiredNominalVoltage::Id: + return "WiredNominalVoltage"; + case chip::app::Clusters::PowerSource::Attributes::WiredMaximumCurrent::Id: + return "WiredMaximumCurrent"; + case chip::app::Clusters::PowerSource::Attributes::WiredPresent::Id: + return "WiredPresent"; + case chip::app::Clusters::PowerSource::Attributes::ActiveWiredFaults::Id: + return "ActiveWiredFaults"; + case chip::app::Clusters::PowerSource::Attributes::BatVoltage::Id: + return "BatVoltage"; + case chip::app::Clusters::PowerSource::Attributes::BatPercentRemaining::Id: + return "BatPercentRemaining"; + case chip::app::Clusters::PowerSource::Attributes::BatTimeRemaining::Id: + return "BatTimeRemaining"; + case chip::app::Clusters::PowerSource::Attributes::BatChargeLevel::Id: + return "BatChargeLevel"; + case chip::app::Clusters::PowerSource::Attributes::BatReplacementNeeded::Id: + return "BatReplacementNeeded"; + case chip::app::Clusters::PowerSource::Attributes::BatReplaceability::Id: + return "BatReplaceability"; + case chip::app::Clusters::PowerSource::Attributes::BatPresent::Id: + return "BatPresent"; + case chip::app::Clusters::PowerSource::Attributes::ActiveBatFaults::Id: + return "ActiveBatFaults"; + case chip::app::Clusters::PowerSource::Attributes::BatReplacementDescription::Id: + return "BatReplacementDescription"; + case chip::app::Clusters::PowerSource::Attributes::BatCommonDesignation::Id: + return "BatCommonDesignation"; + case chip::app::Clusters::PowerSource::Attributes::BatANSIDesignation::Id: + return "BatANSIDesignation"; + case chip::app::Clusters::PowerSource::Attributes::BatIECDesignation::Id: + return "BatIECDesignation"; + case chip::app::Clusters::PowerSource::Attributes::BatApprovedChemistry::Id: + return "BatApprovedChemistry"; + case chip::app::Clusters::PowerSource::Attributes::BatCapacity::Id: + return "BatCapacity"; + case chip::app::Clusters::PowerSource::Attributes::BatQuantity::Id: + return "BatQuantity"; + case chip::app::Clusters::PowerSource::Attributes::BatChargeState::Id: + return "BatChargeState"; + case chip::app::Clusters::PowerSource::Attributes::BatTimeToFullCharge::Id: + return "BatTimeToFullCharge"; + case chip::app::Clusters::PowerSource::Attributes::BatFunctionalWhileCharging::Id: + return "BatFunctionalWhileCharging"; + case chip::app::Clusters::PowerSource::Attributes::BatChargingCurrent::Id: + return "BatChargingCurrent"; + case chip::app::Clusters::PowerSource::Attributes::ActiveBatChargeFaults::Id: + return "ActiveBatChargeFaults"; + case chip::app::Clusters::PowerSource::Attributes::EndpointList::Id: + return "EndpointList"; + case chip::app::Clusters::PowerSource::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::PowerSource::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::PowerSource::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::PowerSource::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::PowerSource::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::PowerSource::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::GeneralCommissioning::Id: { + switch (id) + { + case chip::app::Clusters::GeneralCommissioning::Attributes::Breadcrumb::Id: + return "Breadcrumb"; + case chip::app::Clusters::GeneralCommissioning::Attributes::BasicCommissioningInfo::Id: + return "BasicCommissioningInfo"; + case chip::app::Clusters::GeneralCommissioning::Attributes::RegulatoryConfig::Id: + return "RegulatoryConfig"; + case chip::app::Clusters::GeneralCommissioning::Attributes::LocationCapability::Id: + return "LocationCapability"; + case chip::app::Clusters::GeneralCommissioning::Attributes::SupportsConcurrentConnection::Id: + return "SupportsConcurrentConnection"; + case chip::app::Clusters::GeneralCommissioning::Attributes::TCAcceptedVersion::Id: + return "TCAcceptedVersion"; + case chip::app::Clusters::GeneralCommissioning::Attributes::TCMinRequiredVersion::Id: + return "TCMinRequiredVersion"; + case chip::app::Clusters::GeneralCommissioning::Attributes::TCAcknowledgements::Id: + return "TCAcknowledgements"; + case chip::app::Clusters::GeneralCommissioning::Attributes::TCAcknowledgementsRequired::Id: + return "TCAcknowledgementsRequired"; + case chip::app::Clusters::GeneralCommissioning::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::GeneralCommissioning::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::GeneralCommissioning::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::GeneralCommissioning::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::GeneralCommissioning::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::GeneralCommissioning::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::NetworkCommissioning::Id: { + switch (id) + { + case chip::app::Clusters::NetworkCommissioning::Attributes::MaxNetworks::Id: + return "MaxNetworks"; + case chip::app::Clusters::NetworkCommissioning::Attributes::Networks::Id: + return "Networks"; + case chip::app::Clusters::NetworkCommissioning::Attributes::ScanMaxTimeSeconds::Id: + return "ScanMaxTimeSeconds"; + case chip::app::Clusters::NetworkCommissioning::Attributes::ConnectMaxTimeSeconds::Id: + return "ConnectMaxTimeSeconds"; + case chip::app::Clusters::NetworkCommissioning::Attributes::InterfaceEnabled::Id: + return "InterfaceEnabled"; + case chip::app::Clusters::NetworkCommissioning::Attributes::LastNetworkingStatus::Id: + return "LastNetworkingStatus"; + case chip::app::Clusters::NetworkCommissioning::Attributes::LastNetworkID::Id: + return "LastNetworkID"; + case chip::app::Clusters::NetworkCommissioning::Attributes::LastConnectErrorValue::Id: + return "LastConnectErrorValue"; + case chip::app::Clusters::NetworkCommissioning::Attributes::SupportedWiFiBands::Id: + return "SupportedWiFiBands"; + case chip::app::Clusters::NetworkCommissioning::Attributes::SupportedThreadFeatures::Id: + return "SupportedThreadFeatures"; + case chip::app::Clusters::NetworkCommissioning::Attributes::ThreadVersion::Id: + return "ThreadVersion"; + case chip::app::Clusters::NetworkCommissioning::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::NetworkCommissioning::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::NetworkCommissioning::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::NetworkCommissioning::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::NetworkCommissioning::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::NetworkCommissioning::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DiagnosticLogs::Id: { + switch (id) + { + case chip::app::Clusters::DiagnosticLogs::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::DiagnosticLogs::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::DiagnosticLogs::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::DiagnosticLogs::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::DiagnosticLogs::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::DiagnosticLogs::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::GeneralDiagnostics::Id: { + switch (id) + { + case chip::app::Clusters::GeneralDiagnostics::Attributes::NetworkInterfaces::Id: + return "NetworkInterfaces"; + case chip::app::Clusters::GeneralDiagnostics::Attributes::RebootCount::Id: + return "RebootCount"; + case chip::app::Clusters::GeneralDiagnostics::Attributes::UpTime::Id: + return "UpTime"; + case chip::app::Clusters::GeneralDiagnostics::Attributes::TotalOperationalHours::Id: + return "TotalOperationalHours"; + case chip::app::Clusters::GeneralDiagnostics::Attributes::BootReason::Id: + return "BootReason"; + case chip::app::Clusters::GeneralDiagnostics::Attributes::ActiveHardwareFaults::Id: + return "ActiveHardwareFaults"; + case chip::app::Clusters::GeneralDiagnostics::Attributes::ActiveRadioFaults::Id: + return "ActiveRadioFaults"; + case chip::app::Clusters::GeneralDiagnostics::Attributes::ActiveNetworkFaults::Id: + return "ActiveNetworkFaults"; + case chip::app::Clusters::GeneralDiagnostics::Attributes::TestEventTriggersEnabled::Id: + return "TestEventTriggersEnabled"; + case chip::app::Clusters::GeneralDiagnostics::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::GeneralDiagnostics::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::GeneralDiagnostics::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::GeneralDiagnostics::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::GeneralDiagnostics::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::GeneralDiagnostics::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::SoftwareDiagnostics::Id: { + switch (id) + { + case chip::app::Clusters::SoftwareDiagnostics::Attributes::ThreadMetrics::Id: + return "ThreadMetrics"; + case chip::app::Clusters::SoftwareDiagnostics::Attributes::CurrentHeapFree::Id: + return "CurrentHeapFree"; + case chip::app::Clusters::SoftwareDiagnostics::Attributes::CurrentHeapUsed::Id: + return "CurrentHeapUsed"; + case chip::app::Clusters::SoftwareDiagnostics::Attributes::CurrentHeapHighWatermark::Id: + return "CurrentHeapHighWatermark"; + case chip::app::Clusters::SoftwareDiagnostics::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::SoftwareDiagnostics::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::SoftwareDiagnostics::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::SoftwareDiagnostics::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::SoftwareDiagnostics::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::SoftwareDiagnostics::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ThreadNetworkDiagnostics::Id: { + switch (id) + { + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::Channel::Id: + return "Channel"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RoutingRole::Id: + return "RoutingRole"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::NetworkName::Id: + return "NetworkName"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::PanId::Id: + return "PanId"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ExtendedPanId::Id: + return "ExtendedPanId"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::MeshLocalPrefix::Id: + return "MeshLocalPrefix"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::OverrunCount::Id: + return "OverrunCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::NeighborTable::Id: + return "NeighborTable"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RouteTable::Id: + return "RouteTable"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::PartitionId::Id: + return "PartitionId"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::Weighting::Id: + return "Weighting"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::DataVersion::Id: + return "DataVersion"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::StableDataVersion::Id: + return "StableDataVersion"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::LeaderRouterId::Id: + return "LeaderRouterId"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::DetachedRoleCount::Id: + return "DetachedRoleCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ChildRoleCount::Id: + return "ChildRoleCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RouterRoleCount::Id: + return "RouterRoleCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::LeaderRoleCount::Id: + return "LeaderRoleCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::AttachAttemptCount::Id: + return "AttachAttemptCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::PartitionIdChangeCount::Id: + return "PartitionIdChangeCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::BetterPartitionAttachAttemptCount::Id: + return "BetterPartitionAttachAttemptCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ParentChangeCount::Id: + return "ParentChangeCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxTotalCount::Id: + return "TxTotalCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxUnicastCount::Id: + return "TxUnicastCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxBroadcastCount::Id: + return "TxBroadcastCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxAckRequestedCount::Id: + return "TxAckRequestedCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxAckedCount::Id: + return "TxAckedCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxNoAckRequestedCount::Id: + return "TxNoAckRequestedCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxDataCount::Id: + return "TxDataCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxDataPollCount::Id: + return "TxDataPollCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxBeaconCount::Id: + return "TxBeaconCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxBeaconRequestCount::Id: + return "TxBeaconRequestCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxOtherCount::Id: + return "TxOtherCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxRetryCount::Id: + return "TxRetryCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxDirectMaxRetryExpiryCount::Id: + return "TxDirectMaxRetryExpiryCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxIndirectMaxRetryExpiryCount::Id: + return "TxIndirectMaxRetryExpiryCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxErrCcaCount::Id: + return "TxErrCcaCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxErrAbortCount::Id: + return "TxErrAbortCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxErrBusyChannelCount::Id: + return "TxErrBusyChannelCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxTotalCount::Id: + return "RxTotalCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxUnicastCount::Id: + return "RxUnicastCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxBroadcastCount::Id: + return "RxBroadcastCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxDataCount::Id: + return "RxDataCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxDataPollCount::Id: + return "RxDataPollCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxBeaconCount::Id: + return "RxBeaconCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxBeaconRequestCount::Id: + return "RxBeaconRequestCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxOtherCount::Id: + return "RxOtherCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxAddressFilteredCount::Id: + return "RxAddressFilteredCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxDestAddrFilteredCount::Id: + return "RxDestAddrFilteredCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxDuplicatedCount::Id: + return "RxDuplicatedCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrNoFrameCount::Id: + return "RxErrNoFrameCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrUnknownNeighborCount::Id: + return "RxErrUnknownNeighborCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrInvalidSrcAddrCount::Id: + return "RxErrInvalidSrcAddrCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrSecCount::Id: + return "RxErrSecCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrFcsCount::Id: + return "RxErrFcsCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrOtherCount::Id: + return "RxErrOtherCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ActiveTimestamp::Id: + return "ActiveTimestamp"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::PendingTimestamp::Id: + return "PendingTimestamp"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::Delay::Id: + return "Delay"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::SecurityPolicy::Id: + return "SecurityPolicy"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ChannelPage0Mask::Id: + return "ChannelPage0Mask"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::OperationalDatasetComponents::Id: + return "OperationalDatasetComponents"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ActiveNetworkFaultsList::Id: + return "ActiveNetworkFaultsList"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::WiFiNetworkDiagnostics::Id: { + switch (id) + { + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::Bssid::Id: + return "Bssid"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::SecurityType::Id: + return "SecurityType"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::WiFiVersion::Id: + return "WiFiVersion"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::ChannelNumber::Id: + return "ChannelNumber"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::Rssi::Id: + return "Rssi"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::BeaconLostCount::Id: + return "BeaconLostCount"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::BeaconRxCount::Id: + return "BeaconRxCount"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::PacketMulticastRxCount::Id: + return "PacketMulticastRxCount"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::PacketMulticastTxCount::Id: + return "PacketMulticastTxCount"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::PacketUnicastRxCount::Id: + return "PacketUnicastRxCount"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::PacketUnicastTxCount::Id: + return "PacketUnicastTxCount"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::CurrentMaxRate::Id: + return "CurrentMaxRate"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::OverrunCount::Id: + return "OverrunCount"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::EthernetNetworkDiagnostics::Id: { + switch (id) + { + case chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::PHYRate::Id: + return "PHYRate"; + case chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::FullDuplex::Id: + return "FullDuplex"; + case chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::PacketRxCount::Id: + return "PacketRxCount"; + case chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::PacketTxCount::Id: + return "PacketTxCount"; + case chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::TxErrCount::Id: + return "TxErrCount"; + case chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::CollisionCount::Id: + return "CollisionCount"; + case chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::OverrunCount::Id: + return "OverrunCount"; + case chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::CarrierDetect::Id: + return "CarrierDetect"; + case chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::TimeSinceReset::Id: + return "TimeSinceReset"; + case chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::TimeSynchronization::Id: { + switch (id) + { + case chip::app::Clusters::TimeSynchronization::Attributes::UTCTime::Id: + return "UTCTime"; + case chip::app::Clusters::TimeSynchronization::Attributes::Granularity::Id: + return "Granularity"; + case chip::app::Clusters::TimeSynchronization::Attributes::TimeSource::Id: + return "TimeSource"; + case chip::app::Clusters::TimeSynchronization::Attributes::TrustedTimeSource::Id: + return "TrustedTimeSource"; + case chip::app::Clusters::TimeSynchronization::Attributes::DefaultNTP::Id: + return "DefaultNTP"; + case chip::app::Clusters::TimeSynchronization::Attributes::TimeZone::Id: + return "TimeZone"; + case chip::app::Clusters::TimeSynchronization::Attributes::DSTOffset::Id: + return "DSTOffset"; + case chip::app::Clusters::TimeSynchronization::Attributes::LocalTime::Id: + return "LocalTime"; + case chip::app::Clusters::TimeSynchronization::Attributes::TimeZoneDatabase::Id: + return "TimeZoneDatabase"; + case chip::app::Clusters::TimeSynchronization::Attributes::NTPServerAvailable::Id: + return "NTPServerAvailable"; + case chip::app::Clusters::TimeSynchronization::Attributes::TimeZoneListMaxSize::Id: + return "TimeZoneListMaxSize"; + case chip::app::Clusters::TimeSynchronization::Attributes::DSTOffsetListMaxSize::Id: + return "DSTOffsetListMaxSize"; + case chip::app::Clusters::TimeSynchronization::Attributes::SupportsDNSResolve::Id: + return "SupportsDNSResolve"; + case chip::app::Clusters::TimeSynchronization::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::TimeSynchronization::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::TimeSynchronization::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::TimeSynchronization::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::TimeSynchronization::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::TimeSynchronization::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::BridgedDeviceBasicInformation::Id: { + switch (id) + { + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::VendorName::Id: + return "VendorName"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::VendorID::Id: + return "VendorID"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::ProductName::Id: + return "ProductName"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::ProductID::Id: + return "ProductID"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::NodeLabel::Id: + return "NodeLabel"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::HardwareVersion::Id: + return "HardwareVersion"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::HardwareVersionString::Id: + return "HardwareVersionString"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::SoftwareVersion::Id: + return "SoftwareVersion"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::SoftwareVersionString::Id: + return "SoftwareVersionString"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::ManufacturingDate::Id: + return "ManufacturingDate"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::PartNumber::Id: + return "PartNumber"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::ProductURL::Id: + return "ProductURL"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::ProductLabel::Id: + return "ProductLabel"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::SerialNumber::Id: + return "SerialNumber"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::Reachable::Id: + return "Reachable"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::UniqueID::Id: + return "UniqueID"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::ProductAppearance::Id: + return "ProductAppearance"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Switch::Id: { + switch (id) + { + case chip::app::Clusters::Switch::Attributes::NumberOfPositions::Id: + return "NumberOfPositions"; + case chip::app::Clusters::Switch::Attributes::CurrentPosition::Id: + return "CurrentPosition"; + case chip::app::Clusters::Switch::Attributes::MultiPressMax::Id: + return "MultiPressMax"; + case chip::app::Clusters::Switch::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::Switch::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::Switch::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::Switch::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::Switch::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::Switch::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::AdministratorCommissioning::Id: { + switch (id) + { + case chip::app::Clusters::AdministratorCommissioning::Attributes::WindowStatus::Id: + return "WindowStatus"; + case chip::app::Clusters::AdministratorCommissioning::Attributes::AdminFabricIndex::Id: + return "AdminFabricIndex"; + case chip::app::Clusters::AdministratorCommissioning::Attributes::AdminVendorId::Id: + return "AdminVendorId"; + case chip::app::Clusters::AdministratorCommissioning::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::AdministratorCommissioning::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::AdministratorCommissioning::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::AdministratorCommissioning::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::AdministratorCommissioning::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::AdministratorCommissioning::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OperationalCredentials::Id: { + switch (id) + { + case chip::app::Clusters::OperationalCredentials::Attributes::NOCs::Id: + return "NOCs"; + case chip::app::Clusters::OperationalCredentials::Attributes::Fabrics::Id: + return "Fabrics"; + case chip::app::Clusters::OperationalCredentials::Attributes::SupportedFabrics::Id: + return "SupportedFabrics"; + case chip::app::Clusters::OperationalCredentials::Attributes::CommissionedFabrics::Id: + return "CommissionedFabrics"; + case chip::app::Clusters::OperationalCredentials::Attributes::TrustedRootCertificates::Id: + return "TrustedRootCertificates"; + case chip::app::Clusters::OperationalCredentials::Attributes::CurrentFabricIndex::Id: + return "CurrentFabricIndex"; + case chip::app::Clusters::OperationalCredentials::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::OperationalCredentials::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::OperationalCredentials::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::OperationalCredentials::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::OperationalCredentials::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::OperationalCredentials::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::GroupKeyManagement::Id: { + switch (id) + { + case chip::app::Clusters::GroupKeyManagement::Attributes::GroupKeyMap::Id: + return "GroupKeyMap"; + case chip::app::Clusters::GroupKeyManagement::Attributes::GroupTable::Id: + return "GroupTable"; + case chip::app::Clusters::GroupKeyManagement::Attributes::MaxGroupsPerFabric::Id: + return "MaxGroupsPerFabric"; + case chip::app::Clusters::GroupKeyManagement::Attributes::MaxGroupKeysPerFabric::Id: + return "MaxGroupKeysPerFabric"; + case chip::app::Clusters::GroupKeyManagement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::GroupKeyManagement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::GroupKeyManagement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::GroupKeyManagement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::GroupKeyManagement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::GroupKeyManagement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::FixedLabel::Id: { + switch (id) + { + case chip::app::Clusters::FixedLabel::Attributes::LabelList::Id: + return "LabelList"; + case chip::app::Clusters::FixedLabel::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::FixedLabel::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::FixedLabel::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::FixedLabel::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::FixedLabel::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::FixedLabel::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::UserLabel::Id: { + switch (id) + { + case chip::app::Clusters::UserLabel::Attributes::LabelList::Id: + return "LabelList"; + case chip::app::Clusters::UserLabel::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::UserLabel::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::UserLabel::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::UserLabel::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::UserLabel::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::UserLabel::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ProxyConfiguration::Id: { + switch (id) + { + case chip::app::Clusters::ProxyConfiguration::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ProxyConfiguration::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ProxyConfiguration::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ProxyConfiguration::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ProxyConfiguration::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ProxyConfiguration::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ProxyDiscovery::Id: { + switch (id) + { + case chip::app::Clusters::ProxyDiscovery::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ProxyDiscovery::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ProxyDiscovery::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ProxyDiscovery::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ProxyDiscovery::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ProxyDiscovery::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ProxyValid::Id: { + switch (id) + { + case chip::app::Clusters::ProxyValid::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ProxyValid::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ProxyValid::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ProxyValid::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ProxyValid::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ProxyValid::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::BooleanState::Id: { + switch (id) + { + case chip::app::Clusters::BooleanState::Attributes::StateValue::Id: + return "StateValue"; + case chip::app::Clusters::BooleanState::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::BooleanState::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::BooleanState::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::BooleanState::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::BooleanState::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::BooleanState::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::IcdManagement::Id: { + switch (id) + { + case chip::app::Clusters::IcdManagement::Attributes::IdleModeDuration::Id: + return "IdleModeDuration"; + case chip::app::Clusters::IcdManagement::Attributes::ActiveModeDuration::Id: + return "ActiveModeDuration"; + case chip::app::Clusters::IcdManagement::Attributes::ActiveModeThreshold::Id: + return "ActiveModeThreshold"; + case chip::app::Clusters::IcdManagement::Attributes::RegisteredClients::Id: + return "RegisteredClients"; + case chip::app::Clusters::IcdManagement::Attributes::ICDCounter::Id: + return "ICDCounter"; + case chip::app::Clusters::IcdManagement::Attributes::ClientsSupportedPerFabric::Id: + return "ClientsSupportedPerFabric"; + case chip::app::Clusters::IcdManagement::Attributes::UserActiveModeTriggerHint::Id: + return "UserActiveModeTriggerHint"; + case chip::app::Clusters::IcdManagement::Attributes::UserActiveModeTriggerInstruction::Id: + return "UserActiveModeTriggerInstruction"; + case chip::app::Clusters::IcdManagement::Attributes::OperatingMode::Id: + return "OperatingMode"; + case chip::app::Clusters::IcdManagement::Attributes::MaximumCheckInBackOff::Id: + return "MaximumCheckInBackOff"; + case chip::app::Clusters::IcdManagement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::IcdManagement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::IcdManagement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::IcdManagement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::IcdManagement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::IcdManagement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Timer::Id: { + switch (id) + { + case chip::app::Clusters::Timer::Attributes::SetTime::Id: + return "SetTime"; + case chip::app::Clusters::Timer::Attributes::TimeRemaining::Id: + return "TimeRemaining"; + case chip::app::Clusters::Timer::Attributes::TimerState::Id: + return "TimerState"; + case chip::app::Clusters::Timer::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::Timer::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::Timer::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::Timer::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::Timer::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::Timer::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OvenCavityOperationalState::Id: { + switch (id) + { + case chip::app::Clusters::OvenCavityOperationalState::Attributes::PhaseList::Id: + return "PhaseList"; + case chip::app::Clusters::OvenCavityOperationalState::Attributes::CurrentPhase::Id: + return "CurrentPhase"; + case chip::app::Clusters::OvenCavityOperationalState::Attributes::CountdownTime::Id: + return "CountdownTime"; + case chip::app::Clusters::OvenCavityOperationalState::Attributes::OperationalStateList::Id: + return "OperationalStateList"; + case chip::app::Clusters::OvenCavityOperationalState::Attributes::OperationalState::Id: + return "OperationalState"; + case chip::app::Clusters::OvenCavityOperationalState::Attributes::OperationalError::Id: + return "OperationalError"; + case chip::app::Clusters::OvenCavityOperationalState::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::OvenCavityOperationalState::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::OvenCavityOperationalState::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::OvenCavityOperationalState::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::OvenCavityOperationalState::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::OvenCavityOperationalState::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OvenMode::Id: { + switch (id) + { + case chip::app::Clusters::OvenMode::Attributes::SupportedModes::Id: + return "SupportedModes"; + case chip::app::Clusters::OvenMode::Attributes::CurrentMode::Id: + return "CurrentMode"; + case chip::app::Clusters::OvenMode::Attributes::StartUpMode::Id: + return "StartUpMode"; + case chip::app::Clusters::OvenMode::Attributes::OnMode::Id: + return "OnMode"; + case chip::app::Clusters::OvenMode::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::OvenMode::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::OvenMode::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::OvenMode::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::OvenMode::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::OvenMode::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::LaundryDryerControls::Id: { + switch (id) + { + case chip::app::Clusters::LaundryDryerControls::Attributes::SupportedDrynessLevels::Id: + return "SupportedDrynessLevels"; + case chip::app::Clusters::LaundryDryerControls::Attributes::SelectedDrynessLevel::Id: + return "SelectedDrynessLevel"; + case chip::app::Clusters::LaundryDryerControls::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::LaundryDryerControls::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::LaundryDryerControls::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::LaundryDryerControls::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::LaundryDryerControls::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::LaundryDryerControls::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ModeSelect::Id: { + switch (id) + { + case chip::app::Clusters::ModeSelect::Attributes::Description::Id: + return "Description"; + case chip::app::Clusters::ModeSelect::Attributes::StandardNamespace::Id: + return "StandardNamespace"; + case chip::app::Clusters::ModeSelect::Attributes::SupportedModes::Id: + return "SupportedModes"; + case chip::app::Clusters::ModeSelect::Attributes::CurrentMode::Id: + return "CurrentMode"; + case chip::app::Clusters::ModeSelect::Attributes::StartUpMode::Id: + return "StartUpMode"; + case chip::app::Clusters::ModeSelect::Attributes::OnMode::Id: + return "OnMode"; + case chip::app::Clusters::ModeSelect::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ModeSelect::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ModeSelect::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ModeSelect::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ModeSelect::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ModeSelect::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::LaundryWasherMode::Id: { + switch (id) + { + case chip::app::Clusters::LaundryWasherMode::Attributes::SupportedModes::Id: + return "SupportedModes"; + case chip::app::Clusters::LaundryWasherMode::Attributes::CurrentMode::Id: + return "CurrentMode"; + case chip::app::Clusters::LaundryWasherMode::Attributes::StartUpMode::Id: + return "StartUpMode"; + case chip::app::Clusters::LaundryWasherMode::Attributes::OnMode::Id: + return "OnMode"; + case chip::app::Clusters::LaundryWasherMode::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::LaundryWasherMode::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::LaundryWasherMode::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::LaundryWasherMode::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::LaundryWasherMode::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::LaundryWasherMode::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id: { + switch (id) + { + case chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Attributes::SupportedModes::Id: + return "SupportedModes"; + case chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Attributes::CurrentMode::Id: + return "CurrentMode"; + case chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Attributes::StartUpMode::Id: + return "StartUpMode"; + case chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Attributes::OnMode::Id: + return "OnMode"; + case chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::LaundryWasherControls::Id: { + switch (id) + { + case chip::app::Clusters::LaundryWasherControls::Attributes::SpinSpeeds::Id: + return "SpinSpeeds"; + case chip::app::Clusters::LaundryWasherControls::Attributes::SpinSpeedCurrent::Id: + return "SpinSpeedCurrent"; + case chip::app::Clusters::LaundryWasherControls::Attributes::NumberOfRinses::Id: + return "NumberOfRinses"; + case chip::app::Clusters::LaundryWasherControls::Attributes::SupportedRinses::Id: + return "SupportedRinses"; + case chip::app::Clusters::LaundryWasherControls::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::LaundryWasherControls::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::LaundryWasherControls::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::LaundryWasherControls::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::LaundryWasherControls::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::LaundryWasherControls::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::RvcRunMode::Id: { + switch (id) + { + case chip::app::Clusters::RvcRunMode::Attributes::SupportedModes::Id: + return "SupportedModes"; + case chip::app::Clusters::RvcRunMode::Attributes::CurrentMode::Id: + return "CurrentMode"; + case chip::app::Clusters::RvcRunMode::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::RvcRunMode::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::RvcRunMode::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::RvcRunMode::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::RvcRunMode::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::RvcRunMode::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::RvcCleanMode::Id: { + switch (id) + { + case chip::app::Clusters::RvcCleanMode::Attributes::SupportedModes::Id: + return "SupportedModes"; + case chip::app::Clusters::RvcCleanMode::Attributes::CurrentMode::Id: + return "CurrentMode"; + case chip::app::Clusters::RvcCleanMode::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::RvcCleanMode::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::RvcCleanMode::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::RvcCleanMode::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::RvcCleanMode::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::RvcCleanMode::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::TemperatureControl::Id: { + switch (id) + { + case chip::app::Clusters::TemperatureControl::Attributes::TemperatureSetpoint::Id: + return "TemperatureSetpoint"; + case chip::app::Clusters::TemperatureControl::Attributes::MinTemperature::Id: + return "MinTemperature"; + case chip::app::Clusters::TemperatureControl::Attributes::MaxTemperature::Id: + return "MaxTemperature"; + case chip::app::Clusters::TemperatureControl::Attributes::Step::Id: + return "Step"; + case chip::app::Clusters::TemperatureControl::Attributes::SelectedTemperatureLevel::Id: + return "SelectedTemperatureLevel"; + case chip::app::Clusters::TemperatureControl::Attributes::SupportedTemperatureLevels::Id: + return "SupportedTemperatureLevels"; + case chip::app::Clusters::TemperatureControl::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::TemperatureControl::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::TemperatureControl::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::TemperatureControl::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::TemperatureControl::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::TemperatureControl::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::RefrigeratorAlarm::Id: { + switch (id) + { + case chip::app::Clusters::RefrigeratorAlarm::Attributes::Mask::Id: + return "Mask"; + case chip::app::Clusters::RefrigeratorAlarm::Attributes::State::Id: + return "State"; + case chip::app::Clusters::RefrigeratorAlarm::Attributes::Supported::Id: + return "Supported"; + case chip::app::Clusters::RefrigeratorAlarm::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::RefrigeratorAlarm::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::RefrigeratorAlarm::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::RefrigeratorAlarm::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::RefrigeratorAlarm::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::RefrigeratorAlarm::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DishwasherMode::Id: { + switch (id) + { + case chip::app::Clusters::DishwasherMode::Attributes::SupportedModes::Id: + return "SupportedModes"; + case chip::app::Clusters::DishwasherMode::Attributes::CurrentMode::Id: + return "CurrentMode"; + case chip::app::Clusters::DishwasherMode::Attributes::StartUpMode::Id: + return "StartUpMode"; + case chip::app::Clusters::DishwasherMode::Attributes::OnMode::Id: + return "OnMode"; + case chip::app::Clusters::DishwasherMode::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::DishwasherMode::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::DishwasherMode::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::DishwasherMode::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::DishwasherMode::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::DishwasherMode::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::AirQuality::Id: { + switch (id) + { + case chip::app::Clusters::AirQuality::Attributes::AirQuality::Id: + return "AirQuality"; + case chip::app::Clusters::AirQuality::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::AirQuality::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::AirQuality::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::AirQuality::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::AirQuality::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::AirQuality::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::SmokeCoAlarm::Id: { + switch (id) + { + case chip::app::Clusters::SmokeCoAlarm::Attributes::ExpressedState::Id: + return "ExpressedState"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::SmokeState::Id: + return "SmokeState"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::COState::Id: + return "COState"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::BatteryAlert::Id: + return "BatteryAlert"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::DeviceMuted::Id: + return "DeviceMuted"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::TestInProgress::Id: + return "TestInProgress"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::HardwareFaultAlert::Id: + return "HardwareFaultAlert"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::EndOfServiceAlert::Id: + return "EndOfServiceAlert"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::InterconnectSmokeAlarm::Id: + return "InterconnectSmokeAlarm"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::InterconnectCOAlarm::Id: + return "InterconnectCOAlarm"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::ContaminationState::Id: + return "ContaminationState"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::SmokeSensitivityLevel::Id: + return "SmokeSensitivityLevel"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::ExpiryDate::Id: + return "ExpiryDate"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DishwasherAlarm::Id: { + switch (id) + { + case chip::app::Clusters::DishwasherAlarm::Attributes::Mask::Id: + return "Mask"; + case chip::app::Clusters::DishwasherAlarm::Attributes::Latch::Id: + return "Latch"; + case chip::app::Clusters::DishwasherAlarm::Attributes::State::Id: + return "State"; + case chip::app::Clusters::DishwasherAlarm::Attributes::Supported::Id: + return "Supported"; + case chip::app::Clusters::DishwasherAlarm::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::DishwasherAlarm::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::DishwasherAlarm::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::DishwasherAlarm::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::DishwasherAlarm::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::DishwasherAlarm::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::MicrowaveOvenMode::Id: { + switch (id) + { + case chip::app::Clusters::MicrowaveOvenMode::Attributes::SupportedModes::Id: + return "SupportedModes"; + case chip::app::Clusters::MicrowaveOvenMode::Attributes::CurrentMode::Id: + return "CurrentMode"; + case chip::app::Clusters::MicrowaveOvenMode::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::MicrowaveOvenMode::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::MicrowaveOvenMode::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::MicrowaveOvenMode::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::MicrowaveOvenMode::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::MicrowaveOvenMode::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::MicrowaveOvenControl::Id: { + switch (id) + { + case chip::app::Clusters::MicrowaveOvenControl::Attributes::CookTime::Id: + return "CookTime"; + case chip::app::Clusters::MicrowaveOvenControl::Attributes::MaxCookTime::Id: + return "MaxCookTime"; + case chip::app::Clusters::MicrowaveOvenControl::Attributes::PowerSetting::Id: + return "PowerSetting"; + case chip::app::Clusters::MicrowaveOvenControl::Attributes::MinPower::Id: + return "MinPower"; + case chip::app::Clusters::MicrowaveOvenControl::Attributes::MaxPower::Id: + return "MaxPower"; + case chip::app::Clusters::MicrowaveOvenControl::Attributes::PowerStep::Id: + return "PowerStep"; + case chip::app::Clusters::MicrowaveOvenControl::Attributes::SupportedWatts::Id: + return "SupportedWatts"; + case chip::app::Clusters::MicrowaveOvenControl::Attributes::SelectedWattIndex::Id: + return "SelectedWattIndex"; + case chip::app::Clusters::MicrowaveOvenControl::Attributes::WattRating::Id: + return "WattRating"; + case chip::app::Clusters::MicrowaveOvenControl::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::MicrowaveOvenControl::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::MicrowaveOvenControl::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::MicrowaveOvenControl::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::MicrowaveOvenControl::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::MicrowaveOvenControl::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OperationalState::Id: { + switch (id) + { + case chip::app::Clusters::OperationalState::Attributes::PhaseList::Id: + return "PhaseList"; + case chip::app::Clusters::OperationalState::Attributes::CurrentPhase::Id: + return "CurrentPhase"; + case chip::app::Clusters::OperationalState::Attributes::CountdownTime::Id: + return "CountdownTime"; + case chip::app::Clusters::OperationalState::Attributes::OperationalStateList::Id: + return "OperationalStateList"; + case chip::app::Clusters::OperationalState::Attributes::OperationalState::Id: + return "OperationalState"; + case chip::app::Clusters::OperationalState::Attributes::OperationalError::Id: + return "OperationalError"; + case chip::app::Clusters::OperationalState::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::OperationalState::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::OperationalState::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::OperationalState::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::OperationalState::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::OperationalState::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::RvcOperationalState::Id: { + switch (id) + { + case chip::app::Clusters::RvcOperationalState::Attributes::PhaseList::Id: + return "PhaseList"; + case chip::app::Clusters::RvcOperationalState::Attributes::CurrentPhase::Id: + return "CurrentPhase"; + case chip::app::Clusters::RvcOperationalState::Attributes::CountdownTime::Id: + return "CountdownTime"; + case chip::app::Clusters::RvcOperationalState::Attributes::OperationalStateList::Id: + return "OperationalStateList"; + case chip::app::Clusters::RvcOperationalState::Attributes::OperationalState::Id: + return "OperationalState"; + case chip::app::Clusters::RvcOperationalState::Attributes::OperationalError::Id: + return "OperationalError"; + case chip::app::Clusters::RvcOperationalState::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::RvcOperationalState::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::RvcOperationalState::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::RvcOperationalState::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::RvcOperationalState::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::RvcOperationalState::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ScenesManagement::Id: { + switch (id) + { + case chip::app::Clusters::ScenesManagement::Attributes::LastConfiguredBy::Id: + return "LastConfiguredBy"; + case chip::app::Clusters::ScenesManagement::Attributes::SceneTableSize::Id: + return "SceneTableSize"; + case chip::app::Clusters::ScenesManagement::Attributes::FabricSceneInfo::Id: + return "FabricSceneInfo"; + case chip::app::Clusters::ScenesManagement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ScenesManagement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ScenesManagement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ScenesManagement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ScenesManagement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ScenesManagement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::HepaFilterMonitoring::Id: { + switch (id) + { + case chip::app::Clusters::HepaFilterMonitoring::Attributes::Condition::Id: + return "Condition"; + case chip::app::Clusters::HepaFilterMonitoring::Attributes::DegradationDirection::Id: + return "DegradationDirection"; + case chip::app::Clusters::HepaFilterMonitoring::Attributes::ChangeIndication::Id: + return "ChangeIndication"; + case chip::app::Clusters::HepaFilterMonitoring::Attributes::InPlaceIndicator::Id: + return "InPlaceIndicator"; + case chip::app::Clusters::HepaFilterMonitoring::Attributes::LastChangedTime::Id: + return "LastChangedTime"; + case chip::app::Clusters::HepaFilterMonitoring::Attributes::ReplacementProductList::Id: + return "ReplacementProductList"; + case chip::app::Clusters::HepaFilterMonitoring::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::HepaFilterMonitoring::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::HepaFilterMonitoring::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::HepaFilterMonitoring::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::HepaFilterMonitoring::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::HepaFilterMonitoring::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ActivatedCarbonFilterMonitoring::Id: { + switch (id) + { + case chip::app::Clusters::ActivatedCarbonFilterMonitoring::Attributes::Condition::Id: + return "Condition"; + case chip::app::Clusters::ActivatedCarbonFilterMonitoring::Attributes::DegradationDirection::Id: + return "DegradationDirection"; + case chip::app::Clusters::ActivatedCarbonFilterMonitoring::Attributes::ChangeIndication::Id: + return "ChangeIndication"; + case chip::app::Clusters::ActivatedCarbonFilterMonitoring::Attributes::InPlaceIndicator::Id: + return "InPlaceIndicator"; + case chip::app::Clusters::ActivatedCarbonFilterMonitoring::Attributes::LastChangedTime::Id: + return "LastChangedTime"; + case chip::app::Clusters::ActivatedCarbonFilterMonitoring::Attributes::ReplacementProductList::Id: + return "ReplacementProductList"; + case chip::app::Clusters::ActivatedCarbonFilterMonitoring::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ActivatedCarbonFilterMonitoring::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ActivatedCarbonFilterMonitoring::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ActivatedCarbonFilterMonitoring::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ActivatedCarbonFilterMonitoring::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ActivatedCarbonFilterMonitoring::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::BooleanStateConfiguration::Id: { + switch (id) + { + case chip::app::Clusters::BooleanStateConfiguration::Attributes::CurrentSensitivityLevel::Id: + return "CurrentSensitivityLevel"; + case chip::app::Clusters::BooleanStateConfiguration::Attributes::SupportedSensitivityLevels::Id: + return "SupportedSensitivityLevels"; + case chip::app::Clusters::BooleanStateConfiguration::Attributes::DefaultSensitivityLevel::Id: + return "DefaultSensitivityLevel"; + case chip::app::Clusters::BooleanStateConfiguration::Attributes::AlarmsActive::Id: + return "AlarmsActive"; + case chip::app::Clusters::BooleanStateConfiguration::Attributes::AlarmsSuppressed::Id: + return "AlarmsSuppressed"; + case chip::app::Clusters::BooleanStateConfiguration::Attributes::AlarmsEnabled::Id: + return "AlarmsEnabled"; + case chip::app::Clusters::BooleanStateConfiguration::Attributes::AlarmsSupported::Id: + return "AlarmsSupported"; + case chip::app::Clusters::BooleanStateConfiguration::Attributes::SensorFault::Id: + return "SensorFault"; + case chip::app::Clusters::BooleanStateConfiguration::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::BooleanStateConfiguration::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::BooleanStateConfiguration::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::BooleanStateConfiguration::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::BooleanStateConfiguration::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::BooleanStateConfiguration::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ValveConfigurationAndControl::Id: { + switch (id) + { + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::OpenDuration::Id: + return "OpenDuration"; + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::DefaultOpenDuration::Id: + return "DefaultOpenDuration"; + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::AutoCloseTime::Id: + return "AutoCloseTime"; + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::RemainingDuration::Id: + return "RemainingDuration"; + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::CurrentState::Id: + return "CurrentState"; + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::TargetState::Id: + return "TargetState"; + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::CurrentLevel::Id: + return "CurrentLevel"; + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::TargetLevel::Id: + return "TargetLevel"; + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::DefaultOpenLevel::Id: + return "DefaultOpenLevel"; + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::ValveFault::Id: + return "ValveFault"; + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::LevelStep::Id: + return "LevelStep"; + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ElectricalPowerMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::PowerMode::Id: + return "PowerMode"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::NumberOfMeasurementTypes::Id: + return "NumberOfMeasurementTypes"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::Accuracy::Id: + return "Accuracy"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::Ranges::Id: + return "Ranges"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::Voltage::Id: + return "Voltage"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::ActiveCurrent::Id: + return "ActiveCurrent"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::ReactiveCurrent::Id: + return "ReactiveCurrent"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::ApparentCurrent::Id: + return "ApparentCurrent"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::ActivePower::Id: + return "ActivePower"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::ReactivePower::Id: + return "ReactivePower"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::ApparentPower::Id: + return "ApparentPower"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::RMSVoltage::Id: + return "RMSVoltage"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::RMSCurrent::Id: + return "RMSCurrent"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::RMSPower::Id: + return "RMSPower"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::Frequency::Id: + return "Frequency"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::HarmonicCurrents::Id: + return "HarmonicCurrents"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::HarmonicPhases::Id: + return "HarmonicPhases"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::PowerFactor::Id: + return "PowerFactor"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::NeutralCurrent::Id: + return "NeutralCurrent"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ElectricalEnergyMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::ElectricalEnergyMeasurement::Attributes::Accuracy::Id: + return "Accuracy"; + case chip::app::Clusters::ElectricalEnergyMeasurement::Attributes::CumulativeEnergyImported::Id: + return "CumulativeEnergyImported"; + case chip::app::Clusters::ElectricalEnergyMeasurement::Attributes::CumulativeEnergyExported::Id: + return "CumulativeEnergyExported"; + case chip::app::Clusters::ElectricalEnergyMeasurement::Attributes::PeriodicEnergyImported::Id: + return "PeriodicEnergyImported"; + case chip::app::Clusters::ElectricalEnergyMeasurement::Attributes::PeriodicEnergyExported::Id: + return "PeriodicEnergyExported"; + case chip::app::Clusters::ElectricalEnergyMeasurement::Attributes::CumulativeEnergyReset::Id: + return "CumulativeEnergyReset"; + case chip::app::Clusters::ElectricalEnergyMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ElectricalEnergyMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ElectricalEnergyMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ElectricalEnergyMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ElectricalEnergyMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ElectricalEnergyMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::WaterHeaterManagement::Id: { + switch (id) + { + case chip::app::Clusters::WaterHeaterManagement::Attributes::HeaterTypes::Id: + return "HeaterTypes"; + case chip::app::Clusters::WaterHeaterManagement::Attributes::HeatDemand::Id: + return "HeatDemand"; + case chip::app::Clusters::WaterHeaterManagement::Attributes::TankVolume::Id: + return "TankVolume"; + case chip::app::Clusters::WaterHeaterManagement::Attributes::EstimatedHeatRequired::Id: + return "EstimatedHeatRequired"; + case chip::app::Clusters::WaterHeaterManagement::Attributes::TankPercentage::Id: + return "TankPercentage"; + case chip::app::Clusters::WaterHeaterManagement::Attributes::BoostState::Id: + return "BoostState"; + case chip::app::Clusters::WaterHeaterManagement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::WaterHeaterManagement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::WaterHeaterManagement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::WaterHeaterManagement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::WaterHeaterManagement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::WaterHeaterManagement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DemandResponseLoadControl::Id: { + switch (id) + { + case chip::app::Clusters::DemandResponseLoadControl::Attributes::LoadControlPrograms::Id: + return "LoadControlPrograms"; + case chip::app::Clusters::DemandResponseLoadControl::Attributes::NumberOfLoadControlPrograms::Id: + return "NumberOfLoadControlPrograms"; + case chip::app::Clusters::DemandResponseLoadControl::Attributes::Events::Id: + return "Events"; + case chip::app::Clusters::DemandResponseLoadControl::Attributes::ActiveEvents::Id: + return "ActiveEvents"; + case chip::app::Clusters::DemandResponseLoadControl::Attributes::NumberOfEventsPerProgram::Id: + return "NumberOfEventsPerProgram"; + case chip::app::Clusters::DemandResponseLoadControl::Attributes::NumberOfTransitions::Id: + return "NumberOfTransitions"; + case chip::app::Clusters::DemandResponseLoadControl::Attributes::DefaultRandomStart::Id: + return "DefaultRandomStart"; + case chip::app::Clusters::DemandResponseLoadControl::Attributes::DefaultRandomDuration::Id: + return "DefaultRandomDuration"; + case chip::app::Clusters::DemandResponseLoadControl::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::DemandResponseLoadControl::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::DemandResponseLoadControl::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::DemandResponseLoadControl::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::DemandResponseLoadControl::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::DemandResponseLoadControl::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Messages::Id: { + switch (id) + { + case chip::app::Clusters::Messages::Attributes::Messages::Id: + return "Messages"; + case chip::app::Clusters::Messages::Attributes::ActiveMessageIDs::Id: + return "ActiveMessageIDs"; + case chip::app::Clusters::Messages::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::Messages::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::Messages::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::Messages::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::Messages::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::Messages::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DeviceEnergyManagement::Id: { + switch (id) + { + case chip::app::Clusters::DeviceEnergyManagement::Attributes::ESAType::Id: + return "ESAType"; + case chip::app::Clusters::DeviceEnergyManagement::Attributes::ESACanGenerate::Id: + return "ESACanGenerate"; + case chip::app::Clusters::DeviceEnergyManagement::Attributes::ESAState::Id: + return "ESAState"; + case chip::app::Clusters::DeviceEnergyManagement::Attributes::AbsMinPower::Id: + return "AbsMinPower"; + case chip::app::Clusters::DeviceEnergyManagement::Attributes::AbsMaxPower::Id: + return "AbsMaxPower"; + case chip::app::Clusters::DeviceEnergyManagement::Attributes::PowerAdjustmentCapability::Id: + return "PowerAdjustmentCapability"; + case chip::app::Clusters::DeviceEnergyManagement::Attributes::Forecast::Id: + return "Forecast"; + case chip::app::Clusters::DeviceEnergyManagement::Attributes::OptOutState::Id: + return "OptOutState"; + case chip::app::Clusters::DeviceEnergyManagement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::DeviceEnergyManagement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::DeviceEnergyManagement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::DeviceEnergyManagement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::DeviceEnergyManagement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::DeviceEnergyManagement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::EnergyEvse::Id: { + switch (id) + { + case chip::app::Clusters::EnergyEvse::Attributes::State::Id: + return "State"; + case chip::app::Clusters::EnergyEvse::Attributes::SupplyState::Id: + return "SupplyState"; + case chip::app::Clusters::EnergyEvse::Attributes::FaultState::Id: + return "FaultState"; + case chip::app::Clusters::EnergyEvse::Attributes::ChargingEnabledUntil::Id: + return "ChargingEnabledUntil"; + case chip::app::Clusters::EnergyEvse::Attributes::DischargingEnabledUntil::Id: + return "DischargingEnabledUntil"; + case chip::app::Clusters::EnergyEvse::Attributes::CircuitCapacity::Id: + return "CircuitCapacity"; + case chip::app::Clusters::EnergyEvse::Attributes::MinimumChargeCurrent::Id: + return "MinimumChargeCurrent"; + case chip::app::Clusters::EnergyEvse::Attributes::MaximumChargeCurrent::Id: + return "MaximumChargeCurrent"; + case chip::app::Clusters::EnergyEvse::Attributes::MaximumDischargeCurrent::Id: + return "MaximumDischargeCurrent"; + case chip::app::Clusters::EnergyEvse::Attributes::UserMaximumChargeCurrent::Id: + return "UserMaximumChargeCurrent"; + case chip::app::Clusters::EnergyEvse::Attributes::RandomizationDelayWindow::Id: + return "RandomizationDelayWindow"; + case chip::app::Clusters::EnergyEvse::Attributes::NextChargeStartTime::Id: + return "NextChargeStartTime"; + case chip::app::Clusters::EnergyEvse::Attributes::NextChargeTargetTime::Id: + return "NextChargeTargetTime"; + case chip::app::Clusters::EnergyEvse::Attributes::NextChargeRequiredEnergy::Id: + return "NextChargeRequiredEnergy"; + case chip::app::Clusters::EnergyEvse::Attributes::NextChargeTargetSoC::Id: + return "NextChargeTargetSoC"; + case chip::app::Clusters::EnergyEvse::Attributes::ApproximateEVEfficiency::Id: + return "ApproximateEVEfficiency"; + case chip::app::Clusters::EnergyEvse::Attributes::StateOfCharge::Id: + return "StateOfCharge"; + case chip::app::Clusters::EnergyEvse::Attributes::BatteryCapacity::Id: + return "BatteryCapacity"; + case chip::app::Clusters::EnergyEvse::Attributes::VehicleID::Id: + return "VehicleID"; + case chip::app::Clusters::EnergyEvse::Attributes::SessionID::Id: + return "SessionID"; + case chip::app::Clusters::EnergyEvse::Attributes::SessionDuration::Id: + return "SessionDuration"; + case chip::app::Clusters::EnergyEvse::Attributes::SessionEnergyCharged::Id: + return "SessionEnergyCharged"; + case chip::app::Clusters::EnergyEvse::Attributes::SessionEnergyDischarged::Id: + return "SessionEnergyDischarged"; + case chip::app::Clusters::EnergyEvse::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::EnergyEvse::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::EnergyEvse::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::EnergyEvse::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::EnergyEvse::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::EnergyEvse::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::EnergyPreference::Id: { + switch (id) + { + case chip::app::Clusters::EnergyPreference::Attributes::EnergyBalances::Id: + return "EnergyBalances"; + case chip::app::Clusters::EnergyPreference::Attributes::CurrentEnergyBalance::Id: + return "CurrentEnergyBalance"; + case chip::app::Clusters::EnergyPreference::Attributes::EnergyPriorities::Id: + return "EnergyPriorities"; + case chip::app::Clusters::EnergyPreference::Attributes::LowPowerModeSensitivities::Id: + return "LowPowerModeSensitivities"; + case chip::app::Clusters::EnergyPreference::Attributes::CurrentLowPowerModeSensitivity::Id: + return "CurrentLowPowerModeSensitivity"; + case chip::app::Clusters::EnergyPreference::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::EnergyPreference::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::EnergyPreference::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::EnergyPreference::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::EnergyPreference::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::EnergyPreference::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::PowerTopology::Id: { + switch (id) + { + case chip::app::Clusters::PowerTopology::Attributes::AvailableEndpoints::Id: + return "AvailableEndpoints"; + case chip::app::Clusters::PowerTopology::Attributes::ActiveEndpoints::Id: + return "ActiveEndpoints"; + case chip::app::Clusters::PowerTopology::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::PowerTopology::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::PowerTopology::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::PowerTopology::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::PowerTopology::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::PowerTopology::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::EnergyEvseMode::Id: { + switch (id) + { + case chip::app::Clusters::EnergyEvseMode::Attributes::SupportedModes::Id: + return "SupportedModes"; + case chip::app::Clusters::EnergyEvseMode::Attributes::CurrentMode::Id: + return "CurrentMode"; + case chip::app::Clusters::EnergyEvseMode::Attributes::StartUpMode::Id: + return "StartUpMode"; + case chip::app::Clusters::EnergyEvseMode::Attributes::OnMode::Id: + return "OnMode"; + case chip::app::Clusters::EnergyEvseMode::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::EnergyEvseMode::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::EnergyEvseMode::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::EnergyEvseMode::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::EnergyEvseMode::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::EnergyEvseMode::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::WaterHeaterMode::Id: { + switch (id) + { + case chip::app::Clusters::WaterHeaterMode::Attributes::SupportedModes::Id: + return "SupportedModes"; + case chip::app::Clusters::WaterHeaterMode::Attributes::CurrentMode::Id: + return "CurrentMode"; + case chip::app::Clusters::WaterHeaterMode::Attributes::StartUpMode::Id: + return "StartUpMode"; + case chip::app::Clusters::WaterHeaterMode::Attributes::OnMode::Id: + return "OnMode"; + case chip::app::Clusters::WaterHeaterMode::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::WaterHeaterMode::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::WaterHeaterMode::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::WaterHeaterMode::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::WaterHeaterMode::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::WaterHeaterMode::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DeviceEnergyManagementMode::Id: { + switch (id) + { + case chip::app::Clusters::DeviceEnergyManagementMode::Attributes::SupportedModes::Id: + return "SupportedModes"; + case chip::app::Clusters::DeviceEnergyManagementMode::Attributes::CurrentMode::Id: + return "CurrentMode"; + case chip::app::Clusters::DeviceEnergyManagementMode::Attributes::StartUpMode::Id: + return "StartUpMode"; + case chip::app::Clusters::DeviceEnergyManagementMode::Attributes::OnMode::Id: + return "OnMode"; + case chip::app::Clusters::DeviceEnergyManagementMode::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::DeviceEnergyManagementMode::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::DeviceEnergyManagementMode::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::DeviceEnergyManagementMode::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::DeviceEnergyManagementMode::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::DeviceEnergyManagementMode::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DoorLock::Id: { + switch (id) + { + case chip::app::Clusters::DoorLock::Attributes::LockState::Id: + return "LockState"; + case chip::app::Clusters::DoorLock::Attributes::LockType::Id: + return "LockType"; + case chip::app::Clusters::DoorLock::Attributes::ActuatorEnabled::Id: + return "ActuatorEnabled"; + case chip::app::Clusters::DoorLock::Attributes::DoorState::Id: + return "DoorState"; + case chip::app::Clusters::DoorLock::Attributes::DoorOpenEvents::Id: + return "DoorOpenEvents"; + case chip::app::Clusters::DoorLock::Attributes::DoorClosedEvents::Id: + return "DoorClosedEvents"; + case chip::app::Clusters::DoorLock::Attributes::OpenPeriod::Id: + return "OpenPeriod"; + case chip::app::Clusters::DoorLock::Attributes::NumberOfTotalUsersSupported::Id: + return "NumberOfTotalUsersSupported"; + case chip::app::Clusters::DoorLock::Attributes::NumberOfPINUsersSupported::Id: + return "NumberOfPINUsersSupported"; + case chip::app::Clusters::DoorLock::Attributes::NumberOfRFIDUsersSupported::Id: + return "NumberOfRFIDUsersSupported"; + case chip::app::Clusters::DoorLock::Attributes::NumberOfWeekDaySchedulesSupportedPerUser::Id: + return "NumberOfWeekDaySchedulesSupportedPerUser"; + case chip::app::Clusters::DoorLock::Attributes::NumberOfYearDaySchedulesSupportedPerUser::Id: + return "NumberOfYearDaySchedulesSupportedPerUser"; + case chip::app::Clusters::DoorLock::Attributes::NumberOfHolidaySchedulesSupported::Id: + return "NumberOfHolidaySchedulesSupported"; + case chip::app::Clusters::DoorLock::Attributes::MaxPINCodeLength::Id: + return "MaxPINCodeLength"; + case chip::app::Clusters::DoorLock::Attributes::MinPINCodeLength::Id: + return "MinPINCodeLength"; + case chip::app::Clusters::DoorLock::Attributes::MaxRFIDCodeLength::Id: + return "MaxRFIDCodeLength"; + case chip::app::Clusters::DoorLock::Attributes::MinRFIDCodeLength::Id: + return "MinRFIDCodeLength"; + case chip::app::Clusters::DoorLock::Attributes::CredentialRulesSupport::Id: + return "CredentialRulesSupport"; + case chip::app::Clusters::DoorLock::Attributes::NumberOfCredentialsSupportedPerUser::Id: + return "NumberOfCredentialsSupportedPerUser"; + case chip::app::Clusters::DoorLock::Attributes::Language::Id: + return "Language"; + case chip::app::Clusters::DoorLock::Attributes::LEDSettings::Id: + return "LEDSettings"; + case chip::app::Clusters::DoorLock::Attributes::AutoRelockTime::Id: + return "AutoRelockTime"; + case chip::app::Clusters::DoorLock::Attributes::SoundVolume::Id: + return "SoundVolume"; + case chip::app::Clusters::DoorLock::Attributes::OperatingMode::Id: + return "OperatingMode"; + case chip::app::Clusters::DoorLock::Attributes::SupportedOperatingModes::Id: + return "SupportedOperatingModes"; + case chip::app::Clusters::DoorLock::Attributes::DefaultConfigurationRegister::Id: + return "DefaultConfigurationRegister"; + case chip::app::Clusters::DoorLock::Attributes::EnableLocalProgramming::Id: + return "EnableLocalProgramming"; + case chip::app::Clusters::DoorLock::Attributes::EnableOneTouchLocking::Id: + return "EnableOneTouchLocking"; + case chip::app::Clusters::DoorLock::Attributes::EnableInsideStatusLED::Id: + return "EnableInsideStatusLED"; + case chip::app::Clusters::DoorLock::Attributes::EnablePrivacyModeButton::Id: + return "EnablePrivacyModeButton"; + case chip::app::Clusters::DoorLock::Attributes::LocalProgrammingFeatures::Id: + return "LocalProgrammingFeatures"; + case chip::app::Clusters::DoorLock::Attributes::WrongCodeEntryLimit::Id: + return "WrongCodeEntryLimit"; + case chip::app::Clusters::DoorLock::Attributes::UserCodeTemporaryDisableTime::Id: + return "UserCodeTemporaryDisableTime"; + case chip::app::Clusters::DoorLock::Attributes::SendPINOverTheAir::Id: + return "SendPINOverTheAir"; + case chip::app::Clusters::DoorLock::Attributes::RequirePINforRemoteOperation::Id: + return "RequirePINforRemoteOperation"; + case chip::app::Clusters::DoorLock::Attributes::ExpiringUserTimeout::Id: + return "ExpiringUserTimeout"; + case chip::app::Clusters::DoorLock::Attributes::AliroReaderVerificationKey::Id: + return "AliroReaderVerificationKey"; + case chip::app::Clusters::DoorLock::Attributes::AliroReaderGroupIdentifier::Id: + return "AliroReaderGroupIdentifier"; + case chip::app::Clusters::DoorLock::Attributes::AliroReaderGroupSubIdentifier::Id: + return "AliroReaderGroupSubIdentifier"; + case chip::app::Clusters::DoorLock::Attributes::AliroExpeditedTransactionSupportedProtocolVersions::Id: + return "AliroExpeditedTransactionSupportedProtocolVersions"; + case chip::app::Clusters::DoorLock::Attributes::AliroGroupResolvingKey::Id: + return "AliroGroupResolvingKey"; + case chip::app::Clusters::DoorLock::Attributes::AliroSupportedBLEUWBProtocolVersions::Id: + return "AliroSupportedBLEUWBProtocolVersions"; + case chip::app::Clusters::DoorLock::Attributes::AliroBLEAdvertisingVersion::Id: + return "AliroBLEAdvertisingVersion"; + case chip::app::Clusters::DoorLock::Attributes::NumberOfAliroCredentialIssuerKeysSupported::Id: + return "NumberOfAliroCredentialIssuerKeysSupported"; + case chip::app::Clusters::DoorLock::Attributes::NumberOfAliroEndpointKeysSupported::Id: + return "NumberOfAliroEndpointKeysSupported"; + case chip::app::Clusters::DoorLock::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::DoorLock::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::DoorLock::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::DoorLock::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::DoorLock::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::DoorLock::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::WindowCovering::Id: { + switch (id) + { + case chip::app::Clusters::WindowCovering::Attributes::Type::Id: + return "Type"; + case chip::app::Clusters::WindowCovering::Attributes::PhysicalClosedLimitLift::Id: + return "PhysicalClosedLimitLift"; + case chip::app::Clusters::WindowCovering::Attributes::PhysicalClosedLimitTilt::Id: + return "PhysicalClosedLimitTilt"; + case chip::app::Clusters::WindowCovering::Attributes::CurrentPositionLift::Id: + return "CurrentPositionLift"; + case chip::app::Clusters::WindowCovering::Attributes::CurrentPositionTilt::Id: + return "CurrentPositionTilt"; + case chip::app::Clusters::WindowCovering::Attributes::NumberOfActuationsLift::Id: + return "NumberOfActuationsLift"; + case chip::app::Clusters::WindowCovering::Attributes::NumberOfActuationsTilt::Id: + return "NumberOfActuationsTilt"; + case chip::app::Clusters::WindowCovering::Attributes::ConfigStatus::Id: + return "ConfigStatus"; + case chip::app::Clusters::WindowCovering::Attributes::CurrentPositionLiftPercentage::Id: + return "CurrentPositionLiftPercentage"; + case chip::app::Clusters::WindowCovering::Attributes::CurrentPositionTiltPercentage::Id: + return "CurrentPositionTiltPercentage"; + case chip::app::Clusters::WindowCovering::Attributes::OperationalStatus::Id: + return "OperationalStatus"; + case chip::app::Clusters::WindowCovering::Attributes::TargetPositionLiftPercent100ths::Id: + return "TargetPositionLiftPercent100ths"; + case chip::app::Clusters::WindowCovering::Attributes::TargetPositionTiltPercent100ths::Id: + return "TargetPositionTiltPercent100ths"; + case chip::app::Clusters::WindowCovering::Attributes::EndProductType::Id: + return "EndProductType"; + case chip::app::Clusters::WindowCovering::Attributes::CurrentPositionLiftPercent100ths::Id: + return "CurrentPositionLiftPercent100ths"; + case chip::app::Clusters::WindowCovering::Attributes::CurrentPositionTiltPercent100ths::Id: + return "CurrentPositionTiltPercent100ths"; + case chip::app::Clusters::WindowCovering::Attributes::InstalledOpenLimitLift::Id: + return "InstalledOpenLimitLift"; + case chip::app::Clusters::WindowCovering::Attributes::InstalledClosedLimitLift::Id: + return "InstalledClosedLimitLift"; + case chip::app::Clusters::WindowCovering::Attributes::InstalledOpenLimitTilt::Id: + return "InstalledOpenLimitTilt"; + case chip::app::Clusters::WindowCovering::Attributes::InstalledClosedLimitTilt::Id: + return "InstalledClosedLimitTilt"; + case chip::app::Clusters::WindowCovering::Attributes::Mode::Id: + return "Mode"; + case chip::app::Clusters::WindowCovering::Attributes::SafetyStatus::Id: + return "SafetyStatus"; + case chip::app::Clusters::WindowCovering::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::WindowCovering::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::WindowCovering::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::WindowCovering::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::WindowCovering::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::WindowCovering::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::BarrierControl::Id: { + switch (id) + { + case chip::app::Clusters::BarrierControl::Attributes::BarrierMovingState::Id: + return "BarrierMovingState"; + case chip::app::Clusters::BarrierControl::Attributes::BarrierSafetyStatus::Id: + return "BarrierSafetyStatus"; + case chip::app::Clusters::BarrierControl::Attributes::BarrierCapabilities::Id: + return "BarrierCapabilities"; + case chip::app::Clusters::BarrierControl::Attributes::BarrierOpenEvents::Id: + return "BarrierOpenEvents"; + case chip::app::Clusters::BarrierControl::Attributes::BarrierCloseEvents::Id: + return "BarrierCloseEvents"; + case chip::app::Clusters::BarrierControl::Attributes::BarrierCommandOpenEvents::Id: + return "BarrierCommandOpenEvents"; + case chip::app::Clusters::BarrierControl::Attributes::BarrierCommandCloseEvents::Id: + return "BarrierCommandCloseEvents"; + case chip::app::Clusters::BarrierControl::Attributes::BarrierOpenPeriod::Id: + return "BarrierOpenPeriod"; + case chip::app::Clusters::BarrierControl::Attributes::BarrierClosePeriod::Id: + return "BarrierClosePeriod"; + case chip::app::Clusters::BarrierControl::Attributes::BarrierPosition::Id: + return "BarrierPosition"; + case chip::app::Clusters::BarrierControl::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::BarrierControl::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::BarrierControl::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::BarrierControl::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::BarrierControl::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::BarrierControl::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ServiceArea::Id: { + switch (id) + { + case chip::app::Clusters::ServiceArea::Attributes::SupportedAreas::Id: + return "SupportedAreas"; + case chip::app::Clusters::ServiceArea::Attributes::SupportedMaps::Id: + return "SupportedMaps"; + case chip::app::Clusters::ServiceArea::Attributes::SelectedAreas::Id: + return "SelectedAreas"; + case chip::app::Clusters::ServiceArea::Attributes::CurrentArea::Id: + return "CurrentArea"; + case chip::app::Clusters::ServiceArea::Attributes::EstimatedEndTime::Id: + return "EstimatedEndTime"; + case chip::app::Clusters::ServiceArea::Attributes::Progress::Id: + return "Progress"; + case chip::app::Clusters::ServiceArea::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ServiceArea::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ServiceArea::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ServiceArea::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ServiceArea::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ServiceArea::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::PumpConfigurationAndControl::Id: { + switch (id) + { + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxPressure::Id: + return "MaxPressure"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxSpeed::Id: + return "MaxSpeed"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxFlow::Id: + return "MaxFlow"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinConstPressure::Id: + return "MinConstPressure"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxConstPressure::Id: + return "MaxConstPressure"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinCompPressure::Id: + return "MinCompPressure"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxCompPressure::Id: + return "MaxCompPressure"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinConstSpeed::Id: + return "MinConstSpeed"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxConstSpeed::Id: + return "MaxConstSpeed"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinConstFlow::Id: + return "MinConstFlow"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxConstFlow::Id: + return "MaxConstFlow"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinConstTemp::Id: + return "MinConstTemp"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxConstTemp::Id: + return "MaxConstTemp"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::PumpStatus::Id: + return "PumpStatus"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::EffectiveOperationMode::Id: + return "EffectiveOperationMode"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::EffectiveControlMode::Id: + return "EffectiveControlMode"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::Capacity::Id: + return "Capacity"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::Speed::Id: + return "Speed"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::LifetimeRunningHours::Id: + return "LifetimeRunningHours"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::Power::Id: + return "Power"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::LifetimeEnergyConsumed::Id: + return "LifetimeEnergyConsumed"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::OperationMode::Id: + return "OperationMode"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::ControlMode::Id: + return "ControlMode"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Thermostat::Id: { + switch (id) + { + case chip::app::Clusters::Thermostat::Attributes::LocalTemperature::Id: + return "LocalTemperature"; + case chip::app::Clusters::Thermostat::Attributes::OutdoorTemperature::Id: + return "OutdoorTemperature"; + case chip::app::Clusters::Thermostat::Attributes::Occupancy::Id: + return "Occupancy"; + case chip::app::Clusters::Thermostat::Attributes::AbsMinHeatSetpointLimit::Id: + return "AbsMinHeatSetpointLimit"; + case chip::app::Clusters::Thermostat::Attributes::AbsMaxHeatSetpointLimit::Id: + return "AbsMaxHeatSetpointLimit"; + case chip::app::Clusters::Thermostat::Attributes::AbsMinCoolSetpointLimit::Id: + return "AbsMinCoolSetpointLimit"; + case chip::app::Clusters::Thermostat::Attributes::AbsMaxCoolSetpointLimit::Id: + return "AbsMaxCoolSetpointLimit"; + case chip::app::Clusters::Thermostat::Attributes::PICoolingDemand::Id: + return "PICoolingDemand"; + case chip::app::Clusters::Thermostat::Attributes::PIHeatingDemand::Id: + return "PIHeatingDemand"; + case chip::app::Clusters::Thermostat::Attributes::HVACSystemTypeConfiguration::Id: + return "HVACSystemTypeConfiguration"; + case chip::app::Clusters::Thermostat::Attributes::LocalTemperatureCalibration::Id: + return "LocalTemperatureCalibration"; + case chip::app::Clusters::Thermostat::Attributes::OccupiedCoolingSetpoint::Id: + return "OccupiedCoolingSetpoint"; + case chip::app::Clusters::Thermostat::Attributes::OccupiedHeatingSetpoint::Id: + return "OccupiedHeatingSetpoint"; + case chip::app::Clusters::Thermostat::Attributes::UnoccupiedCoolingSetpoint::Id: + return "UnoccupiedCoolingSetpoint"; + case chip::app::Clusters::Thermostat::Attributes::UnoccupiedHeatingSetpoint::Id: + return "UnoccupiedHeatingSetpoint"; + case chip::app::Clusters::Thermostat::Attributes::MinHeatSetpointLimit::Id: + return "MinHeatSetpointLimit"; + case chip::app::Clusters::Thermostat::Attributes::MaxHeatSetpointLimit::Id: + return "MaxHeatSetpointLimit"; + case chip::app::Clusters::Thermostat::Attributes::MinCoolSetpointLimit::Id: + return "MinCoolSetpointLimit"; + case chip::app::Clusters::Thermostat::Attributes::MaxCoolSetpointLimit::Id: + return "MaxCoolSetpointLimit"; + case chip::app::Clusters::Thermostat::Attributes::MinSetpointDeadBand::Id: + return "MinSetpointDeadBand"; + case chip::app::Clusters::Thermostat::Attributes::RemoteSensing::Id: + return "RemoteSensing"; + case chip::app::Clusters::Thermostat::Attributes::ControlSequenceOfOperation::Id: + return "ControlSequenceOfOperation"; + case chip::app::Clusters::Thermostat::Attributes::SystemMode::Id: + return "SystemMode"; + case chip::app::Clusters::Thermostat::Attributes::ThermostatRunningMode::Id: + return "ThermostatRunningMode"; + case chip::app::Clusters::Thermostat::Attributes::StartOfWeek::Id: + return "StartOfWeek"; + case chip::app::Clusters::Thermostat::Attributes::NumberOfWeeklyTransitions::Id: + return "NumberOfWeeklyTransitions"; + case chip::app::Clusters::Thermostat::Attributes::NumberOfDailyTransitions::Id: + return "NumberOfDailyTransitions"; + case chip::app::Clusters::Thermostat::Attributes::TemperatureSetpointHold::Id: + return "TemperatureSetpointHold"; + case chip::app::Clusters::Thermostat::Attributes::TemperatureSetpointHoldDuration::Id: + return "TemperatureSetpointHoldDuration"; + case chip::app::Clusters::Thermostat::Attributes::ThermostatProgrammingOperationMode::Id: + return "ThermostatProgrammingOperationMode"; + case chip::app::Clusters::Thermostat::Attributes::ThermostatRunningState::Id: + return "ThermostatRunningState"; + case chip::app::Clusters::Thermostat::Attributes::SetpointChangeSource::Id: + return "SetpointChangeSource"; + case chip::app::Clusters::Thermostat::Attributes::SetpointChangeAmount::Id: + return "SetpointChangeAmount"; + case chip::app::Clusters::Thermostat::Attributes::SetpointChangeSourceTimestamp::Id: + return "SetpointChangeSourceTimestamp"; + case chip::app::Clusters::Thermostat::Attributes::OccupiedSetback::Id: + return "OccupiedSetback"; + case chip::app::Clusters::Thermostat::Attributes::OccupiedSetbackMin::Id: + return "OccupiedSetbackMin"; + case chip::app::Clusters::Thermostat::Attributes::OccupiedSetbackMax::Id: + return "OccupiedSetbackMax"; + case chip::app::Clusters::Thermostat::Attributes::UnoccupiedSetback::Id: + return "UnoccupiedSetback"; + case chip::app::Clusters::Thermostat::Attributes::UnoccupiedSetbackMin::Id: + return "UnoccupiedSetbackMin"; + case chip::app::Clusters::Thermostat::Attributes::UnoccupiedSetbackMax::Id: + return "UnoccupiedSetbackMax"; + case chip::app::Clusters::Thermostat::Attributes::EmergencyHeatDelta::Id: + return "EmergencyHeatDelta"; + case chip::app::Clusters::Thermostat::Attributes::ACType::Id: + return "ACType"; + case chip::app::Clusters::Thermostat::Attributes::ACCapacity::Id: + return "ACCapacity"; + case chip::app::Clusters::Thermostat::Attributes::ACRefrigerantType::Id: + return "ACRefrigerantType"; + case chip::app::Clusters::Thermostat::Attributes::ACCompressorType::Id: + return "ACCompressorType"; + case chip::app::Clusters::Thermostat::Attributes::ACErrorCode::Id: + return "ACErrorCode"; + case chip::app::Clusters::Thermostat::Attributes::ACLouverPosition::Id: + return "ACLouverPosition"; + case chip::app::Clusters::Thermostat::Attributes::ACCoilTemperature::Id: + return "ACCoilTemperature"; + case chip::app::Clusters::Thermostat::Attributes::ACCapacityformat::Id: + return "ACCapacityformat"; + case chip::app::Clusters::Thermostat::Attributes::PresetTypes::Id: + return "PresetTypes"; + case chip::app::Clusters::Thermostat::Attributes::ScheduleTypes::Id: + return "ScheduleTypes"; + case chip::app::Clusters::Thermostat::Attributes::NumberOfPresets::Id: + return "NumberOfPresets"; + case chip::app::Clusters::Thermostat::Attributes::NumberOfSchedules::Id: + return "NumberOfSchedules"; + case chip::app::Clusters::Thermostat::Attributes::NumberOfScheduleTransitions::Id: + return "NumberOfScheduleTransitions"; + case chip::app::Clusters::Thermostat::Attributes::NumberOfScheduleTransitionPerDay::Id: + return "NumberOfScheduleTransitionPerDay"; + case chip::app::Clusters::Thermostat::Attributes::ActivePresetHandle::Id: + return "ActivePresetHandle"; + case chip::app::Clusters::Thermostat::Attributes::ActiveScheduleHandle::Id: + return "ActiveScheduleHandle"; + case chip::app::Clusters::Thermostat::Attributes::Presets::Id: + return "Presets"; + case chip::app::Clusters::Thermostat::Attributes::Schedules::Id: + return "Schedules"; + case chip::app::Clusters::Thermostat::Attributes::SetpointHoldExpiryTimestamp::Id: + return "SetpointHoldExpiryTimestamp"; + case chip::app::Clusters::Thermostat::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::Thermostat::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::Thermostat::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::Thermostat::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::Thermostat::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::Thermostat::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::FanControl::Id: { + switch (id) + { + case chip::app::Clusters::FanControl::Attributes::FanMode::Id: + return "FanMode"; + case chip::app::Clusters::FanControl::Attributes::FanModeSequence::Id: + return "FanModeSequence"; + case chip::app::Clusters::FanControl::Attributes::PercentSetting::Id: + return "PercentSetting"; + case chip::app::Clusters::FanControl::Attributes::PercentCurrent::Id: + return "PercentCurrent"; + case chip::app::Clusters::FanControl::Attributes::SpeedMax::Id: + return "SpeedMax"; + case chip::app::Clusters::FanControl::Attributes::SpeedSetting::Id: + return "SpeedSetting"; + case chip::app::Clusters::FanControl::Attributes::SpeedCurrent::Id: + return "SpeedCurrent"; + case chip::app::Clusters::FanControl::Attributes::RockSupport::Id: + return "RockSupport"; + case chip::app::Clusters::FanControl::Attributes::RockSetting::Id: + return "RockSetting"; + case chip::app::Clusters::FanControl::Attributes::WindSupport::Id: + return "WindSupport"; + case chip::app::Clusters::FanControl::Attributes::WindSetting::Id: + return "WindSetting"; + case chip::app::Clusters::FanControl::Attributes::AirflowDirection::Id: + return "AirflowDirection"; + case chip::app::Clusters::FanControl::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::FanControl::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::FanControl::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::FanControl::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::FanControl::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::FanControl::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ThermostatUserInterfaceConfiguration::Id: { + switch (id) + { + case chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::Id: + return "TemperatureDisplayMode"; + case chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::Id: + return "KeypadLockout"; + case chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::Id: + return "ScheduleProgrammingVisibility"; + case chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ColorControl::Id: { + switch (id) + { + case chip::app::Clusters::ColorControl::Attributes::CurrentHue::Id: + return "CurrentHue"; + case chip::app::Clusters::ColorControl::Attributes::CurrentSaturation::Id: + return "CurrentSaturation"; + case chip::app::Clusters::ColorControl::Attributes::RemainingTime::Id: + return "RemainingTime"; + case chip::app::Clusters::ColorControl::Attributes::CurrentX::Id: + return "CurrentX"; + case chip::app::Clusters::ColorControl::Attributes::CurrentY::Id: + return "CurrentY"; + case chip::app::Clusters::ColorControl::Attributes::DriftCompensation::Id: + return "DriftCompensation"; + case chip::app::Clusters::ColorControl::Attributes::CompensationText::Id: + return "CompensationText"; + case chip::app::Clusters::ColorControl::Attributes::ColorTemperatureMireds::Id: + return "ColorTemperatureMireds"; + case chip::app::Clusters::ColorControl::Attributes::ColorMode::Id: + return "ColorMode"; + case chip::app::Clusters::ColorControl::Attributes::Options::Id: + return "Options"; + case chip::app::Clusters::ColorControl::Attributes::NumberOfPrimaries::Id: + return "NumberOfPrimaries"; + case chip::app::Clusters::ColorControl::Attributes::Primary1X::Id: + return "Primary1X"; + case chip::app::Clusters::ColorControl::Attributes::Primary1Y::Id: + return "Primary1Y"; + case chip::app::Clusters::ColorControl::Attributes::Primary1Intensity::Id: + return "Primary1Intensity"; + case chip::app::Clusters::ColorControl::Attributes::Primary2X::Id: + return "Primary2X"; + case chip::app::Clusters::ColorControl::Attributes::Primary2Y::Id: + return "Primary2Y"; + case chip::app::Clusters::ColorControl::Attributes::Primary2Intensity::Id: + return "Primary2Intensity"; + case chip::app::Clusters::ColorControl::Attributes::Primary3X::Id: + return "Primary3X"; + case chip::app::Clusters::ColorControl::Attributes::Primary3Y::Id: + return "Primary3Y"; + case chip::app::Clusters::ColorControl::Attributes::Primary3Intensity::Id: + return "Primary3Intensity"; + case chip::app::Clusters::ColorControl::Attributes::Primary4X::Id: + return "Primary4X"; + case chip::app::Clusters::ColorControl::Attributes::Primary4Y::Id: + return "Primary4Y"; + case chip::app::Clusters::ColorControl::Attributes::Primary4Intensity::Id: + return "Primary4Intensity"; + case chip::app::Clusters::ColorControl::Attributes::Primary5X::Id: + return "Primary5X"; + case chip::app::Clusters::ColorControl::Attributes::Primary5Y::Id: + return "Primary5Y"; + case chip::app::Clusters::ColorControl::Attributes::Primary5Intensity::Id: + return "Primary5Intensity"; + case chip::app::Clusters::ColorControl::Attributes::Primary6X::Id: + return "Primary6X"; + case chip::app::Clusters::ColorControl::Attributes::Primary6Y::Id: + return "Primary6Y"; + case chip::app::Clusters::ColorControl::Attributes::Primary6Intensity::Id: + return "Primary6Intensity"; + case chip::app::Clusters::ColorControl::Attributes::WhitePointX::Id: + return "WhitePointX"; + case chip::app::Clusters::ColorControl::Attributes::WhitePointY::Id: + return "WhitePointY"; + case chip::app::Clusters::ColorControl::Attributes::ColorPointRX::Id: + return "ColorPointRX"; + case chip::app::Clusters::ColorControl::Attributes::ColorPointRY::Id: + return "ColorPointRY"; + case chip::app::Clusters::ColorControl::Attributes::ColorPointRIntensity::Id: + return "ColorPointRIntensity"; + case chip::app::Clusters::ColorControl::Attributes::ColorPointGX::Id: + return "ColorPointGX"; + case chip::app::Clusters::ColorControl::Attributes::ColorPointGY::Id: + return "ColorPointGY"; + case chip::app::Clusters::ColorControl::Attributes::ColorPointGIntensity::Id: + return "ColorPointGIntensity"; + case chip::app::Clusters::ColorControl::Attributes::ColorPointBX::Id: + return "ColorPointBX"; + case chip::app::Clusters::ColorControl::Attributes::ColorPointBY::Id: + return "ColorPointBY"; + case chip::app::Clusters::ColorControl::Attributes::ColorPointBIntensity::Id: + return "ColorPointBIntensity"; + case chip::app::Clusters::ColorControl::Attributes::EnhancedCurrentHue::Id: + return "EnhancedCurrentHue"; + case chip::app::Clusters::ColorControl::Attributes::EnhancedColorMode::Id: + return "EnhancedColorMode"; + case chip::app::Clusters::ColorControl::Attributes::ColorLoopActive::Id: + return "ColorLoopActive"; + case chip::app::Clusters::ColorControl::Attributes::ColorLoopDirection::Id: + return "ColorLoopDirection"; + case chip::app::Clusters::ColorControl::Attributes::ColorLoopTime::Id: + return "ColorLoopTime"; + case chip::app::Clusters::ColorControl::Attributes::ColorLoopStartEnhancedHue::Id: + return "ColorLoopStartEnhancedHue"; + case chip::app::Clusters::ColorControl::Attributes::ColorLoopStoredEnhancedHue::Id: + return "ColorLoopStoredEnhancedHue"; + case chip::app::Clusters::ColorControl::Attributes::ColorCapabilities::Id: + return "ColorCapabilities"; + case chip::app::Clusters::ColorControl::Attributes::ColorTempPhysicalMinMireds::Id: + return "ColorTempPhysicalMinMireds"; + case chip::app::Clusters::ColorControl::Attributes::ColorTempPhysicalMaxMireds::Id: + return "ColorTempPhysicalMaxMireds"; + case chip::app::Clusters::ColorControl::Attributes::CoupleColorTempToLevelMinMireds::Id: + return "CoupleColorTempToLevelMinMireds"; + case chip::app::Clusters::ColorControl::Attributes::StartUpColorTemperatureMireds::Id: + return "StartUpColorTemperatureMireds"; + case chip::app::Clusters::ColorControl::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ColorControl::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ColorControl::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ColorControl::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ColorControl::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ColorControl::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::BallastConfiguration::Id: { + switch (id) + { + case chip::app::Clusters::BallastConfiguration::Attributes::PhysicalMinLevel::Id: + return "PhysicalMinLevel"; + case chip::app::Clusters::BallastConfiguration::Attributes::PhysicalMaxLevel::Id: + return "PhysicalMaxLevel"; + case chip::app::Clusters::BallastConfiguration::Attributes::BallastStatus::Id: + return "BallastStatus"; + case chip::app::Clusters::BallastConfiguration::Attributes::MinLevel::Id: + return "MinLevel"; + case chip::app::Clusters::BallastConfiguration::Attributes::MaxLevel::Id: + return "MaxLevel"; + case chip::app::Clusters::BallastConfiguration::Attributes::IntrinsicBallastFactor::Id: + return "IntrinsicBallastFactor"; + case chip::app::Clusters::BallastConfiguration::Attributes::BallastFactorAdjustment::Id: + return "BallastFactorAdjustment"; + case chip::app::Clusters::BallastConfiguration::Attributes::LampQuantity::Id: + return "LampQuantity"; + case chip::app::Clusters::BallastConfiguration::Attributes::LampType::Id: + return "LampType"; + case chip::app::Clusters::BallastConfiguration::Attributes::LampManufacturer::Id: + return "LampManufacturer"; + case chip::app::Clusters::BallastConfiguration::Attributes::LampRatedHours::Id: + return "LampRatedHours"; + case chip::app::Clusters::BallastConfiguration::Attributes::LampBurnHours::Id: + return "LampBurnHours"; + case chip::app::Clusters::BallastConfiguration::Attributes::LampAlarmMode::Id: + return "LampAlarmMode"; + case chip::app::Clusters::BallastConfiguration::Attributes::LampBurnHoursTripPoint::Id: + return "LampBurnHoursTripPoint"; + case chip::app::Clusters::BallastConfiguration::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::BallastConfiguration::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::BallastConfiguration::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::BallastConfiguration::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::BallastConfiguration::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::BallastConfiguration::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::IlluminanceMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::IlluminanceMeasurement::Attributes::MeasuredValue::Id: + return "MeasuredValue"; + case chip::app::Clusters::IlluminanceMeasurement::Attributes::MinMeasuredValue::Id: + return "MinMeasuredValue"; + case chip::app::Clusters::IlluminanceMeasurement::Attributes::MaxMeasuredValue::Id: + return "MaxMeasuredValue"; + case chip::app::Clusters::IlluminanceMeasurement::Attributes::Tolerance::Id: + return "Tolerance"; + case chip::app::Clusters::IlluminanceMeasurement::Attributes::LightSensorType::Id: + return "LightSensorType"; + case chip::app::Clusters::IlluminanceMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::IlluminanceMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::IlluminanceMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::IlluminanceMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::IlluminanceMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::IlluminanceMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::TemperatureMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::TemperatureMeasurement::Attributes::MeasuredValue::Id: + return "MeasuredValue"; + case chip::app::Clusters::TemperatureMeasurement::Attributes::MinMeasuredValue::Id: + return "MinMeasuredValue"; + case chip::app::Clusters::TemperatureMeasurement::Attributes::MaxMeasuredValue::Id: + return "MaxMeasuredValue"; + case chip::app::Clusters::TemperatureMeasurement::Attributes::Tolerance::Id: + return "Tolerance"; + case chip::app::Clusters::TemperatureMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::TemperatureMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::TemperatureMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::TemperatureMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::TemperatureMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::TemperatureMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::PressureMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::PressureMeasurement::Attributes::MeasuredValue::Id: + return "MeasuredValue"; + case chip::app::Clusters::PressureMeasurement::Attributes::MinMeasuredValue::Id: + return "MinMeasuredValue"; + case chip::app::Clusters::PressureMeasurement::Attributes::MaxMeasuredValue::Id: + return "MaxMeasuredValue"; + case chip::app::Clusters::PressureMeasurement::Attributes::Tolerance::Id: + return "Tolerance"; + case chip::app::Clusters::PressureMeasurement::Attributes::ScaledValue::Id: + return "ScaledValue"; + case chip::app::Clusters::PressureMeasurement::Attributes::MinScaledValue::Id: + return "MinScaledValue"; + case chip::app::Clusters::PressureMeasurement::Attributes::MaxScaledValue::Id: + return "MaxScaledValue"; + case chip::app::Clusters::PressureMeasurement::Attributes::ScaledTolerance::Id: + return "ScaledTolerance"; + case chip::app::Clusters::PressureMeasurement::Attributes::Scale::Id: + return "Scale"; + case chip::app::Clusters::PressureMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::PressureMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::PressureMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::PressureMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::PressureMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::PressureMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::FlowMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::FlowMeasurement::Attributes::MeasuredValue::Id: + return "MeasuredValue"; + case chip::app::Clusters::FlowMeasurement::Attributes::MinMeasuredValue::Id: + return "MinMeasuredValue"; + case chip::app::Clusters::FlowMeasurement::Attributes::MaxMeasuredValue::Id: + return "MaxMeasuredValue"; + case chip::app::Clusters::FlowMeasurement::Attributes::Tolerance::Id: + return "Tolerance"; + case chip::app::Clusters::FlowMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::FlowMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::FlowMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::FlowMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::FlowMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::FlowMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::RelativeHumidityMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::RelativeHumidityMeasurement::Attributes::MeasuredValue::Id: + return "MeasuredValue"; + case chip::app::Clusters::RelativeHumidityMeasurement::Attributes::MinMeasuredValue::Id: + return "MinMeasuredValue"; + case chip::app::Clusters::RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::Id: + return "MaxMeasuredValue"; + case chip::app::Clusters::RelativeHumidityMeasurement::Attributes::Tolerance::Id: + return "Tolerance"; + case chip::app::Clusters::RelativeHumidityMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::RelativeHumidityMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::RelativeHumidityMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::RelativeHumidityMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::RelativeHumidityMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::RelativeHumidityMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OccupancySensing::Id: { + switch (id) + { + case chip::app::Clusters::OccupancySensing::Attributes::Occupancy::Id: + return "Occupancy"; + case chip::app::Clusters::OccupancySensing::Attributes::OccupancySensorType::Id: + return "OccupancySensorType"; + case chip::app::Clusters::OccupancySensing::Attributes::OccupancySensorTypeBitmap::Id: + return "OccupancySensorTypeBitmap"; + case chip::app::Clusters::OccupancySensing::Attributes::HoldTime::Id: + return "HoldTime"; + case chip::app::Clusters::OccupancySensing::Attributes::HoldTimeLimits::Id: + return "HoldTimeLimits"; + case chip::app::Clusters::OccupancySensing::Attributes::PIROccupiedToUnoccupiedDelay::Id: + return "PIROccupiedToUnoccupiedDelay"; + case chip::app::Clusters::OccupancySensing::Attributes::PIRUnoccupiedToOccupiedDelay::Id: + return "PIRUnoccupiedToOccupiedDelay"; + case chip::app::Clusters::OccupancySensing::Attributes::PIRUnoccupiedToOccupiedThreshold::Id: + return "PIRUnoccupiedToOccupiedThreshold"; + case chip::app::Clusters::OccupancySensing::Attributes::UltrasonicOccupiedToUnoccupiedDelay::Id: + return "UltrasonicOccupiedToUnoccupiedDelay"; + case chip::app::Clusters::OccupancySensing::Attributes::UltrasonicUnoccupiedToOccupiedDelay::Id: + return "UltrasonicUnoccupiedToOccupiedDelay"; + case chip::app::Clusters::OccupancySensing::Attributes::UltrasonicUnoccupiedToOccupiedThreshold::Id: + return "UltrasonicUnoccupiedToOccupiedThreshold"; + case chip::app::Clusters::OccupancySensing::Attributes::PhysicalContactOccupiedToUnoccupiedDelay::Id: + return "PhysicalContactOccupiedToUnoccupiedDelay"; + case chip::app::Clusters::OccupancySensing::Attributes::PhysicalContactUnoccupiedToOccupiedDelay::Id: + return "PhysicalContactUnoccupiedToOccupiedDelay"; + case chip::app::Clusters::OccupancySensing::Attributes::PhysicalContactUnoccupiedToOccupiedThreshold::Id: + return "PhysicalContactUnoccupiedToOccupiedThreshold"; + case chip::app::Clusters::OccupancySensing::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::OccupancySensing::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::OccupancySensing::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::OccupancySensing::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::OccupancySensing::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::OccupancySensing::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::MeasuredValue::Id: + return "MeasuredValue"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::MinMeasuredValue::Id: + return "MinMeasuredValue"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: + return "MaxMeasuredValue"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: + return "PeakMeasuredValue"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: + return "PeakMeasuredValueWindow"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: + return "AverageMeasuredValue"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: + return "AverageMeasuredValueWindow"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::Uncertainty::Id: + return "Uncertainty"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::MeasurementUnit::Id: + return "MeasurementUnit"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::MeasurementMedium::Id: + return "MeasurementMedium"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::LevelValue::Id: + return "LevelValue"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::MeasuredValue::Id: + return "MeasuredValue"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::MinMeasuredValue::Id: + return "MinMeasuredValue"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: + return "MaxMeasuredValue"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: + return "PeakMeasuredValue"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: + return "PeakMeasuredValueWindow"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: + return "AverageMeasuredValue"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: + return "AverageMeasuredValueWindow"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::Uncertainty::Id: + return "Uncertainty"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::MeasurementUnit::Id: + return "MeasurementUnit"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::MeasurementMedium::Id: + return "MeasurementMedium"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::LevelValue::Id: + return "LevelValue"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::MeasuredValue::Id: + return "MeasuredValue"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::MinMeasuredValue::Id: + return "MinMeasuredValue"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: + return "MaxMeasuredValue"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: + return "PeakMeasuredValue"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: + return "PeakMeasuredValueWindow"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: + return "AverageMeasuredValue"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: + return "AverageMeasuredValueWindow"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::Uncertainty::Id: + return "Uncertainty"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::MeasurementUnit::Id: + return "MeasurementUnit"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::MeasurementMedium::Id: + return "MeasurementMedium"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::LevelValue::Id: + return "LevelValue"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OzoneConcentrationMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::MeasuredValue::Id: + return "MeasuredValue"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::MinMeasuredValue::Id: + return "MinMeasuredValue"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: + return "MaxMeasuredValue"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: + return "PeakMeasuredValue"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: + return "PeakMeasuredValueWindow"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: + return "AverageMeasuredValue"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: + return "AverageMeasuredValueWindow"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::Uncertainty::Id: + return "Uncertainty"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::MeasurementUnit::Id: + return "MeasurementUnit"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::MeasurementMedium::Id: + return "MeasurementMedium"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::LevelValue::Id: + return "LevelValue"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Pm25ConcentrationMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::MeasuredValue::Id: + return "MeasuredValue"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::MinMeasuredValue::Id: + return "MinMeasuredValue"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: + return "MaxMeasuredValue"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: + return "PeakMeasuredValue"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: + return "PeakMeasuredValueWindow"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: + return "AverageMeasuredValue"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: + return "AverageMeasuredValueWindow"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::Uncertainty::Id: + return "Uncertainty"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::MeasurementUnit::Id: + return "MeasurementUnit"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::MeasurementMedium::Id: + return "MeasurementMedium"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::LevelValue::Id: + return "LevelValue"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::MeasuredValue::Id: + return "MeasuredValue"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::MinMeasuredValue::Id: + return "MinMeasuredValue"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: + return "MaxMeasuredValue"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: + return "PeakMeasuredValue"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: + return "PeakMeasuredValueWindow"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: + return "AverageMeasuredValue"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: + return "AverageMeasuredValueWindow"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::Uncertainty::Id: + return "Uncertainty"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::MeasurementUnit::Id: + return "MeasurementUnit"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::MeasurementMedium::Id: + return "MeasurementMedium"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::LevelValue::Id: + return "LevelValue"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Pm1ConcentrationMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::MeasuredValue::Id: + return "MeasuredValue"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::MinMeasuredValue::Id: + return "MinMeasuredValue"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: + return "MaxMeasuredValue"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: + return "PeakMeasuredValue"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: + return "PeakMeasuredValueWindow"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: + return "AverageMeasuredValue"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: + return "AverageMeasuredValueWindow"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::Uncertainty::Id: + return "Uncertainty"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::MeasurementUnit::Id: + return "MeasurementUnit"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::MeasurementMedium::Id: + return "MeasurementMedium"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::LevelValue::Id: + return "LevelValue"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Pm10ConcentrationMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::MeasuredValue::Id: + return "MeasuredValue"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::MinMeasuredValue::Id: + return "MinMeasuredValue"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: + return "MaxMeasuredValue"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: + return "PeakMeasuredValue"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: + return "PeakMeasuredValueWindow"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: + return "AverageMeasuredValue"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: + return "AverageMeasuredValueWindow"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::Uncertainty::Id: + return "Uncertainty"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::MeasurementUnit::Id: + return "MeasurementUnit"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::MeasurementMedium::Id: + return "MeasurementMedium"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::LevelValue::Id: + return "LevelValue"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MeasuredValue::Id: + return "MeasuredValue"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MinMeasuredValue::Id: + return "MinMeasuredValue"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: + return "MaxMeasuredValue"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: + return "PeakMeasuredValue"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: + return "PeakMeasuredValueWindow"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: + return "AverageMeasuredValue"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: + return "AverageMeasuredValueWindow"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::Uncertainty::Id: + return "Uncertainty"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MeasurementUnit::Id: + return "MeasurementUnit"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MeasurementMedium::Id: + return "MeasurementMedium"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::LevelValue::Id: + return "LevelValue"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::RadonConcentrationMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::MeasuredValue::Id: + return "MeasuredValue"; + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::MinMeasuredValue::Id: + return "MinMeasuredValue"; + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: + return "MaxMeasuredValue"; + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: + return "PeakMeasuredValue"; + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: + return "PeakMeasuredValueWindow"; + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: + return "AverageMeasuredValue"; + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: + return "AverageMeasuredValueWindow"; + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::Uncertainty::Id: + return "Uncertainty"; + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::MeasurementUnit::Id: + return "MeasurementUnit"; + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::MeasurementMedium::Id: + return "MeasurementMedium"; + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::LevelValue::Id: + return "LevelValue"; + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::WiFiNetworkManagement::Id: { + switch (id) + { + case chip::app::Clusters::WiFiNetworkManagement::Attributes::Ssid::Id: + return "Ssid"; + case chip::app::Clusters::WiFiNetworkManagement::Attributes::PassphraseSurrogate::Id: + return "PassphraseSurrogate"; + case chip::app::Clusters::WiFiNetworkManagement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::WiFiNetworkManagement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::WiFiNetworkManagement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::WiFiNetworkManagement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::WiFiNetworkManagement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::WiFiNetworkManagement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ThreadBorderRouterManagement::Id: { + switch (id) + { + case chip::app::Clusters::ThreadBorderRouterManagement::Attributes::BorderRouterName::Id: + return "BorderRouterName"; + case chip::app::Clusters::ThreadBorderRouterManagement::Attributes::BorderAgentID::Id: + return "BorderAgentID"; + case chip::app::Clusters::ThreadBorderRouterManagement::Attributes::ThreadVersion::Id: + return "ThreadVersion"; + case chip::app::Clusters::ThreadBorderRouterManagement::Attributes::InterfaceEnabled::Id: + return "InterfaceEnabled"; + case chip::app::Clusters::ThreadBorderRouterManagement::Attributes::ActiveDatasetTimestamp::Id: + return "ActiveDatasetTimestamp"; + case chip::app::Clusters::ThreadBorderRouterManagement::Attributes::PendingDatasetTimestamp::Id: + return "PendingDatasetTimestamp"; + case chip::app::Clusters::ThreadBorderRouterManagement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ThreadBorderRouterManagement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ThreadBorderRouterManagement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ThreadBorderRouterManagement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ThreadBorderRouterManagement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ThreadBorderRouterManagement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ThreadNetworkDirectory::Id: { + switch (id) + { + case chip::app::Clusters::ThreadNetworkDirectory::Attributes::PreferredExtendedPanID::Id: + return "PreferredExtendedPanID"; + case chip::app::Clusters::ThreadNetworkDirectory::Attributes::ThreadNetworks::Id: + return "ThreadNetworks"; + case chip::app::Clusters::ThreadNetworkDirectory::Attributes::ThreadNetworkTableSize::Id: + return "ThreadNetworkTableSize"; + case chip::app::Clusters::ThreadNetworkDirectory::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ThreadNetworkDirectory::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ThreadNetworkDirectory::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ThreadNetworkDirectory::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ThreadNetworkDirectory::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ThreadNetworkDirectory::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::WakeOnLan::Id: { + switch (id) + { + case chip::app::Clusters::WakeOnLan::Attributes::MACAddress::Id: + return "MACAddress"; + case chip::app::Clusters::WakeOnLan::Attributes::LinkLocalAddress::Id: + return "LinkLocalAddress"; + case chip::app::Clusters::WakeOnLan::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::WakeOnLan::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::WakeOnLan::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::WakeOnLan::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::WakeOnLan::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::WakeOnLan::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Channel::Id: { + switch (id) + { + case chip::app::Clusters::Channel::Attributes::ChannelList::Id: + return "ChannelList"; + case chip::app::Clusters::Channel::Attributes::Lineup::Id: + return "Lineup"; + case chip::app::Clusters::Channel::Attributes::CurrentChannel::Id: + return "CurrentChannel"; + case chip::app::Clusters::Channel::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::Channel::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::Channel::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::Channel::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::Channel::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::Channel::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::TargetNavigator::Id: { + switch (id) + { + case chip::app::Clusters::TargetNavigator::Attributes::TargetList::Id: + return "TargetList"; + case chip::app::Clusters::TargetNavigator::Attributes::CurrentTarget::Id: + return "CurrentTarget"; + case chip::app::Clusters::TargetNavigator::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::TargetNavigator::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::TargetNavigator::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::TargetNavigator::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::TargetNavigator::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::TargetNavigator::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::MediaPlayback::Id: { + switch (id) + { + case chip::app::Clusters::MediaPlayback::Attributes::CurrentState::Id: + return "CurrentState"; + case chip::app::Clusters::MediaPlayback::Attributes::StartTime::Id: + return "StartTime"; + case chip::app::Clusters::MediaPlayback::Attributes::Duration::Id: + return "Duration"; + case chip::app::Clusters::MediaPlayback::Attributes::SampledPosition::Id: + return "SampledPosition"; + case chip::app::Clusters::MediaPlayback::Attributes::PlaybackSpeed::Id: + return "PlaybackSpeed"; + case chip::app::Clusters::MediaPlayback::Attributes::SeekRangeEnd::Id: + return "SeekRangeEnd"; + case chip::app::Clusters::MediaPlayback::Attributes::SeekRangeStart::Id: + return "SeekRangeStart"; + case chip::app::Clusters::MediaPlayback::Attributes::ActiveAudioTrack::Id: + return "ActiveAudioTrack"; + case chip::app::Clusters::MediaPlayback::Attributes::AvailableAudioTracks::Id: + return "AvailableAudioTracks"; + case chip::app::Clusters::MediaPlayback::Attributes::ActiveTextTrack::Id: + return "ActiveTextTrack"; + case chip::app::Clusters::MediaPlayback::Attributes::AvailableTextTracks::Id: + return "AvailableTextTracks"; + case chip::app::Clusters::MediaPlayback::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::MediaPlayback::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::MediaPlayback::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::MediaPlayback::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::MediaPlayback::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::MediaPlayback::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::MediaInput::Id: { + switch (id) + { + case chip::app::Clusters::MediaInput::Attributes::InputList::Id: + return "InputList"; + case chip::app::Clusters::MediaInput::Attributes::CurrentInput::Id: + return "CurrentInput"; + case chip::app::Clusters::MediaInput::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::MediaInput::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::MediaInput::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::MediaInput::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::MediaInput::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::MediaInput::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::LowPower::Id: { + switch (id) + { + case chip::app::Clusters::LowPower::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::LowPower::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::LowPower::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::LowPower::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::LowPower::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::LowPower::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::KeypadInput::Id: { + switch (id) + { + case chip::app::Clusters::KeypadInput::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::KeypadInput::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::KeypadInput::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::KeypadInput::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::KeypadInput::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::KeypadInput::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ContentLauncher::Id: { + switch (id) + { + case chip::app::Clusters::ContentLauncher::Attributes::AcceptHeader::Id: + return "AcceptHeader"; + case chip::app::Clusters::ContentLauncher::Attributes::SupportedStreamingProtocols::Id: + return "SupportedStreamingProtocols"; + case chip::app::Clusters::ContentLauncher::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ContentLauncher::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ContentLauncher::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ContentLauncher::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ContentLauncher::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ContentLauncher::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::AudioOutput::Id: { + switch (id) + { + case chip::app::Clusters::AudioOutput::Attributes::OutputList::Id: + return "OutputList"; + case chip::app::Clusters::AudioOutput::Attributes::CurrentOutput::Id: + return "CurrentOutput"; + case chip::app::Clusters::AudioOutput::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::AudioOutput::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::AudioOutput::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::AudioOutput::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::AudioOutput::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::AudioOutput::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ApplicationLauncher::Id: { + switch (id) + { + case chip::app::Clusters::ApplicationLauncher::Attributes::CatalogList::Id: + return "CatalogList"; + case chip::app::Clusters::ApplicationLauncher::Attributes::CurrentApp::Id: + return "CurrentApp"; + case chip::app::Clusters::ApplicationLauncher::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ApplicationLauncher::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ApplicationLauncher::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ApplicationLauncher::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ApplicationLauncher::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ApplicationLauncher::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ApplicationBasic::Id: { + switch (id) + { + case chip::app::Clusters::ApplicationBasic::Attributes::VendorName::Id: + return "VendorName"; + case chip::app::Clusters::ApplicationBasic::Attributes::VendorID::Id: + return "VendorID"; + case chip::app::Clusters::ApplicationBasic::Attributes::ApplicationName::Id: + return "ApplicationName"; + case chip::app::Clusters::ApplicationBasic::Attributes::ProductID::Id: + return "ProductID"; + case chip::app::Clusters::ApplicationBasic::Attributes::Application::Id: + return "Application"; + case chip::app::Clusters::ApplicationBasic::Attributes::Status::Id: + return "Status"; + case chip::app::Clusters::ApplicationBasic::Attributes::ApplicationVersion::Id: + return "ApplicationVersion"; + case chip::app::Clusters::ApplicationBasic::Attributes::AllowedVendorList::Id: + return "AllowedVendorList"; + case chip::app::Clusters::ApplicationBasic::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ApplicationBasic::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ApplicationBasic::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ApplicationBasic::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ApplicationBasic::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ApplicationBasic::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::AccountLogin::Id: { + switch (id) + { + case chip::app::Clusters::AccountLogin::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::AccountLogin::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::AccountLogin::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::AccountLogin::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::AccountLogin::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::AccountLogin::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ContentControl::Id: { + switch (id) + { + case chip::app::Clusters::ContentControl::Attributes::Enabled::Id: + return "Enabled"; + case chip::app::Clusters::ContentControl::Attributes::OnDemandRatings::Id: + return "OnDemandRatings"; + case chip::app::Clusters::ContentControl::Attributes::OnDemandRatingThreshold::Id: + return "OnDemandRatingThreshold"; + case chip::app::Clusters::ContentControl::Attributes::ScheduledContentRatings::Id: + return "ScheduledContentRatings"; + case chip::app::Clusters::ContentControl::Attributes::ScheduledContentRatingThreshold::Id: + return "ScheduledContentRatingThreshold"; + case chip::app::Clusters::ContentControl::Attributes::ScreenDailyTime::Id: + return "ScreenDailyTime"; + case chip::app::Clusters::ContentControl::Attributes::RemainingScreenTime::Id: + return "RemainingScreenTime"; + case chip::app::Clusters::ContentControl::Attributes::BlockUnrated::Id: + return "BlockUnrated"; + case chip::app::Clusters::ContentControl::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ContentControl::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ContentControl::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ContentControl::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ContentControl::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ContentControl::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ContentAppObserver::Id: { + switch (id) + { + case chip::app::Clusters::ContentAppObserver::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ContentAppObserver::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ContentAppObserver::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ContentAppObserver::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ContentAppObserver::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ContentAppObserver::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::EcosystemInformation::Id: { + switch (id) + { + case chip::app::Clusters::EcosystemInformation::Attributes::RemovedOn::Id: + return "RemovedOn"; + case chip::app::Clusters::EcosystemInformation::Attributes::DeviceDirectory::Id: + return "DeviceDirectory"; + case chip::app::Clusters::EcosystemInformation::Attributes::LocationDirectory::Id: + return "LocationDirectory"; + case chip::app::Clusters::EcosystemInformation::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::EcosystemInformation::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::EcosystemInformation::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::EcosystemInformation::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::EcosystemInformation::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::EcosystemInformation::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::CommissionerControl::Id: { + switch (id) + { + case chip::app::Clusters::CommissionerControl::Attributes::SupportedDeviceCategories::Id: + return "SupportedDeviceCategories"; + case chip::app::Clusters::CommissionerControl::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::CommissionerControl::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::CommissionerControl::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::CommissionerControl::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::CommissionerControl::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::CommissionerControl::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ElectricalMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::ElectricalMeasurement::Attributes::MeasurementType::Id: + return "MeasurementType"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::DcVoltage::Id: + return "DcVoltage"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::DcVoltageMin::Id: + return "DcVoltageMin"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::DcVoltageMax::Id: + return "DcVoltageMax"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::DcCurrent::Id: + return "DcCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::DcCurrentMin::Id: + return "DcCurrentMin"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::DcCurrentMax::Id: + return "DcCurrentMax"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::DcPower::Id: + return "DcPower"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::DcPowerMin::Id: + return "DcPowerMin"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::DcPowerMax::Id: + return "DcPowerMax"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::DcVoltageMultiplier::Id: + return "DcVoltageMultiplier"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::DcVoltageDivisor::Id: + return "DcVoltageDivisor"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::DcCurrentMultiplier::Id: + return "DcCurrentMultiplier"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::DcCurrentDivisor::Id: + return "DcCurrentDivisor"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::DcPowerMultiplier::Id: + return "DcPowerMultiplier"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::DcPowerDivisor::Id: + return "DcPowerDivisor"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcFrequency::Id: + return "AcFrequency"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcFrequencyMin::Id: + return "AcFrequencyMin"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcFrequencyMax::Id: + return "AcFrequencyMax"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::NeutralCurrent::Id: + return "NeutralCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::TotalActivePower::Id: + return "TotalActivePower"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::TotalReactivePower::Id: + return "TotalReactivePower"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::TotalApparentPower::Id: + return "TotalApparentPower"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::Measured1stHarmonicCurrent::Id: + return "Measured1stHarmonicCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::Measured3rdHarmonicCurrent::Id: + return "Measured3rdHarmonicCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::Measured5thHarmonicCurrent::Id: + return "Measured5thHarmonicCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::Measured7thHarmonicCurrent::Id: + return "Measured7thHarmonicCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::Measured9thHarmonicCurrent::Id: + return "Measured9thHarmonicCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::Measured11thHarmonicCurrent::Id: + return "Measured11thHarmonicCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::MeasuredPhase1stHarmonicCurrent::Id: + return "MeasuredPhase1stHarmonicCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::MeasuredPhase3rdHarmonicCurrent::Id: + return "MeasuredPhase3rdHarmonicCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::MeasuredPhase5thHarmonicCurrent::Id: + return "MeasuredPhase5thHarmonicCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::MeasuredPhase7thHarmonicCurrent::Id: + return "MeasuredPhase7thHarmonicCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::MeasuredPhase9thHarmonicCurrent::Id: + return "MeasuredPhase9thHarmonicCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::MeasuredPhase11thHarmonicCurrent::Id: + return "MeasuredPhase11thHarmonicCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcFrequencyMultiplier::Id: + return "AcFrequencyMultiplier"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcFrequencyDivisor::Id: + return "AcFrequencyDivisor"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::PowerMultiplier::Id: + return "PowerMultiplier"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::PowerDivisor::Id: + return "PowerDivisor"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::HarmonicCurrentMultiplier::Id: + return "HarmonicCurrentMultiplier"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::PhaseHarmonicCurrentMultiplier::Id: + return "PhaseHarmonicCurrentMultiplier"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::InstantaneousVoltage::Id: + return "InstantaneousVoltage"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::InstantaneousLineCurrent::Id: + return "InstantaneousLineCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::InstantaneousActiveCurrent::Id: + return "InstantaneousActiveCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::InstantaneousReactiveCurrent::Id: + return "InstantaneousReactiveCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::InstantaneousPower::Id: + return "InstantaneousPower"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltage::Id: + return "RmsVoltage"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageMin::Id: + return "RmsVoltageMin"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageMax::Id: + return "RmsVoltageMax"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrent::Id: + return "RmsCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentMin::Id: + return "RmsCurrentMin"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentMax::Id: + return "RmsCurrentMax"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePower::Id: + return "ActivePower"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerMin::Id: + return "ActivePowerMin"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerMax::Id: + return "ActivePowerMax"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ReactivePower::Id: + return "ReactivePower"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ApparentPower::Id: + return "ApparentPower"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::PowerFactor::Id: + return "PowerFactor"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AverageRmsVoltageMeasurementPeriod::Id: + return "AverageRmsVoltageMeasurementPeriod"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AverageRmsUnderVoltageCounter::Id: + return "AverageRmsUnderVoltageCounter"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsExtremeOverVoltagePeriod::Id: + return "RmsExtremeOverVoltagePeriod"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsExtremeUnderVoltagePeriod::Id: + return "RmsExtremeUnderVoltagePeriod"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageSagPeriod::Id: + return "RmsVoltageSagPeriod"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageSwellPeriod::Id: + return "RmsVoltageSwellPeriod"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcVoltageMultiplier::Id: + return "AcVoltageMultiplier"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcVoltageDivisor::Id: + return "AcVoltageDivisor"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcCurrentMultiplier::Id: + return "AcCurrentMultiplier"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcCurrentDivisor::Id: + return "AcCurrentDivisor"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcPowerMultiplier::Id: + return "AcPowerMultiplier"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcPowerDivisor::Id: + return "AcPowerDivisor"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::OverloadAlarmsMask::Id: + return "OverloadAlarmsMask"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::VoltageOverload::Id: + return "VoltageOverload"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::CurrentOverload::Id: + return "CurrentOverload"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcOverloadAlarmsMask::Id: + return "AcOverloadAlarmsMask"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcVoltageOverload::Id: + return "AcVoltageOverload"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcCurrentOverload::Id: + return "AcCurrentOverload"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcActivePowerOverload::Id: + return "AcActivePowerOverload"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcReactivePowerOverload::Id: + return "AcReactivePowerOverload"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AverageRmsOverVoltage::Id: + return "AverageRmsOverVoltage"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AverageRmsUnderVoltage::Id: + return "AverageRmsUnderVoltage"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsExtremeOverVoltage::Id: + return "RmsExtremeOverVoltage"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsExtremeUnderVoltage::Id: + return "RmsExtremeUnderVoltage"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageSag::Id: + return "RmsVoltageSag"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageSwell::Id: + return "RmsVoltageSwell"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::LineCurrentPhaseB::Id: + return "LineCurrentPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ActiveCurrentPhaseB::Id: + return "ActiveCurrentPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ReactiveCurrentPhaseB::Id: + return "ReactiveCurrentPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltagePhaseB::Id: + return "RmsVoltagePhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageMinPhaseB::Id: + return "RmsVoltageMinPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageMaxPhaseB::Id: + return "RmsVoltageMaxPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentPhaseB::Id: + return "RmsCurrentPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentMinPhaseB::Id: + return "RmsCurrentMinPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentMaxPhaseB::Id: + return "RmsCurrentMaxPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerPhaseB::Id: + return "ActivePowerPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerMinPhaseB::Id: + return "ActivePowerMinPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerMaxPhaseB::Id: + return "ActivePowerMaxPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ReactivePowerPhaseB::Id: + return "ReactivePowerPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ApparentPowerPhaseB::Id: + return "ApparentPowerPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::PowerFactorPhaseB::Id: + return "PowerFactorPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AverageRmsVoltageMeasurementPeriodPhaseB::Id: + return "AverageRmsVoltageMeasurementPeriodPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AverageRmsOverVoltageCounterPhaseB::Id: + return "AverageRmsOverVoltageCounterPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AverageRmsUnderVoltageCounterPhaseB::Id: + return "AverageRmsUnderVoltageCounterPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsExtremeOverVoltagePeriodPhaseB::Id: + return "RmsExtremeOverVoltagePeriodPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsExtremeUnderVoltagePeriodPhaseB::Id: + return "RmsExtremeUnderVoltagePeriodPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageSagPeriodPhaseB::Id: + return "RmsVoltageSagPeriodPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageSwellPeriodPhaseB::Id: + return "RmsVoltageSwellPeriodPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::LineCurrentPhaseC::Id: + return "LineCurrentPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ActiveCurrentPhaseC::Id: + return "ActiveCurrentPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ReactiveCurrentPhaseC::Id: + return "ReactiveCurrentPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltagePhaseC::Id: + return "RmsVoltagePhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageMinPhaseC::Id: + return "RmsVoltageMinPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageMaxPhaseC::Id: + return "RmsVoltageMaxPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentPhaseC::Id: + return "RmsCurrentPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentMinPhaseC::Id: + return "RmsCurrentMinPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentMaxPhaseC::Id: + return "RmsCurrentMaxPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerPhaseC::Id: + return "ActivePowerPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerMinPhaseC::Id: + return "ActivePowerMinPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerMaxPhaseC::Id: + return "ActivePowerMaxPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ReactivePowerPhaseC::Id: + return "ReactivePowerPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ApparentPowerPhaseC::Id: + return "ApparentPowerPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::PowerFactorPhaseC::Id: + return "PowerFactorPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AverageRmsVoltageMeasurementPeriodPhaseC::Id: + return "AverageRmsVoltageMeasurementPeriodPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AverageRmsOverVoltageCounterPhaseC::Id: + return "AverageRmsOverVoltageCounterPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AverageRmsUnderVoltageCounterPhaseC::Id: + return "AverageRmsUnderVoltageCounterPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsExtremeOverVoltagePeriodPhaseC::Id: + return "RmsExtremeOverVoltagePeriodPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsExtremeUnderVoltagePeriodPhaseC::Id: + return "RmsExtremeUnderVoltagePeriodPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageSagPeriodPhaseC::Id: + return "RmsVoltageSagPeriodPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageSwellPeriodPhaseC::Id: + return "RmsVoltageSwellPeriodPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::UnitTesting::Id: { + switch (id) + { + case chip::app::Clusters::UnitTesting::Attributes::Boolean::Id: + return "Boolean"; + case chip::app::Clusters::UnitTesting::Attributes::Bitmap8::Id: + return "Bitmap8"; + case chip::app::Clusters::UnitTesting::Attributes::Bitmap16::Id: + return "Bitmap16"; + case chip::app::Clusters::UnitTesting::Attributes::Bitmap32::Id: + return "Bitmap32"; + case chip::app::Clusters::UnitTesting::Attributes::Bitmap64::Id: + return "Bitmap64"; + case chip::app::Clusters::UnitTesting::Attributes::Int8u::Id: + return "Int8u"; + case chip::app::Clusters::UnitTesting::Attributes::Int16u::Id: + return "Int16u"; + case chip::app::Clusters::UnitTesting::Attributes::Int24u::Id: + return "Int24u"; + case chip::app::Clusters::UnitTesting::Attributes::Int32u::Id: + return "Int32u"; + case chip::app::Clusters::UnitTesting::Attributes::Int40u::Id: + return "Int40u"; + case chip::app::Clusters::UnitTesting::Attributes::Int48u::Id: + return "Int48u"; + case chip::app::Clusters::UnitTesting::Attributes::Int56u::Id: + return "Int56u"; + case chip::app::Clusters::UnitTesting::Attributes::Int64u::Id: + return "Int64u"; + case chip::app::Clusters::UnitTesting::Attributes::Int8s::Id: + return "Int8s"; + case chip::app::Clusters::UnitTesting::Attributes::Int16s::Id: + return "Int16s"; + case chip::app::Clusters::UnitTesting::Attributes::Int24s::Id: + return "Int24s"; + case chip::app::Clusters::UnitTesting::Attributes::Int32s::Id: + return "Int32s"; + case chip::app::Clusters::UnitTesting::Attributes::Int40s::Id: + return "Int40s"; + case chip::app::Clusters::UnitTesting::Attributes::Int48s::Id: + return "Int48s"; + case chip::app::Clusters::UnitTesting::Attributes::Int56s::Id: + return "Int56s"; + case chip::app::Clusters::UnitTesting::Attributes::Int64s::Id: + return "Int64s"; + case chip::app::Clusters::UnitTesting::Attributes::Enum8::Id: + return "Enum8"; + case chip::app::Clusters::UnitTesting::Attributes::Enum16::Id: + return "Enum16"; + case chip::app::Clusters::UnitTesting::Attributes::FloatSingle::Id: + return "FloatSingle"; + case chip::app::Clusters::UnitTesting::Attributes::FloatDouble::Id: + return "FloatDouble"; + case chip::app::Clusters::UnitTesting::Attributes::OctetString::Id: + return "OctetString"; + case chip::app::Clusters::UnitTesting::Attributes::ListInt8u::Id: + return "ListInt8u"; + case chip::app::Clusters::UnitTesting::Attributes::ListOctetString::Id: + return "ListOctetString"; + case chip::app::Clusters::UnitTesting::Attributes::ListStructOctetString::Id: + return "ListStructOctetString"; + case chip::app::Clusters::UnitTesting::Attributes::LongOctetString::Id: + return "LongOctetString"; + case chip::app::Clusters::UnitTesting::Attributes::CharString::Id: + return "CharString"; + case chip::app::Clusters::UnitTesting::Attributes::LongCharString::Id: + return "LongCharString"; + case chip::app::Clusters::UnitTesting::Attributes::EpochUs::Id: + return "EpochUs"; + case chip::app::Clusters::UnitTesting::Attributes::EpochS::Id: + return "EpochS"; + case chip::app::Clusters::UnitTesting::Attributes::VendorId::Id: + return "VendorId"; + case chip::app::Clusters::UnitTesting::Attributes::ListNullablesAndOptionalsStruct::Id: + return "ListNullablesAndOptionalsStruct"; + case chip::app::Clusters::UnitTesting::Attributes::EnumAttr::Id: + return "EnumAttr"; + case chip::app::Clusters::UnitTesting::Attributes::StructAttr::Id: + return "StructAttr"; + case chip::app::Clusters::UnitTesting::Attributes::RangeRestrictedInt8u::Id: + return "RangeRestrictedInt8u"; + case chip::app::Clusters::UnitTesting::Attributes::RangeRestrictedInt8s::Id: + return "RangeRestrictedInt8s"; + case chip::app::Clusters::UnitTesting::Attributes::RangeRestrictedInt16u::Id: + return "RangeRestrictedInt16u"; + case chip::app::Clusters::UnitTesting::Attributes::RangeRestrictedInt16s::Id: + return "RangeRestrictedInt16s"; + case chip::app::Clusters::UnitTesting::Attributes::ListLongOctetString::Id: + return "ListLongOctetString"; + case chip::app::Clusters::UnitTesting::Attributes::ListFabricScoped::Id: + return "ListFabricScoped"; + case chip::app::Clusters::UnitTesting::Attributes::TimedWriteBoolean::Id: + return "TimedWriteBoolean"; + case chip::app::Clusters::UnitTesting::Attributes::GeneralErrorBoolean::Id: + return "GeneralErrorBoolean"; + case chip::app::Clusters::UnitTesting::Attributes::ClusterErrorBoolean::Id: + return "ClusterErrorBoolean"; + case chip::app::Clusters::UnitTesting::Attributes::GlobalEnum::Id: + return "GlobalEnum"; + case chip::app::Clusters::UnitTesting::Attributes::GlobalStruct::Id: + return "GlobalStruct"; + case chip::app::Clusters::UnitTesting::Attributes::Unsupported::Id: + return "Unsupported"; + case chip::app::Clusters::UnitTesting::Attributes::NullableBoolean::Id: + return "NullableBoolean"; + case chip::app::Clusters::UnitTesting::Attributes::NullableBitmap8::Id: + return "NullableBitmap8"; + case chip::app::Clusters::UnitTesting::Attributes::NullableBitmap16::Id: + return "NullableBitmap16"; + case chip::app::Clusters::UnitTesting::Attributes::NullableBitmap32::Id: + return "NullableBitmap32"; + case chip::app::Clusters::UnitTesting::Attributes::NullableBitmap64::Id: + return "NullableBitmap64"; + case chip::app::Clusters::UnitTesting::Attributes::NullableInt8u::Id: + return "NullableInt8u"; + case chip::app::Clusters::UnitTesting::Attributes::NullableInt16u::Id: + return "NullableInt16u"; + case chip::app::Clusters::UnitTesting::Attributes::NullableInt24u::Id: + return "NullableInt24u"; + case chip::app::Clusters::UnitTesting::Attributes::NullableInt32u::Id: + return "NullableInt32u"; + case chip::app::Clusters::UnitTesting::Attributes::NullableInt40u::Id: + return "NullableInt40u"; + case chip::app::Clusters::UnitTesting::Attributes::NullableInt48u::Id: + return "NullableInt48u"; + case chip::app::Clusters::UnitTesting::Attributes::NullableInt56u::Id: + return "NullableInt56u"; + case chip::app::Clusters::UnitTesting::Attributes::NullableInt64u::Id: + return "NullableInt64u"; + case chip::app::Clusters::UnitTesting::Attributes::NullableInt8s::Id: + return "NullableInt8s"; + case chip::app::Clusters::UnitTesting::Attributes::NullableInt16s::Id: + return "NullableInt16s"; + case chip::app::Clusters::UnitTesting::Attributes::NullableInt24s::Id: + return "NullableInt24s"; + case chip::app::Clusters::UnitTesting::Attributes::NullableInt32s::Id: + return "NullableInt32s"; + case chip::app::Clusters::UnitTesting::Attributes::NullableInt40s::Id: + return "NullableInt40s"; + case chip::app::Clusters::UnitTesting::Attributes::NullableInt48s::Id: + return "NullableInt48s"; + case chip::app::Clusters::UnitTesting::Attributes::NullableInt56s::Id: + return "NullableInt56s"; + case chip::app::Clusters::UnitTesting::Attributes::NullableInt64s::Id: + return "NullableInt64s"; + case chip::app::Clusters::UnitTesting::Attributes::NullableEnum8::Id: + return "NullableEnum8"; + case chip::app::Clusters::UnitTesting::Attributes::NullableEnum16::Id: + return "NullableEnum16"; + case chip::app::Clusters::UnitTesting::Attributes::NullableFloatSingle::Id: + return "NullableFloatSingle"; + case chip::app::Clusters::UnitTesting::Attributes::NullableFloatDouble::Id: + return "NullableFloatDouble"; + case chip::app::Clusters::UnitTesting::Attributes::NullableOctetString::Id: + return "NullableOctetString"; + case chip::app::Clusters::UnitTesting::Attributes::NullableCharString::Id: + return "NullableCharString"; + case chip::app::Clusters::UnitTesting::Attributes::NullableEnumAttr::Id: + return "NullableEnumAttr"; + case chip::app::Clusters::UnitTesting::Attributes::NullableStruct::Id: + return "NullableStruct"; + case chip::app::Clusters::UnitTesting::Attributes::NullableRangeRestrictedInt8u::Id: + return "NullableRangeRestrictedInt8u"; + case chip::app::Clusters::UnitTesting::Attributes::NullableRangeRestrictedInt8s::Id: + return "NullableRangeRestrictedInt8s"; + case chip::app::Clusters::UnitTesting::Attributes::NullableRangeRestrictedInt16u::Id: + return "NullableRangeRestrictedInt16u"; + case chip::app::Clusters::UnitTesting::Attributes::NullableRangeRestrictedInt16s::Id: + return "NullableRangeRestrictedInt16s"; + case chip::app::Clusters::UnitTesting::Attributes::WriteOnlyInt8u::Id: + return "WriteOnlyInt8u"; + case chip::app::Clusters::UnitTesting::Attributes::NullableGlobalEnum::Id: + return "NullableGlobalEnum"; + case chip::app::Clusters::UnitTesting::Attributes::NullableGlobalStruct::Id: + return "NullableGlobalStruct"; + case chip::app::Clusters::UnitTesting::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::UnitTesting::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::UnitTesting::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::UnitTesting::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::UnitTesting::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::UnitTesting::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + case chip::app::Clusters::UnitTesting::Attributes::MeiInt8u::Id: + return "MeiInt8u"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::FaultInjection::Id: { + switch (id) + { + case chip::app::Clusters::FaultInjection::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::FaultInjection::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::FaultInjection::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::FaultInjection::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::FaultInjection::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::FaultInjection::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::SampleMei::Id: { + switch (id) + { + case chip::app::Clusters::SampleMei::Attributes::FlipFlop::Id: + return "FlipFlop"; + case chip::app::Clusters::SampleMei::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::SampleMei::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::SampleMei::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::SampleMei::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::SampleMei::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::SampleMei::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + default: + return "Unknown"; + } +} + +char const * AcceptedCommandIdToText(chip::ClusterId cluster, chip::CommandId id) +{ + switch (cluster) + { + case chip::app::Clusters::Identify::Id: { + switch (id) + { + case chip::app::Clusters::Identify::Commands::Identify::Id: + return "Identify"; + case chip::app::Clusters::Identify::Commands::TriggerEffect::Id: + return "TriggerEffect"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Groups::Id: { + switch (id) + { + case chip::app::Clusters::Groups::Commands::AddGroup::Id: + return "AddGroup"; + case chip::app::Clusters::Groups::Commands::ViewGroup::Id: + return "ViewGroup"; + case chip::app::Clusters::Groups::Commands::GetGroupMembership::Id: + return "GetGroupMembership"; + case chip::app::Clusters::Groups::Commands::RemoveGroup::Id: + return "RemoveGroup"; + case chip::app::Clusters::Groups::Commands::RemoveAllGroups::Id: + return "RemoveAllGroups"; + case chip::app::Clusters::Groups::Commands::AddGroupIfIdentifying::Id: + return "AddGroupIfIdentifying"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OnOff::Id: { + switch (id) + { + case chip::app::Clusters::OnOff::Commands::Off::Id: + return "Off"; + case chip::app::Clusters::OnOff::Commands::On::Id: + return "On"; + case chip::app::Clusters::OnOff::Commands::Toggle::Id: + return "Toggle"; + case chip::app::Clusters::OnOff::Commands::OffWithEffect::Id: + return "OffWithEffect"; + case chip::app::Clusters::OnOff::Commands::OnWithRecallGlobalScene::Id: + return "OnWithRecallGlobalScene"; + case chip::app::Clusters::OnOff::Commands::OnWithTimedOff::Id: + return "OnWithTimedOff"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::LevelControl::Id: { + switch (id) + { + case chip::app::Clusters::LevelControl::Commands::MoveToLevel::Id: + return "MoveToLevel"; + case chip::app::Clusters::LevelControl::Commands::Move::Id: + return "Move"; + case chip::app::Clusters::LevelControl::Commands::Step::Id: + return "Step"; + case chip::app::Clusters::LevelControl::Commands::Stop::Id: + return "Stop"; + case chip::app::Clusters::LevelControl::Commands::MoveToLevelWithOnOff::Id: + return "MoveToLevelWithOnOff"; + case chip::app::Clusters::LevelControl::Commands::MoveWithOnOff::Id: + return "MoveWithOnOff"; + case chip::app::Clusters::LevelControl::Commands::StepWithOnOff::Id: + return "StepWithOnOff"; + case chip::app::Clusters::LevelControl::Commands::StopWithOnOff::Id: + return "StopWithOnOff"; + case chip::app::Clusters::LevelControl::Commands::MoveToClosestFrequency::Id: + return "MoveToClosestFrequency"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::AccessControl::Id: { + switch (id) + { + case chip::app::Clusters::AccessControl::Commands::ReviewFabricRestrictions::Id: + return "ReviewFabricRestrictions"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Actions::Id: { + switch (id) + { + case chip::app::Clusters::Actions::Commands::InstantAction::Id: + return "InstantAction"; + case chip::app::Clusters::Actions::Commands::InstantActionWithTransition::Id: + return "InstantActionWithTransition"; + case chip::app::Clusters::Actions::Commands::StartAction::Id: + return "StartAction"; + case chip::app::Clusters::Actions::Commands::StartActionWithDuration::Id: + return "StartActionWithDuration"; + case chip::app::Clusters::Actions::Commands::StopAction::Id: + return "StopAction"; + case chip::app::Clusters::Actions::Commands::PauseAction::Id: + return "PauseAction"; + case chip::app::Clusters::Actions::Commands::PauseActionWithDuration::Id: + return "PauseActionWithDuration"; + case chip::app::Clusters::Actions::Commands::ResumeAction::Id: + return "ResumeAction"; + case chip::app::Clusters::Actions::Commands::EnableAction::Id: + return "EnableAction"; + case chip::app::Clusters::Actions::Commands::EnableActionWithDuration::Id: + return "EnableActionWithDuration"; + case chip::app::Clusters::Actions::Commands::DisableAction::Id: + return "DisableAction"; + case chip::app::Clusters::Actions::Commands::DisableActionWithDuration::Id: + return "DisableActionWithDuration"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::BasicInformation::Id: { + switch (id) + { + case chip::app::Clusters::BasicInformation::Commands::MfgSpecificPing::Id: + return "MfgSpecificPing"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OtaSoftwareUpdateProvider::Id: { + switch (id) + { + case chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImage::Id: + return "QueryImage"; + case chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateRequest::Id: + return "ApplyUpdateRequest"; + case chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::NotifyUpdateApplied::Id: + return "NotifyUpdateApplied"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OtaSoftwareUpdateRequestor::Id: { + switch (id) + { + case chip::app::Clusters::OtaSoftwareUpdateRequestor::Commands::AnnounceOTAProvider::Id: + return "AnnounceOTAProvider"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::GeneralCommissioning::Id: { + switch (id) + { + case chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafe::Id: + return "ArmFailSafe"; + case chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfig::Id: + return "SetRegulatoryConfig"; + case chip::app::Clusters::GeneralCommissioning::Commands::CommissioningComplete::Id: + return "CommissioningComplete"; + case chip::app::Clusters::GeneralCommissioning::Commands::SetTCAcknowledgements::Id: + return "SetTCAcknowledgements"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::NetworkCommissioning::Id: { + switch (id) + { + case chip::app::Clusters::NetworkCommissioning::Commands::ScanNetworks::Id: + return "ScanNetworks"; + case chip::app::Clusters::NetworkCommissioning::Commands::AddOrUpdateWiFiNetwork::Id: + return "AddOrUpdateWiFiNetwork"; + case chip::app::Clusters::NetworkCommissioning::Commands::AddOrUpdateThreadNetwork::Id: + return "AddOrUpdateThreadNetwork"; + case chip::app::Clusters::NetworkCommissioning::Commands::RemoveNetwork::Id: + return "RemoveNetwork"; + case chip::app::Clusters::NetworkCommissioning::Commands::ConnectNetwork::Id: + return "ConnectNetwork"; + case chip::app::Clusters::NetworkCommissioning::Commands::ReorderNetwork::Id: + return "ReorderNetwork"; + case chip::app::Clusters::NetworkCommissioning::Commands::QueryIdentity::Id: + return "QueryIdentity"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DiagnosticLogs::Id: { + switch (id) + { + case chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsRequest::Id: + return "RetrieveLogsRequest"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::GeneralDiagnostics::Id: { + switch (id) + { + case chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Id: + return "TestEventTrigger"; + case chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshot::Id: + return "TimeSnapshot"; + case chip::app::Clusters::GeneralDiagnostics::Commands::PayloadTestRequest::Id: + return "PayloadTestRequest"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::SoftwareDiagnostics::Id: { + switch (id) + { + case chip::app::Clusters::SoftwareDiagnostics::Commands::ResetWatermarks::Id: + return "ResetWatermarks"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ThreadNetworkDiagnostics::Id: { + switch (id) + { + case chip::app::Clusters::ThreadNetworkDiagnostics::Commands::ResetCounts::Id: + return "ResetCounts"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::WiFiNetworkDiagnostics::Id: { + switch (id) + { + case chip::app::Clusters::WiFiNetworkDiagnostics::Commands::ResetCounts::Id: + return "ResetCounts"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::EthernetNetworkDiagnostics::Id: { + switch (id) + { + case chip::app::Clusters::EthernetNetworkDiagnostics::Commands::ResetCounts::Id: + return "ResetCounts"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::TimeSynchronization::Id: { + switch (id) + { + case chip::app::Clusters::TimeSynchronization::Commands::SetUTCTime::Id: + return "SetUTCTime"; + case chip::app::Clusters::TimeSynchronization::Commands::SetTrustedTimeSource::Id: + return "SetTrustedTimeSource"; + case chip::app::Clusters::TimeSynchronization::Commands::SetTimeZone::Id: + return "SetTimeZone"; + case chip::app::Clusters::TimeSynchronization::Commands::SetDSTOffset::Id: + return "SetDSTOffset"; + case chip::app::Clusters::TimeSynchronization::Commands::SetDefaultNTP::Id: + return "SetDefaultNTP"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::BridgedDeviceBasicInformation::Id: { + switch (id) + { + case chip::app::Clusters::BridgedDeviceBasicInformation::Commands::KeepActive::Id: + return "KeepActive"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::AdministratorCommissioning::Id: { + switch (id) + { + case chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Id: + return "OpenCommissioningWindow"; + case chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id: + return "OpenBasicCommissioningWindow"; + case chip::app::Clusters::AdministratorCommissioning::Commands::RevokeCommissioning::Id: + return "RevokeCommissioning"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OperationalCredentials::Id: { + switch (id) + { + case chip::app::Clusters::OperationalCredentials::Commands::AttestationRequest::Id: + return "AttestationRequest"; + case chip::app::Clusters::OperationalCredentials::Commands::CertificateChainRequest::Id: + return "CertificateChainRequest"; + case chip::app::Clusters::OperationalCredentials::Commands::CSRRequest::Id: + return "CSRRequest"; + case chip::app::Clusters::OperationalCredentials::Commands::AddNOC::Id: + return "AddNOC"; + case chip::app::Clusters::OperationalCredentials::Commands::UpdateNOC::Id: + return "UpdateNOC"; + case chip::app::Clusters::OperationalCredentials::Commands::UpdateFabricLabel::Id: + return "UpdateFabricLabel"; + case chip::app::Clusters::OperationalCredentials::Commands::RemoveFabric::Id: + return "RemoveFabric"; + case chip::app::Clusters::OperationalCredentials::Commands::AddTrustedRootCertificate::Id: + return "AddTrustedRootCertificate"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::GroupKeyManagement::Id: { + switch (id) + { + case chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Id: + return "KeySetWrite"; + case chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::Id: + return "KeySetRead"; + case chip::app::Clusters::GroupKeyManagement::Commands::KeySetRemove::Id: + return "KeySetRemove"; + case chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndices::Id: + return "KeySetReadAllIndices"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::IcdManagement::Id: { + switch (id) + { + case chip::app::Clusters::IcdManagement::Commands::RegisterClient::Id: + return "RegisterClient"; + case chip::app::Clusters::IcdManagement::Commands::UnregisterClient::Id: + return "UnregisterClient"; + case chip::app::Clusters::IcdManagement::Commands::StayActiveRequest::Id: + return "StayActiveRequest"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Timer::Id: { + switch (id) + { + case chip::app::Clusters::Timer::Commands::SetTimer::Id: + return "SetTimer"; + case chip::app::Clusters::Timer::Commands::ResetTimer::Id: + return "ResetTimer"; + case chip::app::Clusters::Timer::Commands::AddTime::Id: + return "AddTime"; + case chip::app::Clusters::Timer::Commands::ReduceTime::Id: + return "ReduceTime"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OvenCavityOperationalState::Id: { + switch (id) + { + case chip::app::Clusters::OvenCavityOperationalState::Commands::Pause::Id: + return "Pause"; + case chip::app::Clusters::OvenCavityOperationalState::Commands::Stop::Id: + return "Stop"; + case chip::app::Clusters::OvenCavityOperationalState::Commands::Start::Id: + return "Start"; + case chip::app::Clusters::OvenCavityOperationalState::Commands::Resume::Id: + return "Resume"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OvenMode::Id: { + switch (id) + { + case chip::app::Clusters::OvenMode::Commands::ChangeToMode::Id: + return "ChangeToMode"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ModeSelect::Id: { + switch (id) + { + case chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Id: + return "ChangeToMode"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::LaundryWasherMode::Id: { + switch (id) + { + case chip::app::Clusters::LaundryWasherMode::Commands::ChangeToMode::Id: + return "ChangeToMode"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id: { + switch (id) + { + case chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Commands::ChangeToMode::Id: + return "ChangeToMode"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::RvcRunMode::Id: { + switch (id) + { + case chip::app::Clusters::RvcRunMode::Commands::ChangeToMode::Id: + return "ChangeToMode"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::RvcCleanMode::Id: { + switch (id) + { + case chip::app::Clusters::RvcCleanMode::Commands::ChangeToMode::Id: + return "ChangeToMode"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::TemperatureControl::Id: { + switch (id) + { + case chip::app::Clusters::TemperatureControl::Commands::SetTemperature::Id: + return "SetTemperature"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DishwasherMode::Id: { + switch (id) + { + case chip::app::Clusters::DishwasherMode::Commands::ChangeToMode::Id: + return "ChangeToMode"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::SmokeCoAlarm::Id: { + switch (id) + { + case chip::app::Clusters::SmokeCoAlarm::Commands::SelfTestRequest::Id: + return "SelfTestRequest"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DishwasherAlarm::Id: { + switch (id) + { + case chip::app::Clusters::DishwasherAlarm::Commands::Reset::Id: + return "Reset"; + case chip::app::Clusters::DishwasherAlarm::Commands::ModifyEnabledAlarms::Id: + return "ModifyEnabledAlarms"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::MicrowaveOvenControl::Id: { + switch (id) + { + case chip::app::Clusters::MicrowaveOvenControl::Commands::SetCookingParameters::Id: + return "SetCookingParameters"; + case chip::app::Clusters::MicrowaveOvenControl::Commands::AddMoreTime::Id: + return "AddMoreTime"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OperationalState::Id: { + switch (id) + { + case chip::app::Clusters::OperationalState::Commands::Pause::Id: + return "Pause"; + case chip::app::Clusters::OperationalState::Commands::Stop::Id: + return "Stop"; + case chip::app::Clusters::OperationalState::Commands::Start::Id: + return "Start"; + case chip::app::Clusters::OperationalState::Commands::Resume::Id: + return "Resume"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::RvcOperationalState::Id: { + switch (id) + { + case chip::app::Clusters::RvcOperationalState::Commands::Pause::Id: + return "Pause"; + case chip::app::Clusters::RvcOperationalState::Commands::Resume::Id: + return "Resume"; + case chip::app::Clusters::RvcOperationalState::Commands::GoHome::Id: + return "GoHome"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ScenesManagement::Id: { + switch (id) + { + case chip::app::Clusters::ScenesManagement::Commands::AddScene::Id: + return "AddScene"; + case chip::app::Clusters::ScenesManagement::Commands::ViewScene::Id: + return "ViewScene"; + case chip::app::Clusters::ScenesManagement::Commands::RemoveScene::Id: + return "RemoveScene"; + case chip::app::Clusters::ScenesManagement::Commands::RemoveAllScenes::Id: + return "RemoveAllScenes"; + case chip::app::Clusters::ScenesManagement::Commands::StoreScene::Id: + return "StoreScene"; + case chip::app::Clusters::ScenesManagement::Commands::RecallScene::Id: + return "RecallScene"; + case chip::app::Clusters::ScenesManagement::Commands::GetSceneMembership::Id: + return "GetSceneMembership"; + case chip::app::Clusters::ScenesManagement::Commands::CopyScene::Id: + return "CopyScene"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::HepaFilterMonitoring::Id: { + switch (id) + { + case chip::app::Clusters::HepaFilterMonitoring::Commands::ResetCondition::Id: + return "ResetCondition"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ActivatedCarbonFilterMonitoring::Id: { + switch (id) + { + case chip::app::Clusters::ActivatedCarbonFilterMonitoring::Commands::ResetCondition::Id: + return "ResetCondition"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::BooleanStateConfiguration::Id: { + switch (id) + { + case chip::app::Clusters::BooleanStateConfiguration::Commands::SuppressAlarm::Id: + return "SuppressAlarm"; + case chip::app::Clusters::BooleanStateConfiguration::Commands::EnableDisableAlarm::Id: + return "EnableDisableAlarm"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ValveConfigurationAndControl::Id: { + switch (id) + { + case chip::app::Clusters::ValveConfigurationAndControl::Commands::Open::Id: + return "Open"; + case chip::app::Clusters::ValveConfigurationAndControl::Commands::Close::Id: + return "Close"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::WaterHeaterManagement::Id: { + switch (id) + { + case chip::app::Clusters::WaterHeaterManagement::Commands::Boost::Id: + return "Boost"; + case chip::app::Clusters::WaterHeaterManagement::Commands::CancelBoost::Id: + return "CancelBoost"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DemandResponseLoadControl::Id: { + switch (id) + { + case chip::app::Clusters::DemandResponseLoadControl::Commands::RegisterLoadControlProgramRequest::Id: + return "RegisterLoadControlProgramRequest"; + case chip::app::Clusters::DemandResponseLoadControl::Commands::UnregisterLoadControlProgramRequest::Id: + return "UnregisterLoadControlProgramRequest"; + case chip::app::Clusters::DemandResponseLoadControl::Commands::AddLoadControlEventRequest::Id: + return "AddLoadControlEventRequest"; + case chip::app::Clusters::DemandResponseLoadControl::Commands::RemoveLoadControlEventRequest::Id: + return "RemoveLoadControlEventRequest"; + case chip::app::Clusters::DemandResponseLoadControl::Commands::ClearLoadControlEventsRequest::Id: + return "ClearLoadControlEventsRequest"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Messages::Id: { + switch (id) + { + case chip::app::Clusters::Messages::Commands::PresentMessagesRequest::Id: + return "PresentMessagesRequest"; + case chip::app::Clusters::Messages::Commands::CancelMessagesRequest::Id: + return "CancelMessagesRequest"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DeviceEnergyManagement::Id: { + switch (id) + { + case chip::app::Clusters::DeviceEnergyManagement::Commands::PowerAdjustRequest::Id: + return "PowerAdjustRequest"; + case chip::app::Clusters::DeviceEnergyManagement::Commands::CancelPowerAdjustRequest::Id: + return "CancelPowerAdjustRequest"; + case chip::app::Clusters::DeviceEnergyManagement::Commands::StartTimeAdjustRequest::Id: + return "StartTimeAdjustRequest"; + case chip::app::Clusters::DeviceEnergyManagement::Commands::PauseRequest::Id: + return "PauseRequest"; + case chip::app::Clusters::DeviceEnergyManagement::Commands::ResumeRequest::Id: + return "ResumeRequest"; + case chip::app::Clusters::DeviceEnergyManagement::Commands::ModifyForecastRequest::Id: + return "ModifyForecastRequest"; + case chip::app::Clusters::DeviceEnergyManagement::Commands::RequestConstraintBasedForecast::Id: + return "RequestConstraintBasedForecast"; + case chip::app::Clusters::DeviceEnergyManagement::Commands::CancelRequest::Id: + return "CancelRequest"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::EnergyEvse::Id: { + switch (id) + { + case chip::app::Clusters::EnergyEvse::Commands::Disable::Id: + return "Disable"; + case chip::app::Clusters::EnergyEvse::Commands::EnableCharging::Id: + return "EnableCharging"; + case chip::app::Clusters::EnergyEvse::Commands::EnableDischarging::Id: + return "EnableDischarging"; + case chip::app::Clusters::EnergyEvse::Commands::StartDiagnostics::Id: + return "StartDiagnostics"; + case chip::app::Clusters::EnergyEvse::Commands::SetTargets::Id: + return "SetTargets"; + case chip::app::Clusters::EnergyEvse::Commands::GetTargets::Id: + return "GetTargets"; + case chip::app::Clusters::EnergyEvse::Commands::ClearTargets::Id: + return "ClearTargets"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::EnergyEvseMode::Id: { + switch (id) + { + case chip::app::Clusters::EnergyEvseMode::Commands::ChangeToMode::Id: + return "ChangeToMode"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::WaterHeaterMode::Id: { + switch (id) + { + case chip::app::Clusters::WaterHeaterMode::Commands::ChangeToMode::Id: + return "ChangeToMode"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DeviceEnergyManagementMode::Id: { + switch (id) + { + case chip::app::Clusters::DeviceEnergyManagementMode::Commands::ChangeToMode::Id: + return "ChangeToMode"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DoorLock::Id: { + switch (id) + { + case chip::app::Clusters::DoorLock::Commands::LockDoor::Id: + return "LockDoor"; + case chip::app::Clusters::DoorLock::Commands::UnlockDoor::Id: + return "UnlockDoor"; + case chip::app::Clusters::DoorLock::Commands::UnlockWithTimeout::Id: + return "UnlockWithTimeout"; + case chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Id: + return "SetWeekDaySchedule"; + case chip::app::Clusters::DoorLock::Commands::GetWeekDaySchedule::Id: + return "GetWeekDaySchedule"; + case chip::app::Clusters::DoorLock::Commands::ClearWeekDaySchedule::Id: + return "ClearWeekDaySchedule"; + case chip::app::Clusters::DoorLock::Commands::SetYearDaySchedule::Id: + return "SetYearDaySchedule"; + case chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Id: + return "GetYearDaySchedule"; + case chip::app::Clusters::DoorLock::Commands::ClearYearDaySchedule::Id: + return "ClearYearDaySchedule"; + case chip::app::Clusters::DoorLock::Commands::SetHolidaySchedule::Id: + return "SetHolidaySchedule"; + case chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Id: + return "GetHolidaySchedule"; + case chip::app::Clusters::DoorLock::Commands::ClearHolidaySchedule::Id: + return "ClearHolidaySchedule"; + case chip::app::Clusters::DoorLock::Commands::SetUser::Id: + return "SetUser"; + case chip::app::Clusters::DoorLock::Commands::GetUser::Id: + return "GetUser"; + case chip::app::Clusters::DoorLock::Commands::ClearUser::Id: + return "ClearUser"; + case chip::app::Clusters::DoorLock::Commands::SetCredential::Id: + return "SetCredential"; + case chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Id: + return "GetCredentialStatus"; + case chip::app::Clusters::DoorLock::Commands::ClearCredential::Id: + return "ClearCredential"; + case chip::app::Clusters::DoorLock::Commands::UnboltDoor::Id: + return "UnboltDoor"; + case chip::app::Clusters::DoorLock::Commands::SetAliroReaderConfig::Id: + return "SetAliroReaderConfig"; + case chip::app::Clusters::DoorLock::Commands::ClearAliroReaderConfig::Id: + return "ClearAliroReaderConfig"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::WindowCovering::Id: { + switch (id) + { + case chip::app::Clusters::WindowCovering::Commands::UpOrOpen::Id: + return "UpOrOpen"; + case chip::app::Clusters::WindowCovering::Commands::DownOrClose::Id: + return "DownOrClose"; + case chip::app::Clusters::WindowCovering::Commands::StopMotion::Id: + return "StopMotion"; + case chip::app::Clusters::WindowCovering::Commands::GoToLiftValue::Id: + return "GoToLiftValue"; + case chip::app::Clusters::WindowCovering::Commands::GoToLiftPercentage::Id: + return "GoToLiftPercentage"; + case chip::app::Clusters::WindowCovering::Commands::GoToTiltValue::Id: + return "GoToTiltValue"; + case chip::app::Clusters::WindowCovering::Commands::GoToTiltPercentage::Id: + return "GoToTiltPercentage"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::BarrierControl::Id: { + switch (id) + { + case chip::app::Clusters::BarrierControl::Commands::BarrierControlGoToPercent::Id: + return "BarrierControlGoToPercent"; + case chip::app::Clusters::BarrierControl::Commands::BarrierControlStop::Id: + return "BarrierControlStop"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ServiceArea::Id: { + switch (id) + { + case chip::app::Clusters::ServiceArea::Commands::SelectAreas::Id: + return "SelectAreas"; + case chip::app::Clusters::ServiceArea::Commands::SkipArea::Id: + return "SkipArea"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Thermostat::Id: { + switch (id) + { + case chip::app::Clusters::Thermostat::Commands::SetpointRaiseLower::Id: + return "SetpointRaiseLower"; + case chip::app::Clusters::Thermostat::Commands::SetWeeklySchedule::Id: + return "SetWeeklySchedule"; + case chip::app::Clusters::Thermostat::Commands::GetWeeklySchedule::Id: + return "GetWeeklySchedule"; + case chip::app::Clusters::Thermostat::Commands::ClearWeeklySchedule::Id: + return "ClearWeeklySchedule"; + case chip::app::Clusters::Thermostat::Commands::SetActiveScheduleRequest::Id: + return "SetActiveScheduleRequest"; + case chip::app::Clusters::Thermostat::Commands::SetActivePresetRequest::Id: + return "SetActivePresetRequest"; + case chip::app::Clusters::Thermostat::Commands::AtomicRequest::Id: + return "AtomicRequest"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::FanControl::Id: { + switch (id) + { + case chip::app::Clusters::FanControl::Commands::Step::Id: + return "Step"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ColorControl::Id: { + switch (id) + { + case chip::app::Clusters::ColorControl::Commands::MoveToHue::Id: + return "MoveToHue"; + case chip::app::Clusters::ColorControl::Commands::MoveHue::Id: + return "MoveHue"; + case chip::app::Clusters::ColorControl::Commands::StepHue::Id: + return "StepHue"; + case chip::app::Clusters::ColorControl::Commands::MoveToSaturation::Id: + return "MoveToSaturation"; + case chip::app::Clusters::ColorControl::Commands::MoveSaturation::Id: + return "MoveSaturation"; + case chip::app::Clusters::ColorControl::Commands::StepSaturation::Id: + return "StepSaturation"; + case chip::app::Clusters::ColorControl::Commands::MoveToHueAndSaturation::Id: + return "MoveToHueAndSaturation"; + case chip::app::Clusters::ColorControl::Commands::MoveToColor::Id: + return "MoveToColor"; + case chip::app::Clusters::ColorControl::Commands::MoveColor::Id: + return "MoveColor"; + case chip::app::Clusters::ColorControl::Commands::StepColor::Id: + return "StepColor"; + case chip::app::Clusters::ColorControl::Commands::MoveToColorTemperature::Id: + return "MoveToColorTemperature"; + case chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Id: + return "EnhancedMoveToHue"; + case chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::Id: + return "EnhancedMoveHue"; + case chip::app::Clusters::ColorControl::Commands::EnhancedStepHue::Id: + return "EnhancedStepHue"; + case chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHueAndSaturation::Id: + return "EnhancedMoveToHueAndSaturation"; + case chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Id: + return "ColorLoopSet"; + case chip::app::Clusters::ColorControl::Commands::StopMoveStep::Id: + return "StopMoveStep"; + case chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Id: + return "MoveColorTemperature"; + case chip::app::Clusters::ColorControl::Commands::StepColorTemperature::Id: + return "StepColorTemperature"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::WiFiNetworkManagement::Id: { + switch (id) + { + case chip::app::Clusters::WiFiNetworkManagement::Commands::NetworkPassphraseRequest::Id: + return "NetworkPassphraseRequest"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ThreadBorderRouterManagement::Id: { + switch (id) + { + case chip::app::Clusters::ThreadBorderRouterManagement::Commands::GetActiveDatasetRequest::Id: + return "GetActiveDatasetRequest"; + case chip::app::Clusters::ThreadBorderRouterManagement::Commands::GetPendingDatasetRequest::Id: + return "GetPendingDatasetRequest"; + case chip::app::Clusters::ThreadBorderRouterManagement::Commands::SetActiveDatasetRequest::Id: + return "SetActiveDatasetRequest"; + case chip::app::Clusters::ThreadBorderRouterManagement::Commands::SetPendingDatasetRequest::Id: + return "SetPendingDatasetRequest"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ThreadNetworkDirectory::Id: { + switch (id) + { + case chip::app::Clusters::ThreadNetworkDirectory::Commands::AddNetwork::Id: + return "AddNetwork"; + case chip::app::Clusters::ThreadNetworkDirectory::Commands::RemoveNetwork::Id: + return "RemoveNetwork"; + case chip::app::Clusters::ThreadNetworkDirectory::Commands::GetOperationalDataset::Id: + return "GetOperationalDataset"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Channel::Id: { + switch (id) + { + case chip::app::Clusters::Channel::Commands::ChangeChannel::Id: + return "ChangeChannel"; + case chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Id: + return "ChangeChannelByNumber"; + case chip::app::Clusters::Channel::Commands::SkipChannel::Id: + return "SkipChannel"; + case chip::app::Clusters::Channel::Commands::GetProgramGuide::Id: + return "GetProgramGuide"; + case chip::app::Clusters::Channel::Commands::RecordProgram::Id: + return "RecordProgram"; + case chip::app::Clusters::Channel::Commands::CancelRecordProgram::Id: + return "CancelRecordProgram"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::TargetNavigator::Id: { + switch (id) + { + case chip::app::Clusters::TargetNavigator::Commands::NavigateTarget::Id: + return "NavigateTarget"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::MediaPlayback::Id: { + switch (id) + { + case chip::app::Clusters::MediaPlayback::Commands::Play::Id: + return "Play"; + case chip::app::Clusters::MediaPlayback::Commands::Pause::Id: + return "Pause"; + case chip::app::Clusters::MediaPlayback::Commands::Stop::Id: + return "Stop"; + case chip::app::Clusters::MediaPlayback::Commands::StartOver::Id: + return "StartOver"; + case chip::app::Clusters::MediaPlayback::Commands::Previous::Id: + return "Previous"; + case chip::app::Clusters::MediaPlayback::Commands::Next::Id: + return "Next"; + case chip::app::Clusters::MediaPlayback::Commands::Rewind::Id: + return "Rewind"; + case chip::app::Clusters::MediaPlayback::Commands::FastForward::Id: + return "FastForward"; + case chip::app::Clusters::MediaPlayback::Commands::SkipForward::Id: + return "SkipForward"; + case chip::app::Clusters::MediaPlayback::Commands::SkipBackward::Id: + return "SkipBackward"; + case chip::app::Clusters::MediaPlayback::Commands::Seek::Id: + return "Seek"; + case chip::app::Clusters::MediaPlayback::Commands::ActivateAudioTrack::Id: + return "ActivateAudioTrack"; + case chip::app::Clusters::MediaPlayback::Commands::ActivateTextTrack::Id: + return "ActivateTextTrack"; + case chip::app::Clusters::MediaPlayback::Commands::DeactivateTextTrack::Id: + return "DeactivateTextTrack"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::MediaInput::Id: { + switch (id) + { + case chip::app::Clusters::MediaInput::Commands::SelectInput::Id: + return "SelectInput"; + case chip::app::Clusters::MediaInput::Commands::ShowInputStatus::Id: + return "ShowInputStatus"; + case chip::app::Clusters::MediaInput::Commands::HideInputStatus::Id: + return "HideInputStatus"; + case chip::app::Clusters::MediaInput::Commands::RenameInput::Id: + return "RenameInput"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::LowPower::Id: { + switch (id) + { + case chip::app::Clusters::LowPower::Commands::Sleep::Id: + return "Sleep"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::KeypadInput::Id: { + switch (id) + { + case chip::app::Clusters::KeypadInput::Commands::SendKey::Id: + return "SendKey"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ContentLauncher::Id: { + switch (id) + { + case chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Id: + return "LaunchContent"; + case chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Id: + return "LaunchURL"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::AudioOutput::Id: { + switch (id) + { + case chip::app::Clusters::AudioOutput::Commands::SelectOutput::Id: + return "SelectOutput"; + case chip::app::Clusters::AudioOutput::Commands::RenameOutput::Id: + return "RenameOutput"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ApplicationLauncher::Id: { + switch (id) + { + case chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Id: + return "LaunchApp"; + case chip::app::Clusters::ApplicationLauncher::Commands::StopApp::Id: + return "StopApp"; + case chip::app::Clusters::ApplicationLauncher::Commands::HideApp::Id: + return "HideApp"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::AccountLogin::Id: { + switch (id) + { + case chip::app::Clusters::AccountLogin::Commands::GetSetupPIN::Id: + return "GetSetupPIN"; + case chip::app::Clusters::AccountLogin::Commands::Login::Id: + return "Login"; + case chip::app::Clusters::AccountLogin::Commands::Logout::Id: + return "Logout"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ContentControl::Id: { + switch (id) + { + case chip::app::Clusters::ContentControl::Commands::UpdatePIN::Id: + return "UpdatePIN"; + case chip::app::Clusters::ContentControl::Commands::ResetPIN::Id: + return "ResetPIN"; + case chip::app::Clusters::ContentControl::Commands::Enable::Id: + return "Enable"; + case chip::app::Clusters::ContentControl::Commands::Disable::Id: + return "Disable"; + case chip::app::Clusters::ContentControl::Commands::AddBonusTime::Id: + return "AddBonusTime"; + case chip::app::Clusters::ContentControl::Commands::SetScreenDailyTime::Id: + return "SetScreenDailyTime"; + case chip::app::Clusters::ContentControl::Commands::BlockUnratedContent::Id: + return "BlockUnratedContent"; + case chip::app::Clusters::ContentControl::Commands::UnblockUnratedContent::Id: + return "UnblockUnratedContent"; + case chip::app::Clusters::ContentControl::Commands::SetOnDemandRatingThreshold::Id: + return "SetOnDemandRatingThreshold"; + case chip::app::Clusters::ContentControl::Commands::SetScheduledContentRatingThreshold::Id: + return "SetScheduledContentRatingThreshold"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ContentAppObserver::Id: { + switch (id) + { + case chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessage::Id: + return "ContentAppMessage"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::CommissionerControl::Id: { + switch (id) + { + case chip::app::Clusters::CommissionerControl::Commands::RequestCommissioningApproval::Id: + return "RequestCommissioningApproval"; + case chip::app::Clusters::CommissionerControl::Commands::CommissionNode::Id: + return "CommissionNode"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ElectricalMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::ElectricalMeasurement::Commands::GetProfileInfoCommand::Id: + return "GetProfileInfoCommand"; + case chip::app::Clusters::ElectricalMeasurement::Commands::GetMeasurementProfileCommand::Id: + return "GetMeasurementProfileCommand"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::UnitTesting::Id: { + switch (id) + { + case chip::app::Clusters::UnitTesting::Commands::Test::Id: + return "Test"; + case chip::app::Clusters::UnitTesting::Commands::TestNotHandled::Id: + return "TestNotHandled"; + case chip::app::Clusters::UnitTesting::Commands::TestSpecific::Id: + return "TestSpecific"; + case chip::app::Clusters::UnitTesting::Commands::TestUnknownCommand::Id: + return "TestUnknownCommand"; + case chip::app::Clusters::UnitTesting::Commands::TestAddArguments::Id: + return "TestAddArguments"; + case chip::app::Clusters::UnitTesting::Commands::TestSimpleArgumentRequest::Id: + return "TestSimpleArgumentRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestStructArrayArgumentRequest::Id: + return "TestStructArrayArgumentRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestStructArgumentRequest::Id: + return "TestStructArgumentRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestNestedStructArgumentRequest::Id: + return "TestNestedStructArgumentRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestListStructArgumentRequest::Id: + return "TestListStructArgumentRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestListInt8UArgumentRequest::Id: + return "TestListInt8UArgumentRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestNestedStructListArgumentRequest::Id: + return "TestNestedStructListArgumentRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestListNestedStructListArgumentRequest::Id: + return "TestListNestedStructListArgumentRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestListInt8UReverseRequest::Id: + return "TestListInt8UReverseRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestEnumsRequest::Id: + return "TestEnumsRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestNullableOptionalRequest::Id: + return "TestNullableOptionalRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestComplexNullableOptionalRequest::Id: + return "TestComplexNullableOptionalRequest"; + case chip::app::Clusters::UnitTesting::Commands::SimpleStructEchoRequest::Id: + return "SimpleStructEchoRequest"; + case chip::app::Clusters::UnitTesting::Commands::TimedInvokeRequest::Id: + return "TimedInvokeRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestSimpleOptionalArgumentRequest::Id: + return "TestSimpleOptionalArgumentRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestEmitTestEventRequest::Id: + return "TestEmitTestEventRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestEmitTestFabricScopedEventRequest::Id: + return "TestEmitTestFabricScopedEventRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestBatchHelperRequest::Id: + return "TestBatchHelperRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestSecondBatchHelperRequest::Id: + return "TestSecondBatchHelperRequest"; + case chip::app::Clusters::UnitTesting::Commands::StringEchoRequest::Id: + return "StringEchoRequest"; + case chip::app::Clusters::UnitTesting::Commands::GlobalEchoRequest::Id: + return "GlobalEchoRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestDifferentVendorMeiRequest::Id: + return "TestDifferentVendorMeiRequest"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::FaultInjection::Id: { + switch (id) + { + case chip::app::Clusters::FaultInjection::Commands::FailAtFault::Id: + return "FailAtFault"; + case chip::app::Clusters::FaultInjection::Commands::FailRandomlyAtFault::Id: + return "FailRandomlyAtFault"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::SampleMei::Id: { + switch (id) + { + case chip::app::Clusters::SampleMei::Commands::Ping::Id: + return "Ping"; + case chip::app::Clusters::SampleMei::Commands::AddArguments::Id: + return "AddArguments"; + default: + return "Unknown"; + } + } + default: + return "Unknown"; + } +} + +char const * GeneratedCommandIdToText(chip::ClusterId cluster, chip::CommandId id) +{ + switch (cluster) + { + case chip::app::Clusters::Groups::Id: { + switch (id) + { + case chip::app::Clusters::Groups::Commands::AddGroupResponse::Id: + return "AddGroupResponse"; + case chip::app::Clusters::Groups::Commands::ViewGroupResponse::Id: + return "ViewGroupResponse"; + case chip::app::Clusters::Groups::Commands::GetGroupMembershipResponse::Id: + return "GetGroupMembershipResponse"; + case chip::app::Clusters::Groups::Commands::RemoveGroupResponse::Id: + return "RemoveGroupResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::AccessControl::Id: { + switch (id) + { + case chip::app::Clusters::AccessControl::Commands::ReviewFabricRestrictionsResponse::Id: + return "ReviewFabricRestrictionsResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OtaSoftwareUpdateProvider::Id: { + switch (id) + { + case chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImageResponse::Id: + return "QueryImageResponse"; + case chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateResponse::Id: + return "ApplyUpdateResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::GeneralCommissioning::Id: { + switch (id) + { + case chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafeResponse::Id: + return "ArmFailSafeResponse"; + case chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfigResponse::Id: + return "SetRegulatoryConfigResponse"; + case chip::app::Clusters::GeneralCommissioning::Commands::CommissioningCompleteResponse::Id: + return "CommissioningCompleteResponse"; + case chip::app::Clusters::GeneralCommissioning::Commands::SetTCAcknowledgementsResponse::Id: + return "SetTCAcknowledgementsResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::NetworkCommissioning::Id: { + switch (id) + { + case chip::app::Clusters::NetworkCommissioning::Commands::ScanNetworksResponse::Id: + return "ScanNetworksResponse"; + case chip::app::Clusters::NetworkCommissioning::Commands::NetworkConfigResponse::Id: + return "NetworkConfigResponse"; + case chip::app::Clusters::NetworkCommissioning::Commands::ConnectNetworkResponse::Id: + return "ConnectNetworkResponse"; + case chip::app::Clusters::NetworkCommissioning::Commands::QueryIdentityResponse::Id: + return "QueryIdentityResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DiagnosticLogs::Id: { + switch (id) + { + case chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsResponse::Id: + return "RetrieveLogsResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::GeneralDiagnostics::Id: { + switch (id) + { + case chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshotResponse::Id: + return "TimeSnapshotResponse"; + case chip::app::Clusters::GeneralDiagnostics::Commands::PayloadTestResponse::Id: + return "PayloadTestResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::TimeSynchronization::Id: { + switch (id) + { + case chip::app::Clusters::TimeSynchronization::Commands::SetTimeZoneResponse::Id: + return "SetTimeZoneResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OperationalCredentials::Id: { + switch (id) + { + case chip::app::Clusters::OperationalCredentials::Commands::AttestationResponse::Id: + return "AttestationResponse"; + case chip::app::Clusters::OperationalCredentials::Commands::CertificateChainResponse::Id: + return "CertificateChainResponse"; + case chip::app::Clusters::OperationalCredentials::Commands::CSRResponse::Id: + return "CSRResponse"; + case chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::Id: + return "NOCResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::GroupKeyManagement::Id: { + switch (id) + { + case chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::Id: + return "KeySetReadResponse"; + case chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::Id: + return "KeySetReadAllIndicesResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::IcdManagement::Id: { + switch (id) + { + case chip::app::Clusters::IcdManagement::Commands::RegisterClientResponse::Id: + return "RegisterClientResponse"; + case chip::app::Clusters::IcdManagement::Commands::StayActiveResponse::Id: + return "StayActiveResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OvenCavityOperationalState::Id: { + switch (id) + { + case chip::app::Clusters::OvenCavityOperationalState::Commands::OperationalCommandResponse::Id: + return "OperationalCommandResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OvenMode::Id: { + switch (id) + { + case chip::app::Clusters::OvenMode::Commands::ChangeToModeResponse::Id: + return "ChangeToModeResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::LaundryWasherMode::Id: { + switch (id) + { + case chip::app::Clusters::LaundryWasherMode::Commands::ChangeToModeResponse::Id: + return "ChangeToModeResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id: { + switch (id) + { + case chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Commands::ChangeToModeResponse::Id: + return "ChangeToModeResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::RvcRunMode::Id: { + switch (id) + { + case chip::app::Clusters::RvcRunMode::Commands::ChangeToModeResponse::Id: + return "ChangeToModeResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::RvcCleanMode::Id: { + switch (id) + { + case chip::app::Clusters::RvcCleanMode::Commands::ChangeToModeResponse::Id: + return "ChangeToModeResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DishwasherMode::Id: { + switch (id) + { + case chip::app::Clusters::DishwasherMode::Commands::ChangeToModeResponse::Id: + return "ChangeToModeResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OperationalState::Id: { + switch (id) + { + case chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::Id: + return "OperationalCommandResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::RvcOperationalState::Id: { + switch (id) + { + case chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::Id: + return "OperationalCommandResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ScenesManagement::Id: { + switch (id) + { + case chip::app::Clusters::ScenesManagement::Commands::AddSceneResponse::Id: + return "AddSceneResponse"; + case chip::app::Clusters::ScenesManagement::Commands::ViewSceneResponse::Id: + return "ViewSceneResponse"; + case chip::app::Clusters::ScenesManagement::Commands::RemoveSceneResponse::Id: + return "RemoveSceneResponse"; + case chip::app::Clusters::ScenesManagement::Commands::RemoveAllScenesResponse::Id: + return "RemoveAllScenesResponse"; + case chip::app::Clusters::ScenesManagement::Commands::StoreSceneResponse::Id: + return "StoreSceneResponse"; + case chip::app::Clusters::ScenesManagement::Commands::GetSceneMembershipResponse::Id: + return "GetSceneMembershipResponse"; + case chip::app::Clusters::ScenesManagement::Commands::CopySceneResponse::Id: + return "CopySceneResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::EnergyEvse::Id: { + switch (id) + { + case chip::app::Clusters::EnergyEvse::Commands::GetTargetsResponse::Id: + return "GetTargetsResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::EnergyEvseMode::Id: { + switch (id) + { + case chip::app::Clusters::EnergyEvseMode::Commands::ChangeToModeResponse::Id: + return "ChangeToModeResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::WaterHeaterMode::Id: { + switch (id) + { + case chip::app::Clusters::WaterHeaterMode::Commands::ChangeToModeResponse::Id: + return "ChangeToModeResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DeviceEnergyManagementMode::Id: { + switch (id) + { + case chip::app::Clusters::DeviceEnergyManagementMode::Commands::ChangeToModeResponse::Id: + return "ChangeToModeResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DoorLock::Id: { + switch (id) + { + case chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::Id: + return "GetWeekDayScheduleResponse"; + case chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::Id: + return "GetYearDayScheduleResponse"; + case chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::Id: + return "GetHolidayScheduleResponse"; + case chip::app::Clusters::DoorLock::Commands::GetUserResponse::Id: + return "GetUserResponse"; + case chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::Id: + return "SetCredentialResponse"; + case chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::Id: + return "GetCredentialStatusResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ServiceArea::Id: { + switch (id) + { + case chip::app::Clusters::ServiceArea::Commands::SelectAreasResponse::Id: + return "SelectAreasResponse"; + case chip::app::Clusters::ServiceArea::Commands::SkipAreaResponse::Id: + return "SkipAreaResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Thermostat::Id: { + switch (id) + { + case chip::app::Clusters::Thermostat::Commands::GetWeeklyScheduleResponse::Id: + return "GetWeeklyScheduleResponse"; + case chip::app::Clusters::Thermostat::Commands::AtomicResponse::Id: + return "AtomicResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::WiFiNetworkManagement::Id: { + switch (id) + { + case chip::app::Clusters::WiFiNetworkManagement::Commands::NetworkPassphraseResponse::Id: + return "NetworkPassphraseResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ThreadBorderRouterManagement::Id: { + switch (id) + { + case chip::app::Clusters::ThreadBorderRouterManagement::Commands::DatasetResponse::Id: + return "DatasetResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ThreadNetworkDirectory::Id: { + switch (id) + { + case chip::app::Clusters::ThreadNetworkDirectory::Commands::OperationalDatasetResponse::Id: + return "OperationalDatasetResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Channel::Id: { + switch (id) + { + case chip::app::Clusters::Channel::Commands::ChangeChannelResponse::Id: + return "ChangeChannelResponse"; + case chip::app::Clusters::Channel::Commands::ProgramGuideResponse::Id: + return "ProgramGuideResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::TargetNavigator::Id: { + switch (id) + { + case chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::Id: + return "NavigateTargetResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::MediaPlayback::Id: { + switch (id) + { + case chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id: + return "PlaybackResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::KeypadInput::Id: { + switch (id) + { + case chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::Id: + return "SendKeyResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ContentLauncher::Id: { + switch (id) + { + case chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::Id: + return "LauncherResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ApplicationLauncher::Id: { + switch (id) + { + case chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Id: + return "LauncherResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::AccountLogin::Id: { + switch (id) + { + case chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::Id: + return "GetSetupPINResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ContentControl::Id: { + switch (id) + { + case chip::app::Clusters::ContentControl::Commands::ResetPINResponse::Id: + return "ResetPINResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ContentAppObserver::Id: { + switch (id) + { + case chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessageResponse::Id: + return "ContentAppMessageResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::CommissionerControl::Id: { + switch (id) + { + case chip::app::Clusters::CommissionerControl::Commands::ReverseOpenCommissioningWindow::Id: + return "ReverseOpenCommissioningWindow"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ElectricalMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::ElectricalMeasurement::Commands::GetProfileInfoResponseCommand::Id: + return "GetProfileInfoResponseCommand"; + case chip::app::Clusters::ElectricalMeasurement::Commands::GetMeasurementProfileResponseCommand::Id: + return "GetMeasurementProfileResponseCommand"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::UnitTesting::Id: { + switch (id) + { + case chip::app::Clusters::UnitTesting::Commands::TestSpecificResponse::Id: + return "TestSpecificResponse"; + case chip::app::Clusters::UnitTesting::Commands::TestAddArgumentsResponse::Id: + return "TestAddArgumentsResponse"; + case chip::app::Clusters::UnitTesting::Commands::TestSimpleArgumentResponse::Id: + return "TestSimpleArgumentResponse"; + case chip::app::Clusters::UnitTesting::Commands::TestStructArrayArgumentResponse::Id: + return "TestStructArrayArgumentResponse"; + case chip::app::Clusters::UnitTesting::Commands::TestListInt8UReverseResponse::Id: + return "TestListInt8UReverseResponse"; + case chip::app::Clusters::UnitTesting::Commands::TestEnumsResponse::Id: + return "TestEnumsResponse"; + case chip::app::Clusters::UnitTesting::Commands::TestNullableOptionalResponse::Id: + return "TestNullableOptionalResponse"; + case chip::app::Clusters::UnitTesting::Commands::TestComplexNullableOptionalResponse::Id: + return "TestComplexNullableOptionalResponse"; + case chip::app::Clusters::UnitTesting::Commands::BooleanResponse::Id: + return "BooleanResponse"; + case chip::app::Clusters::UnitTesting::Commands::SimpleStructResponse::Id: + return "SimpleStructResponse"; + case chip::app::Clusters::UnitTesting::Commands::TestEmitTestEventResponse::Id: + return "TestEmitTestEventResponse"; + case chip::app::Clusters::UnitTesting::Commands::TestEmitTestFabricScopedEventResponse::Id: + return "TestEmitTestFabricScopedEventResponse"; + case chip::app::Clusters::UnitTesting::Commands::TestBatchHelperResponse::Id: + return "TestBatchHelperResponse"; + case chip::app::Clusters::UnitTesting::Commands::StringEchoResponse::Id: + return "StringEchoResponse"; + case chip::app::Clusters::UnitTesting::Commands::GlobalEchoResponse::Id: + return "GlobalEchoResponse"; + case chip::app::Clusters::UnitTesting::Commands::TestDifferentVendorMeiResponse::Id: + return "TestDifferentVendorMeiResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::SampleMei::Id: { + switch (id) + { + case chip::app::Clusters::SampleMei::Commands::AddArgumentsResponse::Id: + return "AddArgumentsResponse"; + default: + return "Unknown"; + } + } + default: + return "Unknown"; + } +} diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.h new file mode 100644 index 00000000000000..27fa6512fbdd01 --- /dev/null +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.h @@ -0,0 +1,30 @@ +/* + * + * Copyright (c) 2022 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 +#include +#include + +char const * ClusterIdToText(chip::ClusterId id); + +char const * AttributeIdToText(chip::ClusterId cluster, chip::AttributeId id); + +char const * AcceptedCommandIdToText(chip::ClusterId cluster, chip::CommandId id); + +char const * GeneratedCommandIdToText(chip::ClusterId cluster, chip::CommandId id); From 07789d41bb849e18a970451c6bd6c7189cbc5362 Mon Sep 17 00:00:00 2001 From: William Date: Thu, 22 Aug 2024 09:56:19 +0100 Subject: [PATCH 05/10] Truncate map and area names (#35127) * Updated the setting of the area and map names so that if the name given is greater than the buffer size, it's truncated rater to set to empty. * Restyled by clang-format --------- Co-authored-by: Restyled.io --- .../service-area-cluster-objects.h | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/app/clusters/service-area-server/service-area-cluster-objects.h b/src/app/clusters/service-area-server/service-area-cluster-objects.h index 66f20720701587..69a392a874f49d 100644 --- a/src/app/clusters/service-area-server/service-area-cluster-objects.h +++ b/src/app/clusters/service-area-server/service-area-cluster-objects.h @@ -109,12 +109,14 @@ struct AreaStructureWrapper : public chip::app::Clusters::ServiceArea::Structs:: const DataModel::Nullable & areaType) { areaDesc.locationInfo.SetNonNull(); - // Copy the name - auto areaNameSpan = MutableCharSpan(mAreaNameBuffer, kAreaNameMaxSize); - CopyCharSpanToMutableCharSpan(locationName, areaNameSpan); - areaDesc.locationInfo.Value().locationName = CharSpan(areaNameSpan.data(), areaNameSpan.size()); - areaDesc.locationInfo.Value().floorNumber = floorNumber; - areaDesc.locationInfo.Value().areaType = areaType; + + // Copy the name. If the name is larger than kAreaNameMaxSize, truncate it to fit. + auto sizeToCopy = std::min(kAreaNameMaxSize, locationName.size()); + memcpy(mAreaNameBuffer, locationName.data(), sizeToCopy); + areaDesc.locationInfo.Value().locationName = CharSpan(mAreaNameBuffer, sizeToCopy); + + areaDesc.locationInfo.Value().floorNumber = floorNumber; + areaDesc.locationInfo.Value().areaType = areaType; return *this; } @@ -320,10 +322,11 @@ struct MapStructureWrapper : public chip::app::Clusters::ServiceArea::Structs::M */ void Set(uint32_t aMapId, const CharSpan & aMapName) { - mapID = aMapId; - auto mapNameSpan = MutableCharSpan(mMapNameBuffer, kMapNameMaxSize); - CopyCharSpanToMutableCharSpan(aMapName, mapNameSpan); - name = CharSpan(mapNameSpan.data(), mapNameSpan.size()); + mapID = aMapId; + // Copy the name. If the name is larger than kMapNameMaxSize, truncate it to fit. + auto sizeToCopy = std::min(kMapNameMaxSize, aMapName.size()); + memcpy(mMapNameBuffer, aMapName.data(), sizeToCopy); + name = CharSpan(mMapNameBuffer, sizeToCopy); } /** From 607a6da04159723dd251262b960c5389bbd6318a Mon Sep 17 00:00:00 2001 From: Sean <97990350+s-mcclain@users.noreply.github.com> Date: Thu, 22 Aug 2024 09:56:36 -0500 Subject: [PATCH 06/10] Add new CHIP_CONFIG_ADDRESS_RESOLVE_MIN_LOOKUP_TIME_MS and (#35102) CHIP_CONFIG_ADDRESS_RESOLVE_MAX_LOOKUP_TIME_MS macros to CHIPConfig. Use new lookup time min/max macros inside AddressResolve for default kMinLookupTimeMsDefault and kMaxLookupTimeMsDefault to allow for applications to override the time required to wait for an address lookup before timing out. --- src/lib/address_resolve/AddressResolve.h | 10 ++++++++-- src/lib/core/CHIPConfig.h | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/lib/address_resolve/AddressResolve.h b/src/lib/address_resolve/AddressResolve.h index 0d6f8ab719519d..1e45ffed5da907 100644 --- a/src/lib/address_resolve/AddressResolve.h +++ b/src/lib/address_resolve/AddressResolve.h @@ -143,8 +143,14 @@ class NodeLookupRequest } private: - static constexpr uint32_t kMinLookupTimeMsDefault = 200; - static constexpr uint32_t kMaxLookupTimeMsDefault = 45000; + static_assert((CHIP_CONFIG_ADDRESS_RESOLVE_MIN_LOOKUP_TIME_MS) <= (CHIP_CONFIG_ADDRESS_RESOLVE_MAX_LOOKUP_TIME_MS), + "AddressResolveMinLookupTime must be equal or less than AddressResolveMaxLookupTime"); + static_assert((CHIP_CONFIG_ADDRESS_RESOLVE_MIN_LOOKUP_TIME_MS) >= 0, + "AddressResolveMinLookupTime must be equal or greater than 0"); + static_assert((CHIP_CONFIG_ADDRESS_RESOLVE_MAX_LOOKUP_TIME_MS) < UINT32_MAX, + "AddressResolveMaxLookupTime must be less than UINT32_MAX"); + static constexpr uint32_t kMinLookupTimeMsDefault = CHIP_CONFIG_ADDRESS_RESOLVE_MIN_LOOKUP_TIME_MS; + static constexpr uint32_t kMaxLookupTimeMsDefault = CHIP_CONFIG_ADDRESS_RESOLVE_MAX_LOOKUP_TIME_MS; PeerId mPeerId; System::Clock::Milliseconds32 mMinLookupTimeMs{ kMinLookupTimeMsDefault }; diff --git a/src/lib/core/CHIPConfig.h b/src/lib/core/CHIPConfig.h index e9c317dfc79d5c..7600b4eaa4c315 100644 --- a/src/lib/core/CHIPConfig.h +++ b/src/lib/core/CHIPConfig.h @@ -1370,6 +1370,28 @@ extern const char CHIP_NON_PRODUCTION_MARKER[]; #define CHIP_CONFIG_MDNS_RESOLVE_LOOKUP_RESULTS 1 #endif // CHIP_CONFIG_MDNS_RESOLVE_LOOKUP_RESULTS +/** + * @def CHIP_CONFIG_ADDRESS_RESOLVE_MIN_LOOKUP_TIME_MS + * + * @brief Default minimum lookup time to wait during address resolve for + * additional DNSSD queries even if a reply has already been received, or + * to allow for additional heuristics regarding node choice to succeed, in + * milliseconds + */ +#ifndef CHIP_CONFIG_ADDRESS_RESOLVE_MIN_LOOKUP_TIME_MS +#define CHIP_CONFIG_ADDRESS_RESOLVE_MIN_LOOKUP_TIME_MS 200 +#endif // CHIP_CONFIG_ADDRESS_RESOLVE_MIN_LOOKUP_TIME_MS + +/** + * @def CHIP_CONFIG_ADDRESS_RESOLVE_MAX_LOOKUP_TIME_MS + * + * @brief Default maximum lookup time to wait during address resolve before + * a TIMEOUT error, in milliseconds + */ +#ifndef CHIP_CONFIG_ADDRESS_RESOLVE_MAX_LOOKUP_TIME_MS +#define CHIP_CONFIG_ADDRESS_RESOLVE_MAX_LOOKUP_TIME_MS 45000 +#endif // CHIP_CONFIG_ADDRESS_RESOLVE_MAX_LOOKUP_TIME_MS + /* * @def CHIP_CONFIG_NETWORK_COMMISSIONING_DEBUG_TEXT_BUFFER_SIZE * From 58896ab304b7b7e1b7e0ae279c1a4ba271952d5e Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Thu, 22 Aug 2024 16:58:21 +0200 Subject: [PATCH 07/10] Fix CHIP REPL tests runner after changes in e407d40 (#34453) * Fix CHIP REPL tests runner after changes in e407d40 The click framework does not have a support for async functions. The async needs to be synchronized before applying click wrappers. * Accept 0x, 0b or 0o prefix for int values * Fix for non-string numbers * Exclude Test_TC_BRBINFO_2_1 from chip-repl engine * Log what happened in case of pseudo cluster creation failure * Fix typo * Fix typo when accessing TestGlobalStruct * Fix new line --- scripts/tests/chiptest/__init__.py | 1 + .../tests/chiptest/yamltest_with_chip_repl_tester.py | 11 ++++++++++- src/controller/python/chip/yaml/format_converter.py | 7 ++++--- src/controller/python/chip/yaml/runner.py | 3 ++- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/scripts/tests/chiptest/__init__.py b/scripts/tests/chiptest/__init__.py index aef22e030eae8d..03ac663427ce84 100644 --- a/scripts/tests/chiptest/__init__.py +++ b/scripts/tests/chiptest/__init__.py @@ -234,6 +234,7 @@ def _GetChipReplUnsupportedTests() -> Set[str]: "TestEventsById.yaml", # chip-repl does not support AnyCommands (06/06/2023) "TestReadNoneSubscribeNone.yaml", # chip-repl does not support AnyCommands (07/27/2023) "Test_TC_IDM_1_2.yaml", # chip-repl does not support AnyCommands (19/07/2023) + "Test_TC_BRBINFO_2_1.yaml", # chip-repl does not support AnyCommands (24/07/2024) "TestIcdManagementCluster.yaml", # TODO(#30430): add ICD registration support in chip-repl "Test_TC_ICDM_3_4.yaml", # chip-repl does not support ICD registration # chip-repl and chip-tool disagree on what the YAML here should look like: https://github.com/project-chip/connectedhomeip/issues/29110 diff --git a/scripts/tests/chiptest/yamltest_with_chip_repl_tester.py b/scripts/tests/chiptest/yamltest_with_chip_repl_tester.py index 1b301c572874d0..70f9215f5456be 100644 --- a/scripts/tests/chiptest/yamltest_with_chip_repl_tester.py +++ b/scripts/tests/chiptest/yamltest_with_chip_repl_tester.py @@ -16,6 +16,7 @@ import asyncio import atexit +import functools import logging import os import tempfile @@ -84,6 +85,13 @@ async def execute_test(yaml, runner): raise Exception(f'Test step failed {test_step.label}') +def asyncio_executor(f): + @functools.wraps(f) + def wrapper(*args, **kwargs): + return asyncio.run(f(*args, **kwargs)) + return wrapper + + @click.command() @click.option( '--setup-code', @@ -101,6 +109,7 @@ async def execute_test(yaml, runner): '--pics-file', default=None, help='Optional PICS file') +@asyncio_executor async def main(setup_code, yaml_path, node_id, pics_file): # Setting up python environment for running YAML CI tests using python parser. with tempfile.NamedTemporaryFile() as chip_stack_storage: @@ -153,4 +162,4 @@ def _StackShutDown(): if __name__ == '__main__': - asyncio.run(main()) + main() diff --git a/src/controller/python/chip/yaml/format_converter.py b/src/controller/python/chip/yaml/format_converter.py index eefe61f172ee15..1be051155b6040 100644 --- a/src/controller/python/chip/yaml/format_converter.py +++ b/src/controller/python/chip/yaml/format_converter.py @@ -198,10 +198,11 @@ def convert_to_data_model_type(field_value, field_type): return field_value # YAML conversion treats all numbers as ints. Convert to a uint type if the schema # type indicates so. - elif (field_type == uint): + elif (type(field_value) is str and field_type == uint): # Longer number are stored as strings. Need to make this conversion first. - value = int(field_value) - return field_type(value) + # The value can be represented in binary, octal, decimal or hexadecimal + # format. + return field_type(int(field_value, 0)) # YAML treats enums as ints. Convert to the typed enum class. elif (issubclass(field_type, MatterIntEnum)): return field_type.extend_enum_if_value_doesnt_exist(field_value) diff --git a/src/controller/python/chip/yaml/runner.py b/src/controller/python/chip/yaml/runner.py index 00e0de2154e5ec..8a19109439e3cf 100644 --- a/src/controller/python/chip/yaml/runner.py +++ b/src/controller/python/chip/yaml/runner.py @@ -832,7 +832,8 @@ def _commissioner_command_action_factory(self, test_step): def _default_pseudo_cluster(self, test_step): try: return DefaultPseudoCluster(test_step) - except ActionCreationError: + except ActionCreationError as e: + logger.warn(f"Failed create default pseudo cluster: {e}") return None def encode(self, request) -> Optional[BaseAction]: From 7ad2fc9b2db389f10f963a1b1d546df43375edac Mon Sep 17 00:00:00 2001 From: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> Date: Thu, 22 Aug 2024 13:00:41 -0400 Subject: [PATCH 08/10] use CHIP_DEVICE_CONFIG_FAILSAFE_EXPIRY_LENGTH_SEC define to arme the failsafe (#35137) --- src/app/server/CommissioningWindowManager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/server/CommissioningWindowManager.cpp b/src/app/server/CommissioningWindowManager.cpp index 47bc3e8ff97f07..01bff4bf07db46 100644 --- a/src/app/server/CommissioningWindowManager.cpp +++ b/src/app/server/CommissioningWindowManager.cpp @@ -221,7 +221,8 @@ void CommissioningWindowManager::OnSessionEstablished(const SessionHandle & sess } else { - err = failSafeContext.ArmFailSafe(kUndefinedFabricIndex, System::Clock::Seconds16(60)); + err = failSafeContext.ArmFailSafe(kUndefinedFabricIndex, + System::Clock::Seconds16(CHIP_DEVICE_CONFIG_FAILSAFE_EXPIRY_LENGTH_SEC)); if (err != CHIP_NO_ERROR) { ChipLogError(AppServer, "Error arming failsafe on PASE session establishment completion"); From ae5d75c69f6cec4fb62b991e57b895b6f4812291 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 22 Aug 2024 13:13:04 -0400 Subject: [PATCH 09/10] Remove unnecessary invokeCommand overrides from MTRDevice_Concrete. (#35151) The one part that is not shared with the XPC implementation is _invokeCommandWithEndpointID:.... Everything else is just generic argument massaging and forwarding that can keep living in the base MTRDevice. --- .../Framework/CHIP/MTRDevice_Concrete.mm | 126 ------------------ 1 file changed, 126 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm index 120d29aff122d4..12614ea4091b0c 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm @@ -2835,59 +2835,6 @@ - (void)writeAttributeWithEndpointID:(NSNumber *)endpointID [_asyncWorkQueue enqueueWorkItem:workItem descriptionWithFormat:@"write %@ 0x%llx 0x%llx", endpointID, clusterID.unsignedLongLongValue, attributeID.unsignedLongLongValue]; } -- (void)invokeCommandWithEndpointID:(NSNumber *)endpointID - clusterID:(NSNumber *)clusterID - commandID:(NSNumber *)commandID - commandFields:(NSDictionary * _Nullable)commandFields - expectedValues:(NSArray *> * _Nullable)expectedValues - expectedValueInterval:(NSNumber * _Nullable)expectedValueInterval - queue:(dispatch_queue_t)queue - completion:(MTRDeviceResponseHandler)completion -{ - if (commandFields == nil) { - commandFields = @{ - MTRTypeKey : MTRStructureValueType, - MTRValueKey : @[], - }; - } - - [self invokeCommandWithEndpointID:endpointID - clusterID:clusterID - commandID:commandID - commandFields:commandFields - expectedValues:expectedValues - expectedValueInterval:expectedValueInterval - timedInvokeTimeout:nil - queue:queue - completion:completion]; -} - -- (void)invokeCommandWithEndpointID:(NSNumber *)endpointID - clusterID:(NSNumber *)clusterID - commandID:(NSNumber *)commandID - commandFields:(id)commandFields - expectedValues:(NSArray *> * _Nullable)expectedValues - expectedValueInterval:(NSNumber * _Nullable)expectedValueInterval - timedInvokeTimeout:(NSNumber * _Nullable)timeout - queue:(dispatch_queue_t)queue - completion:(MTRDeviceResponseHandler)completion -{ - // We don't have a way to communicate a non-default invoke timeout - // here for now. - // TODO: https://github.com/project-chip/connectedhomeip/issues/24563 - - [self _invokeCommandWithEndpointID:endpointID - clusterID:clusterID - commandID:commandID - commandFields:commandFields - expectedValues:expectedValues - expectedValueInterval:expectedValueInterval - timedInvokeTimeout:timeout - serverSideProcessingTimeout:nil - queue:queue - completion:completion]; -} - - (void)_invokeCommandWithEndpointID:(NSNumber *)endpointID clusterID:(NSNumber *)clusterID commandID:(NSNumber *)commandID @@ -2985,58 +2932,6 @@ - (void)_invokeCommandWithEndpointID:(NSNumber *)endpointID [_asyncWorkQueue enqueueWorkItem:workItem descriptionWithFormat:@"invoke %@ 0x%llx 0x%llx", endpointID, clusterID.unsignedLongLongValue, commandID.unsignedLongLongValue]; } -- (void)_invokeKnownCommandWithEndpointID:(NSNumber *)endpointID - clusterID:(NSNumber *)clusterID - commandID:(NSNumber *)commandID - commandPayload:(id)commandPayload - expectedValues:(NSArray *> * _Nullable)expectedValues - expectedValueInterval:(NSNumber * _Nullable)expectedValueInterval - timedInvokeTimeout:(NSNumber * _Nullable)timeout - serverSideProcessingTimeout:(NSNumber * _Nullable)serverSideProcessingTimeout - responseClass:(Class _Nullable)responseClass - queue:(dispatch_queue_t)queue - completion:(void (^)(id _Nullable response, NSError * _Nullable error))completion -{ - if (![commandPayload respondsToSelector:@selector(_encodeAsDataValue:)]) { - dispatch_async(queue, ^{ - completion(nil, [MTRError errorForCHIPErrorCode:CHIP_ERROR_INVALID_ARGUMENT]); - }); - return; - } - - NSError * encodingError; - auto * commandFields = [commandPayload _encodeAsDataValue:&encodingError]; - if (commandFields == nil) { - dispatch_async(queue, ^{ - completion(nil, encodingError); - }); - return; - } - - auto responseHandler = ^(NSArray *> * _Nullable values, NSError * _Nullable error) { - id _Nullable response = nil; - if (error == nil) { - if (values.count != 1) { - error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:nil]; - } else if (responseClass != nil) { - response = [[responseClass alloc] initWithResponseValue:values[0] error:&error]; - } - } - completion(response, error); - }; - - [self _invokeCommandWithEndpointID:endpointID - clusterID:clusterID - commandID:commandID - commandFields:commandFields - expectedValues:expectedValues - expectedValueInterval:expectedValueInterval - timedInvokeTimeout:timeout - serverSideProcessingTimeout:serverSideProcessingTimeout - queue:queue - completion:responseHandler]; -} - - (void)openCommissioningWindowWithSetupPasscode:(NSNumber *)setupPasscode discriminator:(NSNumber *)discriminator duration:(NSNumber *)duration @@ -4072,27 +3967,6 @@ + (MTRDevice *)deviceWithNodeID:(uint64_t)nodeID deviceController:(MTRDeviceCont return [self deviceWithNodeID:@(nodeID) controller:deviceController]; } -- (void)invokeCommandWithEndpointID:(NSNumber *)endpointID - clusterID:(NSNumber *)clusterID - commandID:(NSNumber *)commandID - commandFields:(id)commandFields - expectedValues:(NSArray *> * _Nullable)expectedValues - expectedValueInterval:(NSNumber * _Nullable)expectedValueInterval - timedInvokeTimeout:(NSNumber * _Nullable)timeout - clientQueue:(dispatch_queue_t)queue - completion:(MTRDeviceResponseHandler)completion -{ - [self invokeCommandWithEndpointID:endpointID - clusterID:clusterID - commandID:commandID - commandFields:commandFields - expectedValues:expectedValues - expectedValueInterval:expectedValueInterval - timedInvokeTimeout:timeout - queue:queue - completion:completion]; -} - @end #pragma mark - SubscriptionCallback From 26956012d4d6d6a14796a2894ffe4af0a3c88ff9 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 22 Aug 2024 13:16:50 -0400 Subject: [PATCH 10/10] Remove readAttributeWithEndpointID implementation from MTRDevice. (#35150) This is implemented (differently) by the different subclasses. Once this implementation is removed, the following become unreachable and can be removed: * _attributeValueDictionaryForAttributePath * _subscriptionAbleToReport * _readThroughSkipped At that point _subscriptionsAllowed becomes unreachable and can be removed. --- src/darwin/Framework/CHIP/MTRDevice.mm | 229 +------------------------ 1 file changed, 7 insertions(+), 222 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index d4027f7725ddeb..3f2acce5f5587e 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -649,21 +649,7 @@ - (void)_setDSTOffsets:(NSArray return outputArray; } -#pragma mark Subscription and delegate handling - -// subscription intervals are in seconds -#define MTR_DEVICE_SUBSCRIPTION_MAX_INTERVAL_MIN (10 * 60) // 10 minutes (for now) -#define MTR_DEVICE_SUBSCRIPTION_MAX_INTERVAL_MAX (60 * 60) // 60 minutes - -- (BOOL)_subscriptionsAllowed -{ - os_unfair_lock_assert_owner(&self->_lock); - - // TODO: XPC: This function and all its callsites should go away from this class. - - // We should not allow a subscription for device controllers over XPC. - return ![_deviceController isKindOfClass:MTRDeviceControllerOverXPC.class]; -} +#pragma mark Delegate handling - (void)setDelegate:(id)delegate queue:(dispatch_queue_t)queue { @@ -757,41 +743,6 @@ - (void)nodeMayBeAdvertisingOperational MTR_LOG("%@ saw new operational advertisement", self); } -// Return YES if we are in a state where, apart from communication issues with -// the device, we will be able to get reports via our subscription. -- (BOOL)_subscriptionAbleToReport -{ - std::lock_guard lock(_lock); - if (![self _delegateExists]) { - // No delegate definitely means no subscription. - return NO; - } - - // For unit testing only, matching logic in setDelegate -#ifdef DEBUG - __block BOOL useTestDelegateOverride = NO; - __block BOOL testDelegateShouldSetUpSubscriptionForDevice = NO; - [self _callFirstDelegateSynchronouslyWithBlock:^(id testDelegate) { - if ([testDelegate respondsToSelector:@selector(unitTestShouldSetUpSubscriptionForDevice:)]) { - useTestDelegateOverride = YES; - testDelegateShouldSetUpSubscriptionForDevice = [testDelegate unitTestShouldSetUpSubscriptionForDevice:self]; - } - }]; - if (useTestDelegateOverride && !testDelegateShouldSetUpSubscriptionForDevice) { - return NO; - } - -#endif - - // Subscriptions are not able to report if they are not allowed. - return [self _subscriptionsAllowed]; -} - -// Notification that read-through was skipped for an attribute read. -- (void)_readThroughSkipped -{ -} - - (BOOL)_delegateExists { os_unfair_lock_assert_owner(&self->_lock); @@ -1880,147 +1831,12 @@ static BOOL AttributeHasChangesOmittedQuality(MTRAttributePath * attributePath) attributeID:(NSNumber *)attributeID params:(MTRReadParams * _Nullable)params { - MTRAttributePath * attributePath = [MTRAttributePath attributePathWithEndpointID:endpointID - clusterID:clusterID - attributeID:attributeID]; - - BOOL attributeIsSpecified = MTRAttributeIsSpecified(clusterID.unsignedIntValue, attributeID.unsignedIntValue); - BOOL hasChangesOmittedQuality; - if (attributeIsSpecified) { - hasChangesOmittedQuality = AttributeHasChangesOmittedQuality(attributePath); - } else { - if (params == nil) { - hasChangesOmittedQuality = NO; - } else { - hasChangesOmittedQuality = !params.assumeUnknownAttributesReportable; - } - } - - // Return current known / expected value right away - NSDictionary * attributeValueToReturn = [self _attributeValueDictionaryForAttributePath:attributePath]; - - // Send read request to device if any of the following are true: - // 1. Subscription not in a state we can expect reports - // 2. The attribute has the Changes Omitted quality, so we won't get reports for it. - // 3. The attribute is not in the spec, and the read params asks to assume - // an unknown attribute has the Changes Omitted quality. - if (![self _subscriptionAbleToReport] || hasChangesOmittedQuality) { - // Read requests container will be a mutable array of items, each being an array containing: - // [attribute request path, params] - // Batching handler should only coalesce when params are equal. - - // For this single read API there's only 1 array item. Use NSNull to stand in for nil params for easy comparison. - MTRAttributeRequestPath * readRequestPath = [MTRAttributeRequestPath requestPathWithEndpointID:endpointID - clusterID:clusterID - attributeID:attributeID]; - NSArray * readRequestData = @[ readRequestPath, params ?: [NSNull null] ]; - - // But first, check if a duplicate read request is already queued and return - if ([_asyncWorkQueue hasDuplicateForTypeID:MTRDeviceWorkItemDuplicateReadTypeID workItemData:readRequestData]) { - return attributeValueToReturn; - } - - NSMutableArray * readRequests = [NSMutableArray arrayWithObject:readRequestData]; - - // Create work item, set ready handler to perform task, then enqueue the work - MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.queue]; - uint64_t workItemID = workItem.uniqueID; // capture only the ID, not the work item - NSNumber * nodeID = [self nodeID]; - - [workItem setBatchingID:MTRDeviceWorkItemBatchingReadID data:readRequests handler:^(id opaqueDataCurrent, id opaqueDataNext) { - mtr_hide(self); // don't capture self accidentally - NSMutableArray * readRequestsCurrent = opaqueDataCurrent; - NSMutableArray * readRequestsNext = opaqueDataNext; - - MTRBatchingOutcome outcome = MTRNotBatched; - while (readRequestsNext.count) { - // Can only read up to 9 paths at a time, per spec - if (readRequestsCurrent.count >= 9) { - MTR_LOG("Batching read attribute work item [%llu]: cannot add more work, item is full [0x%016llX:%@:0x%llx:0x%llx]", workItemID, nodeID.unsignedLongLongValue, endpointID, clusterID.unsignedLongLongValue, attributeID.unsignedLongLongValue); - return outcome; - } - - // if params don't match then they cannot be merged - if (![readRequestsNext[0][MTRDeviceReadRequestFieldParamsIndex] - isEqual:readRequestsCurrent[0][MTRDeviceReadRequestFieldParamsIndex]]) { - MTR_LOG("Batching read attribute work item [%llu]: cannot add more work, parameter mismatch [0x%016llX:%@:0x%llx:0x%llx]", workItemID, nodeID.unsignedLongLongValue, endpointID, clusterID.unsignedLongLongValue, attributeID.unsignedLongLongValue); - return outcome; - } - - // merge the next item's first request into the current item's list - auto readItem = readRequestsNext.firstObject; - [readRequestsNext removeObjectAtIndex:0]; - [readRequestsCurrent addObject:readItem]; - MTR_LOG("Batching read attribute work item [%llu]: added %@ (now %lu requests total) [0x%016llX:%@:0x%llx:0x%llx]", - workItemID, readItem, static_cast(readRequestsCurrent.count), nodeID.unsignedLongLongValue, endpointID, clusterID.unsignedLongLongValue, attributeID.unsignedLongLongValue); - outcome = MTRBatchedPartially; - } - NSCAssert(readRequestsNext.count == 0, @"should have batched everything or returned early"); - return MTRBatchedFully; - }]; - [workItem setDuplicateTypeID:MTRDeviceWorkItemDuplicateReadTypeID handler:^(id opaqueItemData, BOOL * isDuplicate, BOOL * stop) { - mtr_hide(self); // don't capture self accidentally - for (NSArray * readItem in readRequests) { - if ([readItem isEqual:opaqueItemData]) { - MTR_LOG("Read attribute work item [%llu] report duplicate %@ [0x%016llX:%@:0x%llx:0x%llx]", workItemID, readItem, nodeID.unsignedLongLongValue, endpointID, clusterID.unsignedLongLongValue, attributeID.unsignedLongLongValue); - *isDuplicate = YES; - *stop = YES; - return; - } - } - *stop = NO; - }]; - [workItem setReadyHandler:^(MTRDevice * self, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { - // Sanity check - if (readRequests.count == 0) { - MTR_LOG_ERROR("Read attribute work item [%llu] contained no read requests", workItemID); - completion(MTRAsyncWorkComplete); - return; - } - - // Build the attribute paths from the read requests - NSMutableArray * attributePaths = [NSMutableArray array]; - for (NSArray * readItem in readRequests) { - NSAssert(readItem.count == 2, @"invalid read attribute item"); - [attributePaths addObject:readItem[MTRDeviceReadRequestFieldPathIndex]]; - } - // If param is the NSNull stand-in, then just use nil - id readParamObject = readRequests[0][MTRDeviceReadRequestFieldParamsIndex]; - MTRReadParams * readParams = (![readParamObject isEqual:[NSNull null]]) ? readParamObject : nil; - - MTRBaseDevice * baseDevice = [self newBaseDevice]; - [baseDevice - readAttributePaths:attributePaths - eventPaths:nil - params:readParams - includeDataVersion:YES - queue:self.queue - completion:^(NSArray *> * _Nullable values, NSError * _Nullable error) { - if (values) { - // Since the format is the same data-value dictionary, this looks like an - // attribute report - MTR_LOG("Read attribute work item [%llu] result: %@ [0x%016llX:%@:0x%llX:0x%llX]", workItemID, values, nodeID.unsignedLongLongValue, endpointID, clusterID.unsignedLongLongValue, attributeID.unsignedLongLongValue); - [self _handleAttributeReport:values fromSubscription:NO]; - } - - // TODO: better retry logic - if (error && (retryCount < 2)) { - MTR_LOG_ERROR("Read attribute work item [%llu] failed (will retry): %@ [0x%016llX:%@:0x%llx:0x%llx]", workItemID, error, nodeID.unsignedLongLongValue, endpointID, clusterID.unsignedLongLongValue, attributeID.unsignedLongLongValue); - completion(MTRAsyncWorkNeedsRetry); - } else { - if (error) { - MTR_LOG("Read attribute work item [%llu] failed (giving up): %@ [0x%016llX:%@:0x%llx:0x%llx]", workItemID, error, nodeID.unsignedLongLongValue, endpointID, clusterID.unsignedLongLongValue, attributeID.unsignedLongLongValue); - } - completion(MTRAsyncWorkComplete); - } - }]; - }]; - [_asyncWorkQueue enqueueWorkItem:workItem descriptionWithFormat:@"read %@ 0x%llx 0x%llx", endpointID, clusterID.unsignedLongLongValue, attributeID.unsignedLongLongValue]; - } else { - [self _readThroughSkipped]; - } - - return attributeValueToReturn; +#define ErrorStr "MTRDevice readAttributeWithEndpointID:clusterID:attributeID:params: must be handled by subclasses" + MTR_LOG_ERROR(ErrorStr); +#ifdef DEBUG + NSAssert(NO, @ErrorStr); +#endif // DEBUG + return nil; } - (void)writeAttributeWithEndpointID:(NSNumber *)endpointID @@ -2456,37 +2272,6 @@ - (void)_performScheduledExpirationCheck [self _checkExpiredExpectedValues]; } -// Get attribute value dictionary for an attribute path from the right cache -- (NSDictionary *)_attributeValueDictionaryForAttributePath:(MTRAttributePath *)attributePath -{ - std::lock_guard lock(_lock); - - // First check expected value cache - NSArray * expectedValue = _expectedValueCache[attributePath]; - if (expectedValue) { - NSDate * now = [NSDate date]; - if ([now compare:expectedValue[MTRDeviceExpectedValueFieldExpirationTimeIndex]] == NSOrderedDescending) { - // expired - purge and fall through - _expectedValueCache[attributePath] = nil; - } else { - // not yet expired - return result - return expectedValue[MTRDeviceExpectedValueFieldValueIndex]; - } - } - - // Then check read cache - NSDictionary * cachedAttributeValue = [self _cachedAttributeValueForPath:attributePath]; - if (cachedAttributeValue) { - return cachedAttributeValue; - } else { - // TODO: when not found in cache, generated default values should be used - MTR_LOG("%@ _attributeValueDictionaryForAttributePath: could not find cached attribute values for attribute %@", self, - attributePath); - } - - return nil; -} - - (BOOL)_attributeDataValue:(NSDictionary *)one isEqualToDataValue:(NSDictionary *)theOther { // Sanity check for nil cases