diff --git a/examples/tv-app/android/include/account-login/AccountLoginManager.cpp b/examples/tv-app/android/include/account-login/AccountLoginManager.cpp index 2fbc0aa5899004..2d1ae7d1a1368d 100644 --- a/examples/tv-app/android/include/account-login/AccountLoginManager.cpp +++ b/examples/tv-app/android/include/account-login/AccountLoginManager.cpp @@ -19,6 +19,7 @@ #include "AccountLoginManager.h" #include #include +#include #include #include @@ -102,3 +103,15 @@ void AccountLoginManager::GetSetupPin(char * setupPin, size_t setupPinSize, cons } ChipLogProgress(Zcl, "Returning pin for content app for endpoint %d", mEndpointId); }; + +uint16_t AccountLoginManager::GetClusterRevision(chip::EndpointId endpoint) +{ + if (endpoint >= EMBER_AF_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT) + { + return mDynamicClusterRevision; + } + + uint16_t clusterRevision = 0; + Attributes::ClusterRevision::Get(endpoint, &clusterRevision); + return clusterRevision; +} diff --git a/examples/tv-app/android/include/account-login/AccountLoginManager.h b/examples/tv-app/android/include/account-login/AccountLoginManager.h index a02a029f307eee..bf1d2e8492ca95 100644 --- a/examples/tv-app/android/include/account-login/AccountLoginManager.h +++ b/examples/tv-app/android/include/account-login/AccountLoginManager.h @@ -46,6 +46,7 @@ class AccountLoginManager : public AccountLoginDelegate const CharSpan & tempAccountIdentifierString) override; void GetSetupPin(char * setupPin, size_t setupPinSize, const CharSpan & tempAccountIdentifierString) override; void SetEndpointId(EndpointId epId) { mEndpointId = epId; }; + uint16_t GetClusterRevision(chip::EndpointId endpoint) override; protected: static const size_t kSetupPinSize = 12; @@ -54,4 +55,6 @@ class AccountLoginManager : public AccountLoginDelegate private: ContentAppCommandDelegate * mCommandDelegate; EndpointId mEndpointId; + + uint16_t mDynamicClusterRevision = 2; }; diff --git a/examples/tv-app/android/include/media-playback/AppMediaPlaybackManager.cpp b/examples/tv-app/android/include/media-playback/AppMediaPlaybackManager.cpp index e7d8100e9e5ce0..d6967d2528418d 100644 --- a/examples/tv-app/android/include/media-playback/AppMediaPlaybackManager.cpp +++ b/examples/tv-app/android/include/media-playback/AppMediaPlaybackManager.cpp @@ -283,3 +283,15 @@ uint32_t AppMediaPlaybackManager::GetFeatureMap(chip::EndpointId endpoint) Attributes::FeatureMap::Get(endpoint, &featureMap); return featureMap; } + +uint16_t AppMediaPlaybackManager::GetClusterRevision(chip::EndpointId endpoint) +{ + if (endpoint >= EMBER_AF_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT) + { + return mDynamicClusterRevision; + } + + uint16_t clusterRevision = 0; + Attributes::ClusterRevision::Get(endpoint, &clusterRevision); + return clusterRevision; +} \ No newline at end of file diff --git a/examples/tv-app/android/include/media-playback/AppMediaPlaybackManager.h b/examples/tv-app/android/include/media-playback/AppMediaPlaybackManager.h index 9cb16092f264b2..cc1dcfed286028 100644 --- a/examples/tv-app/android/include/media-playback/AppMediaPlaybackManager.h +++ b/examples/tv-app/android/include/media-playback/AppMediaPlaybackManager.h @@ -102,6 +102,7 @@ class AppMediaPlaybackManager : public MediaPlaybackDelegate bool HandleDeactivateTextTrack() override; uint32_t GetFeatureMap(chip::EndpointId endpoint) override; + uint16_t GetClusterRevision(chip::EndpointId endpoint) override; void SetEndpointId(EndpointId epId) { mEndpointId = epId; }; @@ -114,6 +115,7 @@ class AppMediaPlaybackManager : public MediaPlaybackDelegate // TODO: set this based upon meta data from app uint32_t mDynamicEndpointFeatureMap = 3; + uint16_t mDynamicClusterRevision = 2; ContentAppAttributeDelegate * mAttributeDelegate; }; diff --git a/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.cpp b/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.cpp index f917beb6552ee1..609eb923ed8ad2 100644 --- a/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.cpp +++ b/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.cpp @@ -15,6 +15,7 @@ * limitations under the License. */ +#include #include "TargetNavigatorManager.h" #include @@ -144,3 +145,15 @@ void TargetNavigatorManager::HandleNavigateTarget(CommandResponseHelper= EMBER_AF_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT) + { + return mDynamicClusterRevision; + } + + uint16_t clusterRevision = 0; + Attributes::ClusterRevision::Get(endpoint, &clusterRevision); + return clusterRevision; +} \ No newline at end of file diff --git a/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.h b/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.h index 1f7f4a2096b20b..4f36286021003f 100644 --- a/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.h +++ b/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.h @@ -39,6 +39,7 @@ class TargetNavigatorManager : public TargetNavigatorDelegate uint8_t HandleGetCurrentTarget() override; void HandleNavigateTarget(CommandResponseHelper & responser, const uint64_t & target, const CharSpan & data) override; + uint16_t GetClusterRevision(chip::EndpointId endpoint) override; void SetEndpointId(EndpointId epId) { mEndpointId = epId; }; @@ -51,4 +52,8 @@ class TargetNavigatorManager : public TargetNavigatorDelegate EndpointId mEndpointId; ContentAppAttributeDelegate * mAttributeDelegate; + +private: + // TODO: set this based upon meta data from app + uint16_t mDynamicClusterRevision = 2; }; diff --git a/examples/tv-app/android/java/ChannelManager.cpp b/examples/tv-app/android/java/ChannelManager.cpp index 14d7509600b66f..8b4ecf462a52c0 100644 --- a/examples/tv-app/android/java/ChannelManager.cpp +++ b/examples/tv-app/android/java/ChannelManager.cpp @@ -751,3 +751,15 @@ uint32_t ChannelManager::GetFeatureMap(chip::EndpointId endpoint) Attributes::FeatureMap::Get(endpoint, &featureMap); return featureMap; } + +uint16_t ChannelManager::GetClusterRevision(chip::EndpointId endpoint) +{ + if (endpoint >= EMBER_AF_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT) + { + return mDynamicClusterRevision; + } + + uint16_t clusterRevision = 0; + Attributes::ClusterRevision::Get(endpoint, &clusterRevision); + return clusterRevision; +} \ No newline at end of file diff --git a/examples/tv-app/android/java/ChannelManager.h b/examples/tv-app/android/java/ChannelManager.h index 85d645beda40a3..76e0ee6cd7fd1a 100644 --- a/examples/tv-app/android/java/ChannelManager.h +++ b/examples/tv-app/android/java/ChannelManager.h @@ -64,6 +64,7 @@ class ChannelManager : public ChannelDelegate const chip::ByteSpan & data) override; uint32_t GetFeatureMap(chip::EndpointId endpoint) override; + uint16_t GetClusterRevision(chip::EndpointId endpoint) override; private: jobject mChannelManagerObject = nullptr; @@ -81,4 +82,5 @@ class ChannelManager : public ChannelDelegate // TODO: set this based upon meta data from app uint32_t mDynamicEndpointFeatureMap = 3; + uint16_t mDynamicClusterRevision = 2; }; diff --git a/examples/tv-app/android/java/MediaPlaybackManager.cpp b/examples/tv-app/android/java/MediaPlaybackManager.cpp index 64843fd3a45e4f..a806cfe81c70eb 100644 --- a/examples/tv-app/android/java/MediaPlaybackManager.cpp +++ b/examples/tv-app/android/java/MediaPlaybackManager.cpp @@ -602,3 +602,15 @@ uint32_t MediaPlaybackManager::GetFeatureMap(chip::EndpointId endpoint) Attributes::FeatureMap::Get(endpoint, &featureMap); return featureMap; } + +uint16_t MediaPlaybackManager::GetClusterRevision(chip::EndpointId endpoint) +{ + if (endpoint >= EMBER_AF_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT) + { + return mDynamicClusterRevision; + } + + uint16_t clusterRevision = 0; + Attributes::ClusterRevision::Get(endpoint, &clusterRevision); + return clusterRevision; +} \ No newline at end of file diff --git a/examples/tv-app/android/java/MediaPlaybackManager.h b/examples/tv-app/android/java/MediaPlaybackManager.h index 914462fea57fb2..6bef9f1b3fd51f 100644 --- a/examples/tv-app/android/java/MediaPlaybackManager.h +++ b/examples/tv-app/android/java/MediaPlaybackManager.h @@ -103,6 +103,7 @@ class MediaPlaybackManager : public MediaPlaybackDelegate bool HandleDeactivateTextTrack() override; uint32_t GetFeatureMap(chip::EndpointId endpoint) override; + uint16_t GetClusterRevision(chip::EndpointId endpoint) override; private: jobject mMediaPlaybackManagerObject = nullptr; @@ -121,4 +122,5 @@ class MediaPlaybackManager : public MediaPlaybackDelegate // TODO: set this based upon meta data from app uint32_t mDynamicEndpointFeatureMap = 3; + uint16_t mDynamicClusterRevision = 2; }; diff --git a/examples/tv-app/tv-common/clusters/account-login/AccountLoginManager.cpp b/examples/tv-app/tv-common/clusters/account-login/AccountLoginManager.cpp index 1127d3a8aea35c..b44f4d5f87f09a 100644 --- a/examples/tv-app/tv-common/clusters/account-login/AccountLoginManager.cpp +++ b/examples/tv-app/tv-common/clusters/account-login/AccountLoginManager.cpp @@ -18,6 +18,7 @@ #include "AccountLoginManager.h" #include +#include #include using namespace std; @@ -64,3 +65,15 @@ void AccountLoginManager::HandleGetSetupPin(CommandResponseHelper= EMBER_AF_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT) + { + return mDynamicClusterRevision; + } + + uint16_t clusterRevision = 0; + Attributes::ClusterRevision::Get(endpoint, &clusterRevision); + return clusterRevision; +} diff --git a/examples/tv-app/tv-common/clusters/account-login/AccountLoginManager.h b/examples/tv-app/tv-common/clusters/account-login/AccountLoginManager.h index 4d6f53759b56d3..507132a1ffc69e 100644 --- a/examples/tv-app/tv-common/clusters/account-login/AccountLoginManager.h +++ b/examples/tv-app/tv-common/clusters/account-login/AccountLoginManager.h @@ -46,7 +46,13 @@ class AccountLoginManager : public AccountLoginDelegate CopyString(setupPin, setupPinSize, mSetupPin); }; + uint16_t GetClusterRevision(chip::EndpointId endpoint) override; + protected: static const size_t kSetupPinSize = 12; char mSetupPin[kSetupPinSize]; + +private: + // TODO: set this based upon meta data from app + uint16_t mDynamicClusterRevision = 2; }; diff --git a/examples/tv-app/tv-common/clusters/channel/ChannelManager.cpp b/examples/tv-app/tv-common/clusters/channel/ChannelManager.cpp index 7599bc48ef5d29..ea0a99c6e7a64e 100644 --- a/examples/tv-app/tv-common/clusters/channel/ChannelManager.cpp +++ b/examples/tv-app/tv-common/clusters/channel/ChannelManager.cpp @@ -338,3 +338,15 @@ uint32_t ChannelManager::GetFeatureMap(chip::EndpointId endpoint) Attributes::FeatureMap::Get(endpoint, &featureMap); return featureMap; } + +uint16_t ChannelManager::GetClusterRevision(chip::EndpointId endpoint) +{ + if (endpoint >= EMBER_AF_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT) + { + return mDynamicClusterRevision; + } + + uint16_t clusterRevision = 0; + Attributes::ClusterRevision::Get(endpoint, &clusterRevision); + return clusterRevision; +} diff --git a/examples/tv-app/tv-common/clusters/channel/ChannelManager.h b/examples/tv-app/tv-common/clusters/channel/ChannelManager.h index c0c28bb9d00c08..07ef07b9d1ba05 100644 --- a/examples/tv-app/tv-common/clusters/channel/ChannelManager.h +++ b/examples/tv-app/tv-common/clusters/channel/ChannelManager.h @@ -63,6 +63,7 @@ class ChannelManager : public ChannelDelegate const chip::ByteSpan & data) override; uint32_t GetFeatureMap(chip::EndpointId endpoint) override; + uint16_t GetClusterRevision(chip::EndpointId endpoint) override; protected: uint16_t mCurrentChannelIndex; @@ -73,4 +74,5 @@ class ChannelManager : public ChannelDelegate private: // TODO: set this based upon meta data from app uint32_t mDynamicEndpointFeatureMap = 3; + uint16_t mDynamicClusterRevision = 2; }; diff --git a/examples/tv-app/tv-common/clusters/media-playback/MediaPlaybackManager.cpp b/examples/tv-app/tv-common/clusters/media-playback/MediaPlaybackManager.cpp index fe220ce612e7d5..7e2e320d4079dd 100644 --- a/examples/tv-app/tv-common/clusters/media-playback/MediaPlaybackManager.cpp +++ b/examples/tv-app/tv-common/clusters/media-playback/MediaPlaybackManager.cpp @@ -326,3 +326,15 @@ uint32_t MediaPlaybackManager::GetFeatureMap(chip::EndpointId endpoint) Attributes::FeatureMap::Get(endpoint, &featureMap); return featureMap; } + +uint16_t MediaPlaybackManager::GetClusterRevision(chip::EndpointId endpoint) +{ + if (endpoint >= EMBER_AF_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT) + { + return mDynamicClusterRevision; + } + + uint16_t clusterRevision = 0; + Attributes::ClusterRevision::Get(endpoint, &clusterRevision); + return clusterRevision; +} diff --git a/examples/tv-app/tv-common/clusters/media-playback/MediaPlaybackManager.h b/examples/tv-app/tv-common/clusters/media-playback/MediaPlaybackManager.h index e4582e64d2d19c..ea980711a54bf0 100644 --- a/examples/tv-app/tv-common/clusters/media-playback/MediaPlaybackManager.h +++ b/examples/tv-app/tv-common/clusters/media-playback/MediaPlaybackManager.h @@ -64,6 +64,7 @@ class MediaPlaybackManager : public MediaPlaybackDelegate bool HandleDeactivateTextTrack() override; uint32_t GetFeatureMap(chip::EndpointId endpoint) override; + uint16_t GetClusterRevision(chip::EndpointId endpoint) override; protected: // NOTE: it does not make sense to have default state of playing with a speed of 0, but @@ -113,4 +114,5 @@ class MediaPlaybackManager : public MediaPlaybackDelegate private: // TODO: set this based upon meta data from app uint32_t mDynamicEndpointFeatureMap = 3; + uint16_t mDynamicClusterRevision = 2; }; diff --git a/examples/tv-app/tv-common/clusters/target-navigator/TargetNavigatorManager.cpp b/examples/tv-app/tv-common/clusters/target-navigator/TargetNavigatorManager.cpp index 9c0599eb6df7b0..08c32449afa2e2 100644 --- a/examples/tv-app/tv-common/clusters/target-navigator/TargetNavigatorManager.cpp +++ b/examples/tv-app/tv-common/clusters/target-navigator/TargetNavigatorManager.cpp @@ -16,6 +16,7 @@ */ #include "TargetNavigatorManager.h" +#include using namespace std; using namespace chip::app; @@ -66,3 +67,16 @@ void TargetNavigatorManager::HandleNavigateTarget(CommandResponseHelper= EMBER_AF_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT) + { + return mDynamicClusterRevision; + } + + uint16_t clusterRevision = 0; + Attributes::ClusterRevision::Get(endpoint, &clusterRevision); + return clusterRevision; +} \ No newline at end of file diff --git a/examples/tv-app/tv-common/clusters/target-navigator/TargetNavigatorManager.h b/examples/tv-app/tv-common/clusters/target-navigator/TargetNavigatorManager.h index 0294e75876ac2b..da6ceddff957db 100644 --- a/examples/tv-app/tv-common/clusters/target-navigator/TargetNavigatorManager.h +++ b/examples/tv-app/tv-common/clusters/target-navigator/TargetNavigatorManager.h @@ -36,10 +36,14 @@ class TargetNavigatorManager : public TargetNavigatorDelegate uint8_t HandleGetCurrentTarget() override; void HandleNavigateTarget(CommandResponseHelper & responser, const uint64_t & target, const CharSpan & data) override; + uint16_t GetClusterRevision(chip::EndpointId endpoint) override; protected: // NOTE: the ids for each target start at 1 so that we can reserve 0 as "no current target" static const uint8_t kNoCurrentTarget = 0; std::list mTargets; uint8_t mCurrentTarget; +private: + // TODO: set this based upon meta data from app + uint16_t mDynamicClusterRevision = 2; }; diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index b893f790792eb5..c7b121b74d7a4a 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -3444,7 +3444,7 @@ endpoint 1 { callback attribute lineup; callback attribute currentChannel; ram attribute featureMap default = 0x0003; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 2; handle command ChangeChannel; handle command ChangeChannelResponse; @@ -3461,7 +3461,7 @@ endpoint 1 { callback attribute targetList; ram attribute currentTarget default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 2; handle command NavigateTarget; handle command NavigateTargetResponse; diff --git a/examples/tv-app/tv-common/tv-app.zap b/examples/tv-app/tv-common/tv-app.zap index 955307dbf00c31..c69ad5088e62eb 100644 --- a/examples/tv-app/tv-common/tv-app.zap +++ b/examples/tv-app/tv-common/tv-app.zap @@ -4897,7 +4897,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4989,7 +4989,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/src/app/clusters/account-login-server/account-login-delegate.h b/src/app/clusters/account-login-server/account-login-delegate.h index 0abf1de306d933..8b8a1c4ca28196 100644 --- a/src/app/clusters/account-login-server/account-login-delegate.h +++ b/src/app/clusters/account-login-server/account-login-delegate.h @@ -44,6 +44,8 @@ class Delegate const chip::CharSpan & tempAccountIdentifierString) = 0; virtual void GetSetupPin(char * setupPin, size_t setupPinSize, const chip::CharSpan & tempAccountIdentifierString) = 0; + virtual uint16_t GetClusterRevision(chip::EndpointId endpoint) = 0; + virtual ~Delegate() = default; }; diff --git a/src/app/clusters/account-login-server/account-login-server.cpp b/src/app/clusters/account-login-server/account-login-server.cpp index 1ba2218a69f737..09b0f8c3670c8e 100644 --- a/src/app/clusters/account-login-server/account-login-server.cpp +++ b/src/app/clusters/account-login-server/account-login-server.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -111,6 +112,57 @@ void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate) } // namespace app } // namespace chip +// ----------------------------------------------------------------------------- +// Attribute Accessor Implementation + +namespace { + +class AccountLoginAttrAccess : public app::AttributeAccessInterface +{ +public: + AccountLoginAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), AccountLogin::Id) {} + + CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override; + +private: + CHIP_ERROR ReadRevisionAttribute(EndpointId endpoint, app::AttributeValueEncoder & aEncoder, Delegate * delegate); +}; + +AccountLoginAttrAccess gAccountLoginAttrAccess; + +CHIP_ERROR AccountLoginAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) +{ + EndpointId endpoint = aPath.mEndpointId; + Delegate * delegate = GetDelegate(endpoint); + + switch (aPath.mAttributeId) + { + case app::Clusters::AccountLogin::Attributes::ClusterRevision::Id: { + if (isDelegateNull(delegate, endpoint)) + { + return CHIP_NO_ERROR; + } + + return ReadRevisionAttribute(endpoint, aEncoder, delegate); + } + default: { + break; + } + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR AccountLoginAttrAccess::ReadRevisionAttribute(EndpointId endpoint, app::AttributeValueEncoder & aEncoder, + Delegate * delegate) +{ + uint16_t clusterRevision = delegate->GetClusterRevision(endpoint); + return aEncoder.Encode(clusterRevision); +} + +} // anonymous namespace + + // ----------------------------------------------------------------------------- // Matter Framework Callbacks Implementation @@ -212,4 +264,7 @@ bool emberAfAccountLoginClusterLogoutCallback(app::CommandHandler * commandObj, // ----------------------------------------------------------------------------- // Plugin initialization -void MatterAccountLoginPluginServerInitCallback() {} +void MatterAccountLoginPluginServerInitCallback() +{ + registerAttributeAccessOverride(&gAccountLoginAttrAccess); +} diff --git a/src/app/clusters/channel-server/channel-delegate.h b/src/app/clusters/channel-server/channel-delegate.h index 6007bf06f8867f..71ea2c25788fa3 100644 --- a/src/app/clusters/channel-server/channel-delegate.h +++ b/src/app/clusters/channel-server/channel-delegate.h @@ -65,6 +65,7 @@ class Delegate bool HasFeature(chip::EndpointId endpoint, Feature feature); virtual uint32_t GetFeatureMap(chip::EndpointId endpoint) = 0; + virtual uint16_t GetClusterRevision(chip::EndpointId endpoint) = 0; virtual ~Delegate() = default; }; diff --git a/src/app/clusters/channel-server/channel-server.cpp b/src/app/clusters/channel-server/channel-server.cpp index 52d30083075d66..46df1fb125468d 100644 --- a/src/app/clusters/channel-server/channel-server.cpp +++ b/src/app/clusters/channel-server/channel-server.cpp @@ -124,6 +124,7 @@ class ChannelAttrAccess : public app::AttributeAccessInterface CHIP_ERROR ReadLineupAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); CHIP_ERROR ReadCurrentChannelAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); CHIP_ERROR ReadFeatureFlagAttribute(EndpointId endpoint, app::AttributeValueEncoder & aEncoder, Delegate * delegate); + CHIP_ERROR ReadRevisionAttribute(EndpointId endpoint, app::AttributeValueEncoder & aEncoder, Delegate * delegate); }; ChannelAttrAccess gChannelAttrAccess; @@ -167,6 +168,14 @@ CHIP_ERROR ChannelAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, return ReadFeatureFlagAttribute(endpoint, aEncoder, delegate); } + case app::Clusters::Channel::Attributes::ClusterRevision::Id: { + if (isDelegateNull(delegate, endpoint)) + { + return CHIP_NO_ERROR; + } + + return ReadRevisionAttribute(endpoint, aEncoder, delegate); + } default: { break; } @@ -197,6 +206,14 @@ CHIP_ERROR ChannelAttrAccess::ReadCurrentChannelAttribute(app::AttributeValueEnc return delegate->HandleGetCurrentChannel(aEncoder); } + +CHIP_ERROR ChannelAttrAccess::ReadRevisionAttribute(EndpointId endpoint, app::AttributeValueEncoder & aEncoder, + Delegate * delegate) +{ + uint16_t clusterRevision = delegate->GetClusterRevision(endpoint); + return aEncoder.Encode(clusterRevision); +} + } // anonymous namespace // ----------------------------------------------------------------------------- diff --git a/src/app/clusters/media-playback-server/media-playback-delegate.h b/src/app/clusters/media-playback-server/media-playback-delegate.h index db60f897b8b623..11dde6fd91fc08 100644 --- a/src/app/clusters/media-playback-server/media-playback-delegate.h +++ b/src/app/clusters/media-playback-server/media-playback-delegate.h @@ -71,6 +71,7 @@ class Delegate virtual bool HandleDeactivateTextTrack() = 0; virtual uint32_t GetFeatureMap(chip::EndpointId endpoint) = 0; + virtual uint16_t GetClusterRevision(chip::EndpointId endpoint) = 0; virtual ~Delegate() = default; }; diff --git a/src/app/clusters/media-playback-server/media-playback-server.cpp b/src/app/clusters/media-playback-server/media-playback-server.cpp index ea8f00270aaf30..087f150405d251 100644 --- a/src/app/clusters/media-playback-server/media-playback-server.cpp +++ b/src/app/clusters/media-playback-server/media-playback-server.cpp @@ -139,6 +139,7 @@ class MediaPlaybackAttrAccess : public app::AttributeAccessInterface CHIP_ERROR ReadActiveTextTrackAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); CHIP_ERROR ReadAvailableTextTracksAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); CHIP_ERROR ReadFeatureFlagAttribute(EndpointId endpoint, app::AttributeValueEncoder & aEncoder, Delegate * delegate); + CHIP_ERROR ReadRevisionAttribute(EndpointId endpoint, app::AttributeValueEncoder & aEncoder, Delegate * delegate); }; MediaPlaybackAttrAccess gMediaPlaybackAttrAccess; @@ -205,6 +206,9 @@ CHIP_ERROR MediaPlaybackAttrAccess::Read(const app::ConcreteReadAttributePath & case app::Clusters::ContentLauncher::Attributes::FeatureMap::Id: { return ReadFeatureFlagAttribute(endpoint, aEncoder, delegate); } + case app::Clusters::AccountLogin::Attributes::ClusterRevision::Id: { + return ReadRevisionAttribute(endpoint, aEncoder, delegate); + } default: { break; } @@ -220,6 +224,13 @@ CHIP_ERROR MediaPlaybackAttrAccess::ReadFeatureFlagAttribute(EndpointId endpoint return aEncoder.Encode(featureFlag); } +CHIP_ERROR MediaPlaybackAttrAccess::ReadRevisionAttribute(EndpointId endpoint, app::AttributeValueEncoder & aEncoder, + Delegate * delegate) +{ + uint16_t clusterRevision = delegate->GetClusterRevision(endpoint); + return aEncoder.Encode(clusterRevision); +} + CHIP_ERROR MediaPlaybackAttrAccess::ReadCurrentStateAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) { MediaPlayback::PlaybackStateEnum currentState = delegate->HandleGetCurrentState(); diff --git a/src/app/clusters/messages-server/messages-server.cpp b/src/app/clusters/messages-server/messages-server.cpp index 38cf972c9fccf2..2cca0913eb4320 100644 --- a/src/app/clusters/messages-server/messages-server.cpp +++ b/src/app/clusters/messages-server/messages-server.cpp @@ -26,6 +26,7 @@ bool emberAfMessagesClusterPresentMessagesRequestCallback( { return true; } + /** * @brief Messages Cluster CancelMessagesRequest Command callback (from client) */ diff --git a/src/app/clusters/target-navigator-server/target-navigator-delegate.h b/src/app/clusters/target-navigator-server/target-navigator-delegate.h index 0dd47f56d4de85..4d10a720a7c020 100644 --- a/src/app/clusters/target-navigator-server/target-navigator-delegate.h +++ b/src/app/clusters/target-navigator-server/target-navigator-delegate.h @@ -40,6 +40,7 @@ class Delegate virtual uint8_t HandleGetCurrentTarget() = 0; virtual void HandleNavigateTarget(CommandResponseHelper & helper, const uint64_t & target, const CharSpan & data) = 0; + virtual uint16_t GetClusterRevision(chip::EndpointId endpoint) = 0; virtual ~Delegate() = default; }; diff --git a/src/app/clusters/target-navigator-server/target-navigator-server.cpp b/src/app/clusters/target-navigator-server/target-navigator-server.cpp index e52ef407003eb1..c9d64f26dffc82 100644 --- a/src/app/clusters/target-navigator-server/target-navigator-server.cpp +++ b/src/app/clusters/target-navigator-server/target-navigator-server.cpp @@ -128,6 +128,7 @@ class TargetNavigatorAttrAccess : public app::AttributeAccessInterface private: CHIP_ERROR ReadTargetListAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); CHIP_ERROR ReadCurrentTargetAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); + CHIP_ERROR ReadRevisionAttribute(EndpointId endpoint, app::AttributeValueEncoder & aEncoder, Delegate * delegate); }; TargetNavigatorAttrAccess gTargetNavigatorAttrAccess; @@ -155,6 +156,14 @@ CHIP_ERROR TargetNavigatorAttrAccess::Read(const app::ConcreteReadAttributePath return ReadCurrentTargetAttribute(aEncoder, delegate); } + case app::Clusters::TargetNavigator::Attributes::ClusterRevision::Id: { + if (isDelegateNull(delegate, endpoint)) + { + return CHIP_NO_ERROR; + } + + return ReadRevisionAttribute(endpoint, aEncoder, delegate); + } default: { break; } @@ -174,6 +183,13 @@ CHIP_ERROR TargetNavigatorAttrAccess::ReadCurrentTargetAttribute(app::AttributeV return aEncoder.Encode(currentTarget); } +CHIP_ERROR TargetNavigatorAttrAccess::ReadRevisionAttribute(EndpointId endpoint, app::AttributeValueEncoder & aEncoder, + Delegate * delegate) +{ + uint16_t clusterRevision = delegate->GetClusterRevision(endpoint); + return aEncoder.Encode(clusterRevision); +} + } // anonymous namespace // -----------------------------------------------------------------------------