Skip to content

Commit

Permalink
applications: matter: Fix Data Model for Bridge
Browse files Browse the repository at this point in the history
Data Model is set wrongly for all bridged devices.

Signed-off-by: Arkadiusz Balys <[email protected]>
  • Loading branch information
ArekBalysNordic authored and jfischer-no committed Mar 11, 2024
1 parent f5ff95f commit 1b2e296
Show file tree
Hide file tree
Showing 14 changed files with 369 additions and 25 deletions.
132 changes: 131 additions & 1 deletion applications/matter_bridge/src/bridge.matter
Original file line number Diff line number Diff line change
@@ -1,6 +1,54 @@
// This IDL was generated automatically by ZAP.
// It is for view/code review purposes only.

/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */
client cluster Identify = 3 {
enum EffectIdentifierEnum : enum8 {
kBlink = 0;
kBreathe = 1;
kOkay = 2;
kChannelChange = 11;
kFinishEffect = 254;
kStopEffect = 255;
}

enum EffectVariantEnum : enum8 {
kDefault = 0;
}

enum IdentifyTypeEnum : enum8 {
kNone = 0;
kLightOutput = 1;
kVisibleIndicator = 2;
kAudibleBeep = 3;
kDisplay = 4;
kActuator = 5;
}

attribute int16u identifyTime = 0;
readonly attribute IdentifyTypeEnum identifyType = 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 IdentifyRequest {
int16u identifyTime = 0;
}

request struct TriggerEffectRequest {
EffectIdentifierEnum effectIdentifier = 0;
EffectVariantEnum effectVariant = 1;
}

/** Command description for Identify */
command access(invoke: manage) Identify(IdentifyRequest): DefaultSuccess = 0;
/** Command description for TriggerEffect */
command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64;
}

