15
15
* limitations under the License.
16
16
*/
17
17
18
- /* ***************************************************************************
19
- * @file
20
- * @brief Routines for the Media Playback plugin, the
21
- *server implementation of the Media Playback cluster.
22
- *******************************************************************************
23
- ******************************************************************************/
24
-
25
18
#include < app/clusters/messages-server/messages-delegate.h>
26
19
#include < app/clusters/messages-server/messages-server.h>
27
20
@@ -43,7 +36,7 @@ using chip::app::LogEvent;
43
36
using chip::Protocols::InteractionModel::Status;
44
37
45
38
static constexpr size_t kMessagesDelegateTableSize =
46
- EMBER_AF_MESSAGES_CLUSTER_SERVER_ENDPOINT_COUNT + CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT;
39
+ MATTER_DM_MESSAGES_CLUSTER_SERVER_ENDPOINT_COUNT + CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT;
47
40
static_assert (kMessagesDelegateTableSize <= kEmberInvalidEndpointIndex , " Messages Delegate table size error" );
48
41
49
42
// -----------------------------------------------------------------------------
@@ -57,7 +50,7 @@ Delegate * GetDelegate(EndpointId endpoint)
57
50
{
58
51
ChipLogProgress (Zcl, " MessagesCluster NOT returning delegate for endpoint:%u" , endpoint);
59
52
60
- uint16_t ep = emberAfGetClusterServerEndpointIndex (endpoint, Messages::Id, EMBER_AF_MESSAGES_CLUSTER_SERVER_ENDPOINT_COUNT );
53
+ uint16_t ep = emberAfGetClusterServerEndpointIndex (endpoint, Messages::Id, MATTER_DM_MESSAGES_CLUSTER_SERVER_ENDPOINT_COUNT );
61
54
return (ep >= kMessagesDelegateTableSize ? nullptr : gDelegateTable [ep]);
62
55
}
63
56
@@ -79,15 +72,12 @@ namespace Messages {
79
72
80
73
void SetDefaultDelegate (EndpointId endpoint, Delegate * delegate)
81
74
{
82
- uint16_t ep = emberAfGetClusterServerEndpointIndex (endpoint, Messages::Id, EMBER_AF_MESSAGES_CLUSTER_SERVER_ENDPOINT_COUNT );
75
+ uint16_t ep = emberAfGetClusterServerEndpointIndex (endpoint, Messages::Id, MATTER_DM_MESSAGES_CLUSTER_SERVER_ENDPOINT_COUNT );
83
76
// if endpoint is found
84
77
if (ep < kMessagesDelegateTableSize )
85
78
{
86
79
gDelegateTable [ep] = delegate;
87
80
}
88
- else
89
- {
90
- }
91
81
}
92
82
93
83
bool Delegate::HasFeature (chip::EndpointId endpoint, Feature feature)
@@ -196,9 +186,8 @@ bool emberAfMessagesClusterPresentMessagesRequestCallback(
196
186
197
187
Delegate * delegate = GetDelegate (endpoint);
198
188
VerifyOrExit (isDelegateNull (delegate, endpoint) != true , err = CHIP_ERROR_INCORRECT_STATE);
199
- {
200
- delegate->HandlePresentMessagesRequest (messageId, priority, messageControl, startTime, duration, messageText, responses);
201
- }
189
+
190
+ delegate->HandlePresentMessagesRequest (messageId, priority, messageControl, startTime, duration, messageText, responses);
202
191
203
192
exit :
204
193
if (err != CHIP_NO_ERROR)
@@ -226,9 +215,8 @@ bool emberAfMessagesClusterCancelMessagesRequestCallback(
226
215
227
216
Delegate * delegate = GetDelegate (endpoint);
228
217
VerifyOrExit (isDelegateNull (delegate, endpoint) != true , err = CHIP_ERROR_INCORRECT_STATE);
229
- {
230
- delegate->HandleCancelMessagesRequest (messageIds);
231
- }
218
+
219
+ delegate->HandleCancelMessagesRequest (messageIds);
232
220
233
221
exit :
234
222
if (err != CHIP_NO_ERROR)
0 commit comments