Skip to content

Commit

Permalink
TV Matter Media: Updated existing cluster to resolve the issue #31320 (
Browse files Browse the repository at this point in the history
…#31865)

* Update TV & TV Casting App ZAPs

* Update Matter files
  • Loading branch information
lazarkov authored Feb 3, 2024
1 parent 849f882 commit 1f3675c
Show file tree
Hide file tree
Showing 4 changed files with 455 additions and 12 deletions.
110 changes: 110 additions & 0 deletions examples/tv-app/tv-common/tv-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -2007,6 +2007,99 @@ cluster UserLabel = 65 {
readonly attribute int16u clusterRevision = 65533;
}

/** This cluster provides an interface for passing messages to be presented by a device. */
cluster Messages = 151 {
revision 3;

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 {
kReceivedConfirmation = 0x1;
kConfirmationResponse = 0x2;
kConfirmationReply = 0x4;
kProtectedMessages = 0x8;
}

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

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

struct MessageStruct {
octet_string<16> messageID = 0;
MessagePriorityEnum priority = 1;
MessageControlBitmap messageControl = 2;
nullable epoch_s startTime = 3;
nullable int16u duration = 4;
char_string<256> messageText = 5;
optional MessageResponseOptionStruct responses[] = 6;
}

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

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

info event MessageComplete = 2 {
octet_string messageID = 0;
optional nullable int32u responseID = 1;
optional nullable char_string reply = 2;
nullable FutureMessagePreferenceEnum futureMessagesPreference = 3;
}

readonly attribute MessageStruct messages[] = 0;
readonly attribute octet_string 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;

request struct PresentMessagesRequestRequest {
octet_string<16> messageID = 0;
MessagePriorityEnum priority = 1;
MessageControlBitmap messageControl = 2;
nullable epoch_s startTime = 3;
nullable int16u duration = 4;
char_string<256> messageText = 5;
optional MessageResponseOptionStruct responses[] = 6;
}

request struct CancelMessagesRequestRequest {
octet_string messageIDs[] = 0;
}

/** Command for requesting messages be presented */
fabric command PresentMessagesRequest(PresentMessagesRequestRequest): DefaultSuccess = 0;
/** Command for cancelling message present requests */
fabric command CancelMessagesRequest(CancelMessagesRequestRequest): DefaultSuccess = 1;
}

/** Attributes and commands for configuring the measurement of relative humidity, and reporting relative humidity measurements. */
cluster RelativeHumidityMeasurement = 1029 {
revision 3;
Expand Down Expand Up @@ -3433,6 +3526,23 @@ endpoint 1 {
callback attribute clusterRevision;
}

server cluster Messages {
emits event MessageQueued;
emits event MessagePresented;
emits event MessageComplete;
callback attribute messages;
callback attribute activeMessageIDs;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 3;

handle command PresentMessagesRequest;
handle command CancelMessagesRequest;
}

server cluster WakeOnLan {
ram attribute MACAddress;
ram attribute featureMap default = 0;
Expand Down
191 changes: 185 additions & 6 deletions examples/tv-app/tv-common/tv-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@
}
],
"package": [
{
"pathRelativity": "relativeToZap",
"path": "../../../src/app/zap-templates/app-templates.json",
"type": "gen-templates-json",
"version": "chip-v1"
},
{
"pathRelativity": "relativeToZap",
"path": "../../../src/app/zap-templates/zcl/zcl.json",
"type": "zcl-properties",
"category": "matter",
"version": 1,
"description": "Matter SDK ZCL data"
},
{
"pathRelativity": "relativeToZap",
"path": "../../../src/app/zap-templates/app-templates.json",
"type": "gen-templates-json",
"version": "chip-v1"
}
],
"endpointTypes": [
Expand Down Expand Up @@ -4691,6 +4691,185 @@
}
]
},
{
"name": "Messages",
"code": 151,
"mfgCode": null,
"define": "MESSAGES_CLUSTER",
"side": "server",
"enabled": 1,
"commands": [
{
"name": "PresentMessagesRequest",
"code": 0,
"mfgCode": null,
"source": "client",
"isIncoming": 1,
"isEnabled": 1
},
{
"name": "CancelMessagesRequest",
"code": 1,
"mfgCode": null,
"source": "client",
"isIncoming": 1,
"isEnabled": 1
}
],
"attributes": [
{
"name": "Messages",
"code": 0,
"mfgCode": null,
"side": "server",
"type": "array",
"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": "array",
"included": 1,
"storageOption": "External",
"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": "3",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
}
],
"events": [
{
"name": "MessageQueued",
"code": 0,
"mfgCode": null,
"side": "server",
"included": 1
},
{
"name": "MessagePresented",
"code": 1,
"mfgCode": null,
"side": "server",
"included": 1
},
{
"name": "MessageComplete",
"code": 2,
"mfgCode": null,
"side": "server",
"included": 1
}
]
},
{
"name": "Wake on LAN",
"code": 1283,
Expand Down
Loading

0 comments on commit 1f3675c

Please sign in to comment.