Skip to content

Commit 0a5c45b

Browse files
committed
Update per comments
1 parent 4e7ca4a commit 0a5c45b

File tree

5 files changed

+33
-0
lines changed

5 files changed

+33
-0
lines changed

examples/tv-app/tv-common/clusters/content-launcher/ContentLauncherManager.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -205,3 +205,15 @@ uint32_t ContentLauncherManager::GetFeatureMap(chip::EndpointId endpoint)
205205
Attributes::FeatureMap::Get(endpoint, &featureMap);
206206
return featureMap;
207207
}
208+
209+
uint16_t ContentLauncherManager::GetClusterRevision(chip::EndpointId endpoint)
210+
{
211+
if (endpoint >= EMBER_AF_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT)
212+
{
213+
return mDynamicClusterRevision;
214+
}
215+
216+
uint16_t clusterRevision = 0;
217+
Attributes::ClusterRevision::Get(endpoint, &clusterRevision);
218+
return clusterRevision;
219+
}

examples/tv-app/tv-common/clusters/content-launcher/ContentLauncherManager.h

+2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class ContentLauncherManager : public ContentLauncherDelegate
5454
uint32_t HandleGetSupportedStreamingProtocols() override;
5555

5656
uint32_t GetFeatureMap(chip::EndpointId endpoint) override;
57+
uint16_t GetClusterRevision(chip::EndpointId endpoint) override;
5758

5859
protected:
5960
std::list<std::string> mAcceptHeaderList;
@@ -63,4 +64,5 @@ class ContentLauncherManager : public ContentLauncherDelegate
6364
private:
6465
// TODO: set this based upon meta data from app
6566
uint32_t mDynamicEndpointFeatureMap = 3;
67+
uint16_t mDynamicClusterRevision = 2;
6668
};

src/app/clusters/account-login-server/account-login-server.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929
#include <app/CommandHandler.h>
3030
#include <app/ConcreteCommandPath.h>
3131
#include <app/EventLogging.h>
32+
#include <app/data-model/Encode.h>
3233
#include <app/util/af.h>
34+
#include <app/util/attribute-storage.h>
3335
#include <app/util/config.h>
3436
#include <platform/CHIPDeviceConfig.h>
3537

src/app/clusters/content-launch-server/content-launch-delegate.h

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class Delegate
5454

5555
bool HasFeature(chip::EndpointId endpoint, Feature feature);
5656
virtual uint32_t GetFeatureMap(chip::EndpointId endpoint) = 0;
57+
virtual uint16_t GetClusterRevision(chip::EndpointId endpoint) = 0;
5758

5859
virtual ~Delegate() = default;
5960
};

src/app/clusters/content-launch-server/content-launch-server.cpp

+16
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ class ContentLauncherAttrAccess : public app::AttributeAccessInterface
130130
CHIP_ERROR ReadAcceptHeaderAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate);
131131
CHIP_ERROR ReadSupportedStreamingProtocolsAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate);
132132
CHIP_ERROR ReadFeatureFlagAttribute(EndpointId endpoint, app::AttributeValueEncoder & aEncoder, Delegate * delegate);
133+
CHIP_ERROR ReadRevisionAttribute(EndpointId endpoint, app::AttributeValueEncoder & aEncoder, Delegate * delegate);
133134
};
134135

135136
ContentLauncherAttrAccess gContentLauncherAttrAccess;
@@ -165,6 +166,14 @@ CHIP_ERROR ContentLauncherAttrAccess::Read(const app::ConcreteReadAttributePath
165166

166167
return ReadFeatureFlagAttribute(endpoint, aEncoder, delegate);
167168
}
169+
case app::Clusters::ContentLauncher::Attributes::ClusterRevision::Id: {
170+
if (isDelegateNull(delegate, endpoint))
171+
{
172+
return CHIP_NO_ERROR;
173+
}
174+
175+
return ReadRevisionAttribute(endpoint, aEncoder, delegate);
176+
}
168177
default: {
169178
break;
170179
}
@@ -192,6 +201,13 @@ CHIP_ERROR ContentLauncherAttrAccess::ReadSupportedStreamingProtocolsAttribute(a
192201
return aEncoder.Encode(streamingProtocols);
193202
}
194203

204+
CHIP_ERROR ContentLauncherAttrAccess::ReadRevisionAttribute(EndpointId endpoint, app::AttributeValueEncoder & aEncoder,
205+
Delegate * delegate)
206+
{
207+
uint16_t clusterRevision = delegate->GetClusterRevision(endpoint);
208+
return aEncoder.Encode(clusterRevision);
209+
}
210+
195211
} // anonymous namespace
196212

197213
// -----------------------------------------------------------------------------

0 commit comments

Comments
 (0)