Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Messages Cluster XML #30254

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ jobs:
src/app/zap-templates/zcl/data-model/chip/low-power-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/messages-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/mode-base-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/network-commissioning-cluster.xml \
Expand Down
bzbarsky-apple marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -3230,6 +3230,90 @@ server cluster ActivatedCarbonFilterMonitoring = 114 {
command ResetCondition(): DefaultSuccess = 0;
}

/** An interface for passing messages to be presented by a device. */
provisional server cluster Messages = 151 {
enum FutureMessagePreferenceEnum : enum8 {
kAllowed = 0;
kIncreased = 1;
kReduced = 2;
kDisallowed = 3;
kBanned = 4;
}

enum MessagePriorityEnum : enum8 {
kLow = 0;
kMedium = 1;
kHigh = 2;
kCritical = 3;
}

bitmap Feature : bitmap32 {
kConfirmation = 0x1;
kConfirmationResponse = 0x2;
kConfirmationReply = 0x4;
kProtectedMessages = 0x8;
}

bitmap MessageControl : bitmap16 {
kConfirmationRequired = 0x1;
kResponseRequired = 0x2;
kReplyMessage = 0x4;
kMessageConfirmed = 0x8;
kMessageProtected = 0x10;
}

struct MessageResponseOptionStruct {
int32u messageResponseID = 0;
char_string<32> label = 1;
}

struct PresentMessageRequestStruct {
octet_string<16> messageID = 0;
MessagePriorityEnum priority = 1;
MessageControl messageControl = 2;
epoch_s startTime = 3;
int16u duration = 4;
long_char_string<512> messageText = 5;
MessageResponseOptionStruct responses[] = 6;
}

fabric_scoped struct MessageStruct {
octet_string<16> messageID = 0;
MessagePriorityEnum priority = 1;
MessageControl messageControl = 2;
epoch_s startTime = 3;
int16u duration = 4;
long_char_string<512> messageText = 5;
MessageResponseOptionStruct responses[] = 6;
fabric_idx fabricIndex = 254;
}

info event MessageQueued = 0 {
octet_string messageID = 0;
}

info event MessagePresented = 1 {
octet_string messageID = 0;
}

info event MessageComplete = 2 {
octet_string messageID = 0;
epoch_s timestamp = 2;
nullable int32u responseID = 3;
nullable long_char_string reply = 4;
nullable FutureMessagePreferenceEnum futureMessagesPref = 5;
}

readonly attribute MessageStruct messages[] = 0;
readonly attribute octet_string<16> activeMessageIDs = 1;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
readonly attribute attrib_id attributeList[] = 65531;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;
}

/** Provides an interface for controlling and adjusting automatic window coverings. */
server cluster WindowCovering = 258 {
enum EndProductType : enum8 {
Expand Down Expand Up @@ -6077,6 +6161,17 @@ endpoint 1 {
handle command ResetCondition;
}

server cluster Messages {
callback attribute messages;
ram attribute activeMessageIDs;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 1;
}

server cluster WindowCovering {
ram attribute type default = 0x08;
ram attribute physicalClosedLimitLift default = 0xFFFF;
Expand Down
139 changes: 139 additions & 0 deletions examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -17843,6 +17843,145 @@
}
]
},
{
"name": "Messages",
"code": 151,
"mfgCode": null,
"define": "MESSAGES_CLUSTER",
"side": "server",
"enabled": 1,
"apiMaturity": "provisional",
"attributes": [
{
"name": "Messages",
"code": 0,
"mfgCode": null,
"side": "server",
"type": "MessageStruct",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "ActiveMessageIDs",
"code": 1,
"mfgCode": null,
"side": "server",
"type": "octet_string",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "GeneratedCommandList",
"code": 65528,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "AcceptedCommandList",
"code": 65529,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "EventList",
"code": 65530,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "AttributeList",
"code": 65531,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "FeatureMap",
"code": 65532,
"mfgCode": null,
"side": "server",
"type": "bitmap32",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "ClusterRevision",
"code": 65533,
"mfgCode": null,
"side": "server",
"type": "int16u",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "1",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
}
]
},
{
"name": "Electrical Measurement",
"code": 2820,
Expand Down
3 changes: 2 additions & 1 deletion examples/all-clusters-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ set(SRC_DIRS_LIST
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/temperature-control-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/time-synchronization-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/dishwasher-alarm-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/laundry-washer-controls-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/laundry-washer-controls-server"
bzbarsky-apple marked this conversation as resolved.
Show resolved Hide resolved
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/messages-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/all-clusters-app/all-clusters-common/src"
)

Expand Down
1 change: 1 addition & 0 deletions scripts/rules.matterlint
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/low-power-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/matter-devices.xml";
load "../src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/messages-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/mode-base-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/network-commissioning-cluster.xml";
Expand Down
40 changes: 40 additions & 0 deletions src/app/clusters/messages-server/messages-server.cpp
bzbarsky-apple marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#include "messages-server.h"

#include <app-common/zap-generated/attributes/Accessors.h>
#include <app-common/zap-generated/cluster-objects.h>
#include <app-common/zap-generated/ids/Attributes.h>
#include <app-common/zap-generated/ids/Clusters.h>
#include <app-common/zap-generated/ids/Commands.h>
#include <app/CommandHandler.h>
#include <app/ConcreteCommandPath.h>

#include <app/util/af.h>
#include <app/util/common.h>
#include <app/util/error-mapping.h>
#include <array>
#include <lib/support/CodeUtils.h>
#include <platform/CHIPDeviceLayer.h>

using namespace chip;
using namespace chip::app;
using namespace chip::app::Clusters::Messages;
using chip::Protocols::InteractionModel::Status;

bool emberAfMessagesClusterPresentMessagesRequestCallback(
chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
const chip::app::Clusters::Messages::Commands::PresentMessagesRequest::DecodableType & commandData)
{
return true;
}
/**
* @brief Messages Cluster CancelMessagesRequest Command callback (from client)
*/

bool emberAfMessagesClusterCancelMessagesRequestCallback(
chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
const chip::app::Clusters::Messages::Commands::CancelMessagesRequest::DecodableType & commandData)
{
return true;
}

void MatterMessagesPluginServerInitCallback() {}
29 changes: 29 additions & 0 deletions src/app/clusters/messages-server/messages-server.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
*
* Copyright (c) 2023 Project CHIP Authors
*
* 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 <app-common/zap-generated/cluster-enums.h>
#include <app/util/basic-types.h>

namespace chip {
namespace app {
namespace Clusters {
namespace Messaging {} // namespace Messaging
} // namespace Clusters
} // namespace app
} // namespace chip
1 change: 1 addition & 0 deletions src/app/zap-templates/zcl/data-model/all.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
<xi:include href="chip/low-power-cluster.xml" />
<xi:include href="chip/media-input-cluster.xml" />
<xi:include href="chip/media-playback-cluster.xml" />
<xi:include href="chip/messages-cluster.xml" />
<xi:include href="chip/mode-base-cluster.xml" />
<xi:include href="chip/mode-select-cluster.xml" />
<xi:include href="chip/network-commissioning-cluster.xml" />
Expand Down
Loading
Loading