Line data Source code
1 : /*
2 : * Copyright (c) 2025 Project CHIP Authors
3 : * All rights reserved.
4 : *
5 : * Licensed under the Apache License, Version 2.0 (the "License");
6 : * you may not use this file except in compliance with the License.
7 : * You may obtain a copy of the License at
8 : *
9 : * http://www.apache.org/licenses/LICENSE-2.0
10 : *
11 : * Unless required by applicable law or agreed to in writing, software
12 : * distributed under the License is distributed on an "AS IS" BASIS,
13 : * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 : * See the License for the specific language governing permissions and
15 : * limitations under the License.
16 : */
17 : #include <app/server-cluster/testing/EmptyProvider.h>
18 :
19 : namespace chip {
20 : namespace Test {
21 :
22 : using Protocols::InteractionModel::Status;
23 : using namespace chip::app;
24 : using namespace chip::app::DataModel;
25 :
26 0 : CHIP_ERROR EmptyProvider::Shutdown()
27 : {
28 0 : return CHIP_NO_ERROR;
29 : }
30 :
31 0 : CHIP_ERROR EmptyProvider::Endpoints(ReadOnlyBufferBuilder<app::DataModel::EndpointEntry> & builder)
32 : {
33 0 : return CHIP_NO_ERROR;
34 : }
35 :
36 0 : CHIP_ERROR EmptyProvider::SemanticTags(EndpointId endpointId, ReadOnlyBufferBuilder<SemanticTag> & builder)
37 : {
38 0 : return CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint);
39 : }
40 0 : CHIP_ERROR EmptyProvider::DeviceTypes(EndpointId endpointId, ReadOnlyBufferBuilder<app::DataModel::DeviceTypeEntry> & builder)
41 : {
42 0 : return CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint);
43 : }
44 :
45 0 : CHIP_ERROR EmptyProvider::EventInfo(const app::ConcreteEventPath & path, app::DataModel::EventEntry & eventInfo)
46 : {
47 : // no events in empty providers as there are no clusters
48 0 : return CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint);
49 : }
50 :
51 0 : CHIP_ERROR EmptyProvider::ClientClusters(EndpointId endpointId, ReadOnlyBufferBuilder<ClusterId> & builder)
52 : {
53 0 : return CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint);
54 : }
55 0 : CHIP_ERROR EmptyProvider::ServerClusters(EndpointId endpointId, ReadOnlyBufferBuilder<app::DataModel::ServerClusterEntry> & builder)
56 : {
57 0 : return CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint);
58 : }
59 :
60 0 : CHIP_ERROR EmptyProvider::Attributes(const app::ConcreteClusterPath & path,
61 : ReadOnlyBufferBuilder<app::DataModel::AttributeEntry> & builder)
62 : {
63 0 : return CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint);
64 : }
65 :
66 : #if CHIP_CONFIG_USE_ENDPOINT_UNIQUE_ID
67 : CHIP_ERROR EmptyProvider::EndpointUniqueID(EndpointId endpointId, MutableCharSpan & epUniqueId)
68 : {
69 : return CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint);
70 : }
71 : #endif
72 :
73 0 : CHIP_ERROR EmptyProvider::GeneratedCommands(const app::ConcreteClusterPath & path, ReadOnlyBufferBuilder<CommandId> & builder)
74 : {
75 0 : return CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint);
76 : }
77 :
78 0 : CHIP_ERROR EmptyProvider::AcceptedCommands(const app::ConcreteClusterPath & path,
79 : ReadOnlyBufferBuilder<app::DataModel::AcceptedCommandEntry> & builder)
80 : {
81 0 : return CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint);
82 : }
83 :
84 0 : void EmptyProvider::Temporary_ReportAttributeChanged(const app::AttributePathParams & path) {}
85 :
86 0 : ActionReturnStatus EmptyProvider::ReadAttribute(const app::DataModel::ReadAttributeRequest & request,
87 : app::AttributeValueEncoder & encoder)
88 : {
89 0 : return Status::UnsupportedEndpoint;
90 : }
91 :
92 0 : ActionReturnStatus EmptyProvider::WriteAttribute(const app::DataModel::WriteAttributeRequest & request,
93 : app::AttributeValueDecoder & decoder)
94 : {
95 0 : return Status::UnsupportedEndpoint;
96 : }
97 0 : std::optional<ActionReturnStatus> EmptyProvider::InvokeCommand(const app::DataModel::InvokeRequest & request,
98 : chip::TLV::TLVReader & input_arguments,
99 : app::CommandHandler * handler)
100 : {
101 0 : return Status::UnsupportedEndpoint;
102 : }
103 :
104 : } // namespace Test
105 : } // namespace chip
|