diff --git a/examples/tv-app/android/include/account-login/AccountLoginManager.cpp b/examples/tv-app/android/include/account-login/AccountLoginManager.cpp index 2fbc0aa5899004..2151dd63920f74 100644 --- a/examples/tv-app/android/include/account-login/AccountLoginManager.cpp +++ b/examples/tv-app/android/include/account-login/AccountLoginManager.cpp @@ -17,6 +17,7 @@ */ #include "AccountLoginManager.h" +#include #include #include #include @@ -102,3 +103,19 @@ 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 >= MATTER_DM_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT) + { + return kClusterRevision; + } + + uint16_t clusterRevision = 0; + bool success = (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == EMBER_ZCL_STATUS_SUCCESS); + if (!success) + { + ChipLogError(Zcl, "AccountLoginManager::GetClusterRevision error reading cluster revision"); + } + 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..265118c63243fc 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; + + static constexpr uint16_t kClusterRevision = 2; }; diff --git a/examples/tv-app/android/include/content-control/ContentController.cpp b/examples/tv-app/android/include/content-control/ContentController.cpp index 99373583b0632d..edf2550c489d62 100644 --- a/examples/tv-app/android/include/content-control/ContentController.cpp +++ b/examples/tv-app/android/include/content-control/ContentController.cpp @@ -96,7 +96,7 @@ uint32_t ContentController::GetFeatureMap(chip::EndpointId endpoint) { if (endpoint >= MATTER_DM_CONTENT_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT) { - return mDynamicEndpointFeatureMap; + return kEndpointFeatureMap; } uint32_t featureMap = 0; diff --git a/examples/tv-app/android/include/content-control/ContentController.h b/examples/tv-app/android/include/content-control/ContentController.h index eaafef098f65c0..40b0636efa4cf8 100644 --- a/examples/tv-app/android/include/content-control/ContentController.h +++ b/examples/tv-app/android/include/content-control/ContentController.h @@ -58,6 +58,6 @@ class ContentController : public ContentControlDelegate protected: private: // TODO: set this based upon meta data from app - uint32_t mDynamicEndpointFeatureMap = 3; + static constexpr uint32_t kEndpointFeatureMap = 3; chip::EndpointId mEndpointId; }; diff --git a/examples/tv-app/android/include/content-launcher/AppContentLauncherManager.cpp b/examples/tv-app/android/include/content-launcher/AppContentLauncherManager.cpp index 50b451994de2f7..31745a93c42fce 100644 --- a/examples/tv-app/android/include/content-launcher/AppContentLauncherManager.cpp +++ b/examples/tv-app/android/include/content-launcher/AppContentLauncherManager.cpp @@ -158,10 +158,26 @@ uint32_t AppContentLauncherManager::GetFeatureMap(chip::EndpointId endpoint) { if (endpoint >= MATTER_DM_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT) { - return mDynamicEndpointFeatureMap; + return kEndpointFeatureMap; } uint32_t featureMap = 0; Attributes::FeatureMap::Get(endpoint, &featureMap); return featureMap; } + +uint16_t AppContentLauncherManager::GetClusterRevision(chip::EndpointId endpoint) +{ + if (endpoint >= MATTER_DM_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT) + { + return kClusterRevision; + } + + uint16_t clusterRevision = 0; + bool success = (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == EMBER_ZCL_STATUS_SUCCESS); + if (!success) + { + ChipLogError(Zcl, "AppContentLauncherManager::GetClusterRevision error reading cluster revision"); + } + return clusterRevision; +} diff --git a/examples/tv-app/android/include/content-launcher/AppContentLauncherManager.h b/examples/tv-app/android/include/content-launcher/AppContentLauncherManager.h index 67812744ce0d36..f9e05a1f17a68b 100644 --- a/examples/tv-app/android/include/content-launcher/AppContentLauncherManager.h +++ b/examples/tv-app/android/include/content-launcher/AppContentLauncherManager.h @@ -52,6 +52,7 @@ class AppContentLauncherManager : public ContentLauncherDelegate void SetEndpointId(EndpointId epId) { mEndpointId = epId; }; uint32_t GetFeatureMap(chip::EndpointId endpoint) override; + uint16_t GetClusterRevision(chip::EndpointId endpoint) override; protected: std::list mAcceptHeaderList; @@ -61,7 +62,7 @@ class AppContentLauncherManager : public ContentLauncherDelegate EndpointId mEndpointId; // TODO: set this based upon meta data from app - uint32_t mDynamicEndpointFeatureMap = 3; - + static constexpr uint32_t kEndpointFeatureMap = 3; + static constexpr uint16_t kClusterRevision = 2; ContentAppAttributeDelegate * mAttributeDelegate; }; diff --git a/examples/tv-app/android/include/media-playback/AppMediaPlaybackManager.cpp b/examples/tv-app/android/include/media-playback/AppMediaPlaybackManager.cpp index c3195133711552..39e364d60e4148 100644 --- a/examples/tv-app/android/include/media-playback/AppMediaPlaybackManager.cpp +++ b/examples/tv-app/android/include/media-playback/AppMediaPlaybackManager.cpp @@ -276,10 +276,26 @@ uint32_t AppMediaPlaybackManager::GetFeatureMap(chip::EndpointId endpoint) { if (endpoint >= MATTER_DM_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT) { - return mDynamicEndpointFeatureMap; + return kEndpointFeatureMap; } uint32_t featureMap = 0; Attributes::FeatureMap::Get(endpoint, &featureMap); return featureMap; } + +uint16_t AppMediaPlaybackManager::GetClusterRevision(chip::EndpointId endpoint) +{ + if (endpoint >= MATTER_DM_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT) + { + return kClusterRevision; + } + + uint16_t clusterRevision = 0; + bool success = (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == EMBER_ZCL_STATUS_SUCCESS); + if (!success) + { + ChipLogError(Zcl, "AppMediaPlaybackManager::GetClusterRevision error reading cluster revision"); + } + return clusterRevision; +} diff --git a/examples/tv-app/android/include/media-playback/AppMediaPlaybackManager.h b/examples/tv-app/android/include/media-playback/AppMediaPlaybackManager.h index 9cb16092f264b2..0c8847387dce0f 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; }; @@ -113,7 +114,8 @@ class AppMediaPlaybackManager : public MediaPlaybackDelegate EndpointId mEndpointId; // TODO: set this based upon meta data from app - uint32_t mDynamicEndpointFeatureMap = 3; + static constexpr uint32_t kEndpointFeatureMap = 3; + static constexpr uint16_t kClusterRevision = 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..cb22e9fd9b8abf 100644 --- a/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.cpp +++ b/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.cpp @@ -16,6 +16,7 @@ */ #include "TargetNavigatorManager.h" +#include #include using namespace std; @@ -144,3 +145,19 @@ void TargetNavigatorManager::HandleNavigateTarget(CommandResponseHelper= MATTER_DM_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT) + { + return kClusterRevision; + } + + uint16_t clusterRevision = 0; + bool success = (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == EMBER_ZCL_STATUS_SUCCESS); + if (!success) + { + ChipLogError(Zcl, "TargetNavigatorManager::GetClusterRevision error reading cluster revision"); + } + return clusterRevision; +} diff --git a/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.h b/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.h index 1f7f4a2096b20b..10db972704daa9 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 + static constexpr uint16_t kClusterRevision = 2; }; diff --git a/examples/tv-app/android/java/ChannelManager.cpp b/examples/tv-app/android/java/ChannelManager.cpp index d7657fd5622fee..997f041b78982f 100644 --- a/examples/tv-app/android/java/ChannelManager.cpp +++ b/examples/tv-app/android/java/ChannelManager.cpp @@ -745,10 +745,26 @@ uint32_t ChannelManager::GetFeatureMap(chip::EndpointId endpoint) { if (endpoint >= MATTER_DM_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT) { - return mDynamicEndpointFeatureMap; + return kEndpointFeatureMap; } uint32_t featureMap = 0; Attributes::FeatureMap::Get(endpoint, &featureMap); return featureMap; } + +uint16_t ChannelManager::GetClusterRevision(chip::EndpointId endpoint) +{ + if (endpoint >= MATTER_DM_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT) + { + return kClusterRevision; + } + + uint16_t clusterRevision = 0; + bool success = (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == EMBER_ZCL_STATUS_SUCCESS); + if (!success) + { + ChipLogError(Zcl, "ChannelManager::GetClusterRevision error reading cluster revision"); + } + return clusterRevision; +} diff --git a/examples/tv-app/android/java/ChannelManager.h b/examples/tv-app/android/java/ChannelManager.h index 95bf5317a842cc..6d749ca49a0c51 100644 --- a/examples/tv-app/android/java/ChannelManager.h +++ b/examples/tv-app/android/java/ChannelManager.h @@ -65,6 +65,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: chip::JniGlobalReference mChannelManagerObject; @@ -81,5 +82,6 @@ class ChannelManager : public ChannelDelegate jmethodID mCancelRecordProgramMethod = nullptr; // TODO: set this based upon meta data from app - uint32_t mDynamicEndpointFeatureMap = 3; + static constexpr uint32_t kEndpointFeatureMap = 3; + static constexpr uint16_t kClusterRevision = 2; }; diff --git a/examples/tv-app/android/java/ContentLauncherManager.cpp b/examples/tv-app/android/java/ContentLauncherManager.cpp index 8e8a08be78f4b5..25e5659b4f6703 100644 --- a/examples/tv-app/android/java/ContentLauncherManager.cpp +++ b/examples/tv-app/android/java/ContentLauncherManager.cpp @@ -286,3 +286,19 @@ uint32_t ContentLauncherManager::GetFeatureMap(chip::EndpointId endpoint) Attributes::FeatureMap::Get(endpoint, &featureMap); return featureMap; } + +uint16_t ContentLauncherManager::GetClusterRevision(chip::EndpointId endpoint) +{ + if (endpoint >= MATTER_DM_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT) + { + return kClusterRevision; + } + + uint16_t clusterRevision = 0; + bool success = (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == EMBER_ZCL_STATUS_SUCCESS); + if (!success) + { + ChipLogError(Zcl, "ContentLauncherManager::GetClusterRevision error reading cluster revision"); + } + return clusterRevision; +} diff --git a/examples/tv-app/android/java/ContentLauncherManager.h b/examples/tv-app/android/java/ContentLauncherManager.h index 864d52c4fa64ca..6e858ddebf18a0 100644 --- a/examples/tv-app/android/java/ContentLauncherManager.h +++ b/examples/tv-app/android/java/ContentLauncherManager.h @@ -49,6 +49,7 @@ class ContentLauncherManager : public ContentLauncherDelegate uint32_t HandleGetSupportedStreamingProtocols() override; uint32_t GetFeatureMap(chip::EndpointId endpoint) override; + uint16_t GetClusterRevision(chip::EndpointId endpoint) override; private: chip::JniGlobalReference mContentLauncherManagerObject; @@ -56,4 +57,7 @@ class ContentLauncherManager : public ContentLauncherDelegate jmethodID mGetSupportedStreamingProtocolsMethod = nullptr; jmethodID mLaunchContentMethod = nullptr; jmethodID mLaunchUrlMethod = nullptr; + + // TODO: set this based upon meta data from app + static constexpr uint16_t kClusterRevision = 2; }; diff --git a/examples/tv-app/android/java/KeypadInputManager.cpp b/examples/tv-app/android/java/KeypadInputManager.cpp index 450804a3764449..a43a56cb860978 100644 --- a/examples/tv-app/android/java/KeypadInputManager.cpp +++ b/examples/tv-app/android/java/KeypadInputManager.cpp @@ -96,7 +96,7 @@ uint32_t KeypadInputManager::GetFeatureMap(chip::EndpointId endpoint) { if (endpoint >= MATTER_DM_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT) { - return mDynamicEndpointFeatureMap; + return kEndpointFeatureMap; } uint32_t featureMap = 0; diff --git a/examples/tv-app/android/java/KeypadInputManager.h b/examples/tv-app/android/java/KeypadInputManager.h index 568648eab6e557..4bc887851d021f 100644 --- a/examples/tv-app/android/java/KeypadInputManager.h +++ b/examples/tv-app/android/java/KeypadInputManager.h @@ -42,5 +42,5 @@ class KeypadInputManager : public KeypadInputDelegate jmethodID mSendKeyMethod = nullptr; // TODO: set this based upon meta data from app - uint32_t mDynamicEndpointFeatureMap = 7; + static constexpr uint32_t kEndpointFeatureMap = 7; }; diff --git a/examples/tv-app/android/java/MediaPlaybackManager.cpp b/examples/tv-app/android/java/MediaPlaybackManager.cpp index c72a3135c4b222..8da71d5a533193 100644 --- a/examples/tv-app/android/java/MediaPlaybackManager.cpp +++ b/examples/tv-app/android/java/MediaPlaybackManager.cpp @@ -598,10 +598,26 @@ uint32_t MediaPlaybackManager::GetFeatureMap(chip::EndpointId endpoint) { if (endpoint >= MATTER_DM_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT) { - return mDynamicEndpointFeatureMap; + return kEndpointFeatureMap; } uint32_t featureMap = 0; Attributes::FeatureMap::Get(endpoint, &featureMap); return featureMap; } + +uint16_t MediaPlaybackManager::GetClusterRevision(chip::EndpointId endpoint) +{ + if (endpoint >= MATTER_DM_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT) + { + return kClusterRevision; + } + + uint16_t clusterRevision = 0; + bool success = (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == EMBER_ZCL_STATUS_SUCCESS); + if (!success) + { + ChipLogError(Zcl, "MediaPlaybackManager::GetClusterRevision error reading cluster revision"); + } + return clusterRevision; +} diff --git a/examples/tv-app/android/java/MediaPlaybackManager.h b/examples/tv-app/android/java/MediaPlaybackManager.h index 0414a3087be0cb..7af3381378a808 100644 --- a/examples/tv-app/android/java/MediaPlaybackManager.h +++ b/examples/tv-app/android/java/MediaPlaybackManager.h @@ -104,6 +104,7 @@ class MediaPlaybackManager : public MediaPlaybackDelegate bool HandleDeactivateTextTrack() override; uint32_t GetFeatureMap(chip::EndpointId endpoint) override; + uint16_t GetClusterRevision(chip::EndpointId endpoint) override; private: chip::JniGlobalReference mMediaPlaybackManagerObject; @@ -121,5 +122,6 @@ class MediaPlaybackManager : public MediaPlaybackDelegate HandleMediaRequest(MediaPlaybackRequest mediaPlaybackRequest, uint64_t deltaPositionMilliseconds); // TODO: set this based upon meta data from app - uint32_t mDynamicEndpointFeatureMap = 3; + static constexpr uint32_t kEndpointFeatureMap = 3; + static constexpr uint16_t kClusterRevision = 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..532986f7ba4eea 100644 --- a/examples/tv-app/tv-common/clusters/account-login/AccountLoginManager.cpp +++ b/examples/tv-app/tv-common/clusters/account-login/AccountLoginManager.cpp @@ -17,6 +17,7 @@ */ #include "AccountLoginManager.h" +#include #include #include @@ -64,3 +65,19 @@ void AccountLoginManager::HandleGetSetupPin(CommandResponseHelper= MATTER_DM_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT) + { + return kClusterRevision; + } + + uint16_t clusterRevision = 0; + bool success = (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == EMBER_ZCL_STATUS_SUCCESS); + if (!success) + { + ChipLogError(Zcl, "AccountLoginManager::GetClusterRevision error reading cluster revision"); + } + 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..805a3b36ee2d4d 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 + static constexpr uint16_t kClusterRevision = 2; }; diff --git a/examples/tv-app/tv-common/clusters/channel/ChannelManager.cpp b/examples/tv-app/tv-common/clusters/channel/ChannelManager.cpp index 6fc558da5d3759..82a278b827cd6a 100644 --- a/examples/tv-app/tv-common/clusters/channel/ChannelManager.cpp +++ b/examples/tv-app/tv-common/clusters/channel/ChannelManager.cpp @@ -331,10 +331,26 @@ uint32_t ChannelManager::GetFeatureMap(chip::EndpointId endpoint) { if (endpoint >= MATTER_DM_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT) { - return mDynamicEndpointFeatureMap; + return kEndpointFeatureMap; } uint32_t featureMap = 0; Attributes::FeatureMap::Get(endpoint, &featureMap); return featureMap; } + +uint16_t ChannelManager::GetClusterRevision(chip::EndpointId endpoint) +{ + if (endpoint >= MATTER_DM_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT) + { + return kClusterRevision; + } + + uint16_t clusterRevision = 0; + bool success = (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == EMBER_ZCL_STATUS_SUCCESS); + if (!success) + { + ChipLogError(Zcl, "ChannelManager::GetClusterRevision error reading cluster revision"); + } + 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..5a9c0b686e61a8 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; @@ -72,5 +73,6 @@ class ChannelManager : public ChannelDelegate private: // TODO: set this based upon meta data from app - uint32_t mDynamicEndpointFeatureMap = 3; + static constexpr uint32_t kEndpointFeatureMap = 3; + static constexpr uint16_t kClusterRevision = 2; }; diff --git a/examples/tv-app/tv-common/clusters/content-control/ContentController.cpp b/examples/tv-app/tv-common/clusters/content-control/ContentController.cpp index 3d622e4a5b9383..19317a71b7cfaf 100644 --- a/examples/tv-app/tv-common/clusters/content-control/ContentController.cpp +++ b/examples/tv-app/tv-common/clusters/content-control/ContentController.cpp @@ -96,7 +96,7 @@ uint32_t ContentControlManager::GetFeatureMap(chip::EndpointId endpoint) { if (endpoint >= MATTER_DM_CONTENT_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT) { - return mDynamicEndpointFeatureMap; + return kEndpointFeatureMap; } uint32_t featureMap = 0; diff --git a/examples/tv-app/tv-common/clusters/content-control/ContentController.h b/examples/tv-app/tv-common/clusters/content-control/ContentController.h index 719d42bcbf79b4..cc58a5502d082e 100644 --- a/examples/tv-app/tv-common/clusters/content-control/ContentController.h +++ b/examples/tv-app/tv-common/clusters/content-control/ContentController.h @@ -57,5 +57,5 @@ class ContentControlManager : public ContentControlDelegate protected: private: // TODO: set this based upon meta data from app - uint32_t mDynamicEndpointFeatureMap = 3; + static constexpr uint32_t kEndpointFeatureMap = 3; }; diff --git a/examples/tv-app/tv-common/clusters/content-launcher/ContentLauncherManager.cpp b/examples/tv-app/tv-common/clusters/content-launcher/ContentLauncherManager.cpp index 013831ec5a6055..572209a44d11c3 100644 --- a/examples/tv-app/tv-common/clusters/content-launcher/ContentLauncherManager.cpp +++ b/examples/tv-app/tv-common/clusters/content-launcher/ContentLauncherManager.cpp @@ -198,10 +198,26 @@ uint32_t ContentLauncherManager::GetFeatureMap(chip::EndpointId endpoint) { if (endpoint >= MATTER_DM_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT) { - return mDynamicEndpointFeatureMap; + return kEndpointFeatureMap; } uint32_t featureMap = 0; Attributes::FeatureMap::Get(endpoint, &featureMap); return featureMap; } + +uint16_t ContentLauncherManager::GetClusterRevision(chip::EndpointId endpoint) +{ + if (endpoint >= MATTER_DM_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT) + { + return kClusterRevision; + } + + uint16_t clusterRevision = 0; + bool success = (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == EMBER_ZCL_STATUS_SUCCESS); + if (!success) + { + ChipLogError(Zcl, "ContentLauncherManager::GetClusterRevision error reading cluster revision"); + } + return clusterRevision; +} diff --git a/examples/tv-app/tv-common/clusters/content-launcher/ContentLauncherManager.h b/examples/tv-app/tv-common/clusters/content-launcher/ContentLauncherManager.h index 51c5b1ab4b765e..2bc9e7006fc3ff 100644 --- a/examples/tv-app/tv-common/clusters/content-launcher/ContentLauncherManager.h +++ b/examples/tv-app/tv-common/clusters/content-launcher/ContentLauncherManager.h @@ -54,6 +54,7 @@ class ContentLauncherManager : public ContentLauncherDelegate uint32_t HandleGetSupportedStreamingProtocols() override; uint32_t GetFeatureMap(chip::EndpointId endpoint) override; + uint16_t GetClusterRevision(chip::EndpointId endpoint) override; protected: std::list mAcceptHeaderList; @@ -62,5 +63,6 @@ class ContentLauncherManager : public ContentLauncherDelegate private: // TODO: set this based upon meta data from app - uint32_t mDynamicEndpointFeatureMap = 3; + static constexpr uint32_t kEndpointFeatureMap = 3; + static constexpr uint16_t kClusterRevision = 2; }; diff --git a/examples/tv-app/tv-common/clusters/keypad-input/KeypadInputManager.cpp b/examples/tv-app/tv-common/clusters/keypad-input/KeypadInputManager.cpp index 5817f9a6bb1654..3cec013da1c879 100644 --- a/examples/tv-app/tv-common/clusters/keypad-input/KeypadInputManager.cpp +++ b/examples/tv-app/tv-common/clusters/keypad-input/KeypadInputManager.cpp @@ -101,7 +101,7 @@ uint32_t KeypadInputManager::GetFeatureMap(chip::EndpointId endpoint) { if (endpoint >= MATTER_DM_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT) { - return mDynamicEndpointFeatureMap; + return kEndpointFeatureMap; } uint32_t featureMap = 0; diff --git a/examples/tv-app/tv-common/clusters/keypad-input/KeypadInputManager.h b/examples/tv-app/tv-common/clusters/keypad-input/KeypadInputManager.h index 66d43ed7ec8c6f..4a694890989632 100644 --- a/examples/tv-app/tv-common/clusters/keypad-input/KeypadInputManager.h +++ b/examples/tv-app/tv-common/clusters/keypad-input/KeypadInputManager.h @@ -34,5 +34,5 @@ class KeypadInputManager : public KeypadInputDelegate private: // TODO: set this based upon meta data from app - uint32_t mDynamicEndpointFeatureMap = 7; + static constexpr uint32_t kEndpointFeatureMap = 7; }; 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 0bb3f1366d7e3a..f97a2e98630e01 100644 --- a/examples/tv-app/tv-common/clusters/media-playback/MediaPlaybackManager.cpp +++ b/examples/tv-app/tv-common/clusters/media-playback/MediaPlaybackManager.cpp @@ -319,10 +319,26 @@ uint32_t MediaPlaybackManager::GetFeatureMap(chip::EndpointId endpoint) { if (endpoint >= MATTER_DM_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT) { - return mDynamicEndpointFeatureMap; + return kEndpointFeatureMap; } uint32_t featureMap = 0; Attributes::FeatureMap::Get(endpoint, &featureMap); return featureMap; } + +uint16_t MediaPlaybackManager::GetClusterRevision(chip::EndpointId endpoint) +{ + if (endpoint >= MATTER_DM_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT) + { + return kClusterRevision; + } + + uint16_t clusterRevision = 0; + bool success = (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == EMBER_ZCL_STATUS_SUCCESS); + if (!success) + { + ChipLogError(Zcl, "MediaPlaybackManager::GetClusterRevision error reading cluster revision"); + } + 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..82ee981a9272e3 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 @@ -112,5 +113,6 @@ class MediaPlaybackManager : public MediaPlaybackDelegate private: // TODO: set this based upon meta data from app - uint32_t mDynamicEndpointFeatureMap = 3; + static constexpr uint32_t kEndpointFeatureMap = 3; + static constexpr uint16_t kClusterRevision = 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..0d3a15578b861d 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,20 @@ void TargetNavigatorManager::HandleNavigateTarget(CommandResponseHelper= MATTER_DM_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT) + { + return kClusterRevision; + } + + uint16_t clusterRevision = 0; + bool success = (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == EMBER_ZCL_STATUS_SUCCESS); + if (!success) + { + ChipLogError(Zcl, "TargetNavigatorManager::GetClusterRevision error reading cluster revision"); + } + + return clusterRevision; +} 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..d600f045ff4a4b 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,15 @@ 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 + static constexpr uint16_t kClusterRevision = 2; }; diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index a2a6a086c5b0f8..ce8610ec584e58 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -3570,7 +3570,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; @@ -3587,7 +3587,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; @@ -3610,7 +3610,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0x003; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 2; handle command Play; handle command Pause; @@ -3659,7 +3659,7 @@ endpoint 1 { callback attribute acceptHeader; ram attribute supportedStreamingProtocols; ram attribute featureMap default = 0x0003; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 2; handle command LaunchContent; handle command LaunchURL; @@ -3706,7 +3706,7 @@ endpoint 1 { callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 28; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 2; handle command UpdatePIN; handle command ResetPIN; diff --git a/examples/tv-app/tv-common/tv-app.zap b/examples/tv-app/tv-common/tv-app.zap index 242fbba690931a..bd7b526d2fae6d 100644 --- a/examples/tv-app/tv-common/tv-app.zap +++ b/examples/tv-app/tv-common/tv-app.zap @@ -4727,7 +4727,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4743,7 +4743,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4759,7 +4759,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4775,7 +4775,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4791,7 +4791,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4807,7 +4807,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -5076,7 +5076,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5168,7 +5168,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5565,7 +5565,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -5886,7 +5886,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -6458,7 +6458,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, 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 9fc4b1511d35bb..aa939ae810bb10 100644 --- a/src/app/clusters/account-login-server/account-login-server.cpp +++ b/src/app/clusters/account-login-server/account-login-server.cpp @@ -25,10 +25,13 @@ #include #include +#include #include #include #include +#include #include +#include #include #include @@ -111,6 +114,49 @@ 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: + 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 +258,7 @@ bool emberAfAccountLoginClusterLogoutCallback(app::CommandHandler * commandObj, // ----------------------------------------------------------------------------- // Plugin initialization -void MatterAccountLoginPluginServerInitCallback() {} +void MatterAccountLoginPluginServerInitCallback() +{ + registerAttributeAccessOverride(&gAccountLoginAttrAccess); +} diff --git a/src/app/clusters/application-basic-server/application-basic-server.cpp b/src/app/clusters/application-basic-server/application-basic-server.cpp index ca78bc31d7bc6f..d0c63b3112b1ff 100644 --- a/src/app/clusters/application-basic-server/application-basic-server.cpp +++ b/src/app/clusters/application-basic-server/application-basic-server.cpp @@ -170,30 +170,22 @@ CHIP_ERROR ApplicationBasicAttrAccess::Read(const app::ConcreteReadAttributePath switch (aPath.mAttributeId) { - case chip::app::Clusters::ApplicationBasic::Attributes::VendorName::Id: { + case chip::app::Clusters::ApplicationBasic::Attributes::VendorName::Id: return ReadVendorNameAttribute(aEncoder, delegate); - } - case chip::app::Clusters::ApplicationBasic::Attributes::VendorID::Id: { + case chip::app::Clusters::ApplicationBasic::Attributes::VendorID::Id: return ReadVendorIdAttribute(aEncoder, delegate); - } - case chip::app::Clusters::ApplicationBasic::Attributes::ApplicationName::Id: { + case chip::app::Clusters::ApplicationBasic::Attributes::ApplicationName::Id: return ReadApplicationNameAttribute(aEncoder, delegate); - } - case chip::app::Clusters::ApplicationBasic::Attributes::ProductID::Id: { + case chip::app::Clusters::ApplicationBasic::Attributes::ProductID::Id: return ReadProductIdAttribute(aEncoder, delegate); - } - case chip::app::Clusters::ApplicationBasic::Attributes::Application::Id: { + case chip::app::Clusters::ApplicationBasic::Attributes::Application::Id: return ReadApplicationAttribute(aEncoder, delegate); - } - case chip::app::Clusters::ApplicationBasic::Attributes::Status::Id: { + case chip::app::Clusters::ApplicationBasic::Attributes::Status::Id: return ReadStatusAttribute(aEncoder, delegate); - } - case chip::app::Clusters::ApplicationBasic::Attributes::ApplicationVersion::Id: { + case chip::app::Clusters::ApplicationBasic::Attributes::ApplicationVersion::Id: return ReadApplicationVersionAttribute(aEncoder, delegate); - } - case chip::app::Clusters::ApplicationBasic::Attributes::AllowedVendorList::Id: { + case chip::app::Clusters::ApplicationBasic::Attributes::AllowedVendorList::Id: return ReadAllowedVendorListAttribute(aEncoder, delegate); - } default: { break; } diff --git a/src/app/clusters/channel-server/channel-delegate.h b/src/app/clusters/channel-server/channel-delegate.h index 6007bf06f8867f..c92ada4adda08a 100644 --- a/src/app/clusters/channel-server/channel-delegate.h +++ b/src/app/clusters/channel-server/channel-delegate.h @@ -64,7 +64,8 @@ class Delegate const chip::ByteSpan & data) = 0; bool HasFeature(chip::EndpointId endpoint, Feature feature); - virtual uint32_t GetFeatureMap(chip::EndpointId endpoint) = 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/channel-server/channel-server.cpp b/src/app/clusters/channel-server/channel-server.cpp index af977653da1749..13743d875cfb42 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,10 +168,11 @@ CHIP_ERROR ChannelAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, return ReadFeatureFlagAttribute(endpoint, aEncoder, delegate); } - default: { + case app::Clusters::Channel::Attributes::ClusterRevision::Id: + return ReadRevisionAttribute(endpoint, aEncoder, delegate); + default: break; } - } return CHIP_NO_ERROR; } @@ -197,6 +199,12 @@ 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/content-launch-server/content-launch-delegate.h b/src/app/clusters/content-launch-server/content-launch-delegate.h index 0f84887c881788..8fcf70560d6179 100644 --- a/src/app/clusters/content-launch-server/content-launch-delegate.h +++ b/src/app/clusters/content-launch-server/content-launch-delegate.h @@ -53,7 +53,8 @@ class Delegate virtual uint32_t HandleGetSupportedStreamingProtocols() = 0; bool HasFeature(chip::EndpointId endpoint, Feature feature); - virtual uint32_t GetFeatureMap(chip::EndpointId endpoint) = 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/content-launch-server/content-launch-server.cpp b/src/app/clusters/content-launch-server/content-launch-server.cpp index d9bba198a9df5c..3b0a5d7f633983 100644 --- a/src/app/clusters/content-launch-server/content-launch-server.cpp +++ b/src/app/clusters/content-launch-server/content-launch-server.cpp @@ -130,6 +130,7 @@ class ContentLauncherAttrAccess : public app::AttributeAccessInterface CHIP_ERROR ReadAcceptHeaderAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); CHIP_ERROR ReadSupportedStreamingProtocolsAttribute(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); }; ContentLauncherAttrAccess gContentLauncherAttrAccess; @@ -165,9 +166,11 @@ CHIP_ERROR ContentLauncherAttrAccess::Read(const app::ConcreteReadAttributePath return ReadFeatureFlagAttribute(endpoint, aEncoder, delegate); } - default: { - break; + case app::Clusters::ContentLauncher::Attributes::ClusterRevision::Id: { + return ReadRevisionAttribute(endpoint, aEncoder, delegate); } + default: + break; } return CHIP_NO_ERROR; @@ -192,6 +195,13 @@ CHIP_ERROR ContentLauncherAttrAccess::ReadSupportedStreamingProtocolsAttribute(a return aEncoder.Encode(streamingProtocols); } +CHIP_ERROR ContentLauncherAttrAccess::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..12e89b25efecdc 100644 --- a/src/app/clusters/media-playback-server/media-playback-delegate.h +++ b/src/app/clusters/media-playback-server/media-playback-delegate.h @@ -70,7 +70,8 @@ class Delegate virtual bool HandleActivateTextTrack(const chip::CharSpan & trackId) = 0; virtual bool HandleDeactivateTextTrack() = 0; - virtual uint32_t GetFeatureMap(chip::EndpointId endpoint) = 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 ee8113382b730a..9140cf58044456 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; @@ -169,46 +170,35 @@ CHIP_ERROR MediaPlaybackAttrAccess::Read(const app::ConcreteReadAttributePath & switch (aPath.mAttributeId) { - case app::Clusters::MediaPlayback::Attributes::CurrentState::Id: { + case app::Clusters::MediaPlayback::Attributes::CurrentState::Id: return ReadCurrentStateAttribute(aEncoder, delegate); - } - case app::Clusters::MediaPlayback::Attributes::StartTime::Id: { + case app::Clusters::MediaPlayback::Attributes::StartTime::Id: return ReadStartTimeAttribute(aEncoder, delegate); - } - case app::Clusters::MediaPlayback::Attributes::Duration::Id: { + case app::Clusters::MediaPlayback::Attributes::Duration::Id: return ReadDurationAttribute(aEncoder, delegate); - } - case app::Clusters::MediaPlayback::Attributes::SampledPosition::Id: { + case app::Clusters::MediaPlayback::Attributes::SampledPosition::Id: return ReadSampledPositionAttribute(aEncoder, delegate); - } - case app::Clusters::MediaPlayback::Attributes::PlaybackSpeed::Id: { + case app::Clusters::MediaPlayback::Attributes::PlaybackSpeed::Id: return ReadPlaybackSpeedAttribute(aEncoder, delegate); - } - case app::Clusters::MediaPlayback::Attributes::SeekRangeStart::Id: { + case app::Clusters::MediaPlayback::Attributes::SeekRangeStart::Id: return ReadSeekRangeStartAttribute(aEncoder, delegate); - } - case app::Clusters::MediaPlayback::Attributes::SeekRangeEnd::Id: { + case app::Clusters::MediaPlayback::Attributes::SeekRangeEnd::Id: return ReadSeekRangeEndAttribute(aEncoder, delegate); - } - case app::Clusters::MediaPlayback::Attributes::ActiveAudioTrack::Id: { + case app::Clusters::MediaPlayback::Attributes::ActiveAudioTrack::Id: return ReadActiveAudioTrackAttribute(aEncoder, delegate); - } - case app::Clusters::MediaPlayback::Attributes::AvailableAudioTracks::Id: { + case app::Clusters::MediaPlayback::Attributes::AvailableAudioTracks::Id: return ReadAvailableAudioTracksAttribute(aEncoder, delegate); - } - case app::Clusters::MediaPlayback::Attributes::ActiveTextTrack::Id: { + case app::Clusters::MediaPlayback::Attributes::ActiveTextTrack::Id: return ReadActiveTextTrackAttribute(aEncoder, delegate); - } - case app::Clusters::MediaPlayback::Attributes::AvailableTextTracks::Id: { + case app::Clusters::MediaPlayback::Attributes::AvailableTextTracks::Id: return ReadAvailableTextTracksAttribute(aEncoder, delegate); - } - case app::Clusters::ContentLauncher::Attributes::FeatureMap::Id: { + case app::Clusters::ContentLauncher::Attributes::FeatureMap::Id: return ReadFeatureFlagAttribute(endpoint, aEncoder, delegate); - } - default: { + case app::Clusters::AccountLogin::Attributes::ClusterRevision::Id: + return ReadRevisionAttribute(endpoint, aEncoder, delegate); + default: break; } - } return CHIP_NO_ERROR; } @@ -220,6 +210,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..f3be65c818fbdd 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 71d396a671d67b..a6c4d3911ca70c 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,10 +156,11 @@ CHIP_ERROR TargetNavigatorAttrAccess::Read(const app::ConcreteReadAttributePath return ReadCurrentTargetAttribute(aEncoder, delegate); } - default: { + case app::Clusters::TargetNavigator::Attributes::ClusterRevision::Id: + return ReadRevisionAttribute(endpoint, aEncoder, delegate); + default: break; } - } return CHIP_NO_ERROR; } @@ -174,6 +176,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 // ----------------------------------------------------------------------------- diff --git a/src/app/tests/suites/certification/Test_TC_ALOGIN_1_12.yaml b/src/app/tests/suites/certification/Test_TC_ALOGIN_1_12.yaml index 83585130d7401d..25e6457fd786f9 100644 --- a/src/app/tests/suites/certification/Test_TC_ALOGIN_1_12.yaml +++ b/src/app/tests/suites/certification/Test_TC_ALOGIN_1_12.yaml @@ -37,7 +37,7 @@ tests: command: "readAttribute" attribute: "ClusterRevision" response: - value: 1 + value: 2 constraints: type: int16u diff --git a/src/app/tests/suites/certification/Test_TC_CHANNEL_1_6.yaml b/src/app/tests/suites/certification/Test_TC_CHANNEL_1_6.yaml index a89062e3f6fdeb..fb0379c14734f2 100644 --- a/src/app/tests/suites/certification/Test_TC_CHANNEL_1_6.yaml +++ b/src/app/tests/suites/certification/Test_TC_CHANNEL_1_6.yaml @@ -36,7 +36,7 @@ tests: command: "readAttribute" attribute: "ClusterRevision" response: - value: 1 + value: 2 constraints: type: int16u diff --git a/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_1_11.yaml b/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_1_11.yaml index 6dde4be806ca00..a30b8ce2df79e2 100644 --- a/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_1_11.yaml +++ b/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_1_11.yaml @@ -37,7 +37,7 @@ tests: command: "readAttribute" attribute: "ClusterRevision" response: - value: 1 + value: 2 constraints: type: int16u diff --git a/src/app/tests/suites/certification/Test_TC_MEDIAPLAYBACK_1_7.yaml b/src/app/tests/suites/certification/Test_TC_MEDIAPLAYBACK_1_7.yaml index f1befc5d736971..c3b55fd4e3bbac 100644 --- a/src/app/tests/suites/certification/Test_TC_MEDIAPLAYBACK_1_7.yaml +++ b/src/app/tests/suites/certification/Test_TC_MEDIAPLAYBACK_1_7.yaml @@ -38,7 +38,7 @@ tests: command: "readAttribute" attribute: "ClusterRevision" response: - value: 1 + value: 2 constraints: type: int16u diff --git a/src/app/tests/suites/certification/Test_TC_TGTNAV_1_9.yaml b/src/app/tests/suites/certification/Test_TC_TGTNAV_1_9.yaml index 925fd0aad7848c..55d7d295e4369e 100644 --- a/src/app/tests/suites/certification/Test_TC_TGTNAV_1_9.yaml +++ b/src/app/tests/suites/certification/Test_TC_TGTNAV_1_9.yaml @@ -37,7 +37,7 @@ tests: command: "readAttribute" attribute: "ClusterRevision" response: - value: 1 + value: 2 constraints: type: int16u