/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */
server cluster Identify = 3 {
enum EffectIdentifierEnum : enum8 {
Expand Down Expand Up @@ -229,9 +277,23 @@ server cluster OnOff = 6 {
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;

request struct OffWithEffectRequest {
EffectIdentifierEnum effectIdentifier = 0;
int8u effectVariant = 1;
}

request struct OnWithTimedOffRequest {
OnOffControlBitmap onOffControl = 0;
int16u onTime = 1;
int16u offWaitTime = 2;
}

command Off(): DefaultSuccess = 0;
command On(): DefaultSuccess = 1;
command Toggle(): DefaultSuccess = 2;
command OffWithEffect(OffWithEffectRequest): DefaultSuccess = 64;
command OnWithRecallGlobalScene(): DefaultSuccess = 65;
command OnWithTimedOff(OnWithTimedOffRequest): DefaultSuccess = 66;
}

/** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */
Expand Down Expand Up @@ -1082,6 +1144,58 @@ server cluster BridgedDeviceBasicInformation = 57 {
readonly attribute int16u clusterRevision = 65533;
}

/** This cluster exposes interactions with a switch device, for the purpose of using those interactions by other devices.
Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags.
Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */
server cluster Switch = 59 {
bitmap Feature : bitmap32 {
kLatchingSwitch = 0x1;
kMomentarySwitch = 0x2;
kMomentarySwitchRelease = 0x4;
kMomentarySwitchLongPress = 0x8;
kMomentarySwitchMultiPress = 0x10;
}

info event SwitchLatched = 0 {
int8u newPosition = 0;
}

info event InitialPress = 1 {
int8u newPosition = 0;
}

info event LongPress = 2 {
int8u newPosition = 0;
}

info event ShortRelease = 3 {
int8u previousPosition = 0;
}

info event LongRelease = 4 {
int8u previousPosition = 0;
}

info event MultiPressOngoing = 5 {
int8u newPosition = 0;
int8u currentNumberOfPressesCounted = 1;
}

info event MultiPressComplete = 6 {
int8u previousPosition = 0;
int8u totalNumberOfPressesCounted = 1;
}

readonly attribute int8u numberOfPositions = 0;
readonly attribute int8u currentPosition = 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;
}

/** Commands to trigger a Node to allow a new Administrator to commission it. */
server cluster AdministratorCommissioning = 60 {
enum CommissioningWindowStatusEnum : enum8 {
Expand Down Expand Up @@ -1577,7 +1691,7 @@ endpoint 1 {
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 2;
ram attribute clusterRevision default = 4;

handle command Identify;
}
Expand All @@ -1598,6 +1712,7 @@ endpoint 1 {
endpoint 2 {
device type ma_onofflight = 256, version 2;

binding cluster Identify;
binding cluster OnOff;

server cluster Identify {
Expand Down Expand Up @@ -1651,6 +1766,9 @@ endpoint 2 {
handle command Off;
handle command On;
handle command Toggle;
handle command OffWithEffect;
handle command OnWithRecallGlobalScene;
handle command OnWithTimedOff;
}

server cluster Descriptor {
Expand Down Expand Up @@ -1699,6 +1817,18 @@ endpoint 2 {
ram attribute clusterRevision default = 2;
}

server cluster Switch {
emits event InitialPress;
ram attribute numberOfPositions default = 2;
ram attribute currentPosition;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 2;
ram attribute clusterRevision default = 1;
}

server cluster TemperatureMeasurement {
ram attribute measuredValue;
ram attribute minMeasuredValue default = 0x8000;
Expand Down
120 changes: 110 additions & 10 deletions applications/matter_bridge/src/bridge.zap
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@
"code": 2,
"mfgCode": null,
"side": "server",
"type": "OTAUpdateStateEnum",
"type": "UpdateStateEnum",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
Expand Down Expand Up @@ -1109,7 +1109,7 @@
"code": 2,
"mfgCode": null,
"side": "server",
"type": "RegulatoryLocationType",
"type": "RegulatoryLocationTypeEnum",
"included": 1,
"storageOption": "External",
"singleton": 0,
Expand All @@ -1125,7 +1125,7 @@
"code": 3,
"mfgCode": null,
"side": "server",
"type": "RegulatoryLocationType",
"type": "RegulatoryLocationTypeEnum",
"included": 1,
"storageOption": "External",
"singleton": 0,
Expand Down Expand Up @@ -1401,7 +1401,7 @@
"code": 5,
"mfgCode": null,
"side": "server",
"type": "NetworkCommissioningStatus",
"type": "NetworkCommissioningStatusEnum",
"included": 1,
"storageOption": "External",
"singleton": 0,
Expand Down Expand Up @@ -2165,7 +2165,7 @@
"code": 2,
"mfgCode": null,
"side": "server",
"type": "int16u",
"type": "vendor_id",
"included": 1,
"storageOption": "External",
"singleton": 0,
Expand Down Expand Up @@ -2814,7 +2814,7 @@
"code": 1,
"mfgCode": null,
"side": "server",
"type": "enum8",
"type": "IdentifyTypeEnum",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
Expand Down Expand Up @@ -2915,7 +2915,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "2",
"defaultValue": "4",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down Expand Up @@ -3122,6 +3122,58 @@
"deviceTypeCode": 256,
"deviceTypeProfileId": 259,
"clusters": [
{
"name": "Identify",
"code": 3,
"mfgCode": null,
"define": "IDENTIFY_CLUSTER",
"side": "client",
"enabled": 1,
"commands": [
{
"name": "Identify",
"code": 0,
"mfgCode": null,
"source": "client",
"isIncoming": 0,
"isEnabled": 1
}
],
"attributes": [
{
"name": "FeatureMap",
"code": 65532,
"mfgCode": null,
"side": "client",
"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": "client",
"type": "int16u",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "4",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
}
]
},
{
"name": "Identify",
"code": 3,
Expand Down Expand Up @@ -3169,7 +3221,7 @@
"code": 1,
"mfgCode": null,
"side": "server",
"type": "enum8",
"type": "IdentifyTypeEnum",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
Expand Down Expand Up @@ -3373,7 +3425,7 @@
"code": 0,
"mfgCode": null,
"side": "server",
"type": "bitmap8",
"type": "NameSupportBitmap",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
Expand Down Expand Up @@ -3513,6 +3565,30 @@
"source": "client",
"isIncoming": 0,
"isEnabled": 1
},
{
"name": "OffWithEffect",
"code": 64,
"mfgCode": null,
"source": "client",
"isIncoming": 0,
"isEnabled": 1
},
{
"name": "OnWithRecallGlobalScene",
"code": 65,
"mfgCode": null,
"source": "client",
"isIncoming": 0,
"isEnabled": 1
},
{
"name": "OnWithTimedOff",
"code": 66,
"mfgCode": null,
"source": "client",
"isIncoming": 0,
"isEnabled": 1
}
],
"attributes": [
Expand Down Expand Up @@ -3581,6 +3657,30 @@
"source": "client",
"isIncoming": 1,
"isEnabled": 1
},
{
"name": "OffWithEffect",
"code": 64,
"mfgCode": null,
"source": "client",
"isIncoming": 1,
"isEnabled": 1
},
{
"name": "OnWithRecallGlobalScene",
"code": 65,
"mfgCode": null,
"source": "client",
"isIncoming": 1,
"isEnabled": 1
},
{
"name": "OnWithTimedOff",
"code": 66,
"mfgCode": null,
"source": "client",
"isIncoming": 1,
"isEnabled": 1
}
],
"attributes": [
Expand Down Expand Up @@ -3653,7 +3753,7 @@
"code": 16387,
"mfgCode": null,
"side": "server",
"type": "OnOffStartUpOnOff",
"type": "StartUpOnOffEnum",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
Expand Down
Loading

0 comments on commit 1b2e296

Please sign in to comment.