forked from project-chip/connectedhomeip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClusters.h
355 lines (323 loc) · 21.4 KB
/
Clusters.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
/*
*
* Copyright (c) 2023 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "core/Attribute.h"
#include "core/Command.h"
#include "core/Endpoint.h"
#include <app-common/zap-generated/cluster-objects.h>
/**
* @brief This file contains classes representing all the Matter clusters supported by the Matter TV Casting library
*/
namespace matter {
namespace casting {
namespace clusters {
namespace application_basic {
class ApplicationBasicCluster : public core::BaseCluster
{
public:
ApplicationBasicCluster(memory::Weak<core::Endpoint> endpoint) : core::BaseCluster(endpoint) {}
void SetUp()
{
ChipLogProgress(AppServer, "Setting up ApplicationBasicCluster on EndpointId: %d", GetEndpoint().lock()->GetId());
RegisterAttribute(
chip::app::Clusters::ApplicationBasic::Attributes::VendorName::Id,
new core::Attribute<chip::app::Clusters::ApplicationBasic::Attributes::VendorName::TypeInfo>(GetEndpoint()));
RegisterAttribute(
chip::app::Clusters::ApplicationBasic::Attributes::VendorID::Id,
new core::Attribute<chip::app::Clusters::ApplicationBasic::Attributes::VendorID::TypeInfo>(GetEndpoint()));
RegisterAttribute(
chip::app::Clusters::ApplicationBasic::Attributes::ApplicationName::Id,
new core::Attribute<chip::app::Clusters::ApplicationBasic::Attributes::ApplicationName::TypeInfo>(GetEndpoint()));
RegisterAttribute(
chip::app::Clusters::ApplicationBasic::Attributes::ProductID::Id,
new core::Attribute<chip::app::Clusters::ApplicationBasic::Attributes::ProductID::TypeInfo>(GetEndpoint()));
RegisterAttribute(
chip::app::Clusters::ApplicationBasic::Attributes::Application::Id,
new core::Attribute<chip::app::Clusters::ApplicationBasic::Attributes::Application::TypeInfo>(GetEndpoint()));
RegisterAttribute(chip::app::Clusters::ApplicationBasic::Attributes::Status::Id,
new core::Attribute<chip::app::Clusters::ApplicationBasic::Attributes::Status::TypeInfo>(GetEndpoint()));
RegisterAttribute(
chip::app::Clusters::ApplicationBasic::Attributes::ApplicationVersion::Id,
new core::Attribute<chip::app::Clusters::ApplicationBasic::Attributes::ApplicationVersion::TypeInfo>(GetEndpoint()));
RegisterAttribute(
chip::app::Clusters::ApplicationBasic::Attributes::AllowedVendorList::Id,
new core::Attribute<chip::app::Clusters::ApplicationBasic::Attributes::AllowedVendorList::TypeInfo>(GetEndpoint()));
}
};
}; // namespace application_basic
namespace application_launcher {
class ApplicationLauncherCluster : public core::BaseCluster
{
public:
ApplicationLauncherCluster(memory::Weak<core::Endpoint> endpoint) : core::BaseCluster(endpoint) {}
void SetUp()
{
ChipLogProgress(AppServer, "Setting up ApplicationLauncherCluster on EndpointId: %d", GetEndpoint().lock()->GetId());
RegisterCommand(chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Id,
new core::Command<chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Type>(GetEndpoint()));
RegisterCommand(chip::app::Clusters::ApplicationLauncher::Commands::StopApp::Id,
new core::Command<chip::app::Clusters::ApplicationLauncher::Commands::StopApp::Type>(GetEndpoint()));
RegisterCommand(chip::app::Clusters::ApplicationLauncher::Commands::HideApp::Id,
new core::Command<chip::app::Clusters::ApplicationLauncher::Commands::HideApp::Type>(GetEndpoint()));
RegisterAttribute(
chip::app::Clusters::ApplicationLauncher::Attributes::CatalogList::Id,
new core::Attribute<chip::app::Clusters::ApplicationLauncher::Attributes::CatalogList::TypeInfo>(GetEndpoint()));
RegisterAttribute(
chip::app::Clusters::ApplicationLauncher::Attributes::CurrentApp::Id,
new core::Attribute<chip::app::Clusters::ApplicationLauncher::Attributes::CurrentApp::TypeInfo>(GetEndpoint()));
}
};
}; // namespace application_launcher
namespace content_launcher {
class ContentLauncherCluster : public core::BaseCluster
{
public:
ContentLauncherCluster(memory::Weak<core::Endpoint> endpoint) : core::BaseCluster(endpoint) {}
void SetUp()
{
ChipLogProgress(AppServer, "Setting up ContentLauncherCluster on EndpointId: %d", GetEndpoint().lock()->GetId());
RegisterCommand(chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Id,
new core::Command<chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Type>(GetEndpoint()));
RegisterCommand(chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Id,
new core::Command<chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type>(GetEndpoint()));
RegisterAttribute(
chip::app::Clusters::ContentLauncher::Attributes::SupportedStreamingProtocols::Id,
new core::Attribute<chip::app::Clusters::ContentLauncher::Attributes::SupportedStreamingProtocols::TypeInfo>(
GetEndpoint()));
}
};
}; // namespace content_launcher
namespace keypad_input {
class KeypadInputCluster : public core::BaseCluster
{
public:
KeypadInputCluster(memory::Weak<core::Endpoint> endpoint) : core::BaseCluster(endpoint) {}
void SetUp()
{
ChipLogProgress(AppServer, "Setting up KeypadInputCluster on EndpointId: %d", GetEndpoint().lock()->GetId());
RegisterCommand(chip::app::Clusters::KeypadInput::Commands::SendKey::Id,
new core::Command<chip::app::Clusters::KeypadInput::Commands::SendKey::Type>(GetEndpoint()));
}
};
}; // namespace keypad_input
namespace level_control {
class LevelControlCluster : public core::BaseCluster
{
public:
LevelControlCluster(memory::Weak<core::Endpoint> endpoint) : core::BaseCluster(endpoint) {}
void SetUp()
{
ChipLogProgress(AppServer, "Setting up LevelControlCluster on EndpointId: %d", GetEndpoint().lock()->GetId());
RegisterCommand(chip::app::Clusters::LevelControl::Commands::MoveToLevel::Id,
new core::Command<chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type>(GetEndpoint()));
RegisterCommand(chip::app::Clusters::LevelControl::Commands::Move::Id,
new core::Command<chip::app::Clusters::LevelControl::Commands::Move::Type>(GetEndpoint()));
RegisterCommand(chip::app::Clusters::LevelControl::Commands::Step::Id,
new core::Command<chip::app::Clusters::LevelControl::Commands::Step::Type>(GetEndpoint()));
RegisterCommand(chip::app::Clusters::LevelControl::Commands::Stop::Id,
new core::Command<chip::app::Clusters::LevelControl::Commands::Stop::Type>(GetEndpoint()));
RegisterCommand(chip::app::Clusters::LevelControl::Commands::MoveToLevelWithOnOff::Id,
new core::Command<chip::app::Clusters::LevelControl::Commands::MoveToLevelWithOnOff::Type>(GetEndpoint()));
RegisterCommand(chip::app::Clusters::LevelControl::Commands::MoveWithOnOff::Id,
new core::Command<chip::app::Clusters::LevelControl::Commands::MoveWithOnOff::Type>(GetEndpoint()));
RegisterCommand(chip::app::Clusters::LevelControl::Commands::StepWithOnOff::Id,
new core::Command<chip::app::Clusters::LevelControl::Commands::StepWithOnOff::Type>(GetEndpoint()));
RegisterCommand(
chip::app::Clusters::LevelControl::Commands::MoveToClosestFrequency::Id,
new core::Command<chip::app::Clusters::LevelControl::Commands::MoveToClosestFrequency::Type>(GetEndpoint()));
RegisterAttribute(
chip::app::Clusters::LevelControl::Attributes::CurrentLevel::Id,
new core::Attribute<chip::app::Clusters::LevelControl::Attributes::CurrentLevel::TypeInfo>(GetEndpoint()));
RegisterAttribute(
chip::app::Clusters::LevelControl::Attributes::RemainingTime::Id,
new core::Attribute<chip::app::Clusters::LevelControl::Attributes::RemainingTime::TypeInfo>(GetEndpoint()));
RegisterAttribute(chip::app::Clusters::LevelControl::Attributes::MinLevel::Id,
new core::Attribute<chip::app::Clusters::LevelControl::Attributes::MinLevel::TypeInfo>(GetEndpoint()));
RegisterAttribute(chip::app::Clusters::LevelControl::Attributes::MaxLevel::Id,
new core::Attribute<chip::app::Clusters::LevelControl::Attributes::MaxLevel::TypeInfo>(GetEndpoint()));
RegisterAttribute(
chip::app::Clusters::LevelControl::Attributes::CurrentFrequency::Id,
new core::Attribute<chip::app::Clusters::LevelControl::Attributes::CurrentFrequency::TypeInfo>(GetEndpoint()));
RegisterAttribute(
chip::app::Clusters::LevelControl::Attributes::MinFrequency::Id,
new core::Attribute<chip::app::Clusters::LevelControl::Attributes::MinFrequency::TypeInfo>(GetEndpoint()));
RegisterAttribute(
chip::app::Clusters::LevelControl::Attributes::MaxFrequency::Id,
new core::Attribute<chip::app::Clusters::LevelControl::Attributes::MaxFrequency::TypeInfo>(GetEndpoint()));
RegisterAttribute(chip::app::Clusters::LevelControl::Attributes::Options::Id,
new core::Attribute<chip::app::Clusters::LevelControl::Attributes::Options::TypeInfo>(GetEndpoint()));
RegisterAttribute(
chip::app::Clusters::LevelControl::Attributes::OnOffTransitionTime::Id,
new core::Attribute<chip::app::Clusters::LevelControl::Attributes::OnOffTransitionTime::TypeInfo>(GetEndpoint()));
RegisterAttribute(chip::app::Clusters::LevelControl::Attributes::OnLevel::Id,
new core::Attribute<chip::app::Clusters::LevelControl::Attributes::OnLevel::TypeInfo>(GetEndpoint()));
RegisterAttribute(
chip::app::Clusters::LevelControl::Attributes::OnTransitionTime::Id,
new core::Attribute<chip::app::Clusters::LevelControl::Attributes::OnTransitionTime::TypeInfo>(GetEndpoint()));
RegisterAttribute(
chip::app::Clusters::LevelControl::Attributes::DefaultMoveRate::Id,
new core::Attribute<chip::app::Clusters::LevelControl::Attributes::DefaultMoveRate::TypeInfo>(GetEndpoint()));
RegisterAttribute(
chip::app::Clusters::LevelControl::Attributes::StartUpCurrentLevel::Id,
new core::Attribute<chip::app::Clusters::LevelControl::Attributes::StartUpCurrentLevel::TypeInfo>(GetEndpoint()));
}
};
}; // namespace level_control
namespace media_playback {
class MediaPlaybackCluster : public core::BaseCluster
{
public:
MediaPlaybackCluster(memory::Weak<core::Endpoint> endpoint) : core::BaseCluster(endpoint) {}
void SetUp()
{
ChipLogProgress(AppServer, "Setting up MediaPlaybackCluster on EndpointId: %d", GetEndpoint().lock()->GetId());
RegisterCommand(chip::app::Clusters::MediaPlayback::Commands::Play::Id,
new core::Command<chip::app::Clusters::MediaPlayback::Commands::Play::Type>(GetEndpoint()));
RegisterCommand(chip::app::Clusters::MediaPlayback::Commands::Pause::Id,
new core::Command<chip::app::Clusters::MediaPlayback::Commands::Pause::Type>(GetEndpoint()));
RegisterCommand(chip::app::Clusters::MediaPlayback::Commands::Stop::Id,
new core::Command<chip::app::Clusters::MediaPlayback::Commands::Stop::Type>(GetEndpoint()));
RegisterCommand(chip::app::Clusters::MediaPlayback::Commands::StartOver::Id,
new core::Command<chip::app::Clusters::MediaPlayback::Commands::StartOver::Type>(GetEndpoint()));
RegisterCommand(chip::app::Clusters::MediaPlayback::Commands::Previous::Id,
new core::Command<chip::app::Clusters::MediaPlayback::Commands::Previous::Type>(GetEndpoint()));
RegisterCommand(chip::app::Clusters::MediaPlayback::Commands::Next::Id,
new core::Command<chip::app::Clusters::MediaPlayback::Commands::Next::Type>(GetEndpoint()));
RegisterCommand(chip::app::Clusters::MediaPlayback::Commands::Rewind::Id,
new core::Command<chip::app::Clusters::MediaPlayback::Commands::Rewind::Type>(GetEndpoint()));
RegisterCommand(chip::app::Clusters::MediaPlayback::Commands::FastForward::Id,
new core::Command<chip::app::Clusters::MediaPlayback::Commands::FastForward::Type>(GetEndpoint()));
RegisterCommand(chip::app::Clusters::MediaPlayback::Commands::SkipForward::Id,
new core::Command<chip::app::Clusters::MediaPlayback::Commands::SkipForward::Type>(GetEndpoint()));
RegisterCommand(chip::app::Clusters::MediaPlayback::Commands::SkipBackward::Id,
new core::Command<chip::app::Clusters::MediaPlayback::Commands::SkipBackward::Type>(GetEndpoint()));
RegisterCommand(chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id,
new core::Command<chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type>(GetEndpoint()));
RegisterCommand(chip::app::Clusters::MediaPlayback::Commands::Seek::Id,
new core::Command<chip::app::Clusters::MediaPlayback::Commands::Seek::Type>(GetEndpoint()));
RegisterCommand(chip::app::Clusters::MediaPlayback::Commands::ActivateAudioTrack::Id,
new core::Command<chip::app::Clusters::MediaPlayback::Commands::ActivateAudioTrack::Type>(GetEndpoint()));
RegisterCommand(chip::app::Clusters::MediaPlayback::Commands::ActivateTextTrack::Id,
new core::Command<chip::app::Clusters::MediaPlayback::Commands::ActivateTextTrack::Type>(GetEndpoint()));
RegisterCommand(chip::app::Clusters::MediaPlayback::Commands::DeactivateTextTrack::Id,
new core::Command<chip::app::Clusters::MediaPlayback::Commands::DeactivateTextTrack::Type>(GetEndpoint()));
RegisterAttribute(
chip::app::Clusters::MediaPlayback::Attributes::CurrentState::Id,
new core::Attribute<chip::app::Clusters::MediaPlayback::Attributes::CurrentState::TypeInfo>(GetEndpoint()));
RegisterAttribute(chip::app::Clusters::MediaPlayback::Attributes::StartTime::Id,
new core::Attribute<chip::app::Clusters::MediaPlayback::Attributes::StartTime::TypeInfo>(GetEndpoint()));
RegisterAttribute(chip::app::Clusters::MediaPlayback::Attributes::Duration::Id,
new core::Attribute<chip::app::Clusters::MediaPlayback::Attributes::Duration::TypeInfo>(GetEndpoint()));
RegisterAttribute(
chip::app::Clusters::MediaPlayback::Attributes::SampledPosition::Id,
new core::Attribute<chip::app::Clusters::MediaPlayback::Attributes::SampledPosition::TypeInfo>(GetEndpoint()));
RegisterAttribute(
chip::app::Clusters::MediaPlayback::Attributes::PlaybackSpeed::Id,
new core::Attribute<chip::app::Clusters::MediaPlayback::Attributes::PlaybackSpeed::TypeInfo>(GetEndpoint()));
RegisterAttribute(
chip::app::Clusters::MediaPlayback::Attributes::SeekRangeEnd::Id,
new core::Attribute<chip::app::Clusters::MediaPlayback::Attributes::SeekRangeEnd::TypeInfo>(GetEndpoint()));
RegisterAttribute(
chip::app::Clusters::MediaPlayback::Attributes::SeekRangeStart::Id,
new core::Attribute<chip::app::Clusters::MediaPlayback::Attributes::SeekRangeStart::TypeInfo>(GetEndpoint()));
RegisterAttribute(
chip::app::Clusters::MediaPlayback::Attributes::ActiveAudioTrack::Id,
new core::Attribute<chip::app::Clusters::MediaPlayback::Attributes::ActiveAudioTrack::TypeInfo>(GetEndpoint()));
RegisterAttribute(
chip::app::Clusters::MediaPlayback::Attributes::AvailableAudioTracks::Id,
new core::Attribute<chip::app::Clusters::MediaPlayback::Attributes::AvailableAudioTracks::TypeInfo>(GetEndpoint()));
RegisterAttribute(
chip::app::Clusters::MediaPlayback::Attributes::ActiveTextTrack::Id,
new core::Attribute<chip::app::Clusters::MediaPlayback::Attributes::ActiveTextTrack::TypeInfo>(GetEndpoint()));
RegisterAttribute(
chip::app::Clusters::MediaPlayback::Attributes::AvailableTextTracks::Id,
new core::Attribute<chip::app::Clusters::MediaPlayback::Attributes::AvailableTextTracks::TypeInfo>(GetEndpoint()));
}
};
}; // namespace media_playback
namespace on_off {
class OnOffCluster : public core::BaseCluster
{
public:
OnOffCluster(memory::Weak<core::Endpoint> endpoint) : core::BaseCluster(endpoint) {}
void SetUp()
{
ChipLogProgress(AppServer, "Setting up OnOffCluster on EndpointId: %d", GetEndpoint().lock()->GetId());
RegisterCommand(chip::app::Clusters::OnOff::Commands::Off::Id,
new core::Command<chip::app::Clusters::OnOff::Commands::Off::Type>(GetEndpoint()));
RegisterCommand(chip::app::Clusters::OnOff::Commands::On::Id,
new core::Command<chip::app::Clusters::OnOff::Commands::On::Type>(GetEndpoint()));
RegisterCommand(chip::app::Clusters::OnOff::Commands::Toggle::Id,
new core::Command<chip::app::Clusters::OnOff::Commands::Toggle::Type>(GetEndpoint()));
RegisterCommand(chip::app::Clusters::OnOff::Commands::OffWithEffect::Id,
new core::Command<chip::app::Clusters::OnOff::Commands::OffWithEffect::Type>(GetEndpoint()));
RegisterCommand(chip::app::Clusters::OnOff::Commands::OnWithRecallGlobalScene::Id,
new core::Command<chip::app::Clusters::OnOff::Commands::OnWithRecallGlobalScene::Type>(GetEndpoint()));
RegisterCommand(chip::app::Clusters::OnOff::Commands::OnWithTimedOff::Id,
new core::Command<chip::app::Clusters::OnOff::Commands::OnWithTimedOff::Type>(GetEndpoint()));
RegisterAttribute(chip::app::Clusters::OnOff::Attributes::OnOff::Id,
new core::Attribute<chip::app::Clusters::OnOff::Attributes::OnOff::TypeInfo>(GetEndpoint()));
RegisterAttribute(chip::app::Clusters::OnOff::Attributes::GlobalSceneControl::Id,
new core::Attribute<chip::app::Clusters::OnOff::Attributes::GlobalSceneControl::TypeInfo>(GetEndpoint()));
RegisterAttribute(chip::app::Clusters::OnOff::Attributes::OnTime::Id,
new core::Attribute<chip::app::Clusters::OnOff::Attributes::OnTime::TypeInfo>(GetEndpoint()));
RegisterAttribute(chip::app::Clusters::OnOff::Attributes::OffWaitTime::Id,
new core::Attribute<chip::app::Clusters::OnOff::Attributes::OffWaitTime::TypeInfo>(GetEndpoint()));
RegisterAttribute(chip::app::Clusters::OnOff::Attributes::StartUpOnOff::Id,
new core::Attribute<chip::app::Clusters::OnOff::Attributes::StartUpOnOff::TypeInfo>(GetEndpoint()));
}
};
}; // namespace on_off
namespace target_navigator {
class TargetNavigatorCluster : public core::BaseCluster
{
public:
TargetNavigatorCluster(memory::Weak<core::Endpoint> endpoint) : core::BaseCluster(endpoint) {}
void SetUp()
{
ChipLogProgress(AppServer, "Setting up TargetNavigatorCluster on EndpointId: %d", GetEndpoint().lock()->GetId());
RegisterCommand(chip::app::Clusters::TargetNavigator::Commands::NavigateTarget::Id,
new core::Command<chip::app::Clusters::TargetNavigator::Commands::NavigateTarget::Type>(GetEndpoint()));
RegisterAttribute(
chip::app::Clusters::TargetNavigator::Attributes::TargetList::Id,
new core::Attribute<chip::app::Clusters::TargetNavigator::Attributes::TargetList::TypeInfo>(GetEndpoint()));
RegisterAttribute(
chip::app::Clusters::TargetNavigator::Attributes::CurrentTarget::Id,
new core::Attribute<chip::app::Clusters::TargetNavigator::Attributes::CurrentTarget::TypeInfo>(GetEndpoint()));
}
};
}; // namespace target_navigator
namespace wake_on_lan {
class WakeOnLanCluster : public core::BaseCluster
{
public:
WakeOnLanCluster(memory::Weak<core::Endpoint> endpoint) : core::BaseCluster(endpoint) {}
void SetUp()
{
ChipLogProgress(AppServer, "Setting up WakeOnLanCluster on EndpointId: %d", GetEndpoint().lock()->GetId());
RegisterAttribute(chip::app::Clusters::WakeOnLan::Attributes::MACAddress::Id,
new core::Attribute<chip::app::Clusters::WakeOnLan::Attributes::MACAddress::TypeInfo>(GetEndpoint()));
RegisterAttribute(
chip::app::Clusters::WakeOnLan::Attributes::LinkLocalAddress::Id,
new core::Attribute<chip::app::Clusters::WakeOnLan::Attributes::LinkLocalAddress::TypeInfo>(GetEndpoint()));
}
};
}; // namespace wake_on_lan
}; // namespace clusters
}; // namespace casting
}; // namespace matter