TV Matter Media: Resolve cluster revisions (#31863)
* Resolve the cluster revision issues
* Restyled by whitespace
* Restyled by clang-format
* Update per comments
* Restyled by whitespace
* Restyled by clang-format
* Update Content Launcher
* Restyled by whitespace
* Restyled by clang-format
---------
Co-authored-by: Restyled.io <commits@restyled.io>
diff --git a/examples/tv-app/android/include/account-login/AccountLoginManager.cpp b/examples/tv-app/android/include/account-login/AccountLoginManager.cpp
index 2fbc0aa..2151dd6 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 <app-common/zap-generated/attributes/Accessors.h>
#include <app/CommandHandler.h>
#include <app/util/af.h>
#include <json/json.h>
@@ -102,3 +103,19 @@
}
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 a02a029..265118c 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 @@
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 @@
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 9937358..edf2550 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 @@
{
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 eaafef0..40b0636 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 @@
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 50b4519..31745a9 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 @@
{
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 6781274..f9e05a1 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 @@
void SetEndpointId(EndpointId epId) { mEndpointId = epId; };
uint32_t GetFeatureMap(chip::EndpointId endpoint) override;
+ uint16_t GetClusterRevision(chip::EndpointId endpoint) override;
protected:
std::list<std::string> mAcceptHeaderList;
@@ -61,7 +62,7 @@
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 c319513..39e364d 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 @@
{
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 9cb1609..0c88473 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 @@
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 @@
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 f917beb..cb22e9f 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 <app-common/zap-generated/attributes/Accessors.h>
#include <json/json.h>
using namespace std;
@@ -144,3 +145,19 @@
response.status = StatusEnum::kSuccess;
helper.Success(response);
}
+
+uint16_t TargetNavigatorManager::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, "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 1f7f4a2..10db972 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 @@
uint8_t HandleGetCurrentTarget() override;
void HandleNavigateTarget(CommandResponseHelper<NavigateTargetResponseType> & 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 @@
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 d7657fd..997f041 100644
--- a/examples/tv-app/android/java/ChannelManager.cpp
+++ b/examples/tv-app/android/java/ChannelManager.cpp
@@ -745,10 +745,26 @@
{
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 95bf531..6d749ca 100644
--- a/examples/tv-app/android/java/ChannelManager.h
+++ b/examples/tv-app/android/java/ChannelManager.h
@@ -65,6 +65,7 @@
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 @@
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 8e8a08b..25e5659 100644
--- a/examples/tv-app/android/java/ContentLauncherManager.cpp
+++ b/examples/tv-app/android/java/ContentLauncherManager.cpp
@@ -286,3 +286,19 @@
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 864d52c..6e858dd 100644
--- a/examples/tv-app/android/java/ContentLauncherManager.h
+++ b/examples/tv-app/android/java/ContentLauncherManager.h
@@ -49,6 +49,7 @@
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 @@
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 450804a..a43a56c 100644
--- a/examples/tv-app/android/java/KeypadInputManager.cpp
+++ b/examples/tv-app/android/java/KeypadInputManager.cpp
@@ -96,7 +96,7 @@
{
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 568648e..4bc8878 100644
--- a/examples/tv-app/android/java/KeypadInputManager.h
+++ b/examples/tv-app/android/java/KeypadInputManager.h
@@ -42,5 +42,5 @@
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 c72a313..8da71d5 100644
--- a/examples/tv-app/android/java/MediaPlaybackManager.cpp
+++ b/examples/tv-app/android/java/MediaPlaybackManager.cpp
@@ -598,10 +598,26 @@
{
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 0414a30..7af3381 100644
--- a/examples/tv-app/android/java/MediaPlaybackManager.h
+++ b/examples/tv-app/android/java/MediaPlaybackManager.h
@@ -104,6 +104,7 @@
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 @@
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 1127d3a..532986f 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 <app-common/zap-generated/attributes/Accessors.h>
#include <app/CommandHandler.h>
#include <app/util/af.h>
@@ -64,3 +65,19 @@
response.setupPIN = CharSpan::fromCharString(mSetupPin);
helper.Success(response);
}
+
+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/tv-common/clusters/account-login/AccountLoginManager.h b/examples/tv-app/tv-common/clusters/account-login/AccountLoginManager.h
index 4d6f537..805a3b3 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 @@
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 6fc558d..82a278b 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 @@
{
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 c0c28bb..5a9c0b6 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 @@
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 @@
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 3d622e4..19317a7 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 @@
{
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 719d42b..cc58a55 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 @@
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 013831e..572209a 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 @@
{
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 51c5b1a..2bc9e70 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 @@
uint32_t HandleGetSupportedStreamingProtocols() override;
uint32_t GetFeatureMap(chip::EndpointId endpoint) override;
+ uint16_t GetClusterRevision(chip::EndpointId endpoint) override;
protected:
std::list<std::string> mAcceptHeaderList;
@@ -62,5 +63,6 @@
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 5817f9a..3cec013 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 @@
{
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 66d43ed..4a69489 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 @@
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 0bb3f13..f97a2e9 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 @@
{
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 e4582e6..82ee981 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 @@
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 @@
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 9c0599e..0d3a155 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 <app-common/zap-generated/attributes/Accessors.h>
using namespace std;
using namespace chip::app;
@@ -66,3 +67,20 @@
response.status = StatusEnum::kSuccess;
helper.Success(response);
}
+
+uint16_t TargetNavigatorManager::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, "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 0294e75..d600f04 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 @@
uint8_t HandleGetCurrentTarget() override;
void HandleNavigateTarget(CommandResponseHelper<NavigateTargetResponseType> & 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<std::string> 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 a2a6a08..ce8610e 100644
--- a/examples/tv-app/tv-common/tv-app.matter
+++ b/examples/tv-app/tv-common/tv-app.matter
@@ -3570,7 +3570,7 @@
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 @@
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 @@
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 @@
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 @@
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 242fbba..bd7b526 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 0abf1de..8b8a1c4 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 @@
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 9fc4b15..aa939ae 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 <app/clusters/account-login-server/account-login-server.h>
#include <app-common/zap-generated/cluster-objects.h>
+#include <app/AttributeAccessInterface.h>
#include <app/CommandHandler.h>
#include <app/ConcreteCommandPath.h>
#include <app/EventLogging.h>
+#include <app/data-model/Encode.h>
#include <app/util/af.h>
+#include <app/util/attribute-storage.h>
#include <app/util/config.h>
#include <platform/CHIPDeviceConfig.h>
@@ -112,6 +115,49 @@
} // namespace chip
// -----------------------------------------------------------------------------
+// Attribute Accessor Implementation
+
+namespace {
+
+class AccountLoginAttrAccess : public app::AttributeAccessInterface
+{
+public:
+ AccountLoginAttrAccess() : app::AttributeAccessInterface(Optional<EndpointId>::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
bool emberAfAccountLoginClusterGetSetupPINCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath,
@@ -212,4 +258,7 @@
// -----------------------------------------------------------------------------
// 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 ca78bc3..d0c63b3 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 @@
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 6007bf0..c92ada4 100644
--- a/src/app/clusters/channel-server/channel-delegate.h
+++ b/src/app/clusters/channel-server/channel-delegate.h
@@ -64,7 +64,8 @@
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 af97765..13743d8 100644
--- a/src/app/clusters/channel-server/channel-server.cpp
+++ b/src/app/clusters/channel-server/channel-server.cpp
@@ -124,6 +124,7 @@
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 @@
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 @@
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 0f84887..8fcf705 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 @@
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 d9bba19..3b0a5d7 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 @@
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 @@
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 @@
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 db60f89..12e89b2 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 @@
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 ee81133..9140cf5 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 @@
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 @@
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 @@
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 38cf972..2cca091 100644
--- a/src/app/clusters/messages-server/messages-server.cpp
+++ b/src/app/clusters/messages-server/messages-server.cpp
@@ -26,6 +26,7 @@
{
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 0dd47f5..f3be65c 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 @@
virtual uint8_t HandleGetCurrentTarget() = 0;
virtual void HandleNavigateTarget(CommandResponseHelper<Commands::NavigateTargetResponse::Type> & 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 71d396a..a6c4d39 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 @@
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 @@
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 @@
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 8358513..25e6457 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 @@
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 a89062e..fb0379c 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 @@
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 6dde4be..a30b8ce 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 @@
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 f1befc5..c3b55fd 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 @@
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 925fd0a..55d7d29 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 @@
command: "readAttribute"
attribute: "ClusterRevision"
response:
- value: 1
+ value: 2
constraints:
type: int16u