Skip to content

Commit 366eb23

Browse files
committed
Empty provider updated
1 parent ec840bc commit 366eb23

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

src/app/server-cluster/testing/EmptyProvider.cpp

+9-7
Original file line numberDiff line numberDiff line change
@@ -35,34 +35,36 @@ CHIP_ERROR EmptyProvider::Endpoints(ListBuilder<app::DataModel::EndpointEntry> &
3535

3636
CHIP_ERROR EmptyProvider::SemanticTags(EndpointId endpointId, ListBuilder<SemanticTag> & builder)
3737
{
38-
return CHIP_NO_ERROR;
38+
return CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint);
3939
}
4040
CHIP_ERROR EmptyProvider::DeviceTypes(EndpointId endpointId, ListBuilder<app::DataModel::DeviceTypeEntry> & builder)
4141
{
42-
return CHIP_NO_ERROR;
42+
return CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint);
4343
}
4444

4545
CHIP_ERROR EmptyProvider::ClientClusters(EndpointId endpointId, ListBuilder<ClusterId> & builder)
4646
{
47-
return CHIP_NO_ERROR;
47+
return CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint);
4848
}
4949
CHIP_ERROR EmptyProvider::ServerClusters(EndpointId endpointId, ListBuilder<app::DataModel::ServerClusterEntry> & builder)
5050
{
51-
return CHIP_NO_ERROR;
51+
return CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint);
5252
}
5353

5454
CHIP_ERROR EmptyProvider::Attributes(const app::ConcreteClusterPath & path, ListBuilder<app::DataModel::AttributeEntry> & builder)
5555
{
56-
return CHIP_NO_ERROR;
56+
return CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint);
5757
}
58+
5859
CHIP_ERROR EmptyProvider::GeneratedCommands(const app::ConcreteClusterPath & path, ListBuilder<CommandId> & builder)
5960
{
60-
return CHIP_NO_ERROR;
61+
return CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint);
6162
}
63+
6264
CHIP_ERROR EmptyProvider::AcceptedCommands(const app::ConcreteClusterPath & path,
6365
ListBuilder<app::DataModel::AcceptedCommandEntry> & builder)
6466
{
65-
return CHIP_NO_ERROR;
67+
return CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint);
6668
}
6769

6870
void EmptyProvider::Temporary_ReportAttributeChanged(const app::AttributePathParams & path) {}

src/app/server-cluster/testing/EmptyProvider.h

+5-3
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@
2222
namespace chip {
2323
namespace Test {
2424

25-
/// A provider that is emtpy - everything returns null
25+
/// A provider that is emtpy - it contains no endpoints and most
26+
/// calls fail with `Unsupported Endpoint`
2627
///
27-
/// Over time this should be replaced with some code-generated/controllable provider
28-
/// to allow for better testing.
28+
/// This is a bare minimum implentation to have somethign that claims to be a `Provider`
29+
/// however it has no real implementation that is useful. Over time this should be replaced
30+
/// with some code-generated/controllable provider to allow for better testing.
2931
class EmptyProvider : public app::DataModel::Provider
3032
{
3133
public:

0 commit comments

Comments
 (0)