From c750f4b20e9dff0b564da5e8eb2347206e9c1010 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 20 Jan 2022 14:45:22 -0500 Subject: [PATCH 01/15] Disambiguate type names in cluster-objects initializers. (#13744) In most places, where we are assigning to something of type {{zapTypeToDecodableClusterObjectType type}} to start with, what we had was not a problem. But in the DecodableType for the cluster-wide struct, which is inside namespace chip::app::Clusters::ClusterName::Attributes, we could get an ambiguity when an attribute and an enum had the same name (e.g. HourFormat). Then the bareword HourFormat instead of being treated as ClusterName::HourFormat would get treated as ClusterName::Attributes::HourFormat, which is a namespace, not a type name, and after that things would fail to compile. The fix is to, at this one callsite, pass in the cluster name as the namespace, so we generate fully qualified names for enums. --- .../partials/cluster-objects-field-init.zapt | 2 +- .../templates/app/cluster-objects.zapt | 2 +- .../zap-generated/cluster-objects.h | 31 +++++++++++-------- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/src/app/zap-templates/partials/cluster-objects-field-init.zapt b/src/app/zap-templates/partials/cluster-objects-field-init.zapt index b6729e7eac3d7e..70d55789aabd44 100644 --- a/src/app/zap-templates/partials/cluster-objects-field-init.zapt +++ b/src/app/zap-templates/partials/cluster-objects-field-init.zapt @@ -8,7 +8,7 @@ {{~#if_is_struct type}} {{! Structs have their own initializers }} {{~else~}} - = static_cast<{{zapTypeToEncodableClusterObjectType type}}>(0) + = static_cast<{{zapTypeToEncodableClusterObjectType type ns=ns}}>(0) {{~/if_is_struct}} {{~/unless}} {{~/unless}} diff --git a/src/app/zap-templates/templates/app/cluster-objects.zapt b/src/app/zap-templates/templates/app/cluster-objects.zapt index b2b4bed4051e3e..79090e851e4ed3 100644 --- a/src/app/zap-templates/templates/app/cluster-objects.zapt +++ b/src/app/zap-templates/templates/app/cluster-objects.zapt @@ -176,7 +176,7 @@ struct TypeInfo {{#zcl_attributes_server}} {{! isOptional=false because optional attributes don't get represented as Optional types here. }} - Attributes::{{asUpperCamelCase label}}::TypeInfo::DecodableType {{asLowerCamelCase label}}{{> cluster_objects_field_init isOptional=false}}; + Attributes::{{asUpperCamelCase label}}::TypeInfo::DecodableType {{asLowerCamelCase label}}{{> cluster_objects_field_init ns=parent.name isOptional=false}}; {{/zcl_attributes_server}} }; }; diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index e1c1702ff69d82..73b7ac9929b77d 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -8811,7 +8811,8 @@ struct TypeInfo Attributes::DefaultOtaProviders::TypeInfo::DecodableType defaultOtaProviders; Attributes::UpdatePossible::TypeInfo::DecodableType updatePossible = static_cast(0); - Attributes::UpdateState::TypeInfo::DecodableType updateState = static_cast(0); + Attributes::UpdateState::TypeInfo::DecodableType updateState = + static_cast(0); Attributes::UpdateStateProgress::TypeInfo::DecodableType updateStateProgress; Attributes::AttributeList::TypeInfo::DecodableType attributeList; Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); @@ -10719,7 +10720,8 @@ struct TypeInfo Attributes::ScanMaxTimeSeconds::TypeInfo::DecodableType scanMaxTimeSeconds = static_cast(0); Attributes::ConnectMaxTimeSeconds::TypeInfo::DecodableType connectMaxTimeSeconds = static_cast(0); Attributes::InterfaceEnabled::TypeInfo::DecodableType interfaceEnabled = static_cast(0); - Attributes::LastNetworkingStatus::TypeInfo::DecodableType lastNetworkingStatus = static_cast(0); + Attributes::LastNetworkingStatus::TypeInfo::DecodableType lastNetworkingStatus = + static_cast(0); Attributes::LastNetworkID::TypeInfo::DecodableType lastNetworkID; Attributes::LastConnectErrorValue::TypeInfo::DecodableType lastConnectErrorValue = static_cast(0); Attributes::AttributeList::TypeInfo::DecodableType attributeList; @@ -19196,7 +19198,7 @@ struct TypeInfo CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); Attributes::LockState::TypeInfo::DecodableType lockState; - Attributes::LockType::TypeInfo::DecodableType lockType = static_cast(0); + Attributes::LockType::TypeInfo::DecodableType lockType = static_cast(0); Attributes::ActuatorEnabled::TypeInfo::DecodableType actuatorEnabled = static_cast(0); Attributes::DoorState::TypeInfo::DecodableType doorState; Attributes::DoorOpenEvents::TypeInfo::DecodableType doorOpenEvents = static_cast(0); @@ -19219,11 +19221,12 @@ struct TypeInfo Attributes::CredentialRulesSupport::TypeInfo::DecodableType credentialRulesSupport = static_cast(0); Attributes::EnableLogging::TypeInfo::DecodableType enableLogging = static_cast(0); Attributes::Language::TypeInfo::DecodableType language; - Attributes::LEDSettings::TypeInfo::DecodableType LEDSettings = static_cast(0); - Attributes::AutoRelockTime::TypeInfo::DecodableType autoRelockTime = static_cast(0); - Attributes::SoundVolume::TypeInfo::DecodableType soundVolume = static_cast(0); - Attributes::OperatingMode::TypeInfo::DecodableType operatingMode = static_cast(0); - Attributes::SupportedOperatingModes::TypeInfo::DecodableType supportedOperatingModes = static_cast(0); + Attributes::LEDSettings::TypeInfo::DecodableType LEDSettings = static_cast(0); + Attributes::AutoRelockTime::TypeInfo::DecodableType autoRelockTime = static_cast(0); + Attributes::SoundVolume::TypeInfo::DecodableType soundVolume = static_cast(0); + Attributes::OperatingMode::TypeInfo::DecodableType operatingMode = + static_cast(0); + Attributes::SupportedOperatingModes::TypeInfo::DecodableType supportedOperatingModes = static_cast(0); Attributes::DefaultConfigurationRegister::TypeInfo::DecodableType defaultConfigurationRegister = static_cast(0); Attributes::EnableLocalProgramming::TypeInfo::DecodableType enableLocalProgramming = static_cast(0); Attributes::EnableOneTouchLocking::TypeInfo::DecodableType enableOneTouchLocking = static_cast(0); @@ -31514,9 +31517,10 @@ struct TypeInfo CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); - Attributes::PlaybackState::TypeInfo::DecodableType playbackState = static_cast(0); - Attributes::StartTime::TypeInfo::DecodableType startTime = static_cast(0); - Attributes::Duration::TypeInfo::DecodableType duration = static_cast(0); + Attributes::PlaybackState::TypeInfo::DecodableType playbackState = + static_cast(0); + Attributes::StartTime::TypeInfo::DecodableType startTime = static_cast(0); + Attributes::Duration::TypeInfo::DecodableType duration = static_cast(0); Attributes::Position::TypeInfo::DecodableType position; Attributes::PlaybackSpeed::TypeInfo::DecodableType playbackSpeed = static_cast(0); Attributes::SeekRangeEnd::TypeInfo::DecodableType seekRangeEnd = static_cast(0); @@ -33253,7 +33257,8 @@ struct TypeInfo Attributes::ApplicationName::TypeInfo::DecodableType applicationName; Attributes::ProductId::TypeInfo::DecodableType productId = static_cast(0); Attributes::ApplicationApp::TypeInfo::DecodableType applicationApp; - Attributes::ApplicationStatus::TypeInfo::DecodableType applicationStatus = static_cast(0); + Attributes::ApplicationStatus::TypeInfo::DecodableType applicationStatus = + static_cast(0); Attributes::ApplicationVersion::TypeInfo::DecodableType applicationVersion; Attributes::AllowedVendorList::TypeInfo::DecodableType allowedVendorList; Attributes::AttributeList::TypeInfo::DecodableType attributeList; @@ -36050,7 +36055,7 @@ struct TypeInfo Attributes::EpochS::TypeInfo::DecodableType epochS = static_cast(0); Attributes::VendorId::TypeInfo::DecodableType vendorId = static_cast(0); Attributes::ListNullablesAndOptionalsStruct::TypeInfo::DecodableType listNullablesAndOptionalsStruct; - Attributes::EnumAttr::TypeInfo::DecodableType enumAttr = static_cast(0); + Attributes::EnumAttr::TypeInfo::DecodableType enumAttr = static_cast(0); Attributes::StructAttr::TypeInfo::DecodableType structAttr; Attributes::RangeRestrictedInt8u::TypeInfo::DecodableType rangeRestrictedInt8u = static_cast(0); Attributes::RangeRestrictedInt8s::TypeInfo::DecodableType rangeRestrictedInt8s = static_cast(0); From 4ac926ad392cbd4cb3dacaa77b4792ca4c1a5476 Mon Sep 17 00:00:00 2001 From: manjunathambiger23 Date: Fri, 21 Jan 2022 01:30:48 +0530 Subject: [PATCH 02/15] Added YAML Test Cases - Jan 19th (#13700) * Adding following testcases 1.TC_BRAC_1_1 2.TC_ETHDIAG_1_1 3.TC_ETHDIAG_2_1 4.TC_PS_1_1 5.TC_SWTCH_2_1 6.TC_SWTCH_2_2 7.TC_WIFIDIAG_1_1 8.TC_WIFIDIAG_3_1 * Adding auto generated files --- examples/chip-tool/templates/tests.js | 28 + .../certification/Test_TC_BRAC_1_1.yaml | 37 + .../certification/Test_TC_ETHDIAG_1_1.yaml | 162 ++ .../certification/Test_TC_ETHDIAG_2_1.yaml | 64 + .../suites/certification/Test_TC_PS_1_1.yaml | 94 ++ .../certification/Test_TC_SWTCH_2_1.yaml | 66 + .../certification/Test_TC_SWTCH_2_2.yaml | 514 ++++++ .../certification/Test_TC_WIFIDIAG_1_1.yaml | 216 +++ .../certification/Test_TC_WIFIDIAG_3_1.yaml | 72 + src/darwin/Framework/CHIP/templates/tests.js | 28 + .../Framework/CHIPTests/CHIPClustersTests.m | 880 +++++++++- .../chip-tool/zap-generated/test/Commands.h | 1484 +++++++++++++++++ 12 files changed, 3585 insertions(+), 60 deletions(-) create mode 100644 src/app/tests/suites/certification/Test_TC_BRAC_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_ETHDIAG_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_ETHDIAG_2_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_PS_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_SWTCH_2_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_SWTCH_2_2.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_WIFIDIAG_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_WIFIDIAG_3_1.yaml diff --git a/examples/chip-tool/templates/tests.js b/examples/chip-tool/templates/tests.js index 2a8a71863dfa33..a85b63d25dc961 100644 --- a/examples/chip-tool/templates/tests.js +++ b/examples/chip-tool/templates/tests.js @@ -28,6 +28,10 @@ function getTests() 'Test_TC_BOOL_2_1', ]; + const BridgedActions = [ + 'Test_TC_BRAC_1_1', + ]; + const ColorControl = [ 'Test_TC_CC_1_1', 'Test_TC_CC_2_1', @@ -72,6 +76,11 @@ function getTests() 'Test_TC_EMR_1_1', ]; + const EthernetNetworkDiagnostics = [ + 'Test_TC_ETHDIAG_1_1', + 'Test_TC_ETHDIAG_2_1', + ]; + const FlowMeasurement = [ 'Test_TC_FLW_1_1', 'Test_TC_FLW_2_1', @@ -132,6 +141,10 @@ function getTests() 'Test_TC_OO_2_3', ]; + const PowerSource = [ + 'Test_TC_PS_1_1', + ]; + const PressureMeasurement = [ 'Test_TC_PRS_1_1', 'Test_TC_PRS_2_1', @@ -150,6 +163,11 @@ function getTests() 'Test_TC_RH_2_2', ]; + const Switch = [ + 'Test_TC_SWTCH_2_1', + 'Test_TC_SWTCH_2_2', + ]; + const TemperatureMeasurement = [ 'Test_TC_TM_1_1', 'Test_TC_TM_2_1', @@ -172,6 +190,11 @@ function getTests() 'Test_TC_DIAGTH_1_1', ]; + const WiFiNetworkDiagnostics = [ + 'Test_TC_WIFIDIAG_1_1', + 'Test_TC_WIFIDIAG_3_1', + ]; + const WindowCovering = [ 'Test_TC_WNCV_1_1', 'Test_TC_WNCV_2_1', @@ -229,23 +252,28 @@ function getTests() const tests = [ BinaryInput, // BooleanState, // + BridgedActions, // ColorControl, // DeviceDiscovery, // DeviceManagement, // ElectricalMeasurement, // + EthernetNetworkDiagnostics, // FlowMeasurement, // IlluminanceMeasurement, // LevelControl, // MediaControl, // OccupancySensing, // OnOff, // + PowerSource, // PressureMeasurement, // PumpConfigurationControl, // RelativeHumidityMeasurement, // + Switch, // TemperatureMeasurement, // Thermostat, // ThermostatUserConfiguration, // ThreadNetworkDiagnostics, // + WiFiNetworkDiagnostics, // WindowCovering, // TV, // Others, // diff --git a/src/app/tests/suites/certification/Test_TC_BRAC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_BRAC_1_1.yaml new file mode 100644 index 00000000000000..7cb7fcc9e8a35a --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_BRAC_1_1.yaml @@ -0,0 +1,37 @@ +# Copyright (c) 2021 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. + +name: 77.1.1. [TC-BRAC-1.1] Global attributes with server as DUT + +config: + cluster: "Bridged Actions" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + + - label: "Read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + + - label: "Read the global attribute constraints: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + constraints: + type: uint16 diff --git a/src/app/tests/suites/certification/Test_TC_ETHDIAG_1_1.yaml b/src/app/tests/suites/certification/Test_TC_ETHDIAG_1_1.yaml new file mode 100644 index 00000000000000..c919838d9881fe --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_ETHDIAG_1_1.yaml @@ -0,0 +1,162 @@ +# Copyright (c) 2021 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. + +name: 48.1.1. [TC-ETHDIAG-1.1] Attributes with server as DUT + +config: + cluster: "Ethernet Network Diagnostics" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + + #Disabled due to issue #11670 and #13648 + - label: "Read PHYRate attribute" + disabled: true + command: "readAttribute" + attribute: "PHYRate" + response: + value: null + + - label: "Read PHYRate attribute constraints" + disabled: true + command: "readAttribute" + attribute: "PHYRate" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 9 + + - label: "Read FullDuplex attribute" + disabled: true + command: "readAttribute" + attribute: "FullDuplex" + response: + value: null + + - label: "Read FullDuplex attribute constraints" + disabled: true + command: "readAttribute" + attribute: "FullDuplex" + response: + constraints: + type: bool + + - label: "Read PacketRxCount attribute" + disabled: true + command: "readAttribute" + attribute: "PacketRxCount" + response: + value: 0 + + - label: "Read PacketRxCount attribute constraints" + disabled: true + command: "readAttribute" + attribute: "PacketRxCount" + response: + constraints: + type: uint64 + + - label: "Read PacketTxCount attribute" + disabled: true + command: "readAttribute" + attribute: "PacketTxCount" + response: + value: 0 + + - label: "Read PacketTxCount attribute constraints" + disabled: true + command: "readAttribute" + attribute: "PacketTxCount" + response: + constraints: + type: uint64 + + - label: "Read TxErrCount attribute" + disabled: true + command: "readAttribute" + attribute: "TxErrCount" + response: + value: 0 + + - label: "Read TxErrCount attribute constraints" + disabled: true + command: "readAttribute" + attribute: "TxErrCount" + response: + constraints: + type: uint64 + + - label: "Read CollisionCount attribute" + disabled: true + command: "readAttribute" + attribute: "CollisionCount" + response: + value: 0 + + - label: "Read CollisionCount attribute constraints" + disabled: true + command: "readAttribute" + attribute: "CollisionCount" + response: + constraints: + type: uint64 + + - label: "Read OverrunCount attribute" + disabled: true + command: "readAttribute" + attribute: "OverrunCount" + response: + value: 0 + + - label: "Read OverrunCount attribute constraints" + disabled: true + command: "readAttribute" + attribute: "OverrunCount" + response: + constraints: + type: uint64 + + - label: "Read CarrierDetect attribute" + disabled: true + command: "readAttribute" + attribute: "CarrierDetect" + response: + value: null + + - label: "Read CarrierDetect attribute constraints" + disabled: true + command: "readAttribute" + attribute: "CarrierDetect" + response: + constraints: + type: bool + + - label: "Read TimeSinceReset attribute" + disabled: true + command: "readAttribute" + attribute: "TimeSinceReset" + response: + value: 0 + + - label: "Read TimeSinceReset attribute constraints" + disabled: true + command: "readAttribute" + attribute: "TimeSinceReset" + response: + constraints: + type: uint64 diff --git a/src/app/tests/suites/certification/Test_TC_ETHDIAG_2_1.yaml b/src/app/tests/suites/certification/Test_TC_ETHDIAG_2_1.yaml new file mode 100644 index 00000000000000..a488632be2eeff --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_ETHDIAG_2_1.yaml @@ -0,0 +1,64 @@ +# Copyright (c) 2021 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. + +name: 48.1.3. [TC-ETHDIAG-2.1] Command received functionality with server as DUT + +config: + cluster: "Ethernet Network Diagnostics" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + + #Below steps disabled due to issue #13648 + - label: "Sends ResetCounts command" + disabled: true + command: "ResetCounts" + + - label: "Read the PacketRxCount attribute" + disabled: true + command: "readAttribute" + attribute: "PacketRxCount" + response: + value: 0 + + - label: "Read the PacketTxCount attribute" + disabled: true + command: "readAttribute" + attribute: "PacketTxCount" + response: + value: 0 + + - label: "Read the TxErrCount attribute" + disabled: true + command: "readAttribute" + attribute: "TxErrCount" + response: + value: 0 + + - label: "Read the CollisionCount attribute" + disabled: true + command: "readAttribute" + attribute: "CollisionCount" + response: + value: 0 + + - label: "Read the OverrunCount attribute" + disabled: true + command: "readAttribute" + attribute: "OverrunCount" + response: + value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_PS_1_1.yaml b/src/app/tests/suites/certification/Test_TC_PS_1_1.yaml new file mode 100644 index 00000000000000..061aba72bef687 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_PS_1_1.yaml @@ -0,0 +1,94 @@ +# Copyright (c) 2021 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. + +name: 62.1.1. [TC-PS-1.1] Global attributes with server as DUT + +config: + cluster: "Power Source" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + + - label: "read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + + - label: "Read the global attribute constraints: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + constraints: + type: uint16 + + - label: + "write the default values to mandatory global attribute: + ClusterRevision" + command: "writeAttribute" + attribute: "ClusterRevision" + arguments: + value: 1 + response: + error: UNSUPPORTED_WRITE + + - label: "reads back global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + + #issue #11053 disabled steps below Global attributes missing from YAML framework + - label: "Read the global attribute: EventList" + disabled: true + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + + - label: "Read the global attribute: ClientGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ClientGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: ServerGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ServerGeneratedCommandList" + response: + constraints: + type: list + + #disabled due to issue #13442 + - label: "Read the optional global attribute : FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: map32 diff --git a/src/app/tests/suites/certification/Test_TC_SWTCH_2_1.yaml b/src/app/tests/suites/certification/Test_TC_SWTCH_2_1.yaml new file mode 100644 index 00000000000000..e112b0da7cfbce --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_SWTCH_2_1.yaml @@ -0,0 +1,66 @@ +# Copyright (c) 2021 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. + +name: 74.2.1. [TC-SWTCH-2.1] Attributes with server as DUT + +config: + cluster: "Switch" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + + - label: "Read NumberOfPositions attribute" + command: "readAttribute" + attribute: "number of positions" + response: + value: 2 + + - label: "Read NumberOfPositions attribute" + command: "readAttribute" + attribute: "number of positions" + response: + constraints: + type: uint8 + minValue: 2 + + - label: "Read CurrentPosition attribute" + command: "readAttribute" + attribute: "current position" + response: + value: 0 + + - label: "Read CurrentPosition attribute" + command: "readAttribute" + attribute: "current position" + response: + constraints: + type: uint8 + minValue: 0 + + - label: "Read MultiPressMax attribute" + command: "readAttribute" + attribute: "multi press max" + response: + value: 2 + + - label: "Read MultiPressMax attribute" + command: "readAttribute" + attribute: "multi press max" + response: + constraints: + type: uint8 + minValue: 2 diff --git a/src/app/tests/suites/certification/Test_TC_SWTCH_2_2.yaml b/src/app/tests/suites/certification/Test_TC_SWTCH_2_2.yaml new file mode 100644 index 00000000000000..71f7849f2d39d8 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_SWTCH_2_2.yaml @@ -0,0 +1,514 @@ +# Copyright (c) 2021 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. + +name: 74.2.2. [TC-SWTCH-2.2] Primary functionality with server as DUT + +config: + cluster: "Switch" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + + #### 2: tests for Latching Switch + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Set up subscription to SwitchLatched event" + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator sets switch to first position" + + - label: "Read CurrentPosition attribute" + command: "readAttribute" + attribute: "current position" + response: + value: 0 + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator sets switch to second position" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "SwitchLatched event with NewPosition set to 1" + disabled: true + + - label: "Read CurrentPosition attribute" + disabled: true + command: "readAttribute" + attribute: "current position" + response: + value: 1 + + #Disabled due to issue #11343 -- Event verification not implemented + - label: + "SwitchLatched event with NewPosition set to 1 higher than in previous + event" + disabled: true + + - label: "Read CurrentPosition attribute" + disabled: true + command: "readAttribute" + attribute: "current position" + response: + value: 2 + + #Disabled due to issue #11343 -- Event verification not implemented + - label: + "SwitchLatched event with NewPosition set to 1 higher than in previous + event" + disabled: true + + - label: "Read CurrentPosition attribute" + disabled: true + command: "readAttribute" + attribute: "current position" + response: + value: 3 + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "SwitchLatched event with NewPosition set to 0" + disabled: true + + - label: "Read CurrentPosition attribute" + disabled: true + command: "readAttribute" + attribute: "current position" + response: + value: 0 + + ### 3: tests for Momentary Switch + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Set up subscription to InitialPress event" + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator does not operate switch" + + - label: "Read CurrentPosition attribute" + command: "readAttribute" + attribute: "current position" + response: + value: 0 + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator sets switch to second position" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "InitialPress event with NewPosition set to 1" + disabled: true + + - label: "Read CurrentPosition attribute" + disabled: true + command: "readAttribute" + attribute: "current position" + response: + value: 1 + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator does not operate switch (release switch)" + + - label: "Read CurrentPosition attribute" + disabled: true + command: "readAttribute" + attribute: "current position" + response: + value: 0 + + ## 4: tests for Momentary Switch with release capability but not long press capabilities + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: + "Set up subscription to InitialPress and ShortRelease events" + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator does not operate switch" + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator operates switch (press briefly)" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "InitialPress event with NewPosition set to 1" + disabled: true + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator releases switch" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "ShortRelease event with PreviousPosition set to 1" + disabled: true + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator operates switch for 5 seconds" + + - label: "Wait 3000ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 3000 + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "InitialPress event with NewPosition set to 1" + disabled: true + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator releases switch" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "ShortRelease event with PreviousPosition set to 1" + disabled: true + + ## 5: tests for Momentary Switch with release and long press capabilitie + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: + "Set up subscription to InitialPress, LongPress, + ShortRelease, LongRelease events" + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator does not operate switch" + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator operates switch (press briefly)" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "InitialPress event with NewPosition set to 1" + disabled: true + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator releases switch" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "ShortRelease event with PreviousPosition set to 1" + disabled: true + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator operates switch for 5 seconds" + + - label: "Wait 3000ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 3000 + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "InitialPress event with NewPosition set to 1" + disabled: true + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "LongPress event with NewPosition set to 1" + disabled: true + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator releases switch" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "LongRelease event with PreviousPosition set to 1" + disabled: true + + ## 6: tests for Momentary Switch with multi-press capabilities + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: + "Set up subscription to InitialPress, ShortRelease, + MultiPressOngoing, MultiPressComplete events" + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator does not operate switch" + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator operates switch (press briefly)" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "InitialPress event with NewPosition set to 1" + disabled: true + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator releases switch" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "ShortRelease event with PreviousPosition set to 1" + disabled: true + + #Disabled due to issue #11343 -- Event verification not implemented + - label: + "MultiPressComplete event with PreviousPosition set to 1 and + TotalNumberOfPressesCounted set to 1" + disabled: true + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator operates switch (press briefly)" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "InitialPress event with NewPosition set to 1" + disabled: true + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator releases switch" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "ShortRelease event with PreviousPosition set to 1" + disabled: true + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator operates switch again (press briefly)" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "InitialPress event with NewPosition set to 1" + disabled: true + + #Disabled due to issue #11343 -- Event verification not implemented + - label: + "MultiPressComplete event with PreviousPosition set to 1 and + TotalNumberOfPressesCounted set to 2" + disabled: true + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator releases switch" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "ShortRelease event with PreviousPosition set to 1" + disabled: true + + #Disabled due to issue #11343 -- Event verification not implemented + - label: + "MultiPressComplete event with PreviousPosition set to 1 and + TotalNumberOfPressesCounted set to 1" + disabled: true + + # 6i + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator operates switch again (press briefly)" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "InitialPress event with NewPosition set to 1" + disabled: true + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator releases switch" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "ShortRelease event with PreviousPosition set to 1" + disabled: true + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator operates switch again (press briefly)" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "InitialPress event with NewPosition set to 1" + disabled: true + + #Disabled due to issue #11343 -- Event verification not implemented + - label: + "MultiPressOngoing event with NewPosition set to 1 and + CurrentNumberOfPressesCounted set to 2" + disabled: true + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator releases switch" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "ShortRelease event with PreviousPosition set to 1" + disabled: true + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator operates switch again (press briefly)" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "InitialPress event with NewPosition set to 1" + disabled: true + + #Disabled due to issue #11343 -- Event verification not implemented + - label: + "MultiPressOngoing event with NewPosition set to 1 and + CurrentNumberOfPressesCounted set to 3" + disabled: true + + - label: "User interaction needed" + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Operator releases switch" + + #Disabled due to issue #11343 -- Event verification not implemented + - label: "ShortRelease event with PreviousPosition set to 1" + disabled: true + + #Disabled due to issue #11343 -- Event verification not implemented + - label: + "MultiPressComplete event with PreviousPosition set to 1 and + TotalNumberOfPressesCounted set to 3" + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_WIFIDIAG_1_1.yaml b/src/app/tests/suites/certification/Test_TC_WIFIDIAG_1_1.yaml new file mode 100644 index 00000000000000..6258d1750d4ac3 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_WIFIDIAG_1_1.yaml @@ -0,0 +1,216 @@ +# Copyright (c) 2021 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. + +name: 54.1.1. [TC-WIFIDIAG-1.1] Attributes with server as DUT + +config: + cluster: "WiFi Network Diagnostics" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + + #Below steps disabled due to issue #13645 and 11670 + - label: "Reads NetworkInterface structure attribute from DUT" + disabled: true + cluster: "General Diagnostics" + command: "readAttribute" + attribute: "NetworkInterfaces" + response: + constraints: + type: list + + - label: "Reads SecurityType attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "SecurityType" + response: + value: null + + - label: "Reads SecurityType attribute constraints" + disabled: true + command: "readAttribute" + attribute: "SecurityType" + response: + constraints: + type: enum + + - label: "Reads WiFiVersion attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "WiFiVersion" + response: + value: null + + - label: "Reads WiFiVersion attribute constraints" + disabled: true + command: "readAttribute" + attribute: "WiFiVersion" + response: + constraints: + type: enum + + - label: "Reads ChannelNumber attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "ChannelNumber" + response: + value: null + + - label: "Reads ChannelNumber attribute constraints" + disabled: true + command: "readAttribute" + attribute: "ChannelNumber" + response: + constraints: + type: uint16 + + - label: "Reads RSSI attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "RSSI" + response: + value: null + + - label: "Reads RSSI attribute constraints" + disabled: true + command: "readAttribute" + attribute: "RSSI" + response: + constraints: + type: int8 + minValue: -120 + maxValue: 0 + + - label: "Reads BeaconLostCount attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "BeaconLostCount" + response: + value: 0 + + - label: "Reads BeaconLostCount attribute constraints" + disabled: true + command: "readAttribute" + attribute: "BeaconLostCount" + response: + constraints: + type: uint32 + + - label: "Reads BeaconRxCount attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "BeaconRxCount" + response: + value: 0 + + - label: "Reads BeaconRxCount attribute constraints" + disabled: true + command: "readAttribute" + attribute: "BeaconRxCount" + response: + constraints: + type: uint32 + + - label: "Reads PacketMulticastRxCount attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "PacketMulticastRxCount" + response: + value: 0 + + - label: "Reads PacketMulticastRxCount attribute constraints" + disabled: true + command: "readAttribute" + attribute: "PacketMulticastRxCount" + response: + constraints: + type: uint32 + + - label: "Reads PacketMulticastTxCount attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "PacketMulticastTxCount" + response: + value: 0 + + - label: "Reads PacketMulticastTxCount attribute constraints" + disabled: true + command: "readAttribute" + attribute: "PacketMulticastTxCount" + response: + constraints: + type: uint32 + + - label: "Reads PacketUnicastRxCount attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "PacketUnicastRxCount" + response: + value: 0 + + - label: "Reads PacketUnicastRxCount attribute constraints" + disabled: true + command: "readAttribute" + attribute: "PacketUnicastRxCount" + response: + constraints: + type: uint32 + + - label: "Reads PacketUnicastTxCount attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "PacketUnicastTxCount" + response: + value: 0 + + - label: "Reads PacketUnicastTxCount attribute constraints" + disabled: true + command: "readAttribute" + attribute: "PacketUnicastTxCount" + response: + constraints: + type: uint32 + + - label: "Reads CurrentMaxRate attribute from DUT" + optional: true + command: "readAttribute" + attribute: "CurrentMaxRate" + response: + value: 0 + + - label: "Reads CurrentMaxRate attribute constraints" + optional: true + command: "readAttribute" + attribute: "CurrentMaxRate" + response: + constraints: + type: uint64 + + - label: "Reads OverrunCount attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "OverrunCount" + response: + value: 0 + + - label: "Reads OverrunCount attribute constraints" + disabled: true + command: "readAttribute" + attribute: "OverrunCount" + response: + constraints: + type: uint64 diff --git a/src/app/tests/suites/certification/Test_TC_WIFIDIAG_3_1.yaml b/src/app/tests/suites/certification/Test_TC_WIFIDIAG_3_1.yaml new file mode 100644 index 00000000000000..ba69ea1d0917c7 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_WIFIDIAG_3_1.yaml @@ -0,0 +1,72 @@ +# Copyright (c) 2021 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. + +name: + 54.2.3. [TC-WIFIDIAG-3.1] Command received functionality with server as DUT + +config: + cluster: "WiFi Network Diagnostics" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + + #Below steps disabled due to issue #13645 + - label: "TH sends ResetCounts command to DUT" + disabled: true + command: "ResetCounts" + + - label: "Reads BeaconLostCount attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "BeaconLostCount" + response: + value: 0 + + - label: "Reads BeaconRxCount attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "BeaconRxCount" + response: + value: 0 + + - label: "Reads PacketMulticastRxCount attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "PacketMulticastRxCount" + response: + value: 0 + + - label: "Reads PacketMulticastTxCount attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "PacketMulticastTxCount" + response: + value: 0 + + - label: "Reads PacketUnicastRxCount attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "PacketUnicastRxCount" + response: + value: 0 + + - label: "Reads PacketUnicastTxCount attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "PacketUnicastTxCount" + response: + value: 0 diff --git a/src/darwin/Framework/CHIP/templates/tests.js b/src/darwin/Framework/CHIP/templates/tests.js index 09c410c0bbfd22..acbd8c6b86a8e5 100644 --- a/src/darwin/Framework/CHIP/templates/tests.js +++ b/src/darwin/Framework/CHIP/templates/tests.js @@ -28,6 +28,10 @@ function getTests() 'Test_TC_BOOL_2_1', ]; + const BridgedActions = [ + 'Test_TC_BRAC_1_1', + ]; + const ColorControl = [ 'Test_TC_CC_1_1', 'Test_TC_CC_2_1', @@ -71,6 +75,11 @@ function getTests() 'Test_TC_EMR_1_1', ]; + const EthernetNetworkDiagnostics = [ + 'Test_TC_ETHDIAG_1_1', + 'Test_TC_ETHDIAG_2_1', + ]; + const FlowMeasurement = [ 'Test_TC_FLW_1_1', 'Test_TC_FLW_2_1', @@ -131,6 +140,10 @@ function getTests() 'Test_TC_OO_2_3', ]; + const PowerSource = [ + 'Test_TC_PS_1_1', + ]; + const PressureMeasurement = [ 'Test_TC_PRS_1_1', 'Test_TC_PRS_2_1', @@ -149,6 +162,11 @@ function getTests() 'Test_TC_RH_2_2', ]; + const Switch = [ + 'Test_TC_SWTCH_2_1', + 'Test_TC_SWTCH_2_2', + ]; + const TemperatureMeasurement = [ 'Test_TC_TM_1_1', 'Test_TC_TM_2_1', @@ -171,6 +189,11 @@ function getTests() 'Test_TC_DIAGTH_1_1', ]; + const WiFiNetworkDiagnostics = [ + 'Test_TC_WIFIDIAG_1_1', + 'Test_TC_WIFIDIAG_3_1', + ]; + const WindowCovering = [ 'Test_TC_WNCV_1_1', 'Test_TC_WNCV_2_1', @@ -210,23 +233,28 @@ function getTests() const tests = [ BinaryInput, // BooleanState, // + BridgedActions, // ColorControl, // DeviceDiscovery, // DeviceManagement, // ElectricalMeasurement, // + EthernetNetworkDiagnostics, // FlowMeasurement, // IlluminanceMeasurement, // LevelControl, // MediaControl, // OccupancySensing, // OnOff, // + PowerSource, // PressureMeasurement, // PumpConfigurationControl, // RelativeHumidityMeasurement, // + Switch, // TemperatureMeasurement, // Thermostat, // ThermostatUserConfiguration, // ThreadNetworkDiagnostics, // + WiFiNetworkDiagnostics, // WindowCovering, // Others, // SoftwareDiagnostics, // diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index 0ac11afb64aa39..784f77cfc82a02 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -1001,6 +1001,58 @@ - (void)testSendClusterTest_TC_BOOL_2_1_000004_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTest_TC_BRAC_1_1_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_BRAC_1_1_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestBridgedActions * cluster = [[CHIPTestBridgedActions alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 1U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_BRAC_1_1_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestBridgedActions * cluster = [[CHIPTestBridgedActions alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterTest_TC_CC_1_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; @@ -10424,6 +10476,24 @@ - (void)testSendClusterTest_TC_EMR_1_1_000004_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTest_TC_ETHDIAG_1_1_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_ETHDIAG_2_1_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterTest_TC_FLW_1_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; @@ -15939,6 +16009,124 @@ - (void)testSendClusterTest_TC_OO_2_3_000046_Off [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTest_TC_PS_1_1_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PS_1_1_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 1U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PS_1_1_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PS_1_1_000003_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id clusterRevisionArgument; + clusterRevisionArgument = [NSNumber numberWithUnsignedShort:1U]; + [cluster + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PS_1_1_000004_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 1U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PS_1_1_000005_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterTest_TC_PRS_1_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; @@ -18111,7 +18299,7 @@ - (void)testSendClusterTest_TC_RH_2_2_000002_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_TM_1_1_000000_WaitForCommissionee +- (void)testSendClusterTest_TC_SWTCH_2_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; @@ -18119,25 +18307,23 @@ - (void)testSendClusterTest_TC_TM_1_1_000000_WaitForCommissionee WaitForCommissionee(expectation, queue); [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_TM_1_1_000001_ReadAttribute +- (void)testSendClusterTest_TC_SWTCH_2_1_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read NumberOfPositions attribute"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; + CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeNumberOfPositionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read NumberOfPositions attribute Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 3U); + XCTAssertEqual([actualValue unsignedCharValue], 2); } [expectation fulfill]; @@ -18145,71 +18331,75 @@ - (void)testSendClusterTest_TC_TM_1_1_000001_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_TM_1_1_000002_ReadAttribute +- (void)testSendClusterTest_TC_SWTCH_2_1_000002_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read NumberOfPositions attribute"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; + CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + [cluster readAttributeNumberOfPositionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read NumberOfPositions attribute Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 2); + } + } + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_TM_1_1_000003_WriteAttribute +- (void)testSendClusterTest_TC_SWTCH_2_1_000003_ReadAttribute { - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read CurrentPosition attribute"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; + CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id clusterRevisionArgument; - clusterRevisionArgument = [NSNumber numberWithUnsignedShort:3U]; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeCurrentPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read CurrentPosition attribute Error: %@", err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedCharValue], 0); + } + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_TM_1_1_000004_ReadAttribute +- (void)testSendClusterTest_TC_SWTCH_2_1_000004_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read CurrentPosition attribute"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; + CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeCurrentPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read CurrentPosition attribute Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 3U); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } } [expectation fulfill]; @@ -18217,45 +18407,540 @@ - (void)testSendClusterTest_TC_TM_1_1_000004_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - -- (void)testSendClusterTest_TC_TM_2_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_TM_2_1_000001_ReadAttribute +- (void)testSendClusterTest_TC_SWTCH_2_1_000005_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MeasuredValue"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read MultiPressMax attribute"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; + CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MeasuredValue Error: %@", err); + [cluster readAttributeMultiPressMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read MultiPressMax attribute Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedCharValue], 2); + } + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_TM_2_1_000002_ReadAttribute +- (void)testSendClusterTest_TC_SWTCH_2_1_000006_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: Tolerance"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read MultiPressMax attribute"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; + CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeMultiPressMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read MultiPressMax attribute Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 2); + } + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_SWTCH_2_2_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000001_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Set up subscription to SwitchLatched event"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000002_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator sets switch to first position"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000003_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read CurrentPosition attribute"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeCurrentPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read CurrentPosition attribute Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedCharValue], 0); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000004_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator sets switch to second position"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000005_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Set up subscription to InitialPress event"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000006_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator does not operate switch"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000007_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read CurrentPosition attribute"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestSwitch * cluster = [[CHIPTestSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeCurrentPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read CurrentPosition attribute Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedCharValue], 0); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000008_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator sets switch to second position"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000009_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator does not operate switch (release switch)"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000010_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Set up subscription to InitialPress and ShortRelease events"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000011_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator does not operate switch"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000012_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator operates switch (press briefly)"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000013_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator releases switch"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000014_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator operates switch for 5 seconds"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000015_WaitForMs +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 3000ms"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForMs(expectation, queue, 3000); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000016_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator releases switch"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000017_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Set up subscription to InitialPress, LongPress, ShortRelease, LongRelease events"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000018_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator does not operate switch"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000019_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator operates switch (press briefly)"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000020_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator releases switch"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000021_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator operates switch for 5 seconds"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000022_WaitForMs +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 3000ms"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForMs(expectation, queue, 3000); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000023_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator releases switch"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000024_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt( + expectation, queue, @"Set up subscription to InitialPress, ShortRelease, MultiPressOngoing, MultiPressComplete events"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000025_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator does not operate switch"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000026_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator operates switch (press briefly)"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000027_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator releases switch"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000028_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator operates switch (press briefly)"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000029_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator releases switch"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000030_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator operates switch again (press briefly)"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000031_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator releases switch"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000032_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator operates switch again (press briefly)"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000033_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator releases switch"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000034_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator operates switch again (press briefly)"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000035_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator releases switch"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000036_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator operates switch again (press briefly)"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_SWTCH_2_2_000037_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"User interaction needed"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"Operator releases switch"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_TM_1_1_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TM_1_1_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 3U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TM_1_1_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TM_1_1_000003_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + id clusterRevisionArgument; + clusterRevisionArgument = [NSNumber numberWithUnsignedShort:3U]; + [cluster + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TM_1_1_000004_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 3U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_TM_2_1_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TM_2_1_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MeasuredValue"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: MeasuredValue Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TM_2_1_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional attribute: Tolerance"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:queue]; XCTAssertNotNil(cluster); [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -22133,6 +22818,81 @@ - (void)testSendClusterTest_TC_DIAGTH_1_1_000004_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTest_TC_WIFIDIAG_1_1_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_WIFIDIAG_1_1_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Reads CurrentMaxRate attribute from DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestWiFiNetworkDiagnostics * cluster = [[CHIPTestWiFiNetworkDiagnostics alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeCurrentMaxRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentMaxRate attribute from DUT Error: %@", err); + + if (err.code == CHIPErrorCodeUnsupportedAttribute) { + [expectation fulfill]; + return; + } + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedLongLongValue], 0ULL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_WIFIDIAG_1_1_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Reads CurrentMaxRate attribute constraints"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestWiFiNetworkDiagnostics * cluster = [[CHIPTestWiFiNetworkDiagnostics alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeCurrentMaxRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentMaxRate attribute constraints Error: %@", err); + + if (err.code == CHIPErrorCodeUnsupportedAttribute) { + [expectation fulfill]; + return; + } + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_WIFIDIAG_3_1_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterTest_TC_WNCV_1_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index bff0c88cffa561..1b9df2687ea5d3 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -37,6 +37,7 @@ class TestList : public Command printf("Test_TC_BI_2_2\n"); printf("Test_TC_BOOL_1_1\n"); printf("Test_TC_BOOL_2_1\n"); + printf("Test_TC_BRAC_1_1\n"); printf("Test_TC_CC_1_1\n"); printf("Test_TC_CC_2_1\n"); printf("Test_TC_CC_3_1\n"); @@ -69,6 +70,8 @@ class TestList : public Command printf("Test_TC_DM_3_1\n"); printf("Test_TC_DM_2_2\n"); printf("Test_TC_EMR_1_1\n"); + printf("Test_TC_ETHDIAG_1_1\n"); + printf("Test_TC_ETHDIAG_2_1\n"); printf("Test_TC_FLW_1_1\n"); printf("Test_TC_FLW_2_1\n"); printf("Test_TC_FLW_2_2\n"); @@ -111,6 +114,7 @@ class TestList : public Command printf("Test_TC_OO_2_1\n"); printf("Test_TC_OO_2_2\n"); printf("Test_TC_OO_2_3\n"); + printf("Test_TC_PS_1_1\n"); printf("Test_TC_PRS_1_1\n"); printf("Test_TC_PRS_2_1\n"); printf("Test_TC_PCC_1_1\n"); @@ -120,6 +124,8 @@ class TestList : public Command printf("Test_TC_RH_1_1\n"); printf("Test_TC_RH_2_1\n"); printf("Test_TC_RH_2_2\n"); + printf("Test_TC_SWTCH_2_1\n"); + printf("Test_TC_SWTCH_2_2\n"); printf("Test_TC_TM_1_1\n"); printf("Test_TC_TM_2_1\n"); printf("Test_TC_TM_2_2\n"); @@ -130,6 +136,8 @@ class TestList : public Command printf("Test_TC_TSUIC_2_1\n"); printf("Test_TC_TSUIC_2_2\n"); printf("Test_TC_DIAGTH_1_1\n"); + printf("Test_TC_WIFIDIAG_1_1\n"); + printf("Test_TC_WIFIDIAG_3_1\n"); printf("Test_TC_WNCV_1_1\n"); printf("Test_TC_WNCV_2_1\n"); printf("Test_TC_WNCV_2_2\n"); @@ -1591,6 +1599,140 @@ class Test_TC_BOOL_2_1 : public TestCommand } }; +class Test_TC_BRAC_1_1 : public TestCommand +{ +public: + Test_TC_BRAC_1_1() : TestCommand("Test_TC_BRAC_1_1"), mTestIndex(0) + { + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_BRAC_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_BRAC_1_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BRAC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 3; + + chip::Optional mCluster; + chip::Optional mEndpoint; + + static void OnFailureCallback_1(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_1(clusterRevision); + } + + static void OnFailureCallback_2(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_2(status); + } + + static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_2(clusterRevision); + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::BridgedActionsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(uint16_t clusterRevision) + { + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); + + NextTest(); + } + + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::BridgedActionsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2(uint16_t clusterRevision) + { + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + NextTest(); + } +}; + class Test_TC_CC_1_1 : public TestCommand { public: @@ -16338,6 +16480,140 @@ class Test_TC_EMR_1_1 : public TestCommand } }; +class Test_TC_ETHDIAG_1_1 : public TestCommand +{ +public: + Test_TC_ETHDIAG_1_1() : TestCommand("Test_TC_ETHDIAG_1_1"), mTestIndex(0) + { + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_ETHDIAG_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_ETHDIAG_1_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ETHDIAG_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 1; + + chip::Optional mCluster; + chip::Optional mEndpoint; + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(); + } +}; + +class Test_TC_ETHDIAG_2_1 : public TestCommand +{ +public: + Test_TC_ETHDIAG_2_1() : TestCommand("Test_TC_ETHDIAG_2_1"), mTestIndex(0) + { + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_ETHDIAG_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_ETHDIAG_2_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ETHDIAG_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 1; + + chip::Optional mCluster; + chip::Optional mEndpoint; + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(); + } +}; + class Test_TC_FLW_1_1 : public TestCommand { public: @@ -26599,6 +26875,241 @@ class Test_TC_OO_2_3 : public TestCommand void OnSuccessResponse_46() { NextTest(); } }; +class Test_TC_PS_1_1 : public TestCommand +{ +public: + Test_TC_PS_1_1() : TestCommand("Test_TC_PS_1_1"), mTestIndex(0) + { + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_PS_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PS_1_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PS_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : reads back global attribute: ClusterRevision\n"); + err = TestReadsBackGlobalAttributeClusterRevision_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_5(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 6; + + chip::Optional mCluster; + chip::Optional mEndpoint; + + static void OnFailureCallback_1(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_1(clusterRevision); + } + + static void OnFailureCallback_2(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_2(status); + } + + static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_2(clusterRevision); + } + + static void OnFailureCallback_3(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_3(status); + } + + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + + static void OnFailureCallback_4(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_4(status); + } + + static void OnSuccessCallback_4(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_4(clusterRevision); + } + + static void OnFailureCallback_5(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_5(status); + } + + static void OnSuccessCallback_5(void * context, const chip::app::DataModel::DecodableList & attributeList) + { + (static_cast(context))->OnSuccessResponse_5(attributeList); + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PowerSourceClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(uint16_t clusterRevision) + { + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); + + NextTest(); + } + + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PowerSourceClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2(uint16_t clusterRevision) + { + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + NextTest(); + } + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PowerSourceClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint16_t clusterRevisionArgument; + clusterRevisionArgument = 1U; + + ReturnErrorOnFailure(cluster.WriteAttribute( + clusterRevisionArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_3(EmberAfStatus status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + } + + void OnSuccessResponse_3() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PowerSourceClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_4, OnFailureCallback_4)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_4(uint16_t clusterRevision) + { + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); + + NextTest(); + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_5() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PowerSourceClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_5, OnFailureCallback_5)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_5(const chip::app::DataModel::DecodableList & attributeList) + { + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + NextTest(); + } +}; + class Test_TC_PRS_1_1 : public TestCommand { public: @@ -30182,6 +30693,762 @@ class Test_TC_RH_2_2 : public TestCommand } }; +class Test_TC_SWTCH_2_1 : public TestCommand +{ +public: + Test_TC_SWTCH_2_1() : TestCommand("Test_TC_SWTCH_2_1"), mTestIndex(0) + { + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_SWTCH_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_SWTCH_2_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_SWTCH_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read NumberOfPositions attribute\n"); + err = TestReadNumberOfPositionsAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read NumberOfPositions attribute\n"); + err = TestReadNumberOfPositionsAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read CurrentPosition attribute\n"); + err = TestReadCurrentPositionAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Read CurrentPosition attribute\n"); + err = TestReadCurrentPositionAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read MultiPressMax attribute\n"); + err = TestReadMultiPressMaxAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read MultiPressMax attribute\n"); + err = TestReadMultiPressMaxAttribute_6(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 7; + + chip::Optional mCluster; + chip::Optional mEndpoint; + + static void OnFailureCallback_1(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context, uint8_t numberOfPositions) + { + (static_cast(context))->OnSuccessResponse_1(numberOfPositions); + } + + static void OnFailureCallback_2(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_2(status); + } + + static void OnSuccessCallback_2(void * context, uint8_t numberOfPositions) + { + (static_cast(context))->OnSuccessResponse_2(numberOfPositions); + } + + static void OnFailureCallback_3(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_3(status); + } + + static void OnSuccessCallback_3(void * context, uint8_t currentPosition) + { + (static_cast(context))->OnSuccessResponse_3(currentPosition); + } + + static void OnFailureCallback_4(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_4(status); + } + + static void OnSuccessCallback_4(void * context, uint8_t currentPosition) + { + (static_cast(context))->OnSuccessResponse_4(currentPosition); + } + + static void OnFailureCallback_5(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_5(status); + } + + static void OnSuccessCallback_5(void * context, uint8_t multiPressMax) + { + (static_cast(context))->OnSuccessResponse_5(multiPressMax); + } + + static void OnFailureCallback_6(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_6(status); + } + + static void OnSuccessCallback_6(void * context, uint8_t multiPressMax) + { + (static_cast(context))->OnSuccessResponse_6(multiPressMax); + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(); + } + + CHIP_ERROR TestReadNumberOfPositionsAttribute_1() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::SwitchClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(uint8_t numberOfPositions) + { + VerifyOrReturn(CheckValue("numberOfPositions", numberOfPositions, 2)); + + NextTest(); + } + + CHIP_ERROR TestReadNumberOfPositionsAttribute_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::SwitchClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2(uint8_t numberOfPositions) + { + VerifyOrReturn(CheckConstraintType("numberOfPositions", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("numberOfPositions", numberOfPositions, 2)); + NextTest(); + } + + CHIP_ERROR TestReadCurrentPositionAttribute_3() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::SwitchClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_3, OnFailureCallback_3)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_3(uint8_t currentPosition) + { + VerifyOrReturn(CheckValue("currentPosition", currentPosition, 0)); + + NextTest(); + } + + CHIP_ERROR TestReadCurrentPositionAttribute_4() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::SwitchClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_4, OnFailureCallback_4)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_4(uint8_t currentPosition) + { + VerifyOrReturn(CheckConstraintType("currentPosition", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("currentPosition", currentPosition, 0)); + NextTest(); + } + + CHIP_ERROR TestReadMultiPressMaxAttribute_5() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::SwitchClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_5, OnFailureCallback_5)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_5(uint8_t multiPressMax) + { + VerifyOrReturn(CheckValue("multiPressMax", multiPressMax, 2)); + + NextTest(); + } + + CHIP_ERROR TestReadMultiPressMaxAttribute_6() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::SwitchClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_6, OnFailureCallback_6)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_6(uint8_t multiPressMax) + { + VerifyOrReturn(CheckConstraintType("multiPressMax", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("multiPressMax", multiPressMax, 2)); + NextTest(); + } +}; + +class Test_TC_SWTCH_2_2 : public TestCommand +{ +public: + Test_TC_SWTCH_2_2() : TestCommand("Test_TC_SWTCH_2_2"), mTestIndex(0) + { + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_SWTCH_2_2() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_SWTCH_2_2\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_SWTCH_2_2\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : User interaction needed\n"); + err = TestUserInteractionNeeded_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : User interaction needed\n"); + err = TestUserInteractionNeeded_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read CurrentPosition attribute\n"); + err = TestReadCurrentPositionAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : User interaction needed\n"); + err = TestUserInteractionNeeded_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : User interaction needed\n"); + err = TestUserInteractionNeeded_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : User interaction needed\n"); + err = TestUserInteractionNeeded_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read CurrentPosition attribute\n"); + err = TestReadCurrentPositionAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : User interaction needed\n"); + err = TestUserInteractionNeeded_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : User interaction needed\n"); + err = TestUserInteractionNeeded_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : User interaction needed\n"); + err = TestUserInteractionNeeded_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : User interaction needed\n"); + err = TestUserInteractionNeeded_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : User interaction needed\n"); + err = TestUserInteractionNeeded_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : User interaction needed\n"); + err = TestUserInteractionNeeded_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : User interaction needed\n"); + err = TestUserInteractionNeeded_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Wait 3000ms\n"); + err = TestWait3000ms_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : User interaction needed\n"); + err = TestUserInteractionNeeded_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : User interaction needed\n"); + err = TestUserInteractionNeeded_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : User interaction needed\n"); + err = TestUserInteractionNeeded_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : User interaction needed\n"); + err = TestUserInteractionNeeded_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : User interaction needed\n"); + err = TestUserInteractionNeeded_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : User interaction needed\n"); + err = TestUserInteractionNeeded_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : Wait 3000ms\n"); + err = TestWait3000ms_22(); + break; + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : User interaction needed\n"); + err = TestUserInteractionNeeded_23(); + break; + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : User interaction needed\n"); + err = TestUserInteractionNeeded_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : User interaction needed\n"); + err = TestUserInteractionNeeded_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : User interaction needed\n"); + err = TestUserInteractionNeeded_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : User interaction needed\n"); + err = TestUserInteractionNeeded_27(); + break; + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : User interaction needed\n"); + err = TestUserInteractionNeeded_28(); + break; + case 29: + ChipLogProgress(chipTool, " ***** Test Step 29 : User interaction needed\n"); + err = TestUserInteractionNeeded_29(); + break; + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : User interaction needed\n"); + err = TestUserInteractionNeeded_30(); + break; + case 31: + ChipLogProgress(chipTool, " ***** Test Step 31 : User interaction needed\n"); + err = TestUserInteractionNeeded_31(); + break; + case 32: + ChipLogProgress(chipTool, " ***** Test Step 32 : User interaction needed\n"); + err = TestUserInteractionNeeded_32(); + break; + case 33: + ChipLogProgress(chipTool, " ***** Test Step 33 : User interaction needed\n"); + err = TestUserInteractionNeeded_33(); + break; + case 34: + ChipLogProgress(chipTool, " ***** Test Step 34 : User interaction needed\n"); + err = TestUserInteractionNeeded_34(); + break; + case 35: + ChipLogProgress(chipTool, " ***** Test Step 35 : User interaction needed\n"); + err = TestUserInteractionNeeded_35(); + break; + case 36: + ChipLogProgress(chipTool, " ***** Test Step 36 : User interaction needed\n"); + err = TestUserInteractionNeeded_36(); + break; + case 37: + ChipLogProgress(chipTool, " ***** Test Step 37 : User interaction needed\n"); + err = TestUserInteractionNeeded_37(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 38; + + chip::Optional mCluster; + chip::Optional mEndpoint; + + static void OnFailureCallback_3(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_3(status); + } + + static void OnSuccessCallback_3(void * context, uint8_t currentPosition) + { + (static_cast(context))->OnSuccessResponse_3(currentPosition); + } + + static void OnFailureCallback_7(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_7(status); + } + + static void OnSuccessCallback_7(void * context, uint8_t currentPosition) + { + (static_cast(context))->OnSuccessResponse_7(currentPosition); + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(); + } + + CHIP_ERROR TestUserInteractionNeeded_1() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Set up subscription to SwitchLatched event"); + } + + CHIP_ERROR TestUserInteractionNeeded_2() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator sets switch to first position"); + } + + CHIP_ERROR TestReadCurrentPositionAttribute_3() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::SwitchClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_3, OnFailureCallback_3)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_3(uint8_t currentPosition) + { + VerifyOrReturn(CheckValue("currentPosition", currentPosition, 0)); + + NextTest(); + } + + CHIP_ERROR TestUserInteractionNeeded_4() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator sets switch to second position"); + } + + CHIP_ERROR TestUserInteractionNeeded_5() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Set up subscription to InitialPress event"); + } + + CHIP_ERROR TestUserInteractionNeeded_6() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator does not operate switch"); + } + + CHIP_ERROR TestReadCurrentPositionAttribute_7() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::SwitchClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_7, OnFailureCallback_7)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_7(uint8_t currentPosition) + { + VerifyOrReturn(CheckValue("currentPosition", currentPosition, 0)); + + NextTest(); + } + + CHIP_ERROR TestUserInteractionNeeded_8() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator sets switch to second position"); + } + + CHIP_ERROR TestUserInteractionNeeded_9() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator does not operate switch (release switch)"); + } + + CHIP_ERROR TestUserInteractionNeeded_10() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Set up subscription to InitialPress and ShortRelease events"); + } + + CHIP_ERROR TestUserInteractionNeeded_11() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator does not operate switch"); + } + + CHIP_ERROR TestUserInteractionNeeded_12() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator operates switch (press briefly)"); + } + + CHIP_ERROR TestUserInteractionNeeded_13() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator releases switch"); + } + + CHIP_ERROR TestUserInteractionNeeded_14() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator operates switch for 5 seconds"); + } + + CHIP_ERROR TestWait3000ms_15() + { + SetIdentity(kIdentityAlpha); + return WaitForMs(3000); + } + + CHIP_ERROR TestUserInteractionNeeded_16() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator releases switch"); + } + + CHIP_ERROR TestUserInteractionNeeded_17() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Set up subscription to InitialPress, LongPress, ShortRelease, LongRelease events"); + } + + CHIP_ERROR TestUserInteractionNeeded_18() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator does not operate switch"); + } + + CHIP_ERROR TestUserInteractionNeeded_19() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator operates switch (press briefly)"); + } + + CHIP_ERROR TestUserInteractionNeeded_20() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator releases switch"); + } + + CHIP_ERROR TestUserInteractionNeeded_21() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator operates switch for 5 seconds"); + } + + CHIP_ERROR TestWait3000ms_22() + { + SetIdentity(kIdentityAlpha); + return WaitForMs(3000); + } + + CHIP_ERROR TestUserInteractionNeeded_23() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator releases switch"); + } + + CHIP_ERROR TestUserInteractionNeeded_24() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Set up subscription to InitialPress, ShortRelease, MultiPressOngoing, MultiPressComplete events"); + } + + CHIP_ERROR TestUserInteractionNeeded_25() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator does not operate switch"); + } + + CHIP_ERROR TestUserInteractionNeeded_26() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator operates switch (press briefly)"); + } + + CHIP_ERROR TestUserInteractionNeeded_27() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator releases switch"); + } + + CHIP_ERROR TestUserInteractionNeeded_28() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator operates switch (press briefly)"); + } + + CHIP_ERROR TestUserInteractionNeeded_29() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator releases switch"); + } + + CHIP_ERROR TestUserInteractionNeeded_30() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator operates switch again (press briefly)"); + } + + CHIP_ERROR TestUserInteractionNeeded_31() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator releases switch"); + } + + CHIP_ERROR TestUserInteractionNeeded_32() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator operates switch again (press briefly)"); + } + + CHIP_ERROR TestUserInteractionNeeded_33() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator releases switch"); + } + + CHIP_ERROR TestUserInteractionNeeded_34() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator operates switch again (press briefly)"); + } + + CHIP_ERROR TestUserInteractionNeeded_35() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator releases switch"); + } + + CHIP_ERROR TestUserInteractionNeeded_36() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator operates switch again (press briefly)"); + } + + CHIP_ERROR TestUserInteractionNeeded_37() + { + SetIdentity(kIdentityAlpha); + return UserPrompt("Operator releases switch"); + } +}; + class Test_TC_TM_1_1 : public TestCommand { public: @@ -36216,6 +37483,215 @@ class Test_TC_DIAGTH_1_1 : public TestCommand } }; +class Test_TC_WIFIDIAG_1_1 : public TestCommand +{ +public: + Test_TC_WIFIDIAG_1_1() : TestCommand("Test_TC_WIFIDIAG_1_1"), mTestIndex(0) + { + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_WIFIDIAG_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WIFIDIAG_1_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WIFIDIAG_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Reads CurrentMaxRate attribute from DUT\n"); + err = TestReadsCurrentMaxRateAttributeFromDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads CurrentMaxRate attribute constraints\n"); + err = TestReadsCurrentMaxRateAttributeConstraints_2(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 3; + + chip::Optional mCluster; + chip::Optional mEndpoint; + + static void OnFailureCallback_1(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context, uint64_t currentMaxRate) + { + (static_cast(context))->OnSuccessResponse_1(currentMaxRate); + } + + static void OnFailureCallback_2(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_2(status); + } + + static void OnSuccessCallback_2(void * context, uint64_t currentMaxRate) + { + (static_cast(context))->OnSuccessResponse_2(currentMaxRate); + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(); + } + + CHIP_ERROR TestReadsCurrentMaxRateAttributeFromDut_1() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::WiFiNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_1(EmberAfStatus status) + { + (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); + } + + void OnSuccessResponse_1(uint64_t currentMaxRate) + { + VerifyOrReturn(CheckValue("currentMaxRate", currentMaxRate, 0ULL)); + + NextTest(); + } + + CHIP_ERROR TestReadsCurrentMaxRateAttributeConstraints_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::WiFiNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(EmberAfStatus status) + { + (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); + } + + void OnSuccessResponse_2(uint64_t currentMaxRate) + { + VerifyOrReturn(CheckConstraintType("currentMaxRate", "", "uint64")); + NextTest(); + } +}; + +class Test_TC_WIFIDIAG_3_1 : public TestCommand +{ +public: + Test_TC_WIFIDIAG_3_1() : TestCommand("Test_TC_WIFIDIAG_3_1"), mTestIndex(0) + { + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_WIFIDIAG_3_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WIFIDIAG_3_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WIFIDIAG_3_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 1; + + chip::Optional mCluster; + chip::Optional mEndpoint; + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(); + } +}; + class Test_TC_WNCV_1_1 : public TestCommand { public: @@ -66594,6 +68070,7 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), @@ -66626,6 +68103,8 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), @@ -66668,6 +68147,7 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), @@ -66677,6 +68157,8 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), @@ -66687,6 +68169,8 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), From 6d6d73380bccc9efb79d813c16fd49eacccc65de Mon Sep 17 00:00:00 2001 From: Narayan Mohanram Date: Thu, 20 Jan 2022 13:34:39 -0800 Subject: [PATCH 03/15] Silabs wifi - chip support for EFR32 - Using WF200 and RS911x (#13193) * EFR32+SiLabs WiFi port - using lock app * Changed Wiseconnect SDK to relative symbolic link * Moved WiFi stuff to efr32_sdk/repo/matter/wifi * added Lighting app to silabs_wifi * Silabs_wifi Lighting-app removed some junk files * Update for building with scripts/examples/gn_efr32_example.sh * Rebased to master - Fixes to AppTask.cpp+BUILD.gn * Merged Thread and WiFi apps (Lighting and Windows) into examples/xxx-app/efr32 * Updated lock-app/efr32 to include WiFi build * Fixes to ifdef's in lock-app for efr32 * Removed examples/xx-app/silabs_wifi. Merged into examples/xx-app/efr32 * updated build-script for efr32 to use wifi * WiFi fixes to initialize RS911X for EFR32 * Update for WiFi port to sync with SiLabs work * WiFi - Added saving SSID/PSK/Security * Cleaned up comments in BUILD.gn * Restyled by whitespace * Restyled by clang-format * Restyled by gn * Restyled by shellharden * Restyled by shfmt * Restyled by clang-format * include file reference was changed to * Added WF200 files and changed Defines to match master * Fixed issue with build script that does not handle ARG3/4 Co-authored-by: Restyled.io --- .github/workflows/examples-efr32.yaml | 2 +- config/efr32/toolchain/BUILD.gn | 6 + examples/lighting-app/efr32/BUILD.gn | 110 +++- .../efr32/build_for_wifi_args.gni | 22 + .../efr32/build_for_wifi_gnfile.gn | 28 + .../lighting-app/efr32/include/AppConfig.h | 2 +- .../efr32/include/FreeRTOSConfig.h | 4 + examples/lighting-app/efr32/src/AppTask.cpp | 60 ++- examples/lighting-app/efr32/src/main.cpp | 23 +- examples/lighting-app/efr32/with_pw_rpc.gni | 1 - examples/lock-app/efr32/BUILD.gn | 108 +++- .../lock-app/efr32/build_for_wifi_args.gni | 22 + .../lock-app/efr32/build_for_wifi_gnfile.gn | 28 + examples/lock-app/efr32/include/AppConfig.h | 2 +- examples/lock-app/efr32/src/AppTask.cpp | 57 +- examples/lock-app/efr32/src/main.cpp | 13 +- examples/platform/efr32/uart.cpp | 8 +- .../window-app/common/include/WindowApp.h | 9 +- examples/window-app/common/src/WindowApp.cpp | 16 +- examples/window-app/efr32/BUILD.gn | 115 ++++- .../window-app/efr32/build_for_wifi_args.gni | 22 + .../window-app/efr32/build_for_wifi_gnfile.gn | 28 + .../window-app/efr32/src/WindowAppImpl.cpp | 38 +- examples/window-app/efr32/src/main.cpp | 17 +- scripts/examples/gn_efr32_example.sh | 85 ++- src/lwip/efr32/lwipopts-rs911x.h | 203 ++++++++ src/lwip/efr32/lwipopts-thread.h | 182 +++++++ src/lwip/efr32/lwipopts-wf200.h | 203 ++++++++ src/lwip/efr32/lwipopts.h | 185 +------ src/platform/EFR32/BUILD.gn | 8 +- src/platform/EFR32/CHIPDevicePlatformConfig.h | 11 +- src/platform/EFR32/CHIPDevicePlatformEvent.h | 41 +- .../EFR32/ConfigurationManagerImpl.cpp | 20 + src/platform/EFR32/ConfigurationManagerImpl.h | 2 + src/platform/EFR32/ConnectivityManagerImpl.h | 95 ++++ .../EFR32/ConnectivityManagerImpl_WIFI.cpp | 485 ++++++++++++++++++ .../DeviceNetworkProvisioningDelegateImpl.cpp | 19 + .../DeviceNetworkProvisioningDelegateImpl.h | 4 + .../EFR32/DiagnosticDataProviderImpl.cpp | 8 +- src/platform/EFR32/EFR32Config.h | 7 +- src/platform/EFR32/InetPlatformConfig.h | 15 +- src/platform/EFR32/PlatformManagerImpl.cpp | 68 +++ src/platform/EFR32/PlatformManagerImpl.h | 6 + src/platform/EFR32/ServiceProvisioning.cpp | 56 ++ src/platform/EFR32/ServiceProvisioning.h | 25 + src/platform/EFR32/wifi_args.gni | 46 ++ third_party/efr32_sdk/efr32_sdk.gni | 23 + third_party/wiseconnect-wifi-bt-sdk | 1 + 48 files changed, 2230 insertions(+), 309 deletions(-) create mode 100644 examples/lighting-app/efr32/build_for_wifi_args.gni create mode 100644 examples/lighting-app/efr32/build_for_wifi_gnfile.gn create mode 100644 examples/lock-app/efr32/build_for_wifi_args.gni create mode 100644 examples/lock-app/efr32/build_for_wifi_gnfile.gn create mode 100644 examples/window-app/efr32/build_for_wifi_args.gni create mode 100644 examples/window-app/efr32/build_for_wifi_gnfile.gn create mode 100644 src/lwip/efr32/lwipopts-rs911x.h create mode 100644 src/lwip/efr32/lwipopts-thread.h create mode 100644 src/lwip/efr32/lwipopts-wf200.h create mode 100644 src/platform/EFR32/ConnectivityManagerImpl_WIFI.cpp create mode 100644 src/platform/EFR32/ServiceProvisioning.cpp create mode 100644 src/platform/EFR32/ServiceProvisioning.h create mode 100644 src/platform/EFR32/wifi_args.gni create mode 120000 third_party/wiseconnect-wifi-bt-sdk diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index cebd9102383422..88818ec8693c55 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -82,7 +82,7 @@ jobs: timeout-minutes: 10 run: | scripts/examples/gn_efr32_example.sh examples/lighting-app/efr32/ out/lighting_app_debug_rpc BRD4161A \ - -args='import("//with_pw_rpc.gni")' + 'import("//with_pw_rpc.gni")' .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py efr32 BRD4161A+rpc lighting-app \ out/lighting_app_debug_rpc/BRD4161A/chip-efr32-lighting-example.out /tmp/bloat_reports/ - name: Build example EFR32 Window Covering for BRD4161A diff --git a/config/efr32/toolchain/BUILD.gn b/config/efr32/toolchain/BUILD.gn index 76747ede876a5c..8f448eb44838b9 100644 --- a/config/efr32/toolchain/BUILD.gn +++ b/config/efr32/toolchain/BUILD.gn @@ -37,3 +37,9 @@ arm_toolchain("efr32_window_app") { import("${chip_root}/examples/window-app/efr32/args.gni") } } +arm_toolchain("rs911x_lock_app") { + toolchain_args = { + current_os = "freertos" + import("${chip_root}/examples/lock-app/rs911x/args.gni") + } +} diff --git a/examples/lighting-app/efr32/BUILD.gn b/examples/lighting-app/efr32/BUILD.gn index a248836a3f7efa..b9bbca9a8dc80f 100644 --- a/examples/lighting-app/efr32/BUILD.gn +++ b/examples/lighting-app/efr32/BUILD.gn @@ -44,6 +44,13 @@ declare_args() { # Monitor & log memory usage at runtime. enable_heap_monitoring = false + + # Wifi related stuff - they are overriden by gn -args="use_wf200=true" + use_wf200 = false + use_rs911x = false + use_rs911x_sockets = false + sl_wfx_config_softap = false + sl_wfx_config_scan = false } show_qr_code = true @@ -52,6 +59,26 @@ show_qr_code = true if (efr32_board == "BRD4166A" || efr32_board == "BRD4180A") { show_qr_code = false } +if (use_rs911x || use_wf200) { + wifi_sdk_dir = "${chip_root}/third_party/efr32_sdk/repo/matter/wifi" + if (use_rs911x) { + wiseconnect_sdk_root = "${chip_root}/third_party/wiseconnect-wifi-bt-sdk" + import("${wifi_sdk_dir}/rs911x/rs911x.gni") + } else { + import("${wifi_sdk_dir}/wf200/wf200.gni") + } +} +efr32_lwip_defs = [ "LWIP_NETIF_API=1" ] +if (use_rs911x || use_wf200) { + efr32_lwip_defs += [ + "LWIP_IPV4=1", + "LWIP_ARP=1", + "LWIP_ICMP=1", + "LWIP_DHCP=1", + "LWIP_IPV6_ND=1", + "LWIP_IGMP=1", + ] +} efr32_sdk("sdk") { sources = [ @@ -63,6 +90,7 @@ efr32_sdk("sdk") { "${chip_root}/src/platform/EFR32", "${efr32_project_dir}/include", "${examples_plat_dir}", + "${chip_root}/src/lib", ] defines = [ @@ -77,10 +105,36 @@ efr32_sdk("sdk") { "PW_RPC_ENABLED", ] } + if (use_rs911x) { + defines += rs911x_defs + include_dirs += rs911x_plat_incs + } else if (use_wf200) { + defines += wf200_defs + include_dirs += wf200_plat_incs + } else { + defines += [ "SL_HEAP_SIZE=20480" ] + } + if (use_rs911x_sockets) { + include_dirs += [ "${examples_plat_dir}/wifi/rsi-sockets" ] + defines += rs911x_sock_defs + } else { + # Using LWIP instead of the native TCP/IP stack + # Thread also uses LWIP + # + defines += efr32_lwip_defs + } + if (sl_wfx_config_softap) { + defines += "SL_WFX_CONFIG_SOFTAP" + } + if (sl_wfx_config_scan) { + defines += "SL_WFX_CONFIG_SCAN" + } } efr32_executable("lighting_app") { output_name = "chip-efr32-lighting-example.out" + include_dirs = [ "include" ] + defines = [] sources = [ "${examples_plat_dir}/LEDWidget.cpp", @@ -99,26 +153,50 @@ efr32_executable("lighting_app") { "${chip_root}/examples/lighting-app/lighting-common", "${chip_root}/src/lib", "${chip_root}/src/setup_payload", - "${chip_root}/third_party/openthread/platforms:libopenthread-platform", - "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", - "${examples_plat_dir}:efr-matter-shell", ] - - if (chip_openthread_ftd) { - deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", - "${chip_root}/third_party/openthread/repo:libopenthread-ftd", - ] - } else { + if (!use_rs911x && !use_wf200) { deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", - "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + "${chip_root}/third_party/openthread/platforms:libopenthread-platform", + "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", + "${examples_plat_dir}:efr-matter-shell", ] + if (chip_openthread_ftd) { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", + "${chip_root}/third_party/openthread/repo:libopenthread-ftd", + ] + } else { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", + "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + ] + } + } + if (use_rs911x) { + sources += rs911x_src_plat + + # All the stuff from wiseconnect + sources += rs911x_src_sapi + + # Apparently - the rsi library needs this (though we may not use use it) + sources += rs911x_src_sock + include_dirs += rs911x_inc_plat + + if (use_rs911x_sockets) { + # + # Using native sockets inside RS911x + # + include_dirs += rs911x_sock_inc + } else { + # + # We use LWIP - not built-in sockets + # + sources += rs911x_src_lwip + } + } else if (use_wf200) { + sources += wf200_plat_src + include_dirs += wf200_plat_incs } - - include_dirs = [ "include" ] - - defines = [] if (show_qr_code) { sources += [ "${examples_plat_dir}/display/lcd.c" ] diff --git a/examples/lighting-app/efr32/build_for_wifi_args.gni b/examples/lighting-app/efr32/build_for_wifi_args.gni new file mode 100644 index 00000000000000..04529fddd2076a --- /dev/null +++ b/examples/lighting-app/efr32/build_for_wifi_args.gni @@ -0,0 +1,22 @@ +# Copyright (c) 2020 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. +import("//build_overrides/chip.gni") +import("//build_overrides/pigweed.gni") + +efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") +chip_enable_openthread = false +import("${chip_root}/src/platform/EFR32/wifi_args.gni") + +pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" +pw_assert_BACKEND = "$dir_pw_assert_log" diff --git a/examples/lighting-app/efr32/build_for_wifi_gnfile.gn b/examples/lighting-app/efr32/build_for_wifi_gnfile.gn new file mode 100644 index 00000000000000..9752ee73e7c91d --- /dev/null +++ b/examples/lighting-app/efr32/build_for_wifi_gnfile.gn @@ -0,0 +1,28 @@ +# Copyright (c) 2020 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. + +import("//build_overrides/build.gni") + +# The location of the build configuration file. +buildconfig = "${build_root}/config/BUILDCONFIG.gn" + +# CHIP uses angle bracket includes. +check_system_includes = true + +default_args = { + target_cpu = "arm" + target_os = "freertos" + use_thread = false + import("//build_for_wifi_args.gni") +} diff --git a/examples/lighting-app/efr32/include/AppConfig.h b/examples/lighting-app/efr32/include/AppConfig.h index efe17b3b39288f..91501d889a6234 100644 --- a/examples/lighting-app/efr32/include/AppConfig.h +++ b/examples/lighting-app/efr32/include/AppConfig.h @@ -21,7 +21,7 @@ // ---- Lighting Example App Config ---- -#define APP_TASK_NAME "APP" +#define APP_TASK_NAME "Lit" // Time it takes in ms for the simulated actuator to move from one // state to another. diff --git a/examples/lighting-app/efr32/include/FreeRTOSConfig.h b/examples/lighting-app/efr32/include/FreeRTOSConfig.h index 3d241f9a24ce0e..17bc3975fe19af 100644 --- a/examples/lighting-app/efr32/include/FreeRTOSConfig.h +++ b/examples/lighting-app/efr32/include/FreeRTOSConfig.h @@ -237,7 +237,11 @@ See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ #define configENABLE_BACKWARD_COMPATIBILITY (1) #define configSUPPORT_STATIC_ALLOCATION (1) #define configSUPPORT_DYNAMIC_ALLOCATION (1) +#ifdef SL_WIFI +#define configTOTAL_HEAP_SIZE ((size_t)(28 * 1024)) +#else #define configTOTAL_HEAP_SIZE ((size_t)(20 * 1024)) +#endif /* Optional functions - most linkers will remove unused functions anyway. */ #define INCLUDE_vTaskPrioritySet (1) diff --git a/examples/lighting-app/efr32/src/AppTask.cpp b/examples/lighting-app/efr32/src/AppTask.cpp index 778acda0bd3fc9..acdf7f8c78ea4d 100644 --- a/examples/lighting-app/efr32/src/AppTask.cpp +++ b/examples/lighting-app/efr32/src/AppTask.cpp @@ -51,6 +51,9 @@ #include #include #endif +#ifdef SL_WIFI +#include "wfx_host_events.h" +#endif /* SL_WIFI */ #define FACTORY_RESET_TRIGGER_TIMEOUT 3000 #define FACTORY_RESET_CANCEL_WINDOW_TIMEOUT 3000 @@ -73,9 +76,17 @@ QueueHandle_t sAppEventQueue; LEDWidget sStatusLED; LEDWidget sLightLED; +#ifdef SL_WIFI +bool sIsWiFiProvisioned = false; +bool sIsWiFiEnabled = false; +bool sIsWiFiAttached = false; +#endif /* SL_WIFI */ + +#if CHIP_ENABLE_OPENTHREAD bool sIsThreadProvisioned = false; bool sIsThreadEnabled = false; -bool sHaveBLEConnections = false; +#endif /* CHIP_ENABLE_OPENTHREAD */ +bool sHaveBLEConnections = false; EmberAfIdentifyEffectIdentifier sIdentifyEffect = EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_STOP_EFFECT; @@ -88,6 +99,7 @@ StaticTask_t appTaskStruct; /********************************************************** * Identify Callbacks *********************************************************/ + namespace { void OnTriggerIdentifyEffectCompleted(chip::System::Layer * systemLayer, void * appState) { @@ -208,6 +220,18 @@ CHIP_ERROR AppTask::Init() { CHIP_ERROR err = CHIP_NO_ERROR; +#ifdef SL_WIFI + /* + * Wait for the WiFi to be initialized + */ + EFR32_LOG("APP: Wait WiFi Init"); + while (!wfx_hw_ready()) + { + vTaskDelay(10); + } + EFR32_LOG("APP: Done WiFi Init"); + /* We will init server when we get IP */ +#endif // Init ZCL Data Model chip::Server::GetInstance().Init(); @@ -294,9 +318,16 @@ void AppTask::AppTaskMain(void * pvParameter) // when the CHIP task is busy (e.g. with a long crypto operation). if (PlatformMgr().TryLockChipStack()) { +#ifdef SL_WIFI + sIsWiFiProvisioned = ConnectivityMgr().IsWiFiStationProvisioned(); + sIsWiFiEnabled = ConnectivityMgr().IsWiFiStationEnabled(); + sIsWiFiAttached = ConnectivityMgr().IsWiFiStationConnected(); +#endif /* SL_WIFI */ +#if CHIP_ENABLE_OPENTHREAD sIsThreadProvisioned = ConnectivityMgr().IsThreadProvisioned(); sIsThreadEnabled = ConnectivityMgr().IsThreadEnabled(); - sHaveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0); +#endif /* CHIP_ENABLE_OPENTHREAD */ + sHaveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0); PlatformMgr().UnlockChipStack(); } @@ -333,18 +364,16 @@ void AppTask::AppTaskMain(void * pvParameter) sStatusLED.Blink(300, 700); } } - else if (sIsThreadProvisioned && sIsThreadEnabled) +#if CHIP_ENABLE_OPENTHREAD + if (sIsThreadProvisioned && sIsThreadEnabled) +#else + if (sIsWiFiProvisioned && sIsWiFiEnabled && !sIsWiFiAttached) +#endif { sStatusLED.Blink(950, 50); } - else if (sHaveBLEConnections) - { - sStatusLED.Blink(100, 100); - } - else - { - sStatusLED.Blink(50, 950); - } + else if (sHaveBLEConnections) { sStatusLED.Blink(100, 100); } + else { sStatusLED.Blink(50, 950); } } sStatusLED.Animate(); @@ -484,16 +513,17 @@ void AppTask::FunctionHandler(AppEvent * aEvent) sAppTask.CancelTimer(); sAppTask.mFunction = kFunction_NoneSelected; +#ifdef SL_WIFI + if (!ConnectivityMgr().IsWiFiStationProvisioned()) +#else if (!ConnectivityMgr().IsThreadProvisioned()) +#endif /* !SL_WIFI */ { // Enable BLE advertisements ConnectivityMgr().SetBLEAdvertisingEnabled(true); ConnectivityMgr().SetBLEAdvertisingMode(ConnectivityMgr().kFastAdvertising); } - else - { - EFR32_LOG("Network is already provisioned, Ble advertissement not enabled"); - } + else { EFR32_LOG("Network is already provisioned, Ble advertissement not enabled"); } } else if (sAppTask.mFunctionTimerActive && sAppTask.mFunction == kFunction_FactoryReset) { diff --git a/examples/lighting-app/efr32/src/main.cpp b/examples/lighting-app/efr32/src/main.cpp index 943f0993a7af35..297601ac6f8670 100644 --- a/examples/lighting-app/efr32/src/main.cpp +++ b/examples/lighting-app/efr32/src/main.cpp @@ -48,8 +48,8 @@ #include "lcd.h" #endif -#if CHIP_ENABLE_OPENTHREAD #include +#if CHIP_ENABLE_OPENTHREAD #include #include #include @@ -62,6 +62,10 @@ #include #endif // CHIP_ENABLE_OPENTHREAD +#if defined(RS911X_WIFI) || defined(WF200_WIFI) +#include "wfx_host_events.h" +#endif /* RS911X_WIFI */ + #if PW_RPC_ENABLED #include "Rpc.h" #endif @@ -70,6 +74,7 @@ #include "matter_shell.h" #endif +#define BLE_DEV_NAME "SiLabs-Light" using namespace ::chip; using namespace ::chip::Inet; using namespace ::chip::DeviceLayer; @@ -135,7 +140,7 @@ int main(void) EFR32_LOG("PlatformMgr().InitChipStack() failed"); appError(ret); } - chip::DeviceLayer::ConnectivityMgr().SetBLEDeviceName("EFR32_LIGHT"); + chip::DeviceLayer::ConnectivityMgr().SetBLEDeviceName(BLE_DEV_NAME); #if CHIP_ENABLE_OPENTHREAD EFR32_LOG("Initializing OpenThread stack"); ret = ThreadStackMgr().InitThreadStack(); @@ -160,6 +165,13 @@ int main(void) EFR32_LOG("PlatformMgr().StartEventLoopTask() failed"); appError(ret); } +#ifdef WF200_WIFI + // Start wfx bus communication task. + wfx_bus_start(); +#ifdef SL_WFX_USE_SECURE_LINK + wfx_securelink_task_start(); // start securelink key renegotiation task +#endif // SL_WFX_USE_SECURE_LINK +#endif /* WF200_WIFI */ #if CHIP_ENABLE_OPENTHREAD EFR32_LOG("Starting OpenThread task"); @@ -172,6 +184,13 @@ int main(void) appError(ret); } #endif // CHIP_ENABLE_OPENTHREAD +#ifdef RS911X_WIFI + /* + * Start up any RSI interface stuff + * (Not required) - Note that wfx_wifi_start will deal with + * starting up a rsi task - which will initialize the SPI interface. + */ +#endif EFR32_LOG("Starting App Task"); ret = GetAppTask().StartAppTask(); diff --git a/examples/lighting-app/efr32/with_pw_rpc.gni b/examples/lighting-app/efr32/with_pw_rpc.gni index d0a8f2c0485f06..3922567d5b071a 100644 --- a/examples/lighting-app/efr32/with_pw_rpc.gni +++ b/examples/lighting-app/efr32/with_pw_rpc.gni @@ -23,6 +23,5 @@ efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") chip_enable_pw_rpc = true chip_enable_openthread = true -chip_openthread_ftd = true cpp_standard = "gnu++17" diff --git a/examples/lock-app/efr32/BUILD.gn b/examples/lock-app/efr32/BUILD.gn index 534ce5343e2dde..7dcc8802659fdc 100644 --- a/examples/lock-app/efr32/BUILD.gn +++ b/examples/lock-app/efr32/BUILD.gn @@ -43,6 +43,13 @@ declare_args() { # Monitor & log memory usage at runtime. enable_heap_monitoring = false + + # Wifi related stuff - they are overriden by gn -args="use_wf200=true" + use_wf200 = false + use_rs911x = false + use_rs911x_sockets = false + sl_wfx_config_softap = false + sl_wfx_config_scan = false } show_qr_code = true @@ -51,6 +58,26 @@ show_qr_code = true if (efr32_board == "BRD4166A" || efr32_board == "BRD4180A") { show_qr_code = false } +if (use_rs911x || use_wf200) { + wifi_sdk_dir = "${chip_root}/third_party/efr32_sdk/repo/matter/wifi" + if (use_rs911x) { + wiseconnect_sdk_root = "${chip_root}/third_party/wiseconnect-wifi-bt-sdk" + import("${wifi_sdk_dir}/rs911x/rs911x.gni") + } else { + import("${wifi_sdk_dir}/wf200/wf200.gni") + } +} +efr32_lwip_defs = [ "LWIP_NETIF_API=1" ] +if (use_rs911x || use_wf200) { + efr32_lwip_defs += [ + "LWIP_IPV4=1", + "LWIP_ARP=1", + "LWIP_ICMP=1", + "LWIP_DHCP=1", + "LWIP_IPV6_ND=1", + "LWIP_IGMP=1", + ] +} efr32_sdk("sdk") { sources = [ @@ -62,6 +89,7 @@ efr32_sdk("sdk") { "${chip_root}/src/platform/EFR32", "${efr32_project_dir}/include", "${examples_plat_dir}", + "${chip_root}/src/lib", ] defines = [ @@ -75,10 +103,37 @@ efr32_sdk("sdk") { "PW_RPC_ENABLED", ] } + if (use_rs911x) { + defines += rs911x_defs + include_dirs += rs911x_plat_incs + } else if (use_wf200) { + defines += wf200_defs + include_dirs += wf200_plat_incs + } else { + defines += [ "SL_HEAP_SIZE=20480" ] + } + if (use_rs911x_sockets) { + include_dirs += [ "${examples_plat_dir}/wifi/rsi-sockets" ] + defines += rs911x_sock_defs + } else { + # Using LWIP instead of the native TCP/IP stack + # Thread also uses LWIP + # + defines += efr32_lwip_defs + } + if (sl_wfx_config_softap) { + defines += "SL_WFX_CONFIG_SOFTAP" + } + if (sl_wfx_config_scan) { + defines += "SL_WFX_CONFIG_SCAN" + } } efr32_executable("lock_app") { output_name = "chip-efr32-lock-example.out" + include_dirs = [ "include" ] + + defines = [] sources = [ "${examples_plat_dir}/LEDWidget.cpp", @@ -101,22 +156,49 @@ efr32_executable("lock_app") { "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", "${examples_plat_dir}:efr-matter-shell", ] - - if (chip_openthread_ftd) { - deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", - "${chip_root}/third_party/openthread/repo:libopenthread-ftd", - ] - } else { + if (!use_rs911x && !use_wf200) { deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", - "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + "${chip_root}/third_party/openthread/platforms:libopenthread-platform", + "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", + "${examples_plat_dir}:efr-matter-shell", ] + if (chip_openthread_ftd) { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", + "${chip_root}/third_party/openthread/repo:libopenthread-ftd", + ] + } else { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", + "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + ] + } + } + if (use_rs911x) { + sources += rs911x_src_plat + + # All the stuff from wiseconnect + sources += rs911x_src_sapi + + # Apparently - the rsi library needs this (though we may not use use it) + sources += rs911x_src_sock + include_dirs += rs911x_inc_plat + + if (use_rs911x_sockets) { + # + # Using native sockets inside RS911x + # + include_dirs += rs911x_sock_inc + } else { + # + # We use LWIP - not built-in sockets + # + sources += rs911x_src_lwip + } + } else if (use_wf200) { + sources += wf200_plat_src + include_dirs += wf200_plat_incs } - - include_dirs = [ "include" ] - - defines = [] if (show_qr_code) { sources += [ "${examples_plat_dir}/display/lcd.c" ] diff --git a/examples/lock-app/efr32/build_for_wifi_args.gni b/examples/lock-app/efr32/build_for_wifi_args.gni new file mode 100644 index 00000000000000..04529fddd2076a --- /dev/null +++ b/examples/lock-app/efr32/build_for_wifi_args.gni @@ -0,0 +1,22 @@ +# Copyright (c) 2020 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. +import("//build_overrides/chip.gni") +import("//build_overrides/pigweed.gni") + +efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") +chip_enable_openthread = false +import("${chip_root}/src/platform/EFR32/wifi_args.gni") + +pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" +pw_assert_BACKEND = "$dir_pw_assert_log" diff --git a/examples/lock-app/efr32/build_for_wifi_gnfile.gn b/examples/lock-app/efr32/build_for_wifi_gnfile.gn new file mode 100644 index 00000000000000..9752ee73e7c91d --- /dev/null +++ b/examples/lock-app/efr32/build_for_wifi_gnfile.gn @@ -0,0 +1,28 @@ +# Copyright (c) 2020 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. + +import("//build_overrides/build.gni") + +# The location of the build configuration file. +buildconfig = "${build_root}/config/BUILDCONFIG.gn" + +# CHIP uses angle bracket includes. +check_system_includes = true + +default_args = { + target_cpu = "arm" + target_os = "freertos" + use_thread = false + import("//build_for_wifi_args.gni") +} diff --git a/examples/lock-app/efr32/include/AppConfig.h b/examples/lock-app/efr32/include/AppConfig.h index 77223889639fb1..84b588c4997970 100644 --- a/examples/lock-app/efr32/include/AppConfig.h +++ b/examples/lock-app/efr32/include/AppConfig.h @@ -21,7 +21,7 @@ // ---- Lock Example App Config ---- -#define APP_TASK_NAME "APP" +#define APP_TASK_NAME "Lck" // Time it takes in ms for the simulated actuator to move from one // state to another. diff --git a/examples/lock-app/efr32/src/AppTask.cpp b/examples/lock-app/efr32/src/AppTask.cpp index 0a67f008a94317..a02b834ca0e9eb 100644 --- a/examples/lock-app/efr32/src/AppTask.cpp +++ b/examples/lock-app/efr32/src/AppTask.cpp @@ -47,6 +47,9 @@ #include #include #endif +#ifdef SL_WIFI +#include "wfx_host_events.h" +#endif #define FACTORY_RESET_TRIGGER_TIMEOUT 3000 #define FACTORY_RESET_CANCEL_WINDOW_TIMEOUT 3000 @@ -68,9 +71,17 @@ QueueHandle_t sAppEventQueue; LEDWidget sStatusLED; LEDWidget sLockLED; +#ifdef SL_WIFI +bool sIsWiFiProvisioned = false; +bool sIsWiFiEnabled = false; +bool sIsWiFiAttached = false; +#endif + +#if CHIP_ENABLE_OPENTHREAD bool sIsThreadProvisioned = false; bool sIsThreadEnabled = false; -bool sHaveBLEConnections = false; +#endif +bool sHaveBLEConnections = false; StackType_t appStack[APP_TASK_STACK_SIZE / sizeof(StackType_t)]; StaticTask_t appTaskStruct; @@ -98,6 +109,18 @@ CHIP_ERROR AppTask::StartAppTask() CHIP_ERROR AppTask::Init() { +#ifdef SL_WIFI + /* + * Wait for the WiFi to be initialized + */ + EFR32_LOG("APP: Wait WiFi Init"); + while (!wfx_hw_ready()) + { + vTaskDelay(10); + } + EFR32_LOG("APP: Done WiFi Init"); + /* We will init server when we get IP */ +#endif // Init ZCL Data Model chip::Server::GetInstance().Init(); @@ -185,9 +208,16 @@ void AppTask::AppTaskMain(void * pvParameter) // when the CHIP task is busy (e.g. with a long crypto operation). if (PlatformMgr().TryLockChipStack()) { +#ifdef SL_WIFI + sIsWiFiProvisioned = ConnectivityMgr().IsWiFiStationProvisioned(); + sIsWiFiEnabled = ConnectivityMgr().IsWiFiStationEnabled(); + sIsWiFiAttached = ConnectivityMgr().IsWiFiStationConnected(); +#endif +#if CHIP_ENABLE_OPENTHREAD sIsThreadProvisioned = ConnectivityMgr().IsThreadProvisioned(); sIsThreadEnabled = ConnectivityMgr().IsThreadEnabled(); - sHaveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0); +#endif + sHaveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0); PlatformMgr().UnlockChipStack(); } @@ -205,18 +235,16 @@ void AppTask::AppTaskMain(void * pvParameter) // Otherwise, blink the LED ON for a very short time. if (sAppTask.mFunction != kFunction_FactoryReset) { +#if CHIP_ENABLE_OPENTHREAD if (sIsThreadProvisioned && sIsThreadEnabled) +#else + if (sIsWiFiProvisioned && sIsWiFiEnabled && !sIsWiFiAttached) +#endif { sStatusLED.Blink(950, 50); } - else if (sHaveBLEConnections) - { - sStatusLED.Blink(100, 100); - } - else - { - sStatusLED.Blink(50, 950); - } + else if (sHaveBLEConnections) { sStatusLED.Blink(100, 100); } + else { sStatusLED.Blink(50, 950); } } sStatusLED.Animate(); @@ -356,16 +384,17 @@ void AppTask::FunctionHandler(AppEvent * aEvent) sAppTask.CancelTimer(); sAppTask.mFunction = kFunction_NoneSelected; +#ifdef SL_WIFI + if (!ConnectivityMgr().IsWiFiStationProvisioned()) +#else if (!ConnectivityMgr().IsThreadProvisioned()) +#endif { // Enable BLE advertisements ConnectivityMgr().SetBLEAdvertisingEnabled(true); ConnectivityMgr().SetBLEAdvertisingMode(ConnectivityMgr().kFastAdvertising); } - else - { - EFR32_LOG("Network is already provisioned, Ble advertissement not enabled"); - } + else { EFR32_LOG("Network is already provisioned, Ble advertissement not enabled"); } } else if (sAppTask.mFunctionTimerActive && sAppTask.mFunction == kFunction_FactoryReset) { diff --git a/examples/lock-app/efr32/src/main.cpp b/examples/lock-app/efr32/src/main.cpp index c92b9e71c8b7d5..7e25365142199d 100644 --- a/examples/lock-app/efr32/src/main.cpp +++ b/examples/lock-app/efr32/src/main.cpp @@ -56,8 +56,8 @@ #include "matter_shell.h" #endif -#if CHIP_ENABLE_OPENTHREAD #include +#if CHIP_ENABLE_OPENTHREAD #include #include #include @@ -70,6 +70,10 @@ #include #endif // CHIP_ENABLE_OPENTHREAD +#if defined(RS911X_WIFI) || defined(WF200_WIFI) +#include "wfx_host_events.h" +#endif /* RS911X_WIFI */ + using namespace ::chip; using namespace ::chip::Inet; using namespace ::chip::DeviceLayer; @@ -169,6 +173,13 @@ int main(void) appError(ret); } #endif // CHIP_ENABLE_OPENTHREAD +#ifdef WF200_WIFI + // Start wfx bus communication task. + wfx_bus_start(); +#ifdef SL_WFX_USE_SECURE_LINK + wfx_securelink_task_start(); // start securelink key renegotiation task +#endif // SL_WFX_USE_SECURE_LINK +#endif /* WF200_WIFI */ EFR32_LOG("Starting App Task"); ret = GetAppTask().StartAppTask(); diff --git a/examples/platform/efr32/uart.cpp b/examples/platform/efr32/uart.cpp index 9d3cbc2b1d966d..8d384a9ac657b4 100644 --- a/examples/platform/efr32/uart.cpp +++ b/examples/platform/efr32/uart.cpp @@ -200,7 +200,9 @@ void USART_IRQHandler(void) #ifdef ENABLE_CHIP_SHELL chip::NotifyShellProcessFromISR(); #endif -#ifndef PW_RPC_ENABLED +#if defined(SL_WIFI) + /* TODO */ +#elif !defined(PW_RPC_ENABLED) otSysEventSignalPending(); #endif } @@ -224,7 +226,9 @@ static void UART_rx_callback(UARTDRV_Handle_t handle, Ecode_t transferStatus, ui #ifdef ENABLE_CHIP_SHELL chip::NotifyShellProcessFromISR(); #endif -#ifndef PW_RPC_ENABLED +#if defined(SL_WIFI) + /* TODO */ +#elif !defined(PW_RPC_ENABLED) otSysEventSignalPending(); #endif } diff --git a/examples/window-app/common/include/WindowApp.h b/examples/window-app/common/include/WindowApp.h index e8184e21103b40..f5dc1f582ba35a 100644 --- a/examples/window-app/common/include/WindowApp.h +++ b/examples/window-app/common/include/WindowApp.h @@ -135,10 +135,15 @@ class WindowApp protected: struct StateFlags { +#if CHIP_ENABLE_OPENTHREAD bool isThreadProvisioned = false; bool isThreadEnabled = false; - bool haveBLEConnections = false; - bool isWinking = false; +#else + bool isWiFiProvisioned = false; + bool isWiFiEnabled = false; +#endif + bool haveBLEConnections = false; + bool isWinking = false; }; Cover & GetCover(); diff --git a/examples/window-app/common/src/WindowApp.cpp b/examples/window-app/common/src/WindowApp.cpp index 813ad816a156ad..d69e128257e9f2 100644 --- a/examples/window-app/common/src/WindowApp.cpp +++ b/examples/window-app/common/src/WindowApp.cpp @@ -138,8 +138,11 @@ CHIP_ERROR WindowApp::Run() { StateFlags oldState; +#if CHIP_ENABLE_OPENTHREAD oldState.isThreadProvisioned = !ConnectivityMgr().IsThreadProvisioned(); - +#else + oldState.isWiFiProvisioned = !ConnectivityMgr().IsWiFiStationProvisioned(); +#endif while (true) { ProcessEvents(); @@ -151,13 +154,22 @@ CHIP_ERROR WindowApp::Run() // when the CHIP task is busy (e.g. with a long crypto operation). if (PlatformMgr().TryLockChipStack()) { +#if CHIP_ENABLE_OPENTHREAD mState.isThreadProvisioned = ConnectivityMgr().IsThreadProvisioned(); mState.isThreadEnabled = ConnectivityMgr().IsThreadEnabled(); - mState.haveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0); +#else + mState.isWiFiProvisioned = ConnectivityMgr().IsWiFiStationProvisioned(); + mState.isWiFiEnabled = ConnectivityMgr().IsWiFiStationEnabled(); +#endif + mState.haveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0); PlatformMgr().UnlockChipStack(); } +#if CHIP_ENABLE_OPENTHREAD if (mState.isThreadProvisioned != oldState.isThreadProvisioned) +#else + if (mState.isWiFiProvisioned != oldState.isWiFiProvisioned) +#endif { // Provisioned state changed DispatchEvent(EventId::ProvisionedStateChanged); diff --git a/examples/window-app/efr32/BUILD.gn b/examples/window-app/efr32/BUILD.gn index 40bf9abe5f4545..2f3c814e4a83cb 100644 --- a/examples/window-app/efr32/BUILD.gn +++ b/examples/window-app/efr32/BUILD.gn @@ -37,6 +37,13 @@ declare_args() { # Monitor & log memory usage at runtime. enable_heap_monitoring = false + + # Wifi related stuff - they are overriden by gn -args="use_wf200=true" + use_wf200 = false + use_rs911x = false + use_rs911x_sockets = false + sl_wfx_config_softap = false + sl_wfx_config_scan = false } show_qr_code = true @@ -45,6 +52,26 @@ show_qr_code = true if (efr32_board == "BRD4166A" || efr32_board == "BRD4180A") { show_qr_code = false } +if (use_rs911x || use_wf200) { + wifi_sdk_dir = "${chip_root}/third_party/efr32_sdk/repo/matter/wifi" + if (use_rs911x) { + wiseconnect_sdk_root = "${chip_root}/third_party/wiseconnect-wifi-bt-sdk" + import("${wifi_sdk_dir}/rs911x/rs911x.gni") + } else { + import("${wifi_sdk_dir}/wf200/wf200.gni") + } +} +efr32_lwip_defs = [ "LWIP_NETIF_API=1" ] +if (use_rs911x || use_wf200) { + efr32_lwip_defs += [ + "LWIP_IPV4=1", + "LWIP_ARP=1", + "LWIP_ICMP=1", + "LWIP_DHCP=1", + "LWIP_IPV6_ND=1", + "LWIP_IGMP=1", + ] +} efr32_sdk("sdk") { sources = [ @@ -56,17 +83,47 @@ efr32_sdk("sdk") { "${chip_root}/src/platform/EFR32", "${efr32_project_dir}/include", "${examples_plat_dir}", + "${chip_root}/src/lib", ] defines = [ "BOARD_ID=${efr32_board}", "CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE=${setupPinCode}", ] + if (use_rs911x) { + defines += rs911x_defs + include_dirs += rs911x_plat_incs + } else if (use_wf200) { + defines += wf200_defs + include_dirs += wf200_plat_incs + } else { + defines += [ "SL_HEAP_SIZE=20480" ] + } + if (use_rs911x_sockets) { + include_dirs += [ "${examples_plat_dir}/wifi/rsi-sockets" ] + defines += rs911x_sock_defs + } else { + # Using LWIP instead of the native TCP/IP stack + # Thread also uses LWIP + # + defines += efr32_lwip_defs + } + if (sl_wfx_config_softap) { + defines += "SL_WFX_CONFIG_SOFTAP" + } + if (sl_wfx_config_scan) { + defines += "SL_WFX_CONFIG_SCAN" + } } efr32_executable("window_app") { output_name = "chip-efr32-window-example.out" output_dir = root_out_dir + include_dirs = [ + "include", + "${project_dir}/common/include", + ] + defines = [] sources = [ "${examples_plat_dir}/LEDWidget.cpp", @@ -79,36 +136,58 @@ efr32_executable("window_app") { "src/main.cpp", ] + if (use_rs911x) { + sources += rs911x_src_plat + + # All the stuff from wiseconnect + sources += rs911x_src_sapi + + # Apparently - the rsi library needs this (though we may not use use it) + sources += rs911x_src_sock + include_dirs += rs911x_inc_plat + + if (use_rs911x_sockets) { + # + # Using native sockets inside RS911x + # + include_dirs += rs911x_sock_inc + } else { + # + # We use LWIP - not built-in sockets + # + sources += rs911x_src_lwip + } + } else if (use_wf200) { + sources += wf200_plat_src + include_dirs += wf200_plat_incs + } deps = [ ":sdk", "${chip_root}/examples/common/QRCode", "${chip_root}/examples/window-app/common:window-common", "${chip_root}/src/lib", "${chip_root}/src/setup_payload", - "${chip_root}/third_party/openthread/platforms:libopenthread-platform", - "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", - "${examples_plat_dir}:efr-matter-shell", ] - if (chip_openthread_ftd) { - deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", - "${chip_root}/third_party/openthread/repo:libopenthread-ftd", - ] - } else { + if (!use_rs911x && !use_wf200) { deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", - "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + "${chip_root}/third_party/openthread/platforms:libopenthread-platform", + "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", + "${examples_plat_dir}:efr-matter-shell", ] + if (chip_openthread_ftd) { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", + "${chip_root}/third_party/openthread/repo:libopenthread-ftd", + ] + } else { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", + "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + ] + } } - include_dirs = [ - "include", - "${project_dir}/common/include", - ] - - defines = [] - if (show_qr_code) { sources += [ "${examples_plat_dir}/display/lcd.c", diff --git a/examples/window-app/efr32/build_for_wifi_args.gni b/examples/window-app/efr32/build_for_wifi_args.gni new file mode 100644 index 00000000000000..04529fddd2076a --- /dev/null +++ b/examples/window-app/efr32/build_for_wifi_args.gni @@ -0,0 +1,22 @@ +# Copyright (c) 2020 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. +import("//build_overrides/chip.gni") +import("//build_overrides/pigweed.gni") + +efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") +chip_enable_openthread = false +import("${chip_root}/src/platform/EFR32/wifi_args.gni") + +pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" +pw_assert_BACKEND = "$dir_pw_assert_log" diff --git a/examples/window-app/efr32/build_for_wifi_gnfile.gn b/examples/window-app/efr32/build_for_wifi_gnfile.gn new file mode 100644 index 00000000000000..9752ee73e7c91d --- /dev/null +++ b/examples/window-app/efr32/build_for_wifi_gnfile.gn @@ -0,0 +1,28 @@ +# Copyright (c) 2020 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. + +import("//build_overrides/build.gni") + +# The location of the build configuration file. +buildconfig = "${build_root}/config/BUILDCONFIG.gn" + +# CHIP uses angle bracket includes. +check_system_includes = true + +default_args = { + target_cpu = "arm" + target_os = "freertos" + use_thread = false + import("//build_for_wifi_args.gni") +} diff --git a/examples/window-app/efr32/src/WindowAppImpl.cpp b/examples/window-app/efr32/src/WindowAppImpl.cpp index 6a294c941b5261..7bff2706e5b5cb 100644 --- a/examples/window-app/efr32/src/WindowAppImpl.cpp +++ b/examples/window-app/efr32/src/WindowAppImpl.cpp @@ -31,6 +31,10 @@ #include #include +#ifdef SL_WIFI +#include "wfx_host_events.h" +#endif + #define APP_TASK_STACK_SIZE (4096) #define APP_TASK_PRIORITY 2 #define APP_EVENT_QUEUE_SIZE 10 @@ -143,6 +147,18 @@ void WindowAppImpl::OnIconTimeout(WindowApp::Timer & timer) CHIP_ERROR WindowAppImpl::Init() { +#ifdef SL_WIFI + /* + * Wait for the WiFi to be initialized + */ + EFR32_LOG("APP: Wait WiFi Init"); + while (!wfx_hw_ready()) + { + vTaskDelay(10); + } + EFR32_LOG("APP: Done WiFi Init"); + /* We will init server when we get IP */ +#endif WindowApp::Init(); // Initialize App Task @@ -308,18 +324,18 @@ void WindowAppImpl::UpdateLEDs() { mStatusLED.Blink(200, 200); } - else if (mState.isThreadProvisioned && mState.isThreadEnabled) - { - mStatusLED.Blink(950, 50); - } - else if (mState.haveBLEConnections) - { - mStatusLED.Blink(100, 100); - } else +#if CHIP_ENABLE_OPENTHREAD + if (mState.isThreadProvisioned && mState.isThreadEnabled) +#else + if (mState.isWiFiProvisioned && mState.isWiFiEnabled) +#endif + { - mStatusLED.Blink(50, 950); + mStatusLED.Blink(950, 50); } + else if (mState.haveBLEConnections) { mStatusLED.Blink(100, 100); } + else { mStatusLED.Blink(50, 950); } // Action LED @@ -346,7 +362,11 @@ void WindowAppImpl::UpdateLCD() { // Update LCD #ifdef DISPLAY_ENABLED +#if CHIP_ENABLE_OPENTHREAD if (mState.isThreadProvisioned) +#else + if (mState.isWiFiProvisioned) +#endif { Cover & cover = GetCover(); EmberAfWcType type = TypeGet(cover.mEndpoint); diff --git a/examples/window-app/efr32/src/main.cpp b/examples/window-app/efr32/src/main.cpp index b9d4e3070a4d01..2a8704b949dc9d 100644 --- a/examples/window-app/efr32/src/main.cpp +++ b/examples/window-app/efr32/src/main.cpp @@ -28,8 +28,8 @@ #include #include -#if CHIP_ENABLE_OPENTHREAD #include +#if CHIP_ENABLE_OPENTHREAD #include #include #include @@ -42,6 +42,10 @@ #include #endif // CHIP_ENABLE_OPENTHREAD +#if defined(RS911X_WIFI) || defined(WF200_WIFI) +#include "wfx_host_events.h" +#endif /* RS911X_WIFI */ + #if PW_RPC_ENABLED #include #endif @@ -50,6 +54,7 @@ #include "matter_shell.h" #endif +#define BLE_DEV_NAME "EFR32_WINDOW" using namespace ::chip::DeviceLayer; // ================================================================================ @@ -107,7 +112,7 @@ int main(void) EFR32_LOG("PlatformMgr().InitChipStack() failed"); appError(err); } - chip::DeviceLayer::ConnectivityMgr().SetBLEDeviceName("EFR32_WINDOW"); + chip::DeviceLayer::ConnectivityMgr().SetBLEDeviceName(BLE_DEV_NAME); EFR32_LOG("Starting Platform Manager Event Loop"); err = PlatformMgr().StartEventLoopTask(); @@ -144,6 +149,14 @@ int main(void) } #endif // CHIP_ENABLE_OPENTHREAD +#ifdef WF200_WIFI + // Start wfx bus communication task. + wfx_bus_start(); +#ifdef SL_WFX_USE_SECURE_LINK + wfx_securelink_task_start(); // start securelink key renegotiation task +#endif // SL_WFX_USE_SECURE_LINK +#endif /* WF200_WIFI */ + #ifdef ENABLE_CHIP_SHELL chip::startShellTask(); #endif diff --git a/scripts/examples/gn_efr32_example.sh b/scripts/examples/gn_efr32_example.sh index 1054dbaa184d49..ed0cc22502bfff 100755 --- a/scripts/examples/gn_efr32_example.sh +++ b/scripts/examples/gn_efr32_example.sh @@ -16,27 +16,86 @@ # limitations under the License. # -set -e - # Build script for GN EFT32 examples GitHub workflow. +set -e source "$(dirname "$0")/../../scripts/activate.sh" set -x env +USE_WF200=0 +USE_RS911X=0 +USE_WIFI=0 + +ROOT=$1 +arg2=$2 +shift +shift +while [ $# -gt 0 ]; do + case $1 in + --wifi) + if [ -z "$2" ]; then + echo "--efr requires BRDxxxx" + exit 1 + fi + if [ X"$2" = "Xrs911x" ]; then + WIFI_ARGS="use_rs911x=true" + elif [ "$2" = wf200 ]; then + WIFI_ARGS="use_wf200=true" + else + echo "Wifi usage: --wifi rs911x|wf200" + exit 1 + fi + shift + shift -if [ -z "$3" ]; then - gn gen --check --fail-on-unused-args --root="$1" --args="" "$2"/"$EFR32_BOARD"/ - ninja -v -C "$2"/"$EFR32_BOARD"/ - #print stats - arm-none-eabi-size -A "$2"/"$EFR32_BOARD"/*.out + ;; + --efr) + if [ -z "$2" ]; then + echo "--efr requires BRDxxxx" + exit 1 + fi + EFR32_BOARD=$2 + shift + shift + ;; + + --gnargs) + echo "-gnargs - Not yet implemented" + exit 1 + GNARGS=$2 + shift + shift + ;; + + *) + EFR32_BOARD=$1 + shift + if [ X"$1" != "X" ]; then + GNARGS=$1 + shift + fi + ;; + esac +done + +if [ X"$EFR32_BOARD" = "X" ]; then + echo "EFR32_BOARD not defined" + exit 1 +fi +BUILD_DIR=$arg2/$EFR32_BOARD +echo BUILD_DIR="$BUILD_DIR" +if [ "X$WIFI_ARGS" != "X" ]; then + gn gen --check --fail-on-unused-args --root="$ROOT" --dotfile="$ROOT"/build_for_wifi_gnfile.gn --args="efr32_board=\"$EFR32_BOARD\" $WIFI_ARGS" "$BUILD_DIR" else - if [ -z "$4" ]; then - gn gen --check --fail-on-unused-args --root="$1" --args="efr32_board=\"$3\"" "$2/$3" + # thread build + # + if [ -z "$GNARGS" ]; then + gn gen --check --fail-on-unused-args --root="$ROOT" --args="efr32_board=\"$EFR32_BOARD\"" "$BUILD_DIR" else - gn gen --check --fail-on-unused-args --root="$1" --args="efr32_board=\"$3\"" "$2/$3" "$4" + gn gen --check --fail-on-unused-args --root="$ROOT" --args="efr32_board=\"$EFR32_BOARD\" $GNARGS" "$BUILD_DIR" fi - ninja -v -C "$2/$3" - #print stats - arm-none-eabi-size -A "$2"/"$3"/*.out fi +ninja -v -C "$BUILD_DIR"/ +#print stats +arm-none-eabi-size -A "$BUILD_DIR"/*.out diff --git a/src/lwip/efr32/lwipopts-rs911x.h b/src/lwip/efr32/lwipopts-rs911x.h new file mode 100644 index 00000000000000..9be70a784da48c --- /dev/null +++ b/src/lwip/efr32/lwipopts-rs911x.h @@ -0,0 +1,203 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2019 Nest Labs, Inc. + * + * 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. + */ + +/** + * @file + * Compile-time configuration for LwIP on EFR32 platforms using the + * Silicon Labs EFR32 SDK. + * + */ + +#ifndef __LWIPOPTS_H__ +#define __LWIPOPTS_H__ + +#if CHIP_HAVE_CONFIG_H +#include +#endif + +#include + +#define NO_SYS 0 +#define MEM_ALIGNMENT (4) +#define MEMP_NUM_TCP_SEG (TCP_SND_QUEUELEN + 1) +#define LWIP_TIMEVAL_PRIVATE (0) +#if 1 +#define MEM_LIBC_MALLOC (1) +#define mem_clib_free vPortFree +#define mem_clib_malloc pvPortMalloc +#else +#define MEM_LIBC_MALLOC (0) +#endif + +#define LWIP_COMPAT_MUTEX (0) +#define SYS_LIGHTWEIGHT_PROT (1) +#define LWIP_AUTOIP (0) +#define LWIP_DHCP_AUTOIP_COOP (0) +#define LWIP_SOCKET_SET_ERRNO 0 +#define IP_REASS_MAX_PBUFS 0 +#define IP_REASSEMBLY 0 +#define MEMP_NUM_REASSDATA 0 +#define LWIP_SO_RCVTIMEO 0 +#define SO_REUSE (1) +#define LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS (1) +#define LWIP_STATS (0) +#define LWIP_TCPIP_CORE_LOCKING 1 +#define TCP_QUEUE_OOSEQ 0 +#define ARP_QUEUEING (0) +#define TCPIP_THREAD_NAME "LWIP" + +#define LWIP_SOCKET 0 + +#define LWIP_FREERTOS_USE_STATIC_TCPIP_TASK 1 + +#define LWIP_RAW 1 +#define MEMP_NUM_RAW_PCB (4) + +#define MEMP_NUM_UDP_PCB (7) + +#define LWIP_HAVE_LOOPIF (0) + +// TODO: not sure why this is disabled +#define LWIP_NETIF_LOOPBACK (0) + +#define MEMP_NUM_NETCONN (0) + +#ifndef LWIP_IPV4 +#define LWIP_IPV4 1 +#endif +#ifndef LWIP_IPV6 +#define LWIP_IPV6 1 +#endif +#ifndef LWIP_ARP +#define LWIP_ARP (1) +#endif +#define LWIP_DNS (0) +#ifndef LWIP_ICMP +#define LWIP_ICMP (1) +#endif +#ifndef LWIP_IGMP +#define LWIP_IGMP (1) +#endif +#ifndef LWIP_DHCP +#define LWIP_DHCP (1) +#endif +#define LWIP_IPV6_REASS (0) +#define LWIP_IPV6_DHCP6 0 +#define LWIP_IPV6_AUTOCONFIG (1) +#define LWIP_IPV6_ROUTER_SUPPORT 1 +#define LWIP_ND6_LISTEN_RA 1 + +#define LWIP_ND6_NUM_NEIGHBORS (2) +#define LWIP_ND6_NUM_DESTINATIONS (3) +#define LWIP_ND6_NUM_PREFIXES (2) +#define LWIP_ND6_NUM_ROUTERS (2) +#define LWIP_ND6_MAX_MULTICAST_SOLICIT (2) +#define LWIP_ND6_MAX_UNICAST_SOLICIT (2) +#define LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT (3) +#define LWIP_ND6_TCP_REACHABILITY_HINTS (0) +#define LWIP_ND6_ALLOW_RA_UPDATES 1 + +#if defined(EFR32MG21) +#define MEMP_SEPARATE_POOLS (1) +#define LWIP_PBUF_FROM_CUSTOM_POOLS (0) +#define MEMP_USE_CUSTOM_POOLS (0) +#define PBUF_POOL_SIZE (5) +#define PBUF_POOL_BUFSIZE (1280) +#define PBUF_CUSTOM_POOL_IDX_START (MEMP_PBUF_POOL_SMALL) +#define PBUF_CUSTOM_POOL_IDX_END (MEMP_PBUF_POOL_LARGE) +#else +#define MEMP_SEPARATE_POOLS (1) +#define LWIP_PBUF_FROM_CUSTOM_POOLS (0) +#define MEMP_USE_CUSTOM_POOLS (0) +#define PBUF_POOL_SIZE (8) +#define PBUF_POOL_BUFSIZE (1280) +#define PBUF_CUSTOM_POOL_IDX_START (MEMP_PBUF_POOL_SMALL) +#define PBUF_CUSTOM_POOL_IDX_END (MEMP_PBUF_POOL_LARGE) +#endif + +#define TCP_MSS (1152) +#define TCP_SND_BUF (2 * TCP_MSS) +#define TCP_LISTEN_BACKLOG (1) + +#define ETH_PAD_SIZE (0) +#define SUB_ETHERNET_HEADER_SPACE (0) +#define PBUF_LINK_HLEN (14) + +#if defined(EFR32MG21) +#define TCPIP_THREAD_STACKSIZE (1536) +#else +#define TCPIP_THREAD_STACKSIZE (2048) +#endif + +#define TCPIP_THREAD_PRIO (2) + +#define NETIF_MAX_HWADDR_LEN 8U + +#define LWIP_IPV6_NUM_ADDRESSES 5 + +#ifndef LWIP_IPV6_ND +#define LWIP_IPV6_ND 1 +#endif +#define LWIP_ND6_QUEUEING 1 +#define LWIP_NUM_ND6_QUEUE 3 + +#define LWIP_MULTICAST_PING 0 + +#define TCPIP_MBOX_SIZE 6 +#define DEFAULT_RAW_RECVMBOX_SIZE 6 +#define DEFAULT_UDP_RECVMBOX_SIZE 6 +#define DEFAULT_TCP_RECVMBOX_SIZE 6 + +#ifdef LWIP_DEBUG + +#define MEMP_OVERFLOW_CHECK (0) +#define MEMP_SANITY_CHECK (0) +#define MEM_DEBUG (LWIP_DBG_OFF) +#define MEMP_DEBUG (LWIP_DBG_OFF) +#define PBUF_DEBUG (LWIP_DBG_OFF) +#define API_LIB_DEBUG (LWIP_DBG_OFF) +#define API_MSG_DEBUG (LWIP_DBG_OFF) +#define TCPIP_DEBUG (LWIP_DBG_OFF) +#define NETIF_DEBUG (LWIP_DBG_OFF) +#define SOCKETS_DEBUG (LWIP_DBG_OFF) +#define DEMO_DEBUG (LWIP_DBG_OFF) +#define DHCP_DEBUG (LWIP_DBG_OFF) +#define AUTOIP_DEBUG (LWIP_DBG_OFF) +#define ETHARP_DEBUG (LWIP_DBG_OFF) +#define IP_DEBUG (LWIP_DBG_OFF) +#define IP_REASS_DEBUG (LWIP_DBG_OFF) +#define IP6_DEBUG (LWIP_DBG_OFF) +#define RAW_DEBUG (LWIP_DBG_OFF) +#define ICMP_DEBUG (LWIP_DBG_OFF) +#define UDP_DEBUG (LWIP_DBG_OFF) +#define TCP_DEBUG (LWIP_DBG_OFF) +#define TCP_INPUT_DEBUG (LWIP_DBG_OFF) +#define TCP_OUTPUT_DEBUG (LWIP_DBG_OFF) +#define TCP_RTO_DEBUG (LWIP_DBG_OFF) +#define TCP_CWND_DEBUG (LWIP_DBG_OFF) +#define TCP_WND_DEBUG (LWIP_DBG_OFF) +#define TCP_FR_DEBUG (LWIP_DBG_OFF) +#define TCP_QLEN_DEBUG (LWIP_DBG_OFF) +#define TCP_RST_DEBUG (LWIP_DBG_OFF) +#define PPP_DEBUG (LWIP_DBG_OFF) +#endif + +#define LWIP_DBG_TYPES_ON \ + (LWIP_DBG_ON | LWIP_DBG_TRACE) /* (LWIP_DBG_ON|LWIP_DBG_TRACE|LWIP_DBG_STATE|LWIP_DBG_FRESH|LWIP_DBG_HALT) */ + +#endif /* __LWIPOPTS_H__ */ diff --git a/src/lwip/efr32/lwipopts-thread.h b/src/lwip/efr32/lwipopts-thread.h new file mode 100644 index 00000000000000..f667e5bb3a8f27 --- /dev/null +++ b/src/lwip/efr32/lwipopts-thread.h @@ -0,0 +1,182 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2019 Nest Labs, Inc. + * + * 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. + */ + +/** + * @file + * Compile-time configuration for LwIP on EFR32 platforms using the + * Silicon Labs EFR32 SDK. + * + */ + +#ifndef __LWIPOPTS_H__ +#define __LWIPOPTS_H__ + +#if CHIP_HAVE_CONFIG_H +#include +#endif + +#include + +#define NO_SYS 0 +#define MEM_ALIGNMENT (4) +#define MEMP_NUM_TCP_SEG (TCP_SND_QUEUELEN + 1) +#define LWIP_TIMEVAL_PRIVATE (0) +#define MEM_LIBC_MALLOC (0) +#define LWIP_COMPAT_MUTEX (0) +#define SYS_LIGHTWEIGHT_PROT (1) +#define LWIP_AUTOIP (0) +#define LWIP_DHCP_AUTOIP_COOP (0) +#define LWIP_SOCKET_SET_ERRNO 0 +#define IP_REASS_MAX_PBUFS 0 +#define IP_REASSEMBLY 0 +#define MEMP_NUM_REASSDATA 0 +#define LWIP_SO_RCVTIMEO 0 +#define SO_REUSE (1) +#define LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS (1) +#define LWIP_STATS (0) +#define LWIP_TCPIP_CORE_LOCKING 1 +#define TCP_QUEUE_OOSEQ 0 +#define ARP_QUEUEING (0) +#define TCPIP_THREAD_NAME "LWIP" + +#define LWIP_SOCKET 0 + +#define LWIP_FREERTOS_USE_STATIC_TCPIP_TASK 1 + +#define LWIP_RAW 1 +#define MEMP_NUM_RAW_PCB (4) + +#define MEMP_NUM_UDP_PCB (5) + +#define LWIP_HAVE_LOOPIF (0) + +// TODO: not sure why this is disabled +#define LWIP_NETIF_LOOPBACK (0) + +#define MEMP_NUM_NETCONN (0) + +#define LWIP_IPV4 0 + +#define LWIP_IPV6 1 +#define LWIP_IPV6_ROUTE_TABLE_SUPPORT 1 +#define LWIP_ARP (0) +#define LWIP_DNS (0) +#define LWIP_ICMP (0) +#define LWIP_IGMP (0) +#define LWIP_DHCP (0) +#define LWIP_IPV6_REASS (0) +#define LWIP_IPV6_DHCP6 0 +#define LWIP_IPV6_AUTOCONFIG (0) +#define LWIP_IPV6_ROUTER_SUPPORT 0 +#define LWIP_ND6_LISTEN_RA 0 + +#define LWIP_ND6_NUM_NEIGHBORS (0) +#define LWIP_ND6_NUM_DESTINATIONS (0) +#define LWIP_ND6_NUM_PREFIXES (0) +#define LWIP_ND6_NUM_ROUTERS (0) +#define LWIP_ND6_MAX_MULTICAST_SOLICIT (0) +#define LWIP_ND6_MAX_UNICAST_SOLICIT (0) +#define LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT (0) +#define LWIP_ND6_TCP_REACHABILITY_HINTS (0) + +#if defined(EFR32MG21) +#define MEMP_SEPARATE_POOLS (1) +#define LWIP_PBUF_FROM_CUSTOM_POOLS (0) +#define MEMP_USE_CUSTOM_POOLS (0) +#define PBUF_POOL_SIZE (5) +#define PBUF_POOL_BUFSIZE (1280) +#define PBUF_CUSTOM_POOL_IDX_START (MEMP_PBUF_POOL_SMALL) +#define PBUF_CUSTOM_POOL_IDX_END (MEMP_PBUF_POOL_LARGE) +#else +#define MEMP_SEPARATE_POOLS (1) +#define LWIP_PBUF_FROM_CUSTOM_POOLS (0) +#define MEMP_USE_CUSTOM_POOLS (0) +#define PBUF_POOL_SIZE (8) +#define PBUF_POOL_BUFSIZE (1280) +#define PBUF_CUSTOM_POOL_IDX_START (MEMP_PBUF_POOL_SMALL) +#define PBUF_CUSTOM_POOL_IDX_END (MEMP_PBUF_POOL_LARGE) +#endif + +#define TCP_MSS (1152) +#define TCP_SND_BUF (2 * TCP_MSS) +#define TCP_LISTEN_BACKLOG (1) + +#define ETH_PAD_SIZE (0) +#define SUB_ETHERNET_HEADER_SPACE (0) +#define PBUF_LINK_HLEN (0) + +#if defined(EFR32MG21) +#define TCPIP_THREAD_STACKSIZE (1536) +#else +#define TCPIP_THREAD_STACKSIZE (2048) +#endif + +#define TCPIP_THREAD_PRIO (2) + +#define NETIF_MAX_HWADDR_LEN 8U + +#define LWIP_IPV6_NUM_ADDRESSES 5 + +#define LWIP_IPV6_ND 0 +#define LWIP_ND6_QUEUEING 0 + +#define LWIP_MULTICAST_PING 0 + +#define TCPIP_MBOX_SIZE 6 +#define DEFAULT_RAW_RECVMBOX_SIZE 6 +#define DEFAULT_UDP_RECVMBOX_SIZE 6 +#define DEFAULT_TCP_RECVMBOX_SIZE 6 + +#ifdef LWIP_DEBUG + +#define MEMP_OVERFLOW_CHECK (0) +#define MEMP_SANITY_CHECK (0) +#define MEM_DEBUG (LWIP_DBG_OFF) +#define MEMP_DEBUG (LWIP_DBG_OFF) +#define PBUF_DEBUG (LWIP_DBG_OFF) +#define API_LIB_DEBUG (LWIP_DBG_OFF) +#define API_MSG_DEBUG (LWIP_DBG_OFF) +#define TCPIP_DEBUG (LWIP_DBG_OFF) +#define NETIF_DEBUG (LWIP_DBG_OFF) +#define SOCKETS_DEBUG (LWIP_DBG_OFF) +#define DEMO_DEBUG (LWIP_DBG_OFF) +#define DHCP_DEBUG (LWIP_DBG_OFF) +#define AUTOIP_DEBUG (LWIP_DBG_OFF) +#define ETHARP_DEBUG (LWIP_DBG_OFF) +#define IP_DEBUG (LWIP_DBG_OFF) +#define IP_REASS_DEBUG (LWIP_DBG_OFF) +#define IP6_DEBUG (LWIP_DBG_OFF) +#define RAW_DEBUG (LWIP_DBG_OFF) +#define ICMP_DEBUG (LWIP_DBG_OFF) +#define UDP_DEBUG (LWIP_DBG_OFF) +#define TCP_DEBUG (LWIP_DBG_OFF) +#define TCP_INPUT_DEBUG (LWIP_DBG_OFF) +#define TCP_OUTPUT_DEBUG (LWIP_DBG_OFF) +#define TCP_RTO_DEBUG (LWIP_DBG_OFF) +#define TCP_CWND_DEBUG (LWIP_DBG_OFF) +#define TCP_WND_DEBUG (LWIP_DBG_OFF) +#define TCP_FR_DEBUG (LWIP_DBG_OFF) +#define TCP_QLEN_DEBUG (LWIP_DBG_OFF) +#define TCP_RST_DEBUG (LWIP_DBG_OFF) +#define PPP_DEBUG (LWIP_DBG_OFF) +#endif + +#define LWIP_DBG_TYPES_ON \ + (LWIP_DBG_ON | LWIP_DBG_TRACE) /* (LWIP_DBG_ON|LWIP_DBG_TRACE|LWIP_DBG_STATE|LWIP_DBG_FRESH|LWIP_DBG_HALT) */ + +#endif /* __LWIPOPTS_H__ */ diff --git a/src/lwip/efr32/lwipopts-wf200.h b/src/lwip/efr32/lwipopts-wf200.h new file mode 100644 index 00000000000000..31dbf793c3b8c9 --- /dev/null +++ b/src/lwip/efr32/lwipopts-wf200.h @@ -0,0 +1,203 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2019 Nest Labs, Inc. + * + * 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. + */ + +/** + * @file + * Compile-time configuration for LwIP on EFR32 platforms using the + * Silicon Labs EFR32 SDK. + * + */ + +#ifndef __LWIPOPTS_H__ +#define __LWIPOPTS_H__ + +#if CHIP_HAVE_CONFIG_H +#include +#endif + +#include + +#define NO_SYS 0 +#define MEM_ALIGNMENT (4) +#define MEMP_NUM_TCP_SEG (TCP_SND_QUEUELEN + 1) +#define LWIP_TIMEVAL_PRIVATE (0) +#if 1 +#define MEM_LIBC_MALLOC (1) +#define mem_clib_free vPortFree +#define mem_clib_malloc pvPortMalloc +#else +#define MEM_LIBC_MALLOC (0) +#endif + +#define LWIP_COMPAT_MUTEX (0) +#define SYS_LIGHTWEIGHT_PROT (1) +#define LWIP_AUTOIP (0) +#define LWIP_DHCP_AUTOIP_COOP (0) +#define LWIP_SOCKET_SET_ERRNO 0 +#define IP_REASS_MAX_PBUFS 0 +#define IP_REASSEMBLY 0 +#define MEMP_NUM_REASSDATA 0 +#define LWIP_SO_RCVTIMEO 0 +#define SO_REUSE (1) +#define LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS (1) +#define LWIP_STATS (0) +#define LWIP_TCPIP_CORE_LOCKING 1 +#define TCP_QUEUE_OOSEQ 0 +#define ARP_QUEUEING (0) +#define TCPIP_THREAD_NAME "LWIP" + +#define LWIP_SOCKET 0 + +#define LWIP_FREERTOS_USE_STATIC_TCPIP_TASK 1 + +#define LWIP_RAW 1 +#define MEMP_NUM_RAW_PCB (4) + +#define MEMP_NUM_UDP_PCB (5) + +#define LWIP_HAVE_LOOPIF (0) + +// TODO: not sure why this is disabled +#define LWIP_NETIF_LOOPBACK (0) + +#define MEMP_NUM_NETCONN (0) + +#ifndef LWIP_IPV4 +#define LWIP_IPV4 0 +#endif +#ifndef LWIP_IPV6 +#define LWIP_IPV6 1 +#endif +#ifndef LWIP_ARP +#define LWIP_ARP (0) +#endif +#define LWIP_DNS (0) +#ifndef LWIP_ICMP +#define LWIP_ICMP (1) +#endif +#ifndef LWIP_IGMP +#define LWIP_IGMP (0) +#endif +#ifndef LWIP_DHCP +#define LWIP_DHCP (0) +#endif +#define LWIP_IPV6_REASS (0) +#define LWIP_IPV6_DHCP6 0 +#define LWIP_IPV6_AUTOCONFIG (1) +#define LWIP_IPV6_ROUTER_SUPPORT 1 +#define LWIP_ND6_LISTEN_RA 1 + +#define LWIP_ND6_NUM_NEIGHBORS (2) +#define LWIP_ND6_NUM_DESTINATIONS (3) +#define LWIP_ND6_NUM_PREFIXES (2) +#define LWIP_ND6_NUM_ROUTERS (2) +#define LWIP_ND6_MAX_MULTICAST_SOLICIT (2) +#define LWIP_ND6_MAX_UNICAST_SOLICIT (2) +#define LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT (3) +#define LWIP_ND6_TCP_REACHABILITY_HINTS (0) +#define LWIP_ND6_ALLOW_RA_UPDATES 1 + +#if defined(EFR32MG21) +#define MEMP_SEPARATE_POOLS (1) +#define LWIP_PBUF_FROM_CUSTOM_POOLS (0) +#define MEMP_USE_CUSTOM_POOLS (0) +#define PBUF_POOL_SIZE (5) +#define PBUF_POOL_BUFSIZE (1280) +#define PBUF_CUSTOM_POOL_IDX_START (MEMP_PBUF_POOL_SMALL) +#define PBUF_CUSTOM_POOL_IDX_END (MEMP_PBUF_POOL_LARGE) +#else +#define MEMP_SEPARATE_POOLS (1) +#define LWIP_PBUF_FROM_CUSTOM_POOLS (0) +#define MEMP_USE_CUSTOM_POOLS (0) +#define PBUF_POOL_SIZE (8) +#define PBUF_POOL_BUFSIZE (1280) +#define PBUF_CUSTOM_POOL_IDX_START (MEMP_PBUF_POOL_SMALL) +#define PBUF_CUSTOM_POOL_IDX_END (MEMP_PBUF_POOL_LARGE) +#endif + +#define TCP_MSS (1152) +#define TCP_SND_BUF (2 * TCP_MSS) +#define TCP_LISTEN_BACKLOG (1) + +#define ETH_PAD_SIZE (0) +#define SUB_ETHERNET_HEADER_SPACE (0) +#define PBUF_LINK_HLEN (14) + +#if defined(EFR32MG21) +#define TCPIP_THREAD_STACKSIZE (1536) +#else +#define TCPIP_THREAD_STACKSIZE (2048) +#endif + +#define TCPIP_THREAD_PRIO (2) + +#define NETIF_MAX_HWADDR_LEN 8U + +#define LWIP_IPV6_NUM_ADDRESSES 5 + +#ifndef LWIP_IPV6_ND +#define LWIP_IPV6_ND 0 +#endif +#define LWIP_ND6_QUEUEING 1 +#define LWIP_NUM_ND6_QUEUE 3 + +#define LWIP_MULTICAST_PING 0 + +#define TCPIP_MBOX_SIZE 6 +#define DEFAULT_RAW_RECVMBOX_SIZE 6 +#define DEFAULT_UDP_RECVMBOX_SIZE 6 +#define DEFAULT_TCP_RECVMBOX_SIZE 6 + +#ifdef LWIP_DEBUG + +#define MEMP_OVERFLOW_CHECK (0) +#define MEMP_SANITY_CHECK (0) +#define MEM_DEBUG (LWIP_DBG_OFF) +#define MEMP_DEBUG (LWIP_DBG_OFF) +#define PBUF_DEBUG (LWIP_DBG_OFF) +#define API_LIB_DEBUG (LWIP_DBG_OFF) +#define API_MSG_DEBUG (LWIP_DBG_OFF) +#define TCPIP_DEBUG (LWIP_DBG_OFF) +#define NETIF_DEBUG (LWIP_DBG_OFF) +#define SOCKETS_DEBUG (LWIP_DBG_OFF) +#define DEMO_DEBUG (LWIP_DBG_OFF) +#define DHCP_DEBUG (LWIP_DBG_OFF) +#define AUTOIP_DEBUG (LWIP_DBG_OFF) +#define ETHARP_DEBUG (LWIP_DBG_OFF) +#define IP_DEBUG (LWIP_DBG_OFF) +#define IP_REASS_DEBUG (LWIP_DBG_OFF) +#define IP6_DEBUG (LWIP_DBG_OFF) +#define RAW_DEBUG (LWIP_DBG_OFF) +#define ICMP_DEBUG (LWIP_DBG_OFF) +#define UDP_DEBUG (LWIP_DBG_OFF) +#define TCP_DEBUG (LWIP_DBG_OFF) +#define TCP_INPUT_DEBUG (LWIP_DBG_OFF) +#define TCP_OUTPUT_DEBUG (LWIP_DBG_OFF) +#define TCP_RTO_DEBUG (LWIP_DBG_OFF) +#define TCP_CWND_DEBUG (LWIP_DBG_OFF) +#define TCP_WND_DEBUG (LWIP_DBG_OFF) +#define TCP_FR_DEBUG (LWIP_DBG_OFF) +#define TCP_QLEN_DEBUG (LWIP_DBG_OFF) +#define TCP_RST_DEBUG (LWIP_DBG_OFF) +#define PPP_DEBUG (LWIP_DBG_OFF) +#endif + +#define LWIP_DBG_TYPES_ON \ + (LWIP_DBG_ON | LWIP_DBG_TRACE) /* (LWIP_DBG_ON|LWIP_DBG_TRACE|LWIP_DBG_STATE|LWIP_DBG_FRESH|LWIP_DBG_HALT) */ + +#endif /* __LWIPOPTS_H__ */ diff --git a/src/lwip/efr32/lwipopts.h b/src/lwip/efr32/lwipopts.h index f667e5bb3a8f27..499e11d4700c19 100644 --- a/src/lwip/efr32/lwipopts.h +++ b/src/lwip/efr32/lwipopts.h @@ -1,182 +1,7 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2019 Nest Labs, Inc. - * - * 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. - */ - -/** - * @file - * Compile-time configuration for LwIP on EFR32 platforms using the - * Silicon Labs EFR32 SDK. - * - */ - -#ifndef __LWIPOPTS_H__ -#define __LWIPOPTS_H__ - -#if CHIP_HAVE_CONFIG_H -#include -#endif - -#include - -#define NO_SYS 0 -#define MEM_ALIGNMENT (4) -#define MEMP_NUM_TCP_SEG (TCP_SND_QUEUELEN + 1) -#define LWIP_TIMEVAL_PRIVATE (0) -#define MEM_LIBC_MALLOC (0) -#define LWIP_COMPAT_MUTEX (0) -#define SYS_LIGHTWEIGHT_PROT (1) -#define LWIP_AUTOIP (0) -#define LWIP_DHCP_AUTOIP_COOP (0) -#define LWIP_SOCKET_SET_ERRNO 0 -#define IP_REASS_MAX_PBUFS 0 -#define IP_REASSEMBLY 0 -#define MEMP_NUM_REASSDATA 0 -#define LWIP_SO_RCVTIMEO 0 -#define SO_REUSE (1) -#define LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS (1) -#define LWIP_STATS (0) -#define LWIP_TCPIP_CORE_LOCKING 1 -#define TCP_QUEUE_OOSEQ 0 -#define ARP_QUEUEING (0) -#define TCPIP_THREAD_NAME "LWIP" - -#define LWIP_SOCKET 0 - -#define LWIP_FREERTOS_USE_STATIC_TCPIP_TASK 1 - -#define LWIP_RAW 1 -#define MEMP_NUM_RAW_PCB (4) - -#define MEMP_NUM_UDP_PCB (5) - -#define LWIP_HAVE_LOOPIF (0) - -// TODO: not sure why this is disabled -#define LWIP_NETIF_LOOPBACK (0) - -#define MEMP_NUM_NETCONN (0) - -#define LWIP_IPV4 0 - -#define LWIP_IPV6 1 -#define LWIP_IPV6_ROUTE_TABLE_SUPPORT 1 -#define LWIP_ARP (0) -#define LWIP_DNS (0) -#define LWIP_ICMP (0) -#define LWIP_IGMP (0) -#define LWIP_DHCP (0) -#define LWIP_IPV6_REASS (0) -#define LWIP_IPV6_DHCP6 0 -#define LWIP_IPV6_AUTOCONFIG (0) -#define LWIP_IPV6_ROUTER_SUPPORT 0 -#define LWIP_ND6_LISTEN_RA 0 - -#define LWIP_ND6_NUM_NEIGHBORS (0) -#define LWIP_ND6_NUM_DESTINATIONS (0) -#define LWIP_ND6_NUM_PREFIXES (0) -#define LWIP_ND6_NUM_ROUTERS (0) -#define LWIP_ND6_MAX_MULTICAST_SOLICIT (0) -#define LWIP_ND6_MAX_UNICAST_SOLICIT (0) -#define LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT (0) -#define LWIP_ND6_TCP_REACHABILITY_HINTS (0) - -#if defined(EFR32MG21) -#define MEMP_SEPARATE_POOLS (1) -#define LWIP_PBUF_FROM_CUSTOM_POOLS (0) -#define MEMP_USE_CUSTOM_POOLS (0) -#define PBUF_POOL_SIZE (5) -#define PBUF_POOL_BUFSIZE (1280) -#define PBUF_CUSTOM_POOL_IDX_START (MEMP_PBUF_POOL_SMALL) -#define PBUF_CUSTOM_POOL_IDX_END (MEMP_PBUF_POOL_LARGE) -#else -#define MEMP_SEPARATE_POOLS (1) -#define LWIP_PBUF_FROM_CUSTOM_POOLS (0) -#define MEMP_USE_CUSTOM_POOLS (0) -#define PBUF_POOL_SIZE (8) -#define PBUF_POOL_BUFSIZE (1280) -#define PBUF_CUSTOM_POOL_IDX_START (MEMP_PBUF_POOL_SMALL) -#define PBUF_CUSTOM_POOL_IDX_END (MEMP_PBUF_POOL_LARGE) -#endif - -#define TCP_MSS (1152) -#define TCP_SND_BUF (2 * TCP_MSS) -#define TCP_LISTEN_BACKLOG (1) - -#define ETH_PAD_SIZE (0) -#define SUB_ETHERNET_HEADER_SPACE (0) -#define PBUF_LINK_HLEN (0) - -#if defined(EFR32MG21) -#define TCPIP_THREAD_STACKSIZE (1536) +#if defined(WF200_WIFI) +#include "lwipopts-wf200.h" +#elif defined(RS911X_WIFI) +#include "lwipopts-rs911x.h" #else -#define TCPIP_THREAD_STACKSIZE (2048) -#endif - -#define TCPIP_THREAD_PRIO (2) - -#define NETIF_MAX_HWADDR_LEN 8U - -#define LWIP_IPV6_NUM_ADDRESSES 5 - -#define LWIP_IPV6_ND 0 -#define LWIP_ND6_QUEUEING 0 - -#define LWIP_MULTICAST_PING 0 - -#define TCPIP_MBOX_SIZE 6 -#define DEFAULT_RAW_RECVMBOX_SIZE 6 -#define DEFAULT_UDP_RECVMBOX_SIZE 6 -#define DEFAULT_TCP_RECVMBOX_SIZE 6 - -#ifdef LWIP_DEBUG - -#define MEMP_OVERFLOW_CHECK (0) -#define MEMP_SANITY_CHECK (0) -#define MEM_DEBUG (LWIP_DBG_OFF) -#define MEMP_DEBUG (LWIP_DBG_OFF) -#define PBUF_DEBUG (LWIP_DBG_OFF) -#define API_LIB_DEBUG (LWIP_DBG_OFF) -#define API_MSG_DEBUG (LWIP_DBG_OFF) -#define TCPIP_DEBUG (LWIP_DBG_OFF) -#define NETIF_DEBUG (LWIP_DBG_OFF) -#define SOCKETS_DEBUG (LWIP_DBG_OFF) -#define DEMO_DEBUG (LWIP_DBG_OFF) -#define DHCP_DEBUG (LWIP_DBG_OFF) -#define AUTOIP_DEBUG (LWIP_DBG_OFF) -#define ETHARP_DEBUG (LWIP_DBG_OFF) -#define IP_DEBUG (LWIP_DBG_OFF) -#define IP_REASS_DEBUG (LWIP_DBG_OFF) -#define IP6_DEBUG (LWIP_DBG_OFF) -#define RAW_DEBUG (LWIP_DBG_OFF) -#define ICMP_DEBUG (LWIP_DBG_OFF) -#define UDP_DEBUG (LWIP_DBG_OFF) -#define TCP_DEBUG (LWIP_DBG_OFF) -#define TCP_INPUT_DEBUG (LWIP_DBG_OFF) -#define TCP_OUTPUT_DEBUG (LWIP_DBG_OFF) -#define TCP_RTO_DEBUG (LWIP_DBG_OFF) -#define TCP_CWND_DEBUG (LWIP_DBG_OFF) -#define TCP_WND_DEBUG (LWIP_DBG_OFF) -#define TCP_FR_DEBUG (LWIP_DBG_OFF) -#define TCP_QLEN_DEBUG (LWIP_DBG_OFF) -#define TCP_RST_DEBUG (LWIP_DBG_OFF) -#define PPP_DEBUG (LWIP_DBG_OFF) +#include "lwipopts-thread.h" #endif - -#define LWIP_DBG_TYPES_ON \ - (LWIP_DBG_ON | LWIP_DBG_TRACE) /* (LWIP_DBG_ON|LWIP_DBG_TRACE|LWIP_DBG_STATE|LWIP_DBG_FRESH|LWIP_DBG_HALT) */ - -#endif /* __LWIPOPTS_H__ */ diff --git a/src/platform/EFR32/BUILD.gn b/src/platform/EFR32/BUILD.gn index 5efbf9e4c733e7..00469606e03597 100644 --- a/src/platform/EFR32/BUILD.gn +++ b/src/platform/EFR32/BUILD.gn @@ -36,7 +36,6 @@ static_library("EFR32") { "CHIPPlatformConfig.h", "ConfigurationManagerImpl.cpp", "ConfigurationManagerImpl.h", - "ConnectivityManagerImpl.cpp", "ConnectivityManagerImpl.h", "DeviceNetworkProvisioningDelegateImpl.cpp", "DeviceNetworkProvisioningDelegateImpl.h", @@ -87,6 +86,7 @@ static_library("EFR32") { sources += [ "../OpenThread/OpenThreadUtils.cpp", + "ConnectivityManagerImpl.cpp", "ThreadStackManagerImpl.cpp", "ThreadStackManagerImpl.h", ] @@ -95,5 +95,11 @@ static_library("EFR32") { sources += [ "../OpenThread/DnssdImpl.cpp" ] deps += [ "${chip_root}/src/lib/dnssd:platform_header" ] } + } else { + sources += [ + "ConnectivityManagerImpl_WIFI.cpp", + "ServiceProvisioning.cpp", + "ServiceProvisioning.h", + ] } } diff --git a/src/platform/EFR32/CHIPDevicePlatformConfig.h b/src/platform/EFR32/CHIPDevicePlatformConfig.h index 36ea40f8ebe700..74521d1da33f60 100644 --- a/src/platform/EFR32/CHIPDevicePlatformConfig.h +++ b/src/platform/EFR32/CHIPDevicePlatformConfig.h @@ -29,17 +29,18 @@ #define CHIP_DEVICE_CONFIG_EFR32_NVM3_ERROR_MIN 0xB00000 #define CHIP_DEVICE_CONFIG_EFR32_BLE_ERROR_MIN 0xC00000 +#if defined(SL_WIFI) +#define CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION 1 +#elif CHIP_ENABLE_OPENTHREAD + #define CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION 0 #define CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP 0 - -#if CHIP_ENABLE_OPENTHREAD #define CHIP_DEVICE_CONFIG_ENABLE_THREAD 1 -#define CHIP_DEVICE_CONFIG_ENABLE_DNSSD 1 #define CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT 1 -#endif - #define CHIP_DEVICE_CONFIG_ENABLE_THREAD_DNS_CLIENT 1 #define CHIP_DEVICE_CONFIG_ENABLE_THREAD_COMMISSIONABLE_DISCOVERY 1 +#define CHIP_DEVICE_CONFIG_ENABLE_DNSSD 1 +#endif /* CHIP_ENABLE_OPENTHREAD */ #define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 #define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DISCOVERY 1 diff --git a/src/platform/EFR32/CHIPDevicePlatformEvent.h b/src/platform/EFR32/CHIPDevicePlatformEvent.h index d2ae1b7c65ff35..1252e16064dd89 100644 --- a/src/platform/EFR32/CHIPDevicePlatformEvent.h +++ b/src/platform/EFR32/CHIPDevicePlatformEvent.h @@ -25,6 +25,9 @@ #pragma once #include +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION +#include "wfx_host_events.h" +#endif namespace chip { namespace DeviceLayer { @@ -44,7 +47,7 @@ enum PublicPlatformSpecificEventTypes */ enum InternalPlatformSpecificEventTypes { - /* None currently defined */ + kWFXSystemEvent = kRange_InternalPlatformSpecific, }; } // namespace DeviceEventType @@ -57,9 +60,39 @@ struct ChipDevicePlatformEvent final { union { - /* None currently defined */ +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION + struct + { + wfx_event_base_t eventBase; + union + { + sl_wfx_generic_message_t genericMsgEvent; + sl_wfx_startup_ind_t startupEvent; + sl_wfx_connect_ind_t connectEvent; + sl_wfx_disconnect_ind_t disconnectEvent; + + /* + * NOT CURRENTLY USED + *Some structs might be bigger in size than the one we use + * so we reduce the union size by commenting them out. + * Keep for possible future implementation. + */ + + // sl_wfx_generic_ind_t genericEvent; + // sl_wfx_exception_ind_t exceptionEvent; + // sl_wfx_error_ind_t errorEvent; + // sl_wfx_received_ind_t receivedEvent; + // sl_wfx_scan_result_ind_t scanResultEvent; + // sl_wfx_scan_complete_ind_t scanCompleteEvent; + // sl_wfx_start_ap_ind_t startApEvent; + // sl_wfx_stop_ap_ind_t stopApEvent; + // sl_wfx_ap_client_connected_ind_t apClientConnectedEvent; + // sl_wfx_ap_client_rejected_ind_t apClientRejectedEvent; + // sl_wfx_ap_client_disconnected_ind_t apClientDisconnectedEvent; + } data; + } WFXSystemEvent; +#endif }; }; - -} // namespace DeviceLayer +}; // namespace DeviceLayer } // namespace chip diff --git a/src/platform/EFR32/ConfigurationManagerImpl.cpp b/src/platform/EFR32/ConfigurationManagerImpl.cpp index f550516e28b5a3..fccf7f6fd0f4de 100644 --- a/src/platform/EFR32/ConfigurationManagerImpl.cpp +++ b/src/platform/EFR32/ConfigurationManagerImpl.cpp @@ -32,6 +32,10 @@ #include "em_rmu.h" +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION +#include "wfx_host_events.h" +#endif + namespace chip { namespace DeviceLayer { @@ -291,10 +295,26 @@ void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg) PersistedStorage::KeyValueStoreMgrImpl().ErasePartition(); #endif // CHIP_KVS_AVAILABLE +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION + ChipLogProgress(DeviceLayer, "Clearing WiFi provision"); + wfx_clear_wifi_provision(); +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION + // Restart the system. ChipLogProgress(DeviceLayer, "System restarting"); NVIC_SystemReset(); } +#ifdef SL_WIFI +CHIP_ERROR ConfigurationManagerImpl::GetPrimaryWiFiMACAddress(uint8_t * buf) +{ + sl_wfx_mac_address_t macaddr; + wfx_get_wifi_mac_addr(SL_WFX_STA_INTERFACE, &macaddr); + memcpy(buf, &macaddr.octet[0], sizeof(macaddr.octet)); + + return CHIP_NO_ERROR; +} +#endif + } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/EFR32/ConfigurationManagerImpl.h b/src/platform/EFR32/ConfigurationManagerImpl.h index a638abc425f5f0..7a157ccc3b7fac 100644 --- a/src/platform/EFR32/ConfigurationManagerImpl.h +++ b/src/platform/EFR32/ConfigurationManagerImpl.h @@ -77,10 +77,12 @@ class ConfigurationManagerImpl : public Internal::GenericConfigurationManagerImp static void DoFactoryReset(intptr_t arg); }; +#ifndef SL_WIFI inline CHIP_ERROR ConfigurationManagerImpl::GetPrimaryWiFiMACAddress(uint8_t * buf) { return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; } +#endif /* SL_WIFI */ } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/EFR32/ConnectivityManagerImpl.h b/src/platform/EFR32/ConnectivityManagerImpl.h index 02e1c11c8c7cb9..7e817ad4da743c 100644 --- a/src/platform/EFR32/ConnectivityManagerImpl.h +++ b/src/platform/EFR32/ConnectivityManagerImpl.h @@ -30,7 +30,11 @@ #else #include #endif +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION +#include +#else #include +#endif namespace Inet { class IPAddress; @@ -39,6 +43,8 @@ class IPAddress; namespace chip { namespace DeviceLayer { +class PlatformManagerImpl; + /** * Concrete implementation of the ConnectivityManager singleton object for Silicon Labs EFR32 platforms. */ @@ -54,7 +60,11 @@ class ConnectivityManagerImpl final : public ConnectivityManager, #else public Internal::GenericConnectivityManagerImpl_NoThread, #endif +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION + public Internal::GenericConnectivityManagerImpl_WiFi +#else public Internal::GenericConnectivityManagerImpl_NoWiFi +#endif { // Allow the ConnectivityManager interface class to delegate method calls to // the implementation methods provided by this class. @@ -63,18 +73,103 @@ class ConnectivityManagerImpl final : public ConnectivityManager, private: // ===== Members that implement the ConnectivityManager abstract interface. + bool _HaveIPv4InternetConnectivity(void); + bool _HaveIPv6InternetConnectivity(void); +#if 0 // CHIP_DEVICE_CONFIG_ENABLE_THREAD + bool _HaveServiceConnectivity(void); +#endif CHIP_ERROR _Init(void); void _OnPlatformEvent(const ChipDeviceEvent * event); +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION + using Flags = GenericConnectivityManagerImpl_WiFi::ConnectivityFlags; + WiFiStationMode _GetWiFiStationMode(void); + CHIP_ERROR _SetWiFiStationMode(WiFiStationMode val); + bool _IsWiFiStationEnabled(void); + bool _IsWiFiStationApplicationControlled(void); + bool _IsWiFiStationConnected(void); + System::Clock::Timeout _GetWiFiStationReconnectInterval(void); + CHIP_ERROR _SetWiFiStationReconnectInterval(System::Clock::Timeout val); + bool _IsWiFiStationProvisioned(void); + void _ClearWiFiStationProvision(void); + CHIP_ERROR _GetAndLogWifiStatsCounters(void); + bool _CanStartWiFiScan(); + void _OnWiFiScanDone(); + void _OnWiFiStationProvisionChange(); +#endif // ===== Members for internal use by the following friends. friend ConnectivityManager & ConnectivityMgr(void); friend ConnectivityManagerImpl & ConnectivityMgrImpl(void); static ConnectivityManagerImpl sInstance; + + // ===== Private members reserved for use by this class only. +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION + System::Clock::Timestamp mLastStationConnectFailTime; + WiFiStationMode mWiFiStationMode; + WiFiStationState mWiFiStationState; + System::Clock::Timeout mWiFiStationReconnectInterval; + BitFlags mFlags; + + void DriveStationState(void); + void OnStationConnected(void); + void OnStationDisconnected(void); + void ChangeWiFiStationState(WiFiStationState newState); + static void DriveStationState(::chip::System::Layer * aLayer, void * aAppState); + + void UpdateInternetConnectivityState(void); +#endif }; +inline bool ConnectivityManagerImpl::_HaveIPv4InternetConnectivity(void) +{ +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION + return mFlags.Has(Flags::kHaveIPv4InternetConnectivity); +#else + return false; +#endif +} + +inline bool ConnectivityManagerImpl::_HaveIPv6InternetConnectivity(void) +{ +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION + return mFlags.Has(Flags::kHaveIPv6InternetConnectivity); +#else + return false; +#endif +} + +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION +inline bool ConnectivityManagerImpl::_IsWiFiStationApplicationControlled(void) +{ + return mWiFiStationMode == kWiFiStationMode_ApplicationControlled; +} + +inline bool ConnectivityManagerImpl::_IsWiFiStationConnected(void) +{ + return mWiFiStationState == kWiFiStationState_Connected; +} + +inline System::Clock::Timeout ConnectivityManagerImpl::_GetWiFiStationReconnectInterval(void) +{ + return mWiFiStationReconnectInterval; +} + +inline bool ConnectivityManagerImpl::_CanStartWiFiScan() +{ + return mWiFiStationState != kWiFiStationState_Connecting; +} +#endif +#if 0 // CHIP_DEVICE_CONFIG_ENABLE_THREAD +inline bool ConnectivityManagerImpl::_HaveServiceConnectivity(void) +{ + return _HaveServiceConnectivityViaThread(); +} +#endif + /** + * * Returns the public interface of the ConnectivityManager singleton object. * * Chip applications should use this to access features of the ConnectivityManager object diff --git a/src/platform/EFR32/ConnectivityManagerImpl_WIFI.cpp b/src/platform/EFR32/ConnectivityManagerImpl_WIFI.cpp new file mode 100644 index 00000000000000..bbae58753acf5b --- /dev/null +++ b/src/platform/EFR32/ConnectivityManagerImpl_WIFI.cpp @@ -0,0 +1,485 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2019 Nest Labs, Inc. + * + * 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. + */ +/* this file behaves like a config.h, comes first */ +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE +#include +#endif + +#include "wfx_host_events.h" + +using namespace ::chip; +using namespace ::chip::Inet; +using namespace ::chip::System; +using namespace ::chip::TLV; +using namespace ::chip::DeviceLayer::Internal; + +namespace chip { +namespace DeviceLayer { + +ConnectivityManagerImpl ConnectivityManagerImpl::sInstance; + +CHIP_ERROR ConnectivityManagerImpl::_Init() +{ + CHIP_ERROR err; + // Queue work items to bootstrap the AP and station state machines once the Chip event loop is running. + mWiFiStationMode = kWiFiStationMode_Disabled; + mWiFiStationState = kWiFiStationState_NotConnected; + mLastStationConnectFailTime = System::Clock::kZero; + mWiFiStationReconnectInterval = System::Clock::Milliseconds32(CHIP_DEVICE_CONFIG_WIFI_STATION_RECONNECT_INTERVAL); + mFlags.ClearAll(); + + // TODO Initialize the Chip Addressing and Routing Module. + + // Ensure that station mode is enabled. + wfx_enable_sta_mode(); + + err = DeviceLayer::SystemLayer().ScheduleWork(DriveStationState, NULL); + + SuccessOrExit(err); + +exit: + return err; +} + +void ConnectivityManagerImpl::_OnPlatformEvent(const ChipDeviceEvent * event) +{ + // Forward the event to the generic base classes as needed. + // Handle Wfx wifi events... + if (event->Type == DeviceEventType::kWFXSystemEvent) + { + if (event->Platform.WFXSystemEvent.eventBase == WIFI_EVENT) + { + switch (event->Platform.WFXSystemEvent.data.genericMsgEvent.header.id) + { + case SL_WFX_STARTUP_IND_ID: + ChipLogProgress(DeviceLayer, "WIFI_EVENT_STA_START"); + DriveStationState(); + break; + case SL_WFX_CONNECT_IND_ID: + ChipLogProgress(DeviceLayer, "WIFI_EVENT_STA_CONNECTED"); + if (mWiFiStationState == kWiFiStationState_Connecting) + { + if (event->Platform.WFXSystemEvent.data.connectEvent.body.status == 0) + { + ChangeWiFiStationState(kWiFiStationState_Connecting_Succeeded); + } + else + { + ChangeWiFiStationState(kWiFiStationState_Connecting_Failed); + } + } + DriveStationState(); + break; + case SL_WFX_DISCONNECT_IND_ID: + ChipLogProgress(DeviceLayer, "WIFI_EVENT_STA_DISCONNECTED"); + if (mWiFiStationState == kWiFiStationState_Connecting) + { + ChangeWiFiStationState(kWiFiStationState_Connecting_Failed); + } + DriveStationState(); + break; + default: + break; + } + } + else if (event->Platform.WFXSystemEvent.eventBase == IP_EVENT) + { + switch (event->Platform.WFXSystemEvent.data.genericMsgEvent.header.id) + { + case IP_EVENT_STA_GOT_IP: + ChipLogProgress(DeviceLayer, "IP_EVENT_STA_GOT_IP"); + UpdateInternetConnectivityState(); + break; + case IP_EVENT_STA_LOST_IP: + ChipLogProgress(DeviceLayer, "IP_EVENT_STA_LOST_IP"); + UpdateInternetConnectivityState(); + break; + case IP_EVENT_GOT_IP6: + ChipLogProgress(DeviceLayer, "IP_EVENT_GOT_IP6"); + UpdateInternetConnectivityState(); + break; + default: + break; + } + } + } +} +ConnectivityManager::WiFiStationMode ConnectivityManagerImpl::_GetWiFiStationMode(void) +{ + if (mWiFiStationMode != kWiFiStationMode_ApplicationControlled) + { + wifi_mode_t curWiFiMode = wfx_get_wifi_mode(); + if ((curWiFiMode == WIFI_MODE_STA) || (curWiFiMode == WIFI_MODE_APSTA)) + { + mWiFiStationMode = kWiFiStationMode_Enabled; + } + else + { + mWiFiStationMode = kWiFiStationMode_Disabled; + } + } + return mWiFiStationMode; +} + +bool ConnectivityManagerImpl::_IsWiFiStationProvisioned(void) +{ + char ssid[65]; + size_t len = 0; + + /* See if we have SSID in our Keys */ + if ((Internal::EFR32Config::ReadConfigValueStr(Internal::EFR32Config::kConfigKey_WiFiSSID, ssid, sizeof(ssid) - 1, len) == + CHIP_NO_ERROR) && + (ssid[0] != 0)) + { + return true; + } + + return false; +} + +bool ConnectivityManagerImpl::_IsWiFiStationEnabled(void) +{ + return wfx_is_sta_mode_enabled(); +} +CHIP_ERROR ConnectivityManagerImpl::_SetWiFiStationMode(ConnectivityManager::WiFiStationMode val) +{ + DeviceLayer::SystemLayer().ScheduleWork(DriveStationState, NULL); + + if (mWiFiStationMode != val) + { + ChipLogProgress(DeviceLayer, "WiFi station mode change: %s -> %s", WiFiStationModeToStr(mWiFiStationMode), + WiFiStationModeToStr(val)); + } + + mWiFiStationMode = val; + + return CHIP_NO_ERROR; +} +CHIP_ERROR ConnectivityManagerImpl::_SetWiFiStationReconnectInterval(System::Clock::Timeout val) +{ + mWiFiStationReconnectInterval = val; + return CHIP_NO_ERROR; +} +void ConnectivityManagerImpl::_ClearWiFiStationProvision(void) +{ + if (mWiFiStationMode != kWiFiStationMode_ApplicationControlled) + { + wfx_clear_wifi_provision(); + + DeviceLayer::SystemLayer().ScheduleWork(DriveStationState, NULL); + } +} + +CHIP_ERROR ConnectivityManagerImpl::_GetAndLogWifiStatsCounters(void) +{ + return CHIP_ERROR_NOT_IMPLEMENTED; +} + +void ConnectivityManagerImpl::_OnWiFiScanDone() +{ + // CHIP_ERROR_NOT_IMPLEMENTED +} + +void ConnectivityManagerImpl::_OnWiFiStationProvisionChange() +{ + // Schedule a call to the DriveStationState method to adjust the station state as needed. + ChipLogProgress(DeviceLayer, "_ON WIFI PROVISION CHANGE"); + DeviceLayer::SystemLayer().ScheduleWork(DriveStationState, NULL); +} + +// == == == == == == == == == == ConnectivityManager Private Methods == == == == == == == == == == + +void ConnectivityManagerImpl::DriveStationState() +{ + CHIP_ERROR err = CHIP_NO_ERROR; + sl_status_t serr; + bool stationConnected; + + // Refresh the current station mode. + GetWiFiStationMode(); + + // If the station interface is NOT under application control... + if (mWiFiStationMode != kWiFiStationMode_ApplicationControlled) + { + // Ensure that the WFX is started. + if ((serr = wfx_wifi_start()) != SL_STATUS_OK) + { + ChipLogError(DeviceLayer, "WFX_wifi_start: FAIL: %s", chip::ErrorStr(err)); + return; + } + // Ensure that station mode is enabled in the WFX WiFi layer. + wfx_enable_sta_mode(); + } + + stationConnected = wfx_is_sta_connected(); + + // If the station interface is currently connected ... + if (stationConnected) + { + // Advance the station state to Connected if it was previously NotConnected or + // a previously initiated connect attempt succeeded. + if (mWiFiStationState == kWiFiStationState_NotConnected || mWiFiStationState == kWiFiStationState_Connecting_Succeeded) + { + ChangeWiFiStationState(kWiFiStationState_Connected); + ChipLogProgress(DeviceLayer, "WiFi station interface connected"); + mLastStationConnectFailTime = System::Clock::kZero; + OnStationConnected(); + } + + // If the WiFi station interface is no longer enabled, or no longer provisioned, + // disconnect the station from the AP, unless the WiFi station mode is currently + // under application control. + if (mWiFiStationMode != kWiFiStationMode_ApplicationControlled && + (mWiFiStationMode != kWiFiStationMode_Enabled || !IsWiFiStationProvisioned())) + { + ChipLogProgress(DeviceLayer, "Disconnecting WiFi station interface"); + serr = wfx_sta_discon(); + if (serr != SL_STATUS_OK) + { + ChipLogError(DeviceLayer, "wfx_wifi_disconnect() failed: %s", chip::ErrorStr(err)); + } + SuccessOrExit(serr); + + ChangeWiFiStationState(kWiFiStationState_Disconnecting); + } + } + // Otherwise the station interface is NOT connected to an AP, so... + else + { + System::Clock::Timestamp now = System::SystemClock().GetMonotonicTimestamp(); + + // Advance the station state to NotConnected if it was previously Connected or Disconnecting, + // or if a previous initiated connect attempt failed. + if (mWiFiStationState == kWiFiStationState_Connected || mWiFiStationState == kWiFiStationState_Disconnecting || + mWiFiStationState == kWiFiStationState_Connecting_Failed) + { + WiFiStationState prevState = mWiFiStationState; + ChangeWiFiStationState(kWiFiStationState_NotConnected); + if (prevState != kWiFiStationState_Connecting_Failed) + { + ChipLogProgress(DeviceLayer, "WiFi station interface disconnected"); + mLastStationConnectFailTime = System::Clock::kZero; + OnStationDisconnected(); + } + else + { + mLastStationConnectFailTime = now; + } + } + + // If the WiFi station interface is now enabled and provisioned (and by implication, + // not presently under application control), AND the system is not in the process of + // scanning, then... + if (mWiFiStationMode == kWiFiStationMode_Enabled && IsWiFiStationProvisioned()) + { + // Initiate a connection to the AP if we haven't done so before, or if enough + // time has passed since the last attempt. + if (mLastStationConnectFailTime == System::Clock::kZero || + now >= mLastStationConnectFailTime + mWiFiStationReconnectInterval) + { + if (mWiFiStationState != kWiFiStationState_Connecting) + { + wfx_wifi_provision_t wcfg; + size_t sz; + + (void) Internal::EFR32Config::ReadConfigValueStr(Internal::EFR32Config::kConfigKey_WiFiSSID, wcfg.ssid, + sizeof(wcfg.ssid), sz); + (void) Internal::EFR32Config::ReadConfigValueStr(Internal::EFR32Config::kConfigKey_WiFiPSK, wcfg.passkey, + sizeof(wcfg.passkey), sz); + (void) Internal::EFR32Config::ReadConfigValueBin(Internal::EFR32Config::kConfigKey_WiFiSEC, &wcfg.security, + sizeof(wcfg.security), sz); + wfx_set_wifi_provision(&wcfg); + + ChipLogProgress(DeviceLayer, "Attempting to connect WiFi (%s)", wcfg.ssid); + if ((serr = wfx_connect_to_ap()) != SL_STATUS_OK) + { + ChipLogError(DeviceLayer, "wfx_connect_to_ap failed"); + } + SuccessOrExit(serr); + + ChangeWiFiStationState(kWiFiStationState_Connecting); + } + } + + // Otherwise arrange another connection attempt at a suitable point in the future. + else + { + System::Clock::Timestamp timeToNextConnect = (mLastStationConnectFailTime + mWiFiStationReconnectInterval) - now; + + ChipLogProgress(DeviceLayer, "Next WiFi station reconnect in %" PRIu32 " ms", + System::Clock::Milliseconds32(timeToNextConnect).count()); + + ReturnOnFailure(DeviceLayer::SystemLayer().StartTimer(timeToNextConnect, DriveStationState, NULL)); + } + } + } + +exit: + + ChipLogProgress(DeviceLayer, "Done driving station state, nothing else to do..."); + // Kick-off any pending network scan that might have been deferred due to the activity + // of the WiFi station. +} + +void ConnectivityManagerImpl::OnStationConnected() +{ + ChipDeviceEvent event; + + wfx_setup_ip6_link_local(SL_WFX_STA_INTERFACE); + + // Alert other components of the new state. + event.Type = DeviceEventType::kWiFiConnectivityChange; + event.WiFiConnectivityChange.Result = kConnectivity_Established; + (void) PlatformMgr().PostEvent(&event); + + UpdateInternetConnectivityState(); +} + +void ConnectivityManagerImpl::OnStationDisconnected() +{ + // TODO Invoke WARM to perform actions that occur when the WiFi station interface goes down. + + // Alert other components of the new state. + ChipDeviceEvent event; + event.Type = DeviceEventType::kWiFiConnectivityChange; + event.WiFiConnectivityChange.Result = kConnectivity_Lost; + (void) PlatformMgr().PostEvent(&event); + + UpdateInternetConnectivityState(); +} +void ConnectivityManagerImpl::DriveStationState(::chip::System::Layer * aLayer, void * aAppState) +{ + sInstance.DriveStationState(); +} + +void ConnectivityManagerImpl::ChangeWiFiStationState(WiFiStationState newState) +{ + if (mWiFiStationState != newState) + { + ChipLogProgress(DeviceLayer, "WiFi station state change: %s -> %s", WiFiStationStateToStr(mWiFiStationState), + WiFiStationStateToStr(newState)); + mWiFiStationState = newState; + } +} + +void ConnectivityManagerImpl::UpdateInternetConnectivityState(void) +{ + bool haveIPv4Conn = false; + bool haveIPv6Conn = false; + bool hadIPv4Conn = mFlags.Has(ConnectivityFlags::kHaveIPv4InternetConnectivity); + bool hadIPv6Conn = mFlags.Has(ConnectivityFlags::kHaveIPv6InternetConnectivity); + IPAddress addr; + + // If the WiFi station is currently in the connected state... + if (mWiFiStationState == kWiFiStationState_Connected) + { +#if 1 //! defined (SL_WF200) || (SL_WF200 == 0) + + haveIPv4Conn = wfx_have_ipv4_addr(SL_WFX_STA_INTERFACE); + /* TODO - haveIPv6Conn */ +#else /* Old code that needed LWIP and its internals */ + // Get the LwIP netif for the WiFi station interface. + struct netif * netif = Internal::WFXUtils::GetStationNetif(); + + // If the WiFi station interface is up... + if (netif != NULL && netif_is_up(netif) && netif_is_link_up(netif)) + { + // // Check if a DNS server is currently configured. If so... + // TODO + // ip_addr_t dnsServerAddr = *dns_getserver(0); + // if (!ip_addr_isany_val(dnsServerAddr)) + if (1) + { + // If the station interface has been assigned an IPv4 address, and has + // an IPv4 gateway, then presume that the device has IPv4 Internet + // connectivity. + if (!ip4_addr_isany_val(*netif_ip4_addr(netif)) && !ip4_addr_isany_val(*netif_ip4_gw(netif))) + { + haveIPv4Conn = true; + char addrStr[INET_ADDRSTRLEN]; + // TODO: change the code to using IPv6 address + sprintf(addrStr, "%d.%d.%d.%d", (int) (netif->ip_addr.u_addr.ip4.addr & 0xff), + (int) ((netif->ip_addr.u_addr.ip4.addr >> 8) & 0xff), + (int) ((netif->ip_addr.u_addr.ip4.addr >> 16) & 0xff), + (int) ((netif->ip_addr.u_addr.ip4.addr >> 24) & 0xff)); + IPAddress::FromString(addrStr, addr); + } + + // TODO + // Search among the IPv6 addresses assigned to the interface for a Global Unicast + // address (2000::/3) that is in the valid state. If such an address is found... + // for (uint8_t i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) + // { + // if (ip6_addr_isglobal(netif_ip6_addr(netif, i)) && ip6_addr_isvalid(netif_ip6_addr_state(netif, i))) + // { + // // Determine if there is a default IPv6 router that is currently reachable + // // via the station interface. If so, presume for now that the device has + // // IPv6 connectivity. + // struct netif * found_if = nd6_find_route(IP6_ADDR_ANY6); + // if (found_if && netif->num == found_if->num) + // { + // haveIPv6Conn = true; + // } + // } + // } + } + } +#endif /* OLD-Code */ + } + + // If the internet connectivity state has changed... + if (haveIPv4Conn != hadIPv4Conn || haveIPv6Conn != hadIPv6Conn) + { + // Update the current state. + mFlags.Set(ConnectivityFlags::kHaveIPv4InternetConnectivity, haveIPv4Conn) + .Set(ConnectivityFlags::kHaveIPv6InternetConnectivity, haveIPv6Conn); + + // Alert other components of the state change. + ChipDeviceEvent event; + event.Type = DeviceEventType::kInternetConnectivityChange; + event.InternetConnectivityChange.IPv4 = GetConnectivityChange(hadIPv4Conn, haveIPv4Conn); + event.InternetConnectivityChange.IPv6 = GetConnectivityChange(hadIPv6Conn, haveIPv6Conn); + addr.ToString(event.InternetConnectivityChange.address, sizeof(event.InternetConnectivityChange.address)); + (void) PlatformMgr().PostEvent(&event); + + if (haveIPv4Conn != hadIPv4Conn) + { + ChipLogProgress(DeviceLayer, "%s Internet connectivity %s", "IPv4", (haveIPv4Conn) ? "ESTABLISHED" : "LOST"); + } + + if (haveIPv6Conn != hadIPv6Conn) + { + ChipLogProgress(DeviceLayer, "%s Internet connectivity %s", "IPv6", (haveIPv6Conn) ? "ESTABLISHED" : "LOST"); + } + } +} + +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/EFR32/DeviceNetworkProvisioningDelegateImpl.cpp b/src/platform/EFR32/DeviceNetworkProvisioningDelegateImpl.cpp index 0f87641906c80b..f01887563d3cdd 100644 --- a/src/platform/EFR32/DeviceNetworkProvisioningDelegateImpl.cpp +++ b/src/platform/EFR32/DeviceNetworkProvisioningDelegateImpl.cpp @@ -16,6 +16,9 @@ */ #include "DeviceNetworkProvisioningDelegateImpl.h" +#include "ServiceProvisioning.h" +#include +#include #if CHIP_ENABLE_OPENTHREAD #include @@ -40,5 +43,21 @@ DeviceNetworkProvisioningDelegateImpl::_ProvisionThreadNetwork(ByteSpan threadDa #endif // CHIP_ENABLE_OPENTHREAD } +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION +CHIP_ERROR DeviceNetworkProvisioningDelegateImpl::_ProvisionWiFiNetwork(const char * ssid, const char * key) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + ChipLogProgress(NetworkProvisioning, "EFR Wifi provision: SSID: %s", ssid); + err = SetWiFiStationProvisioning(ssid, key); + if (err != CHIP_NO_ERROR) + { + ChipLogError(NetworkProvisioning, "ERR:WiFi:Provision network: %s", chip::ErrorStr(err)); + } + + return err; +} +#endif + } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/EFR32/DeviceNetworkProvisioningDelegateImpl.h b/src/platform/EFR32/DeviceNetworkProvisioningDelegateImpl.h index e799358e4b7536..6eb53530c0c8d1 100644 --- a/src/platform/EFR32/DeviceNetworkProvisioningDelegateImpl.h +++ b/src/platform/EFR32/DeviceNetworkProvisioningDelegateImpl.h @@ -35,7 +35,11 @@ class DeviceNetworkProvisioningDelegateImpl final friend class GenericDeviceNetworkProvisioningDelegateImpl; private: +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION + CHIP_ERROR _ProvisionWiFiNetwork(const char * ssid, const char * passwd); +#else CHIP_ERROR _ProvisionWiFiNetwork(const char * ssid, const char * passwd) { return CHIP_ERROR_NOT_IMPLEMENTED; } +#endif CHIP_ERROR _ProvisionThreadNetwork(ByteSpan threadData); }; diff --git a/src/platform/EFR32/DiagnosticDataProviderImpl.cpp b/src/platform/EFR32/DiagnosticDataProviderImpl.cpp index e04a34057f8f4b..7c838ecb8633e7 100644 --- a/src/platform/EFR32/DiagnosticDataProviderImpl.cpp +++ b/src/platform/EFR32/DiagnosticDataProviderImpl.cpp @@ -25,8 +25,9 @@ #include #include +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD #include - +#endif #include #include "AppConfig.h" @@ -180,13 +181,16 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetNetworkInterfaces(NetworkInterface ** { NetworkInterface * ifp = new NetworkInterface(); +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD const char * threadNetworkName = otThreadGetNetworkName(ThreadStackMgrImpl().OTInstance()); ifp->name = Span(threadNetworkName, strlen(threadNetworkName)); ifp->fabricConnected = true; ifp->offPremiseServicesReachableIPv4 = false; ifp->offPremiseServicesReachableIPv6 = false; ifp->type = InterfaceType::EMBER_ZCL_INTERFACE_TYPE_THREAD; - +#else + /* TODO */ +#endif uint8_t macBuffer[ConfigurationManager::kPrimaryMACAddressLength]; ConfigurationMgr().GetPrimary802154MACAddress(macBuffer); ifp->hardwareAddress = ByteSpan(macBuffer, ConfigurationManager::kPrimaryMACAddressLength); diff --git a/src/platform/EFR32/EFR32Config.h b/src/platform/EFR32/EFR32Config.h index 295c6f8e08af1d..ea66ef9cf92df5 100644 --- a/src/platform/EFR32/EFR32Config.h +++ b/src/platform/EFR32/EFR32Config.h @@ -95,8 +95,11 @@ class EFR32Config static constexpr Key kConfigKey_CountryCode = EFR32ConfigKey(kChipConfig_KeyBase, 0x0A); static constexpr Key kConfigKey_Breadcrumb = EFR32ConfigKey(kChipConfig_KeyBase, 0x0B); static constexpr Key kConfigKey_ActiveLocale = EFR32ConfigKey(kChipConfig_KeyBase, 0x0C); - static constexpr Key kConfigKey_GroupKeyBase = EFR32ConfigKey(kChipConfig_KeyBase, 0x0D); - static constexpr Key kConfigKey_GroupKeyMax = EFR32ConfigKey(kChipConfig_KeyBase, 0x1C); // Allows 16 Group Keys to be created. + static constexpr Key kConfigKey_WiFiSSID = EFR32ConfigKey(kChipConfig_KeyBase, 0x0D); + static constexpr Key kConfigKey_WiFiPSK = EFR32ConfigKey(kChipConfig_KeyBase, 0x0E); + static constexpr Key kConfigKey_WiFiSEC = EFR32ConfigKey(kChipConfig_KeyBase, 0x0F); + static constexpr Key kConfigKey_GroupKeyBase = EFR32ConfigKey(kChipConfig_KeyBase, 0x10); + static constexpr Key kConfigKey_GroupKeyMax = EFR32ConfigKey(kChipConfig_KeyBase, 0x1F); // Allows 16 Group Keys to be created. // CHIP Counter Keys static constexpr Key kConfigKey_BootCount = EFR32ConfigKey(kChipCounter_KeyBase, 0x00); diff --git a/src/platform/EFR32/InetPlatformConfig.h b/src/platform/EFR32/InetPlatformConfig.h index 87527cf1789e3e..3e8bb9a2f6d229 100644 --- a/src/platform/EFR32/InetPlatformConfig.h +++ b/src/platform/EFR32/InetPlatformConfig.h @@ -25,10 +25,21 @@ #pragma once +#include + // ==================== Platform Adaptations ==================== +#define INET_CONFIG_ERROR_TYPE int32_t +#define INET_CONFIG_NO_ERROR 0 +#define INET_CONFIG_ERROR_MIN 1000000 +#define INET_CONFIG_ERROR_MAX 1000999 + #ifndef INET_CONFIG_ENABLE_IPV4 -#error Inet IPv4 configuration should be configured at build generation time +#ifdef SL_WIFI +#define INET_CONFIG_ENABLE_IPV4 1 +#else /* For Thread only devices */ +#define INET_CONFIG_ENABLE_IPV4 0 +#endif #endif // ========== Platform-specific Configuration Overrides ========= @@ -38,5 +49,5 @@ #endif // INET_CONFIG_NUM_TCP_ENDPOINTS #ifndef INET_CONFIG_NUM_UDP_ENDPOINTS -#define INET_CONFIG_NUM_UDP_ENDPOINTS 4 +#define INET_CONFIG_NUM_UDP_ENDPOINTS 6 #endif // INET_CONFIG_NUM_UDP_ENDPOINTS diff --git a/src/platform/EFR32/PlatformManagerImpl.cpp b/src/platform/EFR32/PlatformManagerImpl.cpp index 790bf23da7ecca..14947f894681a4 100644 --- a/src/platform/EFR32/PlatformManagerImpl.cpp +++ b/src/platform/EFR32/PlatformManagerImpl.cpp @@ -84,6 +84,74 @@ CHIP_ERROR PlatformManagerImpl::_Shutdown() return Internal::GenericPlatformManagerImpl_FreeRTOS::_Shutdown(); } +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION +void PlatformManagerImpl::HandleWFXSystemEvent(wfx_event_base_t eventBase, sl_wfx_generic_message_t * eventData) +{ + ChipDeviceEvent event; + memset(&event, 0, sizeof(event)); + event.Type = DeviceEventType::kWFXSystemEvent; + event.Platform.WFXSystemEvent.eventBase = eventBase; + + if (eventBase == WIFI_EVENT) + { + switch (eventData->header.id) + { + case SL_WFX_STARTUP_IND_ID: + memcpy(&event.Platform.WFXSystemEvent.data.startupEvent, eventData, + sizeof(event.Platform.WFXSystemEvent.data.startupEvent)); + break; + case SL_WFX_CONNECT_IND_ID: + memcpy(&event.Platform.WFXSystemEvent.data.connectEvent, eventData, + sizeof(event.Platform.WFXSystemEvent.data.connectEvent)); + break; + case SL_WFX_DISCONNECT_IND_ID: + memcpy(&event.Platform.WFXSystemEvent.data.disconnectEvent, eventData, + sizeof(event.Platform.WFXSystemEvent.data.disconnectEvent)); + break; + // case SL_WFX_RECEIVED_IND_ID: + // memcpy(&event.Platform.WFXSystemEvent.data.receivedEvent, eventData, + // sizeof(event.Platform.WFXSystemEvent.data.receivedEvent)); + // break; + // case SL_WFX_GENERIC_IND_ID: + // memcpy(&event.Platform.WFXSystemEvent.data.genericEvent, eventData, + // sizeof(event.Platform.WFXSystemEvent.data.genericEvent)); + // break; + // case SL_WFX_EXCEPTION_IND_ID: + // memcpy(&event.Platform.WFXSystemEvent.data.exceptionEvent, eventData, + // sizeof(event.Platform.WFXSystemEvent.data.exceptionEvent)); + // break; + // case SL_WFX_ERROR_IND_ID: + // memcpy(&event.Platform.WFXSystemEvent.data.errorEvent, eventData, + // sizeof(event.Platform.WFXSystemEvent.data.errorEvent)); + // break; + default: + break; + } + } + else if (eventBase == IP_EVENT) + { + switch (eventData->header.id) + { + case IP_EVENT_STA_GOT_IP: + memcpy(&event.Platform.WFXSystemEvent.data.genericMsgEvent, eventData, + sizeof(event.Platform.WFXSystemEvent.data.genericMsgEvent)); + break; + case IP_EVENT_GOT_IP6: + memcpy(&event.Platform.WFXSystemEvent.data.genericMsgEvent, eventData, + sizeof(event.Platform.WFXSystemEvent.data.genericMsgEvent)); + break; + case IP_EVENT_STA_LOST_IP: + memcpy(&event.Platform.WFXSystemEvent.data.genericMsgEvent, eventData, + sizeof(event.Platform.WFXSystemEvent.data.genericMsgEvent)); + break; + default: + break; + } + } + + (void) sInstance.PostEvent(&event); +} +#endif } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/EFR32/PlatformManagerImpl.h b/src/platform/EFR32/PlatformManagerImpl.h index 63a3df6fc03eb8..975fd6ab3463e0 100644 --- a/src/platform/EFR32/PlatformManagerImpl.h +++ b/src/platform/EFR32/PlatformManagerImpl.h @@ -25,6 +25,9 @@ #pragma once #include +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION +#include "wfx_host_events.h" +#endif namespace chip { namespace DeviceLayer { @@ -46,6 +49,9 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener public: // ===== Platform-specific members that may be accessed directly by the application. +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION + void HandleWFXSystemEvent(wfx_event_base_t eventBase, sl_wfx_generic_message_t * eventData); +#endif System::Clock::Timestamp GetStartTime() { return mStartTime; } diff --git a/src/platform/EFR32/ServiceProvisioning.cpp b/src/platform/EFR32/ServiceProvisioning.cpp new file mode 100644 index 00000000000000..494c03b7ec2a61 --- /dev/null +++ b/src/platform/EFR32/ServiceProvisioning.cpp @@ -0,0 +1,56 @@ +/* + * + * Copyright (c) 2020 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. + */ + +#include +#include +#include + +#include "wfx_host_events.h" +#include + +#include "ServiceProvisioning.h" + +using namespace ::chip::DeviceLayer; + +CHIP_ERROR SetWiFiStationProvisioning(const char * ssid, const char * key) +{ + ConnectivityMgr().SetWiFiStationMode(ConnectivityManager::kWiFiStationMode_Disabled); + + CHIP_ERROR err = CHIP_NO_ERROR; + wfx_wifi_provision_t wifiConfig; + + // Set the wifi configuration + memset(&wifiConfig, 0, sizeof(wifiConfig)); + memcpy(wifiConfig.ssid, ssid, std::min(strlen(ssid) + 1, sizeof(wifiConfig.ssid))); + memcpy(wifiConfig.passkey, key, std::min(strlen(key) + 1, sizeof(wifiConfig.passkey))); + wifiConfig.security = WFX_SEC_WPA2; /* Need something better ? Scan? */ + + // Configure the WFX WiFi interface. + wfx_set_wifi_provision(&wifiConfig); + /* Save into internal Keys */ + (void) Internal::EFR32Config::WriteConfigValueStr(Internal::EFR32Config::kConfigKey_WiFiSSID, (char *) ssid); + (void) Internal::EFR32Config::WriteConfigValueStr(Internal::EFR32Config::kConfigKey_WiFiPSK, key); + (void) Internal::EFR32Config::WriteConfigValueBin(Internal::EFR32Config::kConfigKey_WiFiSEC, &wifiConfig.security, + sizeof(wifiConfig.security)); + + ChipLogProgress(DeviceLayer, "SP WiFi STA provision set (SSID: %s)", wifiConfig.ssid); + + ConnectivityMgr().SetWiFiStationMode(ConnectivityManager::kWiFiStationMode_Disabled); + ConnectivityMgr().SetWiFiStationMode(ConnectivityManager::kWiFiStationMode_Enabled); + + return err; +} diff --git a/src/platform/EFR32/ServiceProvisioning.h b/src/platform/EFR32/ServiceProvisioning.h new file mode 100644 index 00000000000000..109ec4ae33ea6c --- /dev/null +++ b/src/platform/EFR32/ServiceProvisioning.h @@ -0,0 +1,25 @@ +/* + * + * Copyright (c) 2020 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. + */ + +#ifndef _SERVICE_PROVISIONING_H +#define _SERVICE_PROVISIONING_H + +#include + +CHIP_ERROR SetWiFiStationProvisioning(const char * ssid, const char * key); + +#endif // _SERVICE_PROVISIONING_H diff --git a/src/platform/EFR32/wifi_args.gni b/src/platform/EFR32/wifi_args.gni new file mode 100644 index 00000000000000..fc6660bc825d73 --- /dev/null +++ b/src/platform/EFR32/wifi_args.gni @@ -0,0 +1,46 @@ +# Copyright (c) 2021 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. + +import("//build_overrides/chip.gni") +import("//build_overrides/efr32_sdk.gni") +import("//build_overrides/pigweed.gni") + +import("${chip_root}/examples/platform/efr32/args.gni") + +# ARM architecture flags will be set based on efr32_family. +arm_platform_config = "${efr32_sdk_build_root}/efr32_arm.gni" + +mbedtls_target = "${efr32_sdk_build_root}:efr32_sdk" + +#lwip_platform = "external" +lwip_platform = "efr32" +lwip_ipv6 = true +lwip_ipv4 = true +lwip_api = true +lwip_ethernet = true + +chip_device_platform = "efr32" +chip_enable_openthread = false +chip_inet_config_enable_ipv4 = true +chip_inet_config_enable_dns_resolver = false + +chip_build_tests = false +chip_config_memory_management = "platform" +chip_mdns = "minimal" +chip_enable_pw_rpc = false + +pw_build_LINK_DEPS = [ + "$dir_pw_assert:impl", + "$dir_pw_log:impl", +] diff --git a/third_party/efr32_sdk/efr32_sdk.gni b/third_party/efr32_sdk/efr32_sdk.gni index 82191ec80ca1e1..0bd7a6faf8bd9d 100644 --- a/third_party/efr32_sdk/efr32_sdk.gni +++ b/third_party/efr32_sdk/efr32_sdk.gni @@ -38,6 +38,12 @@ template("efr32_sdk") { } assert(efr32_sdk_root != "", "efr32_sdk_root must be specified") + use_wf200 = false + if (defined(invoker.use_wf200)) { + if (invoker.use_wf200) { + use_wf200 = true + } + } sdk_target_name = target_name @@ -224,6 +230,15 @@ template("efr32_sdk") { "CHIP_KVS_SECTOR_COUNT=4", ] } + if (use_wf200) { + _include_dirs += [ + "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver", + "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/bus", + "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/firmware", + "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/pds/brd8022a", + "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/secure_link", + ] + } cflags = [] foreach(include_dir, _include_dirs) { @@ -443,6 +458,14 @@ template("efr32_sdk") { ] } } + if (use_wf200) { + sources += [ + "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/bus/sl_wfx_bus.c", + "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/bus/sl_wfx_bus_spi.c", + "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/secure_link/sl_wfx_secure_link.c", + "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/sl_wfx.c", + ] + } if (efr32_family == "efr32mg12") { sources += [ diff --git a/third_party/wiseconnect-wifi-bt-sdk b/third_party/wiseconnect-wifi-bt-sdk new file mode 120000 index 00000000000000..11fcb1f88f5c89 --- /dev/null +++ b/third_party/wiseconnect-wifi-bt-sdk @@ -0,0 +1 @@ +../../../wiseconnect-wifi-bt-sdk \ No newline at end of file From 5d2778fc647e8f6fd37d0ea816ba569f76e0a674 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Thu, 20 Jan 2022 22:40:30 +0100 Subject: [PATCH 04/15] Remove WriteClientHandle leftovers (followup of #13248) (#13774) --- src/app/WriteClient.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/app/WriteClient.h b/src/app/WriteClient.h index 43ab35df860148..90e3307eb875a9 100644 --- a/src/app/WriteClient.h +++ b/src/app/WriteClient.h @@ -42,7 +42,6 @@ namespace chip { namespace app { -class WriteClientHandle; class InteractionModelEngine; /** @@ -168,7 +167,6 @@ class WriteClient : public Messaging::ExchangeDelegate private: friend class TestWriteInteraction; friend class InteractionModelEngine; - friend class WriteClientHandle; enum class State { From 00f6d2574c0ba77cbd4d64b9e50ede72411a3dce Mon Sep 17 00:00:00 2001 From: Thomas Langewouters <82949801+q-thla@users.noreply.github.com> Date: Thu, 20 Jan 2022 23:04:26 +0100 Subject: [PATCH 05/15] Adopt new qpg SDK directory structure (#13762) Introduce qpg_sdk_lib_dir to override the subdirectory in qpg_sdk_root where the Qorvo platform libraries (.a) are to be found. Add an option (qpg_sdk_include_platform_libs) to disable referencing Qorvo platform libraries (useful to avoid missing unneeded paths when building //config/qpg/chip-gn). Update third_party/qpg_sdk/repo to a commit with the new directory structure. --- examples/lighting-app/qpg/BUILD.gn | 2 +- examples/lock-app/qpg/BUILD.gn | 2 +- examples/persistent-storage/qpg/BUILD.gn | 2 +- src/lwip/BUILD.gn | 11 ++-- third_party/openthread/platforms/qpg/BUILD.gn | 4 +- third_party/qpg_sdk/BUILD.gn | 4 +- third_party/qpg_sdk/qpg_sdk.gni | 51 ++++++++++++------- third_party/qpg_sdk/repo | 2 +- 8 files changed, 46 insertions(+), 32 deletions(-) diff --git a/examples/lighting-app/qpg/BUILD.gn b/examples/lighting-app/qpg/BUILD.gn index 428931ffcd2cdc..4b8c416fffdfa5 100644 --- a/examples/lighting-app/qpg/BUILD.gn +++ b/examples/lighting-app/qpg/BUILD.gn @@ -79,7 +79,7 @@ qpg_executable("lighting_app") { "${chip_root}/examples/lighting-app/lighting-common/color_format", ] - ldscript = "${qpg_sdk_root}/${qpg_target_ic}/ldscripts/chip-${qpg_target_ic}-example.ld" + ldscript = "${qpg_sdk_root}/Libraries/Qorvo/QorvoStack/gen/QorvoStack_${qpg_target_ic}/QorvoStack_${qpg_target_ic}.ld" inputs = [ ldscript ] diff --git a/examples/lock-app/qpg/BUILD.gn b/examples/lock-app/qpg/BUILD.gn index 0ba2a9729c709f..c25fe779b00dc0 100644 --- a/examples/lock-app/qpg/BUILD.gn +++ b/examples/lock-app/qpg/BUILD.gn @@ -75,7 +75,7 @@ qpg_executable("lock_app") { cflags = [ "-Wconversion" ] - ldscript = "${qpg_sdk_root}/${qpg_target_ic}/ldscripts/chip-${qpg_target_ic}-example.ld" + ldscript = "${qpg_sdk_root}/Libraries/Qorvo/QorvoStack/gen/QorvoStack_${qpg_target_ic}/QorvoStack_${qpg_target_ic}.ld" inputs = [ ldscript ] diff --git a/examples/persistent-storage/qpg/BUILD.gn b/examples/persistent-storage/qpg/BUILD.gn index 907dfba90e9a1b..19cfb9eb550549 100644 --- a/examples/persistent-storage/qpg/BUILD.gn +++ b/examples/persistent-storage/qpg/BUILD.gn @@ -63,7 +63,7 @@ qpg_executable("persistent_storage") { output_dir = root_out_dir - ldscript = "${qpg_sdk_root}/${qpg_target_ic}/ldscripts/chip-${qpg_target_ic}-example.ld" + ldscript = "${qpg_sdk_root}/Libraries/Qorvo/QorvoStack/gen/QorvoStack_${qpg_target_ic}/QorvoStack_${qpg_target_ic}.ld" inputs = [ ldscript ] diff --git a/src/lwip/BUILD.gn b/src/lwip/BUILD.gn index a038fe06875500..6fb03fc2768381 100644 --- a/src/lwip/BUILD.gn +++ b/src/lwip/BUILD.gn @@ -99,14 +99,13 @@ if (current_os == "zephyr" || current_os == "mbed") { lwip_target("lwip") { public = [ - "${qpg_sdk_build_root}/repo/${qpg_target_ic}/comps/lwip/arch/cc.h", - "${qpg_sdk_build_root}/repo/${qpg_target_ic}/comps/lwip/arch/perf.h", - "${qpg_sdk_build_root}/repo/${qpg_target_ic}/comps/lwip/lwipopts.h", - "${qpg_sdk_build_root}/repo/${qpg_target_ic}/comps/lwip/lwippools.h", + "${qpg_sdk_root}/Components/ThirdParty/Lwip/arch/cc.h", + "${qpg_sdk_root}/Components/ThirdParty/Lwip/arch/perf.h", + "${qpg_sdk_root}/Components/ThirdParty/Lwip/lwipopts.h", + "${qpg_sdk_root}/Components/ThirdParty/Lwip/lwippools.h", "freertos/arch/sys_arch.h", ] - sources = - [ "${qpg_sdk_build_root}/repo/${qpg_target_ic}/comps/lwip/sys_arch.c" ] + sources = [ "${qpg_sdk_root}/Components/ThirdParty/Lwip/sys_arch.c" ] public_deps = [ ":lwip_buildconfig" ] public_deps += [ "${qpg_sdk_build_root}:qpg_sdk" ] diff --git a/third_party/openthread/platforms/qpg/BUILD.gn b/third_party/openthread/platforms/qpg/BUILD.gn index f87607b062e249..4a3c7634b2f7d9 100644 --- a/third_party/openthread/platforms/qpg/BUILD.gn +++ b/third_party/openthread/platforms/qpg/BUILD.gn @@ -64,7 +64,9 @@ source_set("libopenthread-qpg") { ] include_dirs += [ "${openthread_root}/examples/apps" ] - libs = [ "${qpg_sdk_root}/${qpg_target_ic}/lib/libOpenThreadQorvoGlue_${qpg_target_ic}_mtd.a" ] + if (qpg_sdk_include_platform_libs) { + libs = [ "${qpg_sdk_root}/${qpg_sdk_lib_dir}/OpenThreadQorvoGlue_${qpg_target_ic}_mtd/libOpenThreadQorvoGlue_${qpg_target_ic}_mtd.a" ] + } public_deps = [ ":openthread_core_config_qpg", diff --git a/third_party/qpg_sdk/BUILD.gn b/third_party/qpg_sdk/BUILD.gn index ce2d987151e179..c7cf2b29d0b7bc 100755 --- a/third_party/qpg_sdk/BUILD.gn +++ b/third_party/qpg_sdk/BUILD.gn @@ -33,8 +33,8 @@ group("qpg_sdk") { config("qpg_freertos_config") { include_dirs = [ - "${qpg_sdk_root}/${qpg_target_ic}/comps/gpFreeRTOS/config", - "${chip_root}/third_party/qpg_sdk/repo/${qpg_target_ic}/comps/lwip", + "${qpg_sdk_root}/Applications/Matter/shared/config/inc", + "${qpg_sdk_root}/Components/ThirdParty/Lwip", "${freertos_root}/repo/portable/GCC/ARM_CM3", ] } diff --git a/third_party/qpg_sdk/qpg_sdk.gni b/third_party/qpg_sdk/qpg_sdk.gni index 5b8385cee44a91..9cae9288e36e14 100644 --- a/third_party/qpg_sdk/qpg_sdk.gni +++ b/third_party/qpg_sdk/qpg_sdk.gni @@ -22,8 +22,16 @@ declare_args() { # Location of the QPG SDK. qpg_sdk_root = "${chip_root}/third_party/qpg_sdk/repo" + # subdirectory in qpg_sdk_root where the binary library builds (.a) are to be found + # for connectedhomeip-qpg: Binaries (default) + # for matter endnodes sdk: Work + qpg_sdk_lib_dir = "Binaries" + # Target IC for QPG SDK qpg_target_ic = "qpg6105" + + # an option to disable referencing qorvo object archive files (*.a) + qpg_sdk_include_platform_libs = true } assert(qpg_sdk_root != "", "qpg_sdk_root must be specified") @@ -57,21 +65,25 @@ template("qpg_sdk") { } include_dirs += [ - "${qpg_sdk_root}/${qpg_target_ic}/comps/qvCHIP/inc", - "${qpg_sdk_root}/${qpg_target_ic}/comps/qvIO/inc", - "${qpg_sdk_root}/${qpg_target_ic}/comps/gpFreeRTOS/config", - "${qpg_sdk_root}/${qpg_target_ic}/comps/libmbedtls", + "${qpg_sdk_root}/Components/Qorvo/Matter/qvCHIP/inc", + "${qpg_sdk_root}/Components/Qorvo/BSP/qvIO/inc", + "${qpg_sdk_root}/Libraries/Qorvo/mbedtls_alt/inc", + "${qpg_sdk_root}/Components/ThirdParty/Silex/cryptosoc/mbedtls_alt", + "${qpg_sdk_root}/Components/ThirdParty/Lwip", + "${qpg_sdk_root}/Components/ThirdParty/Lwip/arch", "${mbedtls_root}/repo/include", "${openthread_root}/include", ] lib_dirs = [] - libs += [ - "${qpg_sdk_root}/${qpg_target_ic}/lib/libMatterQorvoGlue_${qpg_target_ic}_libbuild.a", - "${qpg_sdk_root}/${qpg_target_ic}/lib/libQorvoStack_${qpg_target_ic}.a", - "${qpg_sdk_root}/${qpg_target_ic}/lib/libmbedtls_alt_${qpg_target_ic}.a", - ] + if (qpg_sdk_include_platform_libs) { + libs += [ + "${qpg_sdk_root}/${qpg_sdk_lib_dir}/MatterQorvoGlue_${qpg_target_ic}_libbuild/libMatterQorvoGlue_${qpg_target_ic}_libbuild.a", + "${qpg_sdk_root}/${qpg_sdk_lib_dir}/QorvoStack_${qpg_target_ic}/libQorvoStack_${qpg_target_ic}.a", + "${qpg_sdk_root}/${qpg_sdk_lib_dir}/mbedtls_alt_${qpg_target_ic}/libmbedtls_alt_${qpg_target_ic}.a", + ] + } #MBed TLS built from third_party/mbedtls tree - OT config not used defines = [ @@ -177,18 +189,19 @@ template("qpg_sdk") { "${chip_root}/third_party/mbedtls/repo/library/x509write_crt.c", "${chip_root}/third_party/mbedtls/repo/library/x509write_csr.c", "${chip_root}/third_party/mbedtls/repo/library/xtea.c", - "${qpg_sdk_root}/${qpg_target_ic}/comps/gpFreeRTOS/config/FreeRTOSConfig.h", - "${qpg_sdk_root}/${qpg_target_ic}/comps/gpFreeRTOS/config/hooks.c", - "${qpg_sdk_root}/${qpg_target_ic}/comps/libmbedtls/${qpg_target_ic}-mbedtls-config.h", - "${qpg_sdk_root}/${qpg_target_ic}/comps/libmbedtls/aes_alt.h", - "${qpg_sdk_root}/${qpg_target_ic}/comps/libmbedtls/ccm_alt.h", - "${qpg_sdk_root}/${qpg_target_ic}/comps/libmbedtls/ecjpake_alt.h", - "${qpg_sdk_root}/${qpg_target_ic}/comps/libmbedtls/ecp_alt.h", - "${qpg_sdk_root}/${qpg_target_ic}/comps/libmbedtls/sha256_alt.h", - "${qpg_sdk_root}/${qpg_target_ic}/comps/libmbedtls/trng.c", #add this for + "${qpg_sdk_root}/Applications/Matter/shared/config/inc/FreeRTOSConfig.h", + "${qpg_sdk_root}/Applications/Matter/shared/config/src/hooks.c", + "${qpg_sdk_root}/Components/ThirdParty/Silex/cryptosoc/mbedtls_alt/aes_alt.h", + "${qpg_sdk_root}/Components/ThirdParty/Silex/cryptosoc/mbedtls_alt/ccm_alt.h", + "${qpg_sdk_root}/Components/ThirdParty/Silex/cryptosoc/mbedtls_alt/ecjpake_alt.h", + "${qpg_sdk_root}/Components/ThirdParty/Silex/cryptosoc/mbedtls_alt/ecp_alt.h", + "${qpg_sdk_root}/Components/ThirdParty/Silex/cryptosoc/mbedtls_alt/sha256_alt.h", + "${qpg_sdk_root}/Libraries/Qorvo/mbedtls_alt/inc/${qpg_target_ic}-mbedtls-config.h", + "${qpg_sdk_root}/Libraries/Qorvo/mbedtls_alt/src/trng.c", # mbedtls_hardware_poll - "${qpg_sdk_root}/${qpg_target_ic}/comps/qvCHIP/inc/qvCHIP.h", + "${qpg_sdk_root}/Components/Qorvo/BSP/qvIO/inc/qvIO.h", + "${qpg_sdk_root}/Components/Qorvo/Matter/qvCHIP/inc/qvCHIP.h", ] if (defined(invoker.sources)) { diff --git a/third_party/qpg_sdk/repo b/third_party/qpg_sdk/repo index 6bce6f11208c77..2b463adb2a9323 160000 --- a/third_party/qpg_sdk/repo +++ b/third_party/qpg_sdk/repo @@ -1 +1 @@ -Subproject commit 6bce6f11208c77dfc6bb1b9256bf01248ff002ab +Subproject commit 2b463adb2a9323fc54d435f359cd0f167845dfb1 From 9595afe47bf0c236eeca53d1b4661f8f2d59282e Mon Sep 17 00:00:00 2001 From: mkardous-silabs <84793247+mkardous-silabs@users.noreply.github.com> Date: Thu, 20 Jan 2022 17:05:22 -0500 Subject: [PATCH 06/15] add scene callbacks for on-off (#13780) --- .../clusters/on-off-server/on-off-server.cpp | 76 ++++++++----------- .../clusters/on-off-server/on-off-server.h | 5 +- 2 files changed, 36 insertions(+), 45 deletions(-) diff --git a/src/app/clusters/on-off-server/on-off-server.cpp b/src/app/clusters/on-off-server/on-off-server.cpp index 4c35510fdf9f72..a7f8f1361fd405 100644 --- a/src/app/clusters/on-off-server/on-off-server.cpp +++ b/src/app/clusters/on-off-server/on-off-server.cpp @@ -41,26 +41,15 @@ #include "on-off-server.h" #include +#include #include #include #include -#include -#include -#include - #ifdef EMBER_AF_PLUGIN_SCENES #include #endif // EMBER_AF_PLUGIN_SCENES -#ifdef EMBER_AF_PLUGIN_ZLL_ON_OFF_SERVER -#include "../zll-on-off-server/zll-on-off-server.h" -#endif - -#ifdef EMBER_AF_PLUGIN_ZLL_LEVEL_CONTROL_SERVER -#include "../zll-level-control-server/zll-level-control-server.h" -#endif - using namespace chip; using namespace chip::app::Clusters; using namespace chip::app::Clusters::OnOff; @@ -189,13 +178,6 @@ EmberAfStatus OnOffServer::setOnOffValue(chip::EndpointId endpoint, uint8_t comm } } -#ifdef EMBER_AF_PLUGIN_ZLL_ON_OFF_SERVER - if (initiatedByLevelChange) - { - emberAfPluginZllOnOffServerLevelControlZllExtensions(endpoint); - } -#endif - #ifdef EMBER_AF_PLUGIN_SCENES // the scene has been changed (the value of on/off has changed) so // the current scene as described in the attribute table is invalid, @@ -273,12 +255,7 @@ void OnOffServer::initOnOffServer(chip::EndpointId endpoint) bool OnOffServer::offCommand(const app::ConcreteCommandPath & commandPath) { EmberAfStatus status = setOnOffValue(commandPath.mEndpointId, Commands::Off::Id, false); -#ifdef EMBER_AF_PLUGIN_ZLL_ON_OFF_SERVER - if (status == EMBER_ZCL_STATUS_SUCCESS) - { - emberAfPluginZllOnOffServerOffZllExtensions(emberAfCurrentCommand()); - } -#endif + emberAfSendImmediateDefaultResponse(status); return true; } @@ -287,13 +264,6 @@ bool OnOffServer::onCommand(const app::ConcreteCommandPath & commandPath) { EmberAfStatus status = setOnOffValue(commandPath.mEndpointId, Commands::On::Id, false); -#ifdef EMBER_AF_PLUGIN_ZLL_ON_OFF_SERVER - if (status == EMBER_ZCL_STATUS_SUCCESS) - { - emberAfPluginZllOnOffServerOnZllExtensions(emberAfCurrentCommand()); - } -#endif - emberAfSendImmediateDefaultResponse(status); return true; } @@ -301,24 +271,21 @@ bool OnOffServer::onCommand(const app::ConcreteCommandPath & commandPath) bool OnOffServer::toggleCommand(const app::ConcreteCommandPath & commandPath) { EmberAfStatus status = setOnOffValue(commandPath.mEndpointId, Commands::Toggle::Id, false); -#ifdef EMBER_AF_PLUGIN_ZLL_ON_OFF_SERVER - if (status == EMBER_ZCL_STATUS_SUCCESS) - { - emberAfPluginZllOnOffServerToggleZllExtensions(emberAfCurrentCommand()); - } -#endif + emberAfSendImmediateDefaultResponse(status); return true; } -bool OnOffServer::offWithEffectCommand(const app::ConcreteCommandPath & commandPath, +bool OnOffServer::offWithEffectCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, const Commands::OffWithEffect::DecodableType & commandData) { OnOffEffectIdentifier effectId = commandData.effectId; uint8_t effectVariant = commandData.effectVariant; chip::EndpointId endpoint = commandPath.mEndpointId; EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; - +#ifdef EMBER_AF_PLUGIN_SCENES + FabricIndex fabric = commandObj->GetAccessingFabricIndex(); +#endif // EMBER_AF_PLUGIN_SCENES bool globalSceneControl = false; OnOff::Attributes::GlobalSceneControl::Get(endpoint, &globalSceneControl); @@ -327,6 +294,16 @@ bool OnOffServer::offWithEffectCommand(const app::ConcreteCommandPath & commandP if (globalSceneControl) { +#ifdef EMBER_AF_PLUGIN_SCENES + GroupId groupId = ZCL_SCENES_GLOBAL_SCENE_GROUP_ID; + if (emberAfCurrentCommand()->type == EMBER_INCOMING_MULTICAST) + { + groupId = emberAfCurrentCommand()->source->GetSessionHandle()->AsGroupSession()->GetGroupId(); + } + + emberAfScenesClusterStoreCurrentSceneCallback(fabric, endpoint, groupId, ZCL_SCENES_GLOBAL_SCENE_SCENE_ID); +#endif // EMBER_AF_PLUGIN_SCENES + OnOff::Attributes::GlobalSceneControl::Set(endpoint, false); status = setOnOffValue(endpoint, Commands::Off::Id, false); @@ -355,10 +332,13 @@ bool OnOffServer::offWithEffectCommand(const app::ConcreteCommandPath & commandP return true; } -bool OnOffServer::OnWithRecallGlobalSceneCommand(const app::ConcreteCommandPath & commandPath) +bool OnOffServer::OnWithRecallGlobalSceneCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath) { chip::EndpointId endpoint = commandPath.mEndpointId; EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; +#ifdef EMBER_AF_PLUGIN_SCENES + FabricIndex fabric = commandObj->GetAccessingFabricIndex(); +#endif // EMBER_AF_PLUGIN_SCENES bool globalSceneControl = false; OnOff::Attributes::GlobalSceneControl::Get(endpoint, &globalSceneControl); @@ -369,6 +349,16 @@ bool OnOffServer::OnWithRecallGlobalSceneCommand(const app::ConcreteCommandPath return true; } +#ifdef EMBER_AF_PLUGIN_SCENES + GroupId groupId = ZCL_SCENES_GLOBAL_SCENE_GROUP_ID; + if (emberAfCurrentCommand()->type == EMBER_INCOMING_MULTICAST) + { + groupId = emberAfCurrentCommand()->source->GetSessionHandle()->AsGroupSession()->GetGroupId(); + } + + emberAfScenesClusterRecallSavedSceneCallback(fabric, endpoint, groupId, ZCL_SCENES_GLOBAL_SCENE_SCENE_ID); +#endif // EMBER_AF_PLUGIN_SCENES + OnOff::Attributes::GlobalSceneControl::Set(endpoint, true); setOnOffValue(endpoint, Commands::On::Id, false); @@ -631,14 +621,14 @@ bool emberAfOnOffClusterToggleCallback(app::CommandHandler * commandObj, const a bool emberAfOnOffClusterOffWithEffectCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, const Commands::OffWithEffect::DecodableType & commandData) { - return OnOffServer::Instance().offWithEffectCommand(commandPath, commandData); + return OnOffServer::Instance().offWithEffectCommand(commandObj, commandPath, commandData); } bool emberAfOnOffClusterOnWithRecallGlobalSceneCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, const Commands::OnWithRecallGlobalScene::DecodableType & commandData) { - return OnOffServer::Instance().OnWithRecallGlobalSceneCommand(commandPath); + return OnOffServer::Instance().OnWithRecallGlobalSceneCommand(commandObj, commandPath); } bool emberAfOnOffClusterOnWithTimedOffCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, diff --git a/src/app/clusters/on-off-server/on-off-server.h b/src/app/clusters/on-off-server/on-off-server.h index 8e2502007f1a3c..043c3c8c52a932 100644 --- a/src/app/clusters/on-off-server/on-off-server.h +++ b/src/app/clusters/on-off-server/on-off-server.h @@ -18,6 +18,7 @@ #pragma once #include +#include #include #include #include @@ -49,9 +50,9 @@ class OnOffServer bool onCommand(const chip::app::ConcreteCommandPath & commandPath); bool toggleCommand(const chip::app::ConcreteCommandPath & commandPath); void initOnOffServer(chip::EndpointId endpoint); - bool offWithEffectCommand(const chip::app::ConcreteCommandPath & commandPath, + bool offWithEffectCommand(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::OnOff::Commands::OffWithEffect::DecodableType & commandData); - bool OnWithRecallGlobalSceneCommand(const chip::app::ConcreteCommandPath & commandPath); + bool OnWithRecallGlobalSceneCommand(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath); bool OnWithTimedOffCommand(const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::OnOff::Commands::OnWithTimedOff::DecodableType & commandData); void updateOnOffTimeCommand(chip::EndpointId endpoint); From 947d5bdcf61d22152750385cb58c8c8f7256049d Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Thu, 20 Jan 2022 14:06:29 -0800 Subject: [PATCH 07/15] Update the ACL event fields to align with the spec (#13738) --- .../all-clusters-app.matter | 12 +++---- .../chip/access-control-cluster.xml | 12 +++---- .../data_model/controller-clusters.matter | 12 +++---- .../python/chip/clusters/Objects.py | 24 +++++++------- .../zap-generated/cluster-objects.h | 32 +++++++++---------- 5 files changed, 46 insertions(+), 46 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index ffff2220bcbc6f..1f79cd561c30ad 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -48,18 +48,18 @@ server cluster AccessControl = 31 { info event AccessControlEntryChanged = 0 { fabric_idx adminFabricIndex = 0; - node_id adminNodeID = 1; - INT16U adminPasscodeID = 2; + nullable node_id adminNodeID = 1; + nullable INT16U adminPasscodeID = 2; ChangeTypeEnum changeType = 3; - AccessControlEntry latestValue = 4; + nullable AccessControlEntry latestValue = 4; } info event AccessControlExtensionChanged = 1 { fabric_idx adminFabricIndex = 0; - node_id adminNodeID = 1; - INT16U adminPasscodeID = 2; + nullable node_id adminNodeID = 1; + nullable INT16U adminPasscodeID = 2; ChangeTypeEnum changeType = 3; - ExtensionEntry latestValue = 4; + nullable ExtensionEntry latestValue = 4; } attribute AccessControlEntry acl[] = 0; diff --git a/src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml index 6b912b1de27157..00405d84eec76a 100644 --- a/src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml @@ -89,18 +89,18 @@ limitations under the License. The cluster SHALL send AccessControlEntryChanged events whenever its ACL attribute data is changed by an Administrator. - - + + - + The cluster SHALL send AccessControlExtensionChanged events whenever its extension attribute data is changed by an Administrator. - - + + - + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 680a495df9f7f7..a1ac966d363d2d 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -48,18 +48,18 @@ client cluster AccessControl = 31 { info event AccessControlEntryChanged = 0 { fabric_idx adminFabricIndex = 0; - node_id adminNodeID = 1; - INT16U adminPasscodeID = 2; + nullable node_id adminNodeID = 1; + nullable INT16U adminPasscodeID = 2; ChangeTypeEnum changeType = 3; - AccessControlEntry latestValue = 4; + nullable AccessControlEntry latestValue = 4; } info event AccessControlExtensionChanged = 1 { fabric_idx adminFabricIndex = 0; - node_id adminNodeID = 1; - INT16U adminPasscodeID = 2; + nullable node_id adminNodeID = 1; + nullable INT16U adminPasscodeID = 2; ChangeTypeEnum changeType = 3; - ExtensionEntry latestValue = 4; + nullable ExtensionEntry latestValue = 4; } attribute AccessControlEntry acl[] = 0; diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 51247828185d9f..f5d675ce4aba73 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -5297,17 +5297,17 @@ def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ ClusterObjectFieldDescriptor(Label="adminFabricIndex", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="adminNodeID", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="adminPasscodeID", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="adminNodeID", Tag=1, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="adminPasscodeID", Tag=2, Type=typing.Union[Nullable, uint]), ClusterObjectFieldDescriptor(Label="changeType", Tag=3, Type=AccessControl.Enums.ChangeTypeEnum), - ClusterObjectFieldDescriptor(Label="latestValue", Tag=4, Type=AccessControl.Structs.AccessControlEntry), + ClusterObjectFieldDescriptor(Label="latestValue", Tag=4, Type=typing.Union[Nullable, AccessControl.Structs.AccessControlEntry]), ]) adminFabricIndex: 'uint' = 0 - adminNodeID: 'uint' = 0 - adminPasscodeID: 'uint' = 0 + adminNodeID: 'typing.Union[Nullable, uint]' = NullValue + adminPasscodeID: 'typing.Union[Nullable, uint]' = NullValue changeType: 'AccessControl.Enums.ChangeTypeEnum' = 0 - latestValue: 'AccessControl.Structs.AccessControlEntry' = field(default_factory=lambda: AccessControl.Structs.AccessControlEntry()) + latestValue: 'typing.Union[Nullable, AccessControl.Structs.AccessControlEntry]' = NullValue @dataclass class AccessControlExtensionChanged(ClusterEvent): @@ -5324,17 +5324,17 @@ def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ ClusterObjectFieldDescriptor(Label="adminFabricIndex", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="adminNodeID", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="adminPasscodeID", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="adminNodeID", Tag=1, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="adminPasscodeID", Tag=2, Type=typing.Union[Nullable, uint]), ClusterObjectFieldDescriptor(Label="changeType", Tag=3, Type=AccessControl.Enums.ChangeTypeEnum), - ClusterObjectFieldDescriptor(Label="latestValue", Tag=4, Type=AccessControl.Structs.ExtensionEntry), + ClusterObjectFieldDescriptor(Label="latestValue", Tag=4, Type=typing.Union[Nullable, AccessControl.Structs.ExtensionEntry]), ]) adminFabricIndex: 'uint' = 0 - adminNodeID: 'uint' = 0 - adminPasscodeID: 'uint' = 0 + adminNodeID: 'typing.Union[Nullable, uint]' = NullValue + adminPasscodeID: 'typing.Union[Nullable, uint]' = NullValue changeType: 'AccessControl.Enums.ChangeTypeEnum' = 0 - latestValue: 'AccessControl.Structs.ExtensionEntry' = field(default_factory=lambda: AccessControl.Structs.ExtensionEntry()) + latestValue: 'typing.Union[Nullable, AccessControl.Structs.ExtensionEntry]' = NullValue @dataclass diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 73b7ac9929b77d..b7de5f24dad72b 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -6605,10 +6605,10 @@ struct Type static constexpr ClusterId GetClusterId() { return Clusters::AccessControl::Id; } chip::FabricIndex adminFabricIndex = static_cast(0); - chip::NodeId adminNodeID = static_cast(0); - uint16_t adminPasscodeID = static_cast(0); - ChangeTypeEnum changeType = static_cast(0); - Structs::AccessControlEntry::Type latestValue; + DataModel::Nullable adminNodeID; + DataModel::Nullable adminPasscodeID; + ChangeTypeEnum changeType = static_cast(0); + DataModel::Nullable latestValue; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -6621,10 +6621,10 @@ struct DecodableType static constexpr ClusterId GetClusterId() { return Clusters::AccessControl::Id; } chip::FabricIndex adminFabricIndex = static_cast(0); - chip::NodeId adminNodeID = static_cast(0); - uint16_t adminPasscodeID = static_cast(0); - ChangeTypeEnum changeType = static_cast(0); - Structs::AccessControlEntry::DecodableType latestValue; + DataModel::Nullable adminNodeID; + DataModel::Nullable adminPasscodeID; + ChangeTypeEnum changeType = static_cast(0); + DataModel::Nullable latestValue; CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -6650,10 +6650,10 @@ struct Type static constexpr ClusterId GetClusterId() { return Clusters::AccessControl::Id; } chip::FabricIndex adminFabricIndex = static_cast(0); - chip::NodeId adminNodeID = static_cast(0); - uint16_t adminPasscodeID = static_cast(0); - ChangeTypeEnum changeType = static_cast(0); - Structs::ExtensionEntry::Type latestValue; + DataModel::Nullable adminNodeID; + DataModel::Nullable adminPasscodeID; + ChangeTypeEnum changeType = static_cast(0); + DataModel::Nullable latestValue; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -6666,10 +6666,10 @@ struct DecodableType static constexpr ClusterId GetClusterId() { return Clusters::AccessControl::Id; } chip::FabricIndex adminFabricIndex = static_cast(0); - chip::NodeId adminNodeID = static_cast(0); - uint16_t adminPasscodeID = static_cast(0); - ChangeTypeEnum changeType = static_cast(0); - Structs::ExtensionEntry::DecodableType latestValue; + DataModel::Nullable adminNodeID; + DataModel::Nullable adminPasscodeID; + ChangeTypeEnum changeType = static_cast(0); + DataModel::Nullable latestValue; CHIP_ERROR Decode(TLV::TLVReader & reader); }; From 161b81be611011f887ead115581e9004858dbb74 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Thu, 20 Jan 2022 23:07:30 +0100 Subject: [PATCH 08/15] Add ids/Events.h (#13689) * Add ids/Events.h * Update generated code --- src/app/common/templates/templates.json | 5 + .../templates/app/cluster-objects.zapt | 10 +- .../templates/app/ids/Events.zapt | 32 ++ src/platform/Linux/PlatformManagerImpl.cpp | 31 +- .../zap-generated/cluster-objects.h | 256 ++++++-------- .../app-common/zap-generated/ids/Events.h | 312 ++++++++++++++++++ 6 files changed, 473 insertions(+), 173 deletions(-) create mode 100644 src/app/zap-templates/templates/app/ids/Events.zapt create mode 100644 zzz_generated/app-common/app-common/zap-generated/ids/Events.h diff --git a/src/app/common/templates/templates.json b/src/app/common/templates/templates.json index 366ef0457fff13..6a7286ac922a0b 100644 --- a/src/app/common/templates/templates.json +++ b/src/app/common/templates/templates.json @@ -104,6 +104,11 @@ "name": "Commands Ids header", "output": "ids/Commands.h" }, + { + "path": "../../zap-templates/templates/app/ids/Events.zapt", + "name": "Events Ids header", + "output": "ids/Events.h" + }, { "path": "../../zap-templates/templates/app/cluster-objects.zapt", "name": "Cluster objects header for Interaction Model", diff --git a/src/app/zap-templates/templates/app/cluster-objects.zapt b/src/app/zap-templates/templates/app/cluster-objects.zapt index 79090e851e4ed3..bcc515dd53b298 100644 --- a/src/app/zap-templates/templates/app/cluster-objects.zapt +++ b/src/app/zap-templates/templates/app/cluster-objects.zapt @@ -12,9 +12,10 @@ #include #include #include -#include -#include #include +#include +#include +#include namespace chip { namespace app { @@ -187,7 +188,6 @@ namespace Events { {{/first}} namespace {{asUpperCamelCase name}} { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::{{asUpperCamelCase priority}}; -static constexpr EventId kEventId = {{asMEI manufacturerCode code}}; enum class Fields { {{#zcl_event_fields}} @@ -199,7 +199,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::{{asUpperCamelCase name}}::Id; } static constexpr ClusterId GetClusterId() { return Clusters::{{asUpperCamelCase parent.name}}::Id; } {{#zcl_event_fields}} @@ -212,7 +212,7 @@ public: struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::{{asUpperCamelCase name}}::Id; } static constexpr ClusterId GetClusterId() { return Clusters::{{asUpperCamelCase parent.name}}::Id; } {{#zcl_event_fields}} diff --git a/src/app/zap-templates/templates/app/ids/Events.zapt b/src/app/zap-templates/templates/app/ids/Events.zapt new file mode 100644 index 00000000000000..dca5a226aa1c1c --- /dev/null +++ b/src/app/zap-templates/templates/app/ids/Events.zapt @@ -0,0 +1,32 @@ +{{> header}} + +#pragma once + +#include + +namespace chip { +namespace app { +namespace Clusters { + +{{#zcl_clusters}} +{{#zcl_events}} +{{#first}} +namespace {{asUpperCamelCase parent.label}} { +namespace Events { + +{{/first}} +namespace {{asUpperCamelCase name}} { +static constexpr EventId Id = {{asMEI manufacturerCode code}}; +} // namespace {{asUpperCamelCase name}} + +{{#last}} +} // namespace Events +} // namespace {{asUpperCamelCase parent.label}} + +{{/last}} +{{/zcl_events}} +{{/zcl_clusters}} + +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/platform/Linux/PlatformManagerImpl.cpp b/src/platform/Linux/PlatformManagerImpl.cpp index d9fbaeb9d32c1a..6b4ad3ebf17368 100644 --- a/src/platform/Linux/PlatformManagerImpl.cpp +++ b/src/platform/Linux/PlatformManagerImpl.cpp @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -88,19 +89,19 @@ void SignalHandler(int signum) err = CHIP_ERROR_REBOOT_SIGNAL_RECEIVED; break; case SIGTRAP: - PlatformMgrImpl().HandleSoftwareFault(SoftwareDiagnostics::Events::SoftwareFault::kEventId); + PlatformMgrImpl().HandleSoftwareFault(SoftwareDiagnostics::Events::SoftwareFault::Id); break; case SIGILL: - PlatformMgrImpl().HandleGeneralFault(GeneralDiagnostics::Events::HardwareFaultChange::kEventId); + PlatformMgrImpl().HandleGeneralFault(GeneralDiagnostics::Events::HardwareFaultChange::Id); break; case SIGALRM: - PlatformMgrImpl().HandleGeneralFault(GeneralDiagnostics::Events::RadioFaultChange::kEventId); + PlatformMgrImpl().HandleGeneralFault(GeneralDiagnostics::Events::RadioFaultChange::Id); break; case SIGVTALRM: - PlatformMgrImpl().HandleGeneralFault(GeneralDiagnostics::Events::NetworkFaultChange::kEventId); + PlatformMgrImpl().HandleGeneralFault(GeneralDiagnostics::Events::NetworkFaultChange::Id); break; case SIGIO: - PlatformMgrImpl().HandleSwitchEvent(Switch::Events::SwitchLatched::kEventId); + PlatformMgrImpl().HandleSwitchEvent(Switch::Events::SwitchLatched::Id); break; default: break; @@ -385,7 +386,7 @@ void PlatformManagerImpl::HandleGeneralFault(uint32_t EventId) return; } - if (EventId == GeneralDiagnostics::Events::HardwareFaultChange::kEventId) + if (EventId == GeneralDiagnostics::Events::HardwareFaultChange::Id) { GeneralFaults previous; GeneralFaults current; @@ -402,7 +403,7 @@ void PlatformManagerImpl::HandleGeneralFault(uint32_t EventId) #endif delegate->OnHardwareFaultsDetected(previous, current); } - else if (EventId == GeneralDiagnostics::Events::RadioFaultChange::kEventId) + else if (EventId == GeneralDiagnostics::Events::RadioFaultChange::Id) { GeneralFaults previous; GeneralFaults current; @@ -419,7 +420,7 @@ void PlatformManagerImpl::HandleGeneralFault(uint32_t EventId) #endif delegate->OnRadioFaultsDetected(previous, current); } - else if (EventId == GeneralDiagnostics::Events::NetworkFaultChange::kEventId) + else if (EventId == GeneralDiagnostics::Events::NetworkFaultChange::Id) { GeneralFaults previous; GeneralFaults current; @@ -470,7 +471,7 @@ void PlatformManagerImpl::HandleSwitchEvent(uint32_t EventId) return; } - if (EventId == Switch::Events::SwitchLatched::kEventId) + if (EventId == Switch::Events::SwitchLatched::Id) { uint8_t newPosition = 0; @@ -479,7 +480,7 @@ void PlatformManagerImpl::HandleSwitchEvent(uint32_t EventId) #endif delegate->OnSwitchLatched(newPosition); } - else if (EventId == Switch::Events::InitialPress::kEventId) + else if (EventId == Switch::Events::InitialPress::Id) { uint8_t newPosition = 0; @@ -488,7 +489,7 @@ void PlatformManagerImpl::HandleSwitchEvent(uint32_t EventId) #endif delegate->OnInitialPressed(newPosition); } - else if (EventId == Switch::Events::LongPress::kEventId) + else if (EventId == Switch::Events::LongPress::Id) { uint8_t newPosition = 0; @@ -497,7 +498,7 @@ void PlatformManagerImpl::HandleSwitchEvent(uint32_t EventId) #endif delegate->OnLongPressed(newPosition); } - else if (EventId == Switch::Events::ShortRelease::kEventId) + else if (EventId == Switch::Events::ShortRelease::Id) { uint8_t previousPosition = 0; @@ -506,7 +507,7 @@ void PlatformManagerImpl::HandleSwitchEvent(uint32_t EventId) #endif delegate->OnShortReleased(previousPosition); } - else if (EventId == Switch::Events::LongRelease::kEventId) + else if (EventId == Switch::Events::LongRelease::Id) { uint8_t previousPosition = 0; @@ -515,7 +516,7 @@ void PlatformManagerImpl::HandleSwitchEvent(uint32_t EventId) #endif delegate->OnLongReleased(previousPosition); } - else if (EventId == Switch::Events::MultiPressOngoing::kEventId) + else if (EventId == Switch::Events::MultiPressOngoing::Id) { uint8_t newPosition = 0; uint8_t currentNumberOfPressesCounted = 0; @@ -526,7 +527,7 @@ void PlatformManagerImpl::HandleSwitchEvent(uint32_t EventId) #endif delegate->OnMultiPressOngoing(newPosition, currentNumberOfPressesCounted); } - else if (EventId == Switch::Events::MultiPressComplete::kEventId) + else if (EventId == Switch::Events::MultiPressComplete::Id) { uint8_t newPosition = 0; uint8_t totalNumberOfPressesCounted = 0; diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index b7de5f24dad72b..64bbdcf3f43936 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -6586,7 +6587,6 @@ struct TypeInfo namespace Events { namespace AccessControlEntryChanged { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000000; enum class Fields { @@ -6601,7 +6601,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::AccessControlEntryChanged::Id; } static constexpr ClusterId GetClusterId() { return Clusters::AccessControl::Id; } chip::FabricIndex adminFabricIndex = static_cast(0); @@ -6617,7 +6617,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::AccessControlEntryChanged::Id; } static constexpr ClusterId GetClusterId() { return Clusters::AccessControl::Id; } chip::FabricIndex adminFabricIndex = static_cast(0); @@ -6631,7 +6631,6 @@ struct DecodableType } // namespace AccessControlEntryChanged namespace AccessControlExtensionChanged { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000001; enum class Fields { @@ -6646,7 +6645,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::AccessControlExtensionChanged::Id; } static constexpr ClusterId GetClusterId() { return Clusters::AccessControl::Id; } chip::FabricIndex adminFabricIndex = static_cast(0); @@ -6662,7 +6661,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::AccessControlExtensionChanged::Id; } static constexpr ClusterId GetClusterId() { return Clusters::AccessControl::Id; } chip::FabricIndex adminFabricIndex = static_cast(0); @@ -7726,7 +7725,6 @@ struct TypeInfo namespace Events { namespace StateChanged { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000000; enum class Fields { @@ -7739,7 +7737,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::StateChanged::Id; } static constexpr ClusterId GetClusterId() { return Clusters::BridgedActions::Id; } uint16_t actionID = static_cast(0); @@ -7753,7 +7751,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::StateChanged::Id; } static constexpr ClusterId GetClusterId() { return Clusters::BridgedActions::Id; } uint16_t actionID = static_cast(0); @@ -7765,7 +7763,6 @@ struct DecodableType } // namespace StateChanged namespace ActionFailed { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000001; enum class Fields { @@ -7779,7 +7776,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ActionFailed::Id; } static constexpr ClusterId GetClusterId() { return Clusters::BridgedActions::Id; } uint16_t actionID = static_cast(0); @@ -7794,7 +7791,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ActionFailed::Id; } static constexpr ClusterId GetClusterId() { return Clusters::BridgedActions::Id; } uint16_t actionID = static_cast(0); @@ -8153,7 +8150,6 @@ struct TypeInfo namespace Events { namespace StartUp { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; -static constexpr EventId kEventId = 0x00000000; enum class Fields { @@ -8164,7 +8160,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::StartUp::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Basic::Id; } uint32_t softwareVersion = static_cast(0); @@ -8176,7 +8172,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::StartUp::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Basic::Id; } uint32_t softwareVersion = static_cast(0); @@ -8186,7 +8182,6 @@ struct DecodableType } // namespace StartUp namespace ShutDown { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; -static constexpr EventId kEventId = 0x00000001; enum class Fields { @@ -8196,7 +8191,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ShutDown::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Basic::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -8206,7 +8201,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ShutDown::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Basic::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -8214,7 +8209,6 @@ struct DecodableType } // namespace ShutDown namespace Leave { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000002; enum class Fields { @@ -8224,7 +8218,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::Leave::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Basic::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -8234,7 +8228,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::Leave::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Basic::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -8242,7 +8236,6 @@ struct DecodableType } // namespace Leave namespace ReachableChanged { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000003; enum class Fields { @@ -8253,7 +8246,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ReachableChanged::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Basic::Id; } bool reachableNewValue = static_cast(0); @@ -8265,7 +8258,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ReachableChanged::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Basic::Id; } bool reachableNewValue = static_cast(0); @@ -8823,7 +8816,6 @@ struct TypeInfo namespace Events { namespace StateTransition { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000000; enum class Fields { @@ -8837,7 +8829,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::StateTransition::Id; } static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateRequestor::Id; } DataModel::Nullable previousState; @@ -8852,7 +8844,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::StateTransition::Id; } static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateRequestor::Id; } DataModel::Nullable previousState; @@ -8865,7 +8857,6 @@ struct DecodableType } // namespace StateTransition namespace VersionApplied { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; -static constexpr EventId kEventId = 0x00000001; enum class Fields { @@ -8877,7 +8868,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::VersionApplied::Id; } static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateRequestor::Id; } uint32_t softwareVersion = static_cast(0); @@ -8890,7 +8881,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::VersionApplied::Id; } static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateRequestor::Id; } uint32_t softwareVersion = static_cast(0); @@ -8901,7 +8892,6 @@ struct DecodableType } // namespace VersionApplied namespace DownloadError { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000002; enum class Fields { @@ -8915,7 +8905,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::DownloadError::Id; } static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateRequestor::Id; } uint32_t softwareVersion = static_cast(0); @@ -8930,7 +8920,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::DownloadError::Id; } static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateRequestor::Id; } uint32_t softwareVersion = static_cast(0); @@ -11185,7 +11175,6 @@ struct TypeInfo namespace Events { namespace HardwareFaultChange { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; -static constexpr EventId kEventId = 0x00000000; enum class Fields { @@ -11197,7 +11186,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::HardwareFaultChange::Id; } static constexpr ClusterId GetClusterId() { return Clusters::GeneralDiagnostics::Id; } DataModel::List current; @@ -11210,7 +11199,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::HardwareFaultChange::Id; } static constexpr ClusterId GetClusterId() { return Clusters::GeneralDiagnostics::Id; } DataModel::DecodableList current; @@ -11221,7 +11210,6 @@ struct DecodableType } // namespace HardwareFaultChange namespace RadioFaultChange { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; -static constexpr EventId kEventId = 0x00000001; enum class Fields { @@ -11233,7 +11221,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::RadioFaultChange::Id; } static constexpr ClusterId GetClusterId() { return Clusters::GeneralDiagnostics::Id; } DataModel::List current; @@ -11246,7 +11234,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::RadioFaultChange::Id; } static constexpr ClusterId GetClusterId() { return Clusters::GeneralDiagnostics::Id; } DataModel::DecodableList current; @@ -11257,7 +11245,6 @@ struct DecodableType } // namespace RadioFaultChange namespace NetworkFaultChange { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; -static constexpr EventId kEventId = 0x00000002; enum class Fields { @@ -11269,7 +11256,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::NetworkFaultChange::Id; } static constexpr ClusterId GetClusterId() { return Clusters::GeneralDiagnostics::Id; } DataModel::List current; @@ -11282,7 +11269,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::NetworkFaultChange::Id; } static constexpr ClusterId GetClusterId() { return Clusters::GeneralDiagnostics::Id; } DataModel::DecodableList current; @@ -11293,7 +11280,6 @@ struct DecodableType } // namespace NetworkFaultChange namespace BootReason { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; -static constexpr EventId kEventId = 0x00000003; enum class Fields { @@ -11304,7 +11290,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::BootReason::Id; } static constexpr ClusterId GetClusterId() { return Clusters::GeneralDiagnostics::Id; } BootReasonType bootReason = static_cast(0); @@ -11316,7 +11302,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::BootReason::Id; } static constexpr ClusterId GetClusterId() { return Clusters::GeneralDiagnostics::Id; } BootReasonType bootReason = static_cast(0); @@ -11530,7 +11516,6 @@ struct TypeInfo namespace Events { namespace SoftwareFault { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000000; enum class Fields { @@ -11541,7 +11526,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::SoftwareFault::Id; } static constexpr ClusterId GetClusterId() { return Clusters::SoftwareDiagnostics::Id; } Structs::SoftwareFault::Type softwareFault; @@ -11553,7 +11538,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::SoftwareFault::Id; } static constexpr ClusterId GetClusterId() { return Clusters::SoftwareDiagnostics::Id; } Structs::SoftwareFault::DecodableType softwareFault; @@ -12666,7 +12651,6 @@ struct TypeInfo namespace Events { namespace ConnectionStatus { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000000; enum class Fields { @@ -12677,7 +12661,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ConnectionStatus::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ThreadNetworkDiagnostics::Id; } ThreadConnectionStatus connectionStatus = static_cast(0); @@ -12689,7 +12673,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ConnectionStatus::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ThreadNetworkDiagnostics::Id; } ThreadConnectionStatus connectionStatus = static_cast(0); @@ -13013,7 +12997,6 @@ struct TypeInfo namespace Events { namespace Disconnection { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000000; enum class Fields { @@ -13024,7 +13007,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::Disconnection::Id; } static constexpr ClusterId GetClusterId() { return Clusters::WiFiNetworkDiagnostics::Id; } uint16_t reasonCode = static_cast(0); @@ -13036,7 +13019,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::Disconnection::Id; } static constexpr ClusterId GetClusterId() { return Clusters::WiFiNetworkDiagnostics::Id; } uint16_t reasonCode = static_cast(0); @@ -13046,7 +13029,6 @@ struct DecodableType } // namespace Disconnection namespace AssociationFailure { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000001; enum class Fields { @@ -13058,7 +13040,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::AssociationFailure::Id; } static constexpr ClusterId GetClusterId() { return Clusters::WiFiNetworkDiagnostics::Id; } AssociationFailureCause associationFailure = static_cast(0); @@ -13071,7 +13053,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::AssociationFailure::Id; } static constexpr ClusterId GetClusterId() { return Clusters::WiFiNetworkDiagnostics::Id; } AssociationFailureCause associationFailure = static_cast(0); @@ -13082,7 +13064,6 @@ struct DecodableType } // namespace AssociationFailure namespace ConnectionStatus { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000002; enum class Fields { @@ -13093,7 +13074,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ConnectionStatus::Id; } static constexpr ClusterId GetClusterId() { return Clusters::WiFiNetworkDiagnostics::Id; } WiFiConnectionStatus connectionStatus = static_cast(0); @@ -13105,7 +13086,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ConnectionStatus::Id; } static constexpr ClusterId GetClusterId() { return Clusters::WiFiNetworkDiagnostics::Id; } WiFiConnectionStatus connectionStatus = static_cast(0); @@ -13893,7 +13874,6 @@ struct TypeInfo namespace Events { namespace SwitchLatched { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000000; enum class Fields { @@ -13904,7 +13884,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::SwitchLatched::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } uint8_t newPosition = static_cast(0); @@ -13916,7 +13896,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::SwitchLatched::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } uint8_t newPosition = static_cast(0); @@ -13926,7 +13906,6 @@ struct DecodableType } // namespace SwitchLatched namespace InitialPress { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000001; enum class Fields { @@ -13937,7 +13916,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::InitialPress::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } uint8_t newPosition = static_cast(0); @@ -13949,7 +13928,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::InitialPress::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } uint8_t newPosition = static_cast(0); @@ -13959,7 +13938,6 @@ struct DecodableType } // namespace InitialPress namespace LongPress { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000002; enum class Fields { @@ -13970,7 +13948,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::LongPress::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } uint8_t newPosition = static_cast(0); @@ -13982,7 +13960,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::LongPress::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } uint8_t newPosition = static_cast(0); @@ -13992,7 +13970,6 @@ struct DecodableType } // namespace LongPress namespace ShortRelease { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000003; enum class Fields { @@ -14003,7 +13980,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ShortRelease::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } uint8_t previousPosition = static_cast(0); @@ -14015,7 +13992,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ShortRelease::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } uint8_t previousPosition = static_cast(0); @@ -14025,7 +14002,6 @@ struct DecodableType } // namespace ShortRelease namespace LongRelease { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000004; enum class Fields { @@ -14036,7 +14012,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::LongRelease::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } uint8_t previousPosition = static_cast(0); @@ -14048,7 +14024,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::LongRelease::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } uint8_t previousPosition = static_cast(0); @@ -14058,7 +14034,6 @@ struct DecodableType } // namespace LongRelease namespace MultiPressOngoing { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000005; enum class Fields { @@ -14070,7 +14045,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::MultiPressOngoing::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } uint8_t newPosition = static_cast(0); @@ -14083,7 +14058,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::MultiPressOngoing::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } uint8_t newPosition = static_cast(0); @@ -14094,7 +14069,6 @@ struct DecodableType } // namespace MultiPressOngoing namespace MultiPressComplete { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000006; enum class Fields { @@ -14106,7 +14080,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::MultiPressComplete::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } uint8_t newPosition = static_cast(0); @@ -14119,7 +14093,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::MultiPressComplete::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } uint8_t newPosition = static_cast(0); @@ -15928,7 +15902,6 @@ struct TypeInfo namespace Events { namespace StateChange { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000000; enum class Fields { @@ -15939,7 +15912,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::StateChange::Id; } static constexpr ClusterId GetClusterId() { return Clusters::BooleanState::Id; } bool stateValue = static_cast(0); @@ -15951,7 +15924,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::StateChange::Id; } static constexpr ClusterId GetClusterId() { return Clusters::BooleanState::Id; } bool stateValue = static_cast(0); @@ -19255,7 +19228,6 @@ struct TypeInfo namespace Events { namespace DoorLockAlarm { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; -static constexpr EventId kEventId = 0x00000000; enum class Fields { @@ -19266,7 +19238,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::DoorLockAlarm::Id; } static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } DlAlarmCode alarmCode = static_cast(0); @@ -19278,7 +19250,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::DoorLockAlarm::Id; } static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } DlAlarmCode alarmCode = static_cast(0); @@ -19288,7 +19260,6 @@ struct DecodableType } // namespace DoorLockAlarm namespace DoorStateChange { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; -static constexpr EventId kEventId = 0x00000001; enum class Fields { @@ -19299,7 +19270,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::DoorStateChange::Id; } static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } DlDoorState doorState = static_cast(0); @@ -19311,7 +19282,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::DoorStateChange::Id; } static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } DlDoorState doorState = static_cast(0); @@ -19321,7 +19292,6 @@ struct DecodableType } // namespace DoorStateChange namespace LockOperation { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; -static constexpr EventId kEventId = 0x00000002; enum class Fields { @@ -19337,7 +19307,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::LockOperation::Id; } static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } DlLockOperationType lockOperationType = static_cast(0); @@ -19354,7 +19324,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::LockOperation::Id; } static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } DlLockOperationType lockOperationType = static_cast(0); @@ -19369,7 +19339,6 @@ struct DecodableType } // namespace LockOperation namespace LockOperationError { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; -static constexpr EventId kEventId = 0x00000003; enum class Fields { @@ -19386,7 +19355,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::LockOperationError::Id; } static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } DlLockOperationType lockOperationType = static_cast(0); @@ -19404,7 +19373,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::LockOperationError::Id; } static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } DlLockOperationType lockOperationType = static_cast(0); @@ -19420,7 +19389,6 @@ struct DecodableType } // namespace LockOperationError namespace LockUserChange { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000004; enum class Fields { @@ -19437,7 +19405,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::LockUserChange::Id; } static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } DlLockDataType lockDataType = static_cast(0); @@ -19455,7 +19423,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::LockUserChange::Id; } static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } DlLockDataType lockDataType = static_cast(0); @@ -20796,7 +20764,6 @@ struct TypeInfo namespace Events { namespace SupplyVoltageLow { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000000; enum class Fields { @@ -20806,7 +20773,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::SupplyVoltageLow::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -20816,7 +20783,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::SupplyVoltageLow::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -20824,7 +20791,6 @@ struct DecodableType } // namespace SupplyVoltageLow namespace SupplyVoltageHigh { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000001; enum class Fields { @@ -20834,7 +20800,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::SupplyVoltageHigh::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -20844,7 +20810,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::SupplyVoltageHigh::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -20852,7 +20818,6 @@ struct DecodableType } // namespace SupplyVoltageHigh namespace PowerMissingPhase { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000002; enum class Fields { @@ -20862,7 +20827,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::PowerMissingPhase::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -20872,7 +20837,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::PowerMissingPhase::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -20880,7 +20845,6 @@ struct DecodableType } // namespace PowerMissingPhase namespace SystemPressureLow { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000003; enum class Fields { @@ -20890,7 +20854,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::SystemPressureLow::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -20900,7 +20864,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::SystemPressureLow::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -20908,7 +20872,6 @@ struct DecodableType } // namespace SystemPressureLow namespace SystemPressureHigh { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000004; enum class Fields { @@ -20918,7 +20881,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::SystemPressureHigh::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -20928,7 +20891,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::SystemPressureHigh::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -20936,7 +20899,6 @@ struct DecodableType } // namespace SystemPressureHigh namespace DryRunning { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; -static constexpr EventId kEventId = 0x00000005; enum class Fields { @@ -20946,7 +20908,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::DryRunning::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -20956,7 +20918,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::DryRunning::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -20964,7 +20926,6 @@ struct DecodableType } // namespace DryRunning namespace MotorTemperatureHigh { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000006; enum class Fields { @@ -20974,7 +20935,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::MotorTemperatureHigh::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -20984,7 +20945,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::MotorTemperatureHigh::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -20992,7 +20953,6 @@ struct DecodableType } // namespace MotorTemperatureHigh namespace PumpMotorFatalFailure { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; -static constexpr EventId kEventId = 0x00000007; enum class Fields { @@ -21002,7 +20962,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::PumpMotorFatalFailure::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -21012,7 +20972,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::PumpMotorFatalFailure::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -21020,7 +20980,6 @@ struct DecodableType } // namespace PumpMotorFatalFailure namespace ElectronicTemperatureHigh { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000008; enum class Fields { @@ -21030,7 +20989,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ElectronicTemperatureHigh::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -21040,7 +20999,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ElectronicTemperatureHigh::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -21048,7 +21007,6 @@ struct DecodableType } // namespace ElectronicTemperatureHigh namespace PumpBlocked { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; -static constexpr EventId kEventId = 0x00000009; enum class Fields { @@ -21058,7 +21016,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::PumpBlocked::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -21068,7 +21026,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::PumpBlocked::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -21076,7 +21034,6 @@ struct DecodableType } // namespace PumpBlocked namespace SensorFailure { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x0000000A; enum class Fields { @@ -21086,7 +21043,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::SensorFailure::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -21096,7 +21053,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::SensorFailure::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -21104,7 +21061,6 @@ struct DecodableType } // namespace SensorFailure namespace ElectronicNonFatalFailure { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x0000000B; enum class Fields { @@ -21114,7 +21070,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ElectronicNonFatalFailure::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -21124,7 +21080,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ElectronicNonFatalFailure::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -21132,7 +21088,6 @@ struct DecodableType } // namespace ElectronicNonFatalFailure namespace ElectronicFatalFailure { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; -static constexpr EventId kEventId = 0x0000000C; enum class Fields { @@ -21142,7 +21097,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ElectronicFatalFailure::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -21152,7 +21107,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::ElectronicFatalFailure::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -21160,7 +21115,6 @@ struct DecodableType } // namespace ElectronicFatalFailure namespace GeneralFault { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x0000000D; enum class Fields { @@ -21170,7 +21124,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::GeneralFault::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -21180,7 +21134,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::GeneralFault::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -21188,7 +21142,6 @@ struct DecodableType } // namespace GeneralFault namespace Leakage { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x0000000E; enum class Fields { @@ -21198,7 +21151,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::Leakage::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -21208,7 +21161,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::Leakage::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -21216,7 +21169,6 @@ struct DecodableType } // namespace Leakage namespace AirDetection { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x0000000F; enum class Fields { @@ -21226,7 +21178,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::AirDetection::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -21236,7 +21188,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::AirDetection::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -21244,7 +21196,6 @@ struct DecodableType } // namespace AirDetection namespace TurbineOperation { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000010; enum class Fields { @@ -21254,7 +21205,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::TurbineOperation::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -21264,7 +21215,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::TurbineOperation::Id; } static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -36106,7 +36057,6 @@ struct TypeInfo namespace Events { namespace TestEvent { static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; -static constexpr EventId kEventId = 0x00000001; enum class Fields { @@ -36122,7 +36072,7 @@ struct Type { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::TestEvent::Id; } static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } uint8_t arg1 = static_cast(0); @@ -36139,7 +36089,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } - static constexpr EventId GetEventId() { return kEventId; } + static constexpr EventId GetEventId() { return Events::TestEvent::Id; } static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } uint8_t arg1 = static_cast(0); diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Events.h b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h new file mode 100644 index 00000000000000..b42a2a5d588ad2 --- /dev/null +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h @@ -0,0 +1,312 @@ +/* + * + * Copyright (c) 2021 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. + */ + +// THIS FILE IS GENERATED BY ZAP + +#pragma once + +#include + +namespace chip { +namespace app { +namespace Clusters { + +namespace AccessControl { +namespace Events { + +namespace AccessControlEntryChanged { +static constexpr EventId Id = 0x00000000; +} // namespace AccessControlEntryChanged + +namespace AccessControlExtensionChanged { +static constexpr EventId Id = 0x00000001; +} // namespace AccessControlExtensionChanged + +} // namespace Events +} // namespace AccessControl + +namespace BridgedActions { +namespace Events { + +namespace StateChanged { +static constexpr EventId Id = 0x00000000; +} // namespace StateChanged + +namespace ActionFailed { +static constexpr EventId Id = 0x00000001; +} // namespace ActionFailed + +} // namespace Events +} // namespace BridgedActions + +namespace Basic { +namespace Events { + +namespace StartUp { +static constexpr EventId Id = 0x00000000; +} // namespace StartUp + +namespace ShutDown { +static constexpr EventId Id = 0x00000001; +} // namespace ShutDown + +namespace Leave { +static constexpr EventId Id = 0x00000002; +} // namespace Leave + +namespace ReachableChanged { +static constexpr EventId Id = 0x00000003; +} // namespace ReachableChanged + +} // namespace Events +} // namespace Basic + +namespace OtaSoftwareUpdateRequestor { +namespace Events { + +namespace StateTransition { +static constexpr EventId Id = 0x00000000; +} // namespace StateTransition + +namespace VersionApplied { +static constexpr EventId Id = 0x00000001; +} // namespace VersionApplied + +namespace DownloadError { +static constexpr EventId Id = 0x00000002; +} // namespace DownloadError + +} // namespace Events +} // namespace OtaSoftwareUpdateRequestor + +namespace GeneralDiagnostics { +namespace Events { + +namespace HardwareFaultChange { +static constexpr EventId Id = 0x00000000; +} // namespace HardwareFaultChange + +namespace RadioFaultChange { +static constexpr EventId Id = 0x00000001; +} // namespace RadioFaultChange + +namespace NetworkFaultChange { +static constexpr EventId Id = 0x00000002; +} // namespace NetworkFaultChange + +namespace BootReason { +static constexpr EventId Id = 0x00000003; +} // namespace BootReason + +} // namespace Events +} // namespace GeneralDiagnostics + +namespace SoftwareDiagnostics { +namespace Events { + +namespace SoftwareFault { +static constexpr EventId Id = 0x00000000; +} // namespace SoftwareFault + +} // namespace Events +} // namespace SoftwareDiagnostics + +namespace ThreadNetworkDiagnostics { +namespace Events { + +namespace ConnectionStatus { +static constexpr EventId Id = 0x00000000; +} // namespace ConnectionStatus + +} // namespace Events +} // namespace ThreadNetworkDiagnostics + +namespace WiFiNetworkDiagnostics { +namespace Events { + +namespace Disconnection { +static constexpr EventId Id = 0x00000000; +} // namespace Disconnection + +namespace AssociationFailure { +static constexpr EventId Id = 0x00000001; +} // namespace AssociationFailure + +namespace ConnectionStatus { +static constexpr EventId Id = 0x00000002; +} // namespace ConnectionStatus + +} // namespace Events +} // namespace WiFiNetworkDiagnostics + +namespace Switch { +namespace Events { + +namespace SwitchLatched { +static constexpr EventId Id = 0x00000000; +} // namespace SwitchLatched + +namespace InitialPress { +static constexpr EventId Id = 0x00000001; +} // namespace InitialPress + +namespace LongPress { +static constexpr EventId Id = 0x00000002; +} // namespace LongPress + +namespace ShortRelease { +static constexpr EventId Id = 0x00000003; +} // namespace ShortRelease + +namespace LongRelease { +static constexpr EventId Id = 0x00000004; +} // namespace LongRelease + +namespace MultiPressOngoing { +static constexpr EventId Id = 0x00000005; +} // namespace MultiPressOngoing + +namespace MultiPressComplete { +static constexpr EventId Id = 0x00000006; +} // namespace MultiPressComplete + +} // namespace Events +} // namespace Switch + +namespace BooleanState { +namespace Events { + +namespace StateChange { +static constexpr EventId Id = 0x00000000; +} // namespace StateChange + +} // namespace Events +} // namespace BooleanState + +namespace DoorLock { +namespace Events { + +namespace DoorLockAlarm { +static constexpr EventId Id = 0x00000000; +} // namespace DoorLockAlarm + +namespace DoorStateChange { +static constexpr EventId Id = 0x00000001; +} // namespace DoorStateChange + +namespace LockOperation { +static constexpr EventId Id = 0x00000002; +} // namespace LockOperation + +namespace LockOperationError { +static constexpr EventId Id = 0x00000003; +} // namespace LockOperationError + +namespace LockUserChange { +static constexpr EventId Id = 0x00000004; +} // namespace LockUserChange + +} // namespace Events +} // namespace DoorLock + +namespace PumpConfigurationAndControl { +namespace Events { + +namespace SupplyVoltageLow { +static constexpr EventId Id = 0x00000000; +} // namespace SupplyVoltageLow + +namespace SupplyVoltageHigh { +static constexpr EventId Id = 0x00000001; +} // namespace SupplyVoltageHigh + +namespace PowerMissingPhase { +static constexpr EventId Id = 0x00000002; +} // namespace PowerMissingPhase + +namespace SystemPressureLow { +static constexpr EventId Id = 0x00000003; +} // namespace SystemPressureLow + +namespace SystemPressureHigh { +static constexpr EventId Id = 0x00000004; +} // namespace SystemPressureHigh + +namespace DryRunning { +static constexpr EventId Id = 0x00000005; +} // namespace DryRunning + +namespace MotorTemperatureHigh { +static constexpr EventId Id = 0x00000006; +} // namespace MotorTemperatureHigh + +namespace PumpMotorFatalFailure { +static constexpr EventId Id = 0x00000007; +} // namespace PumpMotorFatalFailure + +namespace ElectronicTemperatureHigh { +static constexpr EventId Id = 0x00000008; +} // namespace ElectronicTemperatureHigh + +namespace PumpBlocked { +static constexpr EventId Id = 0x00000009; +} // namespace PumpBlocked + +namespace SensorFailure { +static constexpr EventId Id = 0x0000000A; +} // namespace SensorFailure + +namespace ElectronicNonFatalFailure { +static constexpr EventId Id = 0x0000000B; +} // namespace ElectronicNonFatalFailure + +namespace ElectronicFatalFailure { +static constexpr EventId Id = 0x0000000C; +} // namespace ElectronicFatalFailure + +namespace GeneralFault { +static constexpr EventId Id = 0x0000000D; +} // namespace GeneralFault + +namespace Leakage { +static constexpr EventId Id = 0x0000000E; +} // namespace Leakage + +namespace AirDetection { +static constexpr EventId Id = 0x0000000F; +} // namespace AirDetection + +namespace TurbineOperation { +static constexpr EventId Id = 0x00000010; +} // namespace TurbineOperation + +} // namespace Events +} // namespace PumpConfigurationAndControl + +namespace TestCluster { +namespace Events { + +namespace TestEvent { +static constexpr EventId Id = 0x00000001; +} // namespace TestEvent + +} // namespace Events +} // namespace TestCluster + +} // namespace Clusters +} // namespace app +} // namespace chip From aa7285490be2caaa4702bccdec1b65cbc6d6b725 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 20 Jan 2022 17:28:50 -0500 Subject: [PATCH 09/15] Add global property for attributes (#13791) --- .../all-clusters-app.matter | 146 +++++----- .../bridge-common/bridge-app.matter | 48 ++-- .../door-lock-common/door-lock-app.matter | 46 ++-- .../lighting-common/lighting-app.matter | 62 ++--- examples/lock-app/lock-common/lock-app.matter | 48 ++-- .../log-source-common/log-source-app.matter | 6 +- .../ota-provider-app.matter | 16 +- .../ota-requestor-app.matter | 20 +- .../placeholder/linux/apps/app1/config.matter | 28 +- .../placeholder/linux/apps/app2/config.matter | 28 +- examples/pump-app/pump-common/pump-app.matter | 50 ++-- .../pump-controller-app.matter | 50 ++-- .../esp32/main/temperature-measurement.matter | 36 +-- .../thermostat-common/thermostat.matter | 56 ++-- examples/tv-app/tv-common/tv-app.matter | 88 +++--- .../tv-casting-common/tv-casting-app.matter | 110 ++++---- examples/window-app/common/window-app.matter | 48 ++-- .../templates/app/MatterIDL.zapt | 3 + .../data_model/controller-clusters.matter | 258 +++++++++--------- 19 files changed, 575 insertions(+), 572 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 1f79cd561c30ad..72d0a2fe9bc8c9 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -64,11 +64,11 @@ server cluster AccessControl = 31 { attribute AccessControlEntry acl[] = 0; attribute ExtensionEntry extension[] = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster AccountLogin = 1294 { - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster AdministratorCommissioning = 60 { @@ -87,7 +87,7 @@ server cluster AdministratorCommissioning = 60 { readonly attribute int8u windowStatus = 0; readonly attribute fabric_idx adminFabricIndex = 1; readonly attribute int16u adminVendorId = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -122,7 +122,7 @@ server cluster ApplicationBasic = 1293 { readonly attribute ApplicationStatusEnum applicationStatus = 5; readonly attribute char_string applicationVersion = 6; readonly attribute vendor_id allowedVendorList[] = 7; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster ApplicationLauncher = 1292 { @@ -138,7 +138,7 @@ server cluster ApplicationLauncher = 1292 { } readonly attribute INT16U applicationLauncherList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster AudioOutput = 1291 { @@ -159,7 +159,7 @@ server cluster AudioOutput = 1291 { readonly attribute OutputInfo audioOutputList[] = 0; readonly attribute int8u currentAudioOutput = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster BarrierControl = 259 { @@ -167,7 +167,7 @@ server cluster BarrierControl = 259 { readonly attribute bitmap16 barrierSafetyStatus = 2; readonly attribute bitmap8 barrierCapabilities = 3; readonly attribute int8u barrierPosition = 10; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct BarrierControlGoToPercentRequest { INT8U percentOpen = 0; @@ -211,7 +211,7 @@ server cluster Basic = 40 { attribute boolean localConfigDisabled = 16; readonly attribute boolean reachable = 17; readonly attribute char_string uniqueID = 18; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; command MfgSpecificPing(): DefaultSuccess = 0; } @@ -220,11 +220,11 @@ server cluster BinaryInputBasic = 15 { attribute boolean outOfService = 81; attribute boolean presentValue = 85; readonly attribute bitmap8 statusFlags = 111; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster Binding = 30 { - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct BindRequest { NODE_ID nodeId = 0; @@ -250,7 +250,7 @@ server cluster BooleanState = 69 { } readonly attribute boolean stateValue = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster BridgedActions = 37 { @@ -314,11 +314,11 @@ server cluster BridgedActions = 37 { readonly attribute ActionStruct actionList[] = 0; readonly attribute EndpointListStruct endpointList[] = 1; readonly attribute long_char_string setupUrl = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster BridgedDeviceBasic = 57 { - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster Channel = 1284 { @@ -340,7 +340,7 @@ server cluster Channel = 1284 { } readonly attribute ChannelInfo channelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster ColorControl = 768 { @@ -442,7 +442,7 @@ server cluster ColorControl = 768 { readonly attribute int16u colorTempPhysicalMax = 16396; readonly attribute int16u coupleColorTempToLevelMinMireds = 16397; attribute int16u startUpColorTemperatureMireds = 16400; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ColorLoopSetRequest { ColorLoopUpdateFlags updateFlags = 0; @@ -679,7 +679,7 @@ server cluster ContentLauncher = 1290 { readonly attribute CHAR_STRING acceptHeaderList[] = 0; attribute bitmap32 supportedStreamingProtocols = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster Descriptor = 29 { @@ -692,7 +692,7 @@ server cluster Descriptor = 29 { readonly attribute CLUSTER_ID serverList[] = 1; readonly attribute CLUSTER_ID clientList[] = 2; readonly attribute ENDPOINT_NO partsList[] = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster DiagnosticLogs = 50 { @@ -988,7 +988,7 @@ server cluster DoorLock = 257 { attribute int8u wrongCodeEntryLimit = 48; attribute int8u userCodeTemporaryDisableTime = 49; attribute boolean requirePINforRemoteOperation = 51; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ClearCredentialRequest { DlCredential credential = 0; @@ -1079,7 +1079,7 @@ server cluster ElectricalMeasurement = 2820 { readonly attribute int16s activePower = 1291; readonly attribute int16s activePowerMin = 1292; readonly attribute int16s activePowerMax = 1293; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster EthernetNetworkDiagnostics = 55 { @@ -1105,15 +1105,15 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute int64u overrunCount = 6; readonly attribute boolean carrierDetect = 7; readonly attribute int64u timeSinceReset = 8; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; command ResetCounts(): DefaultSuccess = 0; } server cluster FixedLabel = 64 { readonly attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster FlowMeasurement = 1028 { @@ -1121,7 +1121,7 @@ server cluster FlowMeasurement = 1028 { readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; readonly attribute int16u tolerance = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -1146,8 +1146,8 @@ server cluster GeneralCommissioning = 48 { readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; readonly attribute enum8 regulatoryConfig = 2; readonly attribute enum8 locationCapability = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -1268,7 +1268,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute ENUM8 activeHardwareFaults[] = 5; readonly attribute ENUM8 activeRadioFaults[] = 6; readonly attribute ENUM8 activeNetworkFaults[] = 7; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GroupKeyManagement = 63 { @@ -1305,7 +1305,7 @@ server cluster GroupKeyManagement = 63 { readonly attribute GroupInfo groupTable[] = 1; readonly attribute int16u maxGroupsPerFabric = 2; readonly attribute int16u maxGroupKeysPerFabric = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct KeySetReadRequest { INT16U groupKeySetID = 0; @@ -1339,7 +1339,7 @@ server cluster GroupKeyManagement = 63 { server cluster Groups = 4 { readonly attribute bitmap8 nameSupport = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddGroupRequest { INT16U groupId = 0; @@ -1424,7 +1424,7 @@ server cluster IasZone = 1280 { readonly attribute bitmap16 zoneStatus = 2; attribute node_id iasCieAddress = 16; readonly attribute int8u zoneId = 17; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ZoneEnrollRequestRequest { IasZoneType zoneType = 0; @@ -1472,7 +1472,7 @@ server cluster Identify = 3 { attribute int16u identifyTime = 0; readonly attribute enum8 identifyType = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct IdentifyRequest { INT16U identifyTime = 0; @@ -1503,7 +1503,7 @@ server cluster IlluminanceMeasurement = 1024 { readonly attribute int16u maxMeasuredValue = 2; readonly attribute int16u tolerance = 3; readonly attribute enum8 lightSensorType = 4; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster KeypadInput = 1289 { @@ -1602,7 +1602,7 @@ server cluster KeypadInput = 1289 { kInvalidKeyInCurrentState = 2; } - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster LevelControl = 8 { @@ -1630,8 +1630,8 @@ server cluster LevelControl = 8 { attribute int16u offTransitionTime = 19; attribute int8u defaultMoveRate = 20; attribute int8u startUpCurrentLevel = 16384; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct MoveRequest { MoveMode moveMode = 0; @@ -1692,7 +1692,7 @@ server cluster LocalizationConfiguration = 43 { } server cluster LowPower = 1288 { - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; command Sleep(): DefaultSuccess = 0; } @@ -1722,7 +1722,7 @@ server cluster MediaInput = 1287 { readonly attribute InputInfo mediaInputList[] = 0; readonly attribute int8u currentMediaInput = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster MediaPlayback = 1286 { @@ -1748,7 +1748,7 @@ server cluster MediaPlayback = 1286 { readonly attribute single playbackSpeed = 4; readonly attribute int64u seekRangeEnd = 5; readonly attribute int64u seekRangeStart = 6; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster ModeSelect = 80 { @@ -1763,7 +1763,7 @@ server cluster ModeSelect = 80 { attribute int8u onMode = 2; readonly attribute int8u startUpMode = 3; readonly attribute char_string description = 4; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ChangeToModeRequest { INT8U newMode = 0; @@ -1830,8 +1830,8 @@ server cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -1912,7 +1912,7 @@ client cluster OtaSoftwareUpdateProvider = 41 { kDownloadProtocolNotSupported = 3; } - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ApplyUpdateRequestRequest { OCTET_STRING updateToken = 0; @@ -2001,7 +2001,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { readonly attribute boolean updatePossible = 1; readonly attribute OTAUpdateStateEnum updateState = 2; readonly attribute int8u updateStateProgress = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AnnounceOtaProviderRequest { node_id providerNodeId = 0; @@ -2018,7 +2018,7 @@ server cluster OccupancySensing = 1030 { readonly attribute bitmap8 occupancy = 0; readonly attribute enum8 occupancySensorType = 1; readonly attribute bitmap8 occupancySensorTypeBitmap = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster OnOff = 6 { @@ -2042,8 +2042,8 @@ server cluster OnOff = 6 { attribute int16u onTime = 16385; attribute int16u offWaitTime = 16386; attribute enum8 startUpOnOff = 16387; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct OffWithEffectRequest { OnOffEffectIdentifier effectId = 0; @@ -2067,7 +2067,7 @@ server cluster OnOff = 6 { server cluster OnOffSwitchConfiguration = 7 { readonly attribute enum8 switchType = 0; attribute enum8 switchActions = 16; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster OperationalCredentials = 62 { @@ -2105,7 +2105,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -2189,20 +2189,20 @@ server cluster PowerSource = 47 { readonly attribute enum8 batteryChargeLevel = 14; readonly attribute ENUM8 activeBatteryFaults[] = 18; readonly attribute enum8 batteryChargeState = 26; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster PowerSourceConfiguration = 46 { readonly attribute INT8U sources[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster PressureMeasurement = 1027 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster PumpConfigurationAndControl = 512 { @@ -2297,8 +2297,8 @@ server cluster PumpConfigurationAndControl = 512 { attribute enum8 operationMode = 32; attribute enum8 controlMode = 33; readonly attribute bitmap16 alarmMask = 34; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster RelativeHumidityMeasurement = 1029 { @@ -2306,7 +2306,7 @@ server cluster RelativeHumidityMeasurement = 1029 { readonly attribute int16u minMeasuredValue = 1; readonly attribute int16u maxMeasuredValue = 2; readonly attribute int16u tolerance = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster Scenes = 5 { @@ -2321,7 +2321,7 @@ server cluster Scenes = 5 { readonly attribute int16u currentGroup = 2; readonly attribute boolean sceneValid = 3; readonly attribute bitmap8 nameSupport = 4; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddSceneRequest { INT16U groupId = 0; @@ -2426,8 +2426,8 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute int64u currentHeapFree = 1; readonly attribute int64u currentHeapUsed = 2; readonly attribute int64u currentHeapHighWatermark = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; command ResetWatermarks(): DefaultSuccess = 0; } @@ -2466,8 +2466,8 @@ server cluster Switch = 59 { readonly attribute int8u numberOfPositions = 0; readonly attribute int8u currentPosition = 1; readonly attribute int8u multiPressMax = 2; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster TargetNavigator = 1285 { @@ -2484,7 +2484,7 @@ server cluster TargetNavigator = 1285 { readonly attribute TargetInfo targetNavigatorList[] = 0; readonly attribute int8u currentNavigatorTarget = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster TemperatureMeasurement = 1026 { @@ -2492,7 +2492,7 @@ server cluster TemperatureMeasurement = 1026 { readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; readonly attribute int16u tolerance = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster TestCluster = 1295 { @@ -2636,7 +2636,7 @@ server cluster TestCluster = 1295 { attribute int8s nullableRangeRestrictedInt8s = 32807; attribute int16u nullableRangeRestrictedInt16u = 32808; attribute int16s nullableRangeRestrictedInt16s = 32809; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct SimpleStructEchoRequestRequest { SimpleStruct arg1 = 0; @@ -2769,15 +2769,15 @@ server cluster Thermostat = 513 { readonly attribute enum8 startOfWeek = 32; readonly attribute int8u numberOfWeeklyTransitions = 33; readonly attribute int8u numberOfDailyTransitions = 34; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster ThermostatUserInterfaceConfiguration = 516 { attribute enum8 temperatureDisplayMode = 0; attribute enum8 keypadLockout = 1; attribute enum8 scheduleProgrammingVisibility = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster ThreadNetworkDiagnostics = 53 { @@ -2920,20 +2920,20 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute octet_string channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; command ResetCounts(): DefaultSuccess = 0; } server cluster UserLabel = 65 { attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster WakeOnLan = 1283 { readonly attribute char_string wakeOnLanMacAddress = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster WiFiNetworkDiagnostics = 54 { @@ -2993,8 +2993,8 @@ server cluster WiFiNetworkDiagnostics = 54 { readonly attribute int32u packetUnicastTxCount = 10; readonly attribute int64u currentMaxRate = 11; readonly attribute int64u overrunCount = 12; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; command ResetCounts(): DefaultSuccess = 0; } @@ -3018,8 +3018,8 @@ server cluster WindowCovering = 258 { readonly attribute int16u installedClosedLimitTilt = 19; attribute bitmap8 mode = 23; readonly attribute bitmap16 safetyStatus = 26; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; command DownOrClose(): DefaultSuccess = 1; command StopMotion(): DefaultSuccess = 2; diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index 4a52bd4ce5ccc5..f8504f25addfa8 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -22,7 +22,7 @@ server cluster AdministratorCommissioning = 60 { readonly attribute int8u windowStatus = 0; readonly attribute fabric_idx adminFabricIndex = 1; readonly attribute int16u adminVendorId = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -68,7 +68,7 @@ server cluster Basic = 40 { readonly attribute char_string hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; readonly attribute char_string softwareVersionString = 10; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster Descriptor = 29 { @@ -81,7 +81,7 @@ server cluster Descriptor = 29 { readonly attribute CLUSTER_ID serverList[] = 1; readonly attribute CLUSTER_ID clientList[] = 2; readonly attribute ENDPOINT_NO partsList[] = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster DiagnosticLogs = 50 { @@ -137,13 +137,13 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute int64u overrunCount = 6; readonly attribute boolean carrierDetect = 7; readonly attribute int64u timeSinceReset = 8; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster FixedLabel = 64 { readonly attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -168,8 +168,8 @@ server cluster GeneralCommissioning = 48 { readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; readonly attribute enum8 regulatoryConfig = 2; readonly attribute enum8 locationCapability = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -290,7 +290,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute ENUM8 activeHardwareFaults[] = 5; readonly attribute ENUM8 activeRadioFaults[] = 6; readonly attribute ENUM8 activeNetworkFaults[] = 7; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster LevelControl = 8 { @@ -318,8 +318,8 @@ server cluster LevelControl = 8 { attribute int16u offTransitionTime = 19; attribute int8u defaultMoveRate = 20; attribute int8u startUpCurrentLevel = 16384; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct MoveRequest { MoveMode moveMode = 0; @@ -437,8 +437,8 @@ server cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -515,7 +515,7 @@ server cluster OnOff = 6 { } readonly attribute boolean onOff = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; command Off(): DefaultSuccess = 0; command On(): DefaultSuccess = 1; @@ -557,7 +557,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -648,8 +648,8 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute int64u currentHeapFree = 1; readonly attribute int64u currentHeapUsed = 2; readonly attribute int64u currentHeapHighWatermark = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster Switch = 59 { @@ -686,8 +686,8 @@ server cluster Switch = 59 { readonly attribute int8u numberOfPositions = 0; readonly attribute int8u currentPosition = 1; readonly attribute int8u multiPressMax = 2; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster ThreadNetworkDiagnostics = 53 { @@ -830,13 +830,13 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute octet_string channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster UserLabel = 65 { attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster WiFiNetworkDiagnostics = 54 { @@ -896,8 +896,8 @@ server cluster WiFiNetworkDiagnostics = 54 { readonly attribute int32u packetUnicastTxCount = 10; readonly attribute int64u currentMaxRate = 11; readonly attribute int64u overrunCount = 12; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } diff --git a/examples/door-lock-app/door-lock-common/door-lock-app.matter b/examples/door-lock-app/door-lock-common/door-lock-app.matter index f06dc83c1b8c3e..2dbd6bc86aa468 100644 --- a/examples/door-lock-app/door-lock-common/door-lock-app.matter +++ b/examples/door-lock-app/door-lock-common/door-lock-app.matter @@ -22,7 +22,7 @@ server cluster AdministratorCommissioning = 60 { readonly attribute int8u windowStatus = 0; readonly attribute fabric_idx adminFabricIndex = 1; readonly attribute int16u adminVendorId = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -68,7 +68,7 @@ server cluster Basic = 40 { readonly attribute char_string hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; readonly attribute char_string softwareVersionString = 10; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster Descriptor = 29 { @@ -81,7 +81,7 @@ server cluster Descriptor = 29 { readonly attribute CLUSTER_ID serverList[] = 1; readonly attribute CLUSTER_ID clientList[] = 2; readonly attribute ENDPOINT_NO partsList[] = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster DiagnosticLogs = 50 { @@ -368,7 +368,7 @@ server cluster DoorLock = 257 { attribute boolean enablePrivacyModeButton = 43; attribute int8u wrongCodeEntryLimit = 48; attribute int8u userCodeTemporaryDisableTime = 49; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ClearCredentialRequest { DlCredential credential = 0; @@ -470,13 +470,13 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute int64u overrunCount = 6; readonly attribute boolean carrierDetect = 7; readonly attribute int64u timeSinceReset = 8; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster FixedLabel = 64 { readonly attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -501,8 +501,8 @@ server cluster GeneralCommissioning = 48 { readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; readonly attribute enum8 regulatoryConfig = 2; readonly attribute enum8 locationCapability = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -623,7 +623,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute ENUM8 activeHardwareFaults[] = 5; readonly attribute ENUM8 activeRadioFaults[] = 6; readonly attribute ENUM8 activeNetworkFaults[] = 7; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster LocalizationConfiguration = 43 { @@ -689,8 +689,8 @@ server cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -785,7 +785,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -868,13 +868,13 @@ server cluster PowerSource = 47 { readonly attribute boolean batteryReplacementNeeded = 15; readonly attribute enum8 batteryReplaceability = 16; readonly attribute char_string batteryReplacementDescription = 19; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster PowerSourceConfiguration = 46 { readonly attribute INT8U sources[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster SoftwareDiagnostics = 52 { @@ -894,8 +894,8 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute int64u currentHeapFree = 1; readonly attribute int64u currentHeapUsed = 2; readonly attribute int64u currentHeapHighWatermark = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster ThreadNetworkDiagnostics = 53 { @@ -1038,13 +1038,13 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute octet_string channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster UserLabel = 65 { attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster WiFiNetworkDiagnostics = 54 { @@ -1104,8 +1104,8 @@ server cluster WiFiNetworkDiagnostics = 54 { readonly attribute int32u packetUnicastTxCount = 10; readonly attribute int64u currentMaxRate = 11; readonly attribute int64u overrunCount = 12; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index eea92f58f086ee..b2e216e95e5504 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -22,7 +22,7 @@ server cluster AdministratorCommissioning = 60 { readonly attribute int8u windowStatus = 0; readonly attribute fabric_idx adminFabricIndex = 1; readonly attribute int16u adminVendorId = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -76,7 +76,7 @@ server cluster Basic = 40 { attribute boolean localConfigDisabled = 16; readonly attribute boolean reachable = 17; readonly attribute char_string uniqueID = 18; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster ColorControl = 768 { @@ -147,7 +147,7 @@ server cluster ColorControl = 768 { readonly attribute int16u colorTempPhysicalMax = 16396; readonly attribute int16u coupleColorTempToLevelMinMireds = 16397; attribute int16u startUpColorTemperatureMireds = 16400; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ColorLoopSetRequest { ColorLoopUpdateFlags updateFlags = 0; @@ -328,7 +328,7 @@ server cluster Descriptor = 29 { readonly attribute CLUSTER_ID serverList[] = 1; readonly attribute CLUSTER_ID clientList[] = 2; readonly attribute ENDPOINT_NO partsList[] = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster DiagnosticLogs = 50 { @@ -384,15 +384,15 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute int64u overrunCount = 6; readonly attribute boolean carrierDetect = 7; readonly attribute int64u timeSinceReset = 8; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; command ResetCounts(): DefaultSuccess = 0; } server cluster FixedLabel = 64 { readonly attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -417,8 +417,8 @@ server cluster GeneralCommissioning = 48 { readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; readonly attribute enum8 regulatoryConfig = 2; readonly attribute enum8 locationCapability = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -539,7 +539,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute ENUM8 activeHardwareFaults[] = 5; readonly attribute ENUM8 activeRadioFaults[] = 6; readonly attribute ENUM8 activeNetworkFaults[] = 7; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster Identify = 3 { @@ -567,7 +567,7 @@ server cluster Identify = 3 { attribute int16u identifyTime = 0; readonly attribute enum8 identifyType = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct IdentifyRequest { INT16U identifyTime = 0; @@ -612,8 +612,8 @@ server cluster LevelControl = 8 { attribute int16u offTransitionTime = 19; attribute int8u defaultMoveRate = 20; attribute int8u startUpCurrentLevel = 16384; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct MoveRequest { MoveMode moveMode = 0; @@ -731,8 +731,8 @@ server cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -813,7 +813,7 @@ client cluster OtaSoftwareUpdateProvider = 41 { kDownloadProtocolNotSupported = 3; } - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ApplyUpdateRequestRequest { OCTET_STRING updateToken = 0; @@ -913,7 +913,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { readonly attribute boolean updatePossible = 1; readonly attribute OTAUpdateStateEnum updateState = 2; readonly attribute int8u updateStateProgress = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AnnounceOtaProviderRequest { node_id providerNodeId = 0; @@ -930,7 +930,7 @@ server cluster OccupancySensing = 1030 { readonly attribute bitmap8 occupancy = 0; readonly attribute enum8 occupancySensorType = 1; readonly attribute bitmap8 occupancySensorTypeBitmap = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } client cluster OnOff = 6 { @@ -954,8 +954,8 @@ client cluster OnOff = 6 { attribute int16u onTime = 16385; attribute int16u offWaitTime = 16386; attribute enum8 startUpOnOff = 16387; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster OnOff = 6 { @@ -979,8 +979,8 @@ server cluster OnOff = 6 { attribute int16u onTime = 16385; attribute int16u offWaitTime = 16386; attribute enum8 startUpOnOff = 16387; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct OffWithEffectRequest { OnOffEffectIdentifier effectId = 0; @@ -1004,7 +1004,7 @@ server cluster OnOff = 6 { server cluster OnOffSwitchConfiguration = 7 { readonly attribute enum8 switchType = 0; attribute enum8 switchActions = 16; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster OperationalCredentials = 62 { @@ -1042,7 +1042,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -1133,8 +1133,8 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute int64u currentHeapFree = 1; readonly attribute int64u currentHeapUsed = 2; readonly attribute int64u currentHeapHighWatermark = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; command ResetWatermarks(): DefaultSuccess = 0; } @@ -1312,15 +1312,15 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute octet_string channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; command ResetCounts(): DefaultSuccess = 0; } server cluster UserLabel = 65 { attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster WiFiNetworkDiagnostics = 54 { @@ -1380,8 +1380,8 @@ server cluster WiFiNetworkDiagnostics = 54 { readonly attribute int32u packetUnicastTxCount = 10; readonly attribute int64u currentMaxRate = 11; readonly attribute int64u overrunCount = 12; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; command ResetCounts(): DefaultSuccess = 0; } diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index 68d68747fa3d1b..fe6fecc6a9dd26 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -22,7 +22,7 @@ server cluster AdministratorCommissioning = 60 { readonly attribute int8u windowStatus = 0; readonly attribute fabric_idx adminFabricIndex = 1; readonly attribute int16u adminVendorId = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -68,7 +68,7 @@ server cluster Basic = 40 { readonly attribute char_string hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; readonly attribute char_string softwareVersionString = 10; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster Descriptor = 29 { @@ -81,7 +81,7 @@ server cluster Descriptor = 29 { readonly attribute CLUSTER_ID serverList[] = 1; readonly attribute CLUSTER_ID clientList[] = 2; readonly attribute ENDPOINT_NO partsList[] = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster DiagnosticLogs = 50 { @@ -137,13 +137,13 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute int64u overrunCount = 6; readonly attribute boolean carrierDetect = 7; readonly attribute int64u timeSinceReset = 8; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster FixedLabel = 64 { readonly attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -168,8 +168,8 @@ server cluster GeneralCommissioning = 48 { readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; readonly attribute enum8 regulatoryConfig = 2; readonly attribute enum8 locationCapability = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -290,7 +290,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute ENUM8 activeHardwareFaults[] = 5; readonly attribute ENUM8 activeRadioFaults[] = 6; readonly attribute ENUM8 activeNetworkFaults[] = 7; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster LocalizationConfiguration = 43 { @@ -356,8 +356,8 @@ server cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -438,8 +438,8 @@ server cluster OnOff = 6 { attribute int16u onTime = 16385; attribute int16u offWaitTime = 16386; attribute enum8 startUpOnOff = 16387; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; command Off(): DefaultSuccess = 0; command On(): DefaultSuccess = 1; @@ -481,7 +481,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -564,13 +564,13 @@ server cluster PowerSource = 47 { readonly attribute boolean batteryReplacementNeeded = 15; readonly attribute enum8 batteryReplaceability = 16; readonly attribute char_string batteryReplacementDescription = 19; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster PowerSourceConfiguration = 46 { readonly attribute INT8U sources[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster SoftwareDiagnostics = 52 { @@ -590,8 +590,8 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute int64u currentHeapFree = 1; readonly attribute int64u currentHeapUsed = 2; readonly attribute int64u currentHeapHighWatermark = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster ThreadNetworkDiagnostics = 53 { @@ -734,13 +734,13 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute octet_string channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster UserLabel = 65 { attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster WiFiNetworkDiagnostics = 54 { @@ -800,8 +800,8 @@ server cluster WiFiNetworkDiagnostics = 54 { readonly attribute int32u packetUnicastTxCount = 10; readonly attribute int64u currentMaxRate = 11; readonly attribute int64u overrunCount = 12; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } diff --git a/examples/log-source-app/log-source-common/log-source-app.matter b/examples/log-source-app/log-source-common/log-source-app.matter index 118db74926951c..e30623a820f786 100644 --- a/examples/log-source-app/log-source-common/log-source-app.matter +++ b/examples/log-source-app/log-source-common/log-source-app.matter @@ -80,7 +80,7 @@ server cluster GeneralCommissioning = 48 { attribute int64u breadcrumb = 0; readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -160,7 +160,7 @@ server cluster NetworkCommissioning = 49 { INT8U lqi = 7; } - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -247,7 +247,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; diff --git a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter index 362dc798456791..09b4f798d20c84 100644 --- a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter +++ b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter @@ -8,7 +8,7 @@ struct LabelStruct { server cluster FixedLabel = 64 { readonly attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -33,8 +33,8 @@ server cluster GeneralCommissioning = 48 { readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; readonly attribute enum8 regulatoryConfig = 2; readonly attribute enum8 locationCapability = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -132,8 +132,8 @@ server cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -214,7 +214,7 @@ server cluster OtaSoftwareUpdateProvider = 41 { kDownloadProtocolNotSupported = 3; } - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ApplyUpdateRequestRequest { OCTET_STRING updateToken = 0; @@ -293,7 +293,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -358,7 +358,7 @@ server cluster OperationalCredentials = 62 { server cluster UserLabel = 65 { attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } diff --git a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter index 483e85870e6687..fae07dd1a603d8 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter +++ b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter @@ -32,14 +32,14 @@ server cluster Basic = 40 { readonly attribute char_string hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; readonly attribute char_string softwareVersionString = 10; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; command MfgSpecificPing(): DefaultSuccess = 0; } server cluster FixedLabel = 64 { readonly attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -64,8 +64,8 @@ server cluster GeneralCommissioning = 48 { readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; readonly attribute enum8 regulatoryConfig = 2; readonly attribute enum8 locationCapability = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -163,8 +163,8 @@ server cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -245,7 +245,7 @@ client cluster OtaSoftwareUpdateProvider = 41 { kDownloadProtocolNotSupported = 3; } - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ApplyUpdateRequestRequest { OCTET_STRING updateToken = 0; @@ -345,7 +345,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { readonly attribute boolean updatePossible = 1; readonly attribute OTAUpdateStateEnum updateState = 2; readonly attribute int8u updateStateProgress = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AnnounceOtaProviderRequest { node_id providerNodeId = 0; @@ -393,7 +393,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -469,7 +469,7 @@ server cluster OperationalCredentials = 62 { server cluster UserLabel = 65 { attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 764bbe9a482b79..07f3fde86630e9 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -35,7 +35,7 @@ server cluster Basic = 40 { attribute boolean localConfigDisabled = 16; readonly attribute boolean reachable = 17; readonly attribute char_string uniqueID = 18; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster ColorControl = 768 { @@ -90,7 +90,7 @@ server cluster ColorControl = 768 { attribute bitmap8 colorControlOptions = 15; readonly attribute int16u coupleColorTempToLevelMinMireds = 16397; attribute int16u startUpColorTemperatureMireds = 16400; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct MoveColorRequest { INT16S rateX = 0; @@ -130,7 +130,7 @@ server cluster Descriptor = 29 { readonly attribute CLUSTER_ID serverList[] = 1; readonly attribute CLUSTER_ID clientList[] = 2; readonly attribute ENDPOINT_NO partsList[] = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -153,7 +153,7 @@ server cluster GeneralCommissioning = 48 { attribute int64u breadcrumb = 0; readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -190,7 +190,7 @@ server cluster GeneralCommissioning = 48 { server cluster Groups = 4 { readonly attribute bitmap8 nameSupport = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddGroupRequest { INT16U groupId = 0; @@ -268,7 +268,7 @@ server cluster Identify = 3 { attribute int16u identifyTime = 0; readonly attribute enum8 identifyType = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct IdentifyRequest { INT16U identifyTime = 0; @@ -294,7 +294,7 @@ server cluster LevelControl = 8 { } readonly attribute int8u currentLevel = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct MoveRequest { MoveMode moveMode = 0; @@ -407,8 +407,8 @@ server cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -485,7 +485,7 @@ server cluster OnOff = 6 { } readonly attribute boolean onOff = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; command Off(): DefaultSuccess = 0; command On(): DefaultSuccess = 1; @@ -520,7 +520,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -606,7 +606,7 @@ server cluster Scenes = 5 { readonly attribute int16u currentGroup = 2; readonly attribute boolean sceneValid = 3; readonly attribute bitmap8 nameSupport = 4; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddSceneRequest { INT16U groupId = 0; @@ -698,14 +698,14 @@ client cluster TemperatureMeasurement = 1026 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster TemperatureMeasurement = 1026 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 764bbe9a482b79..07f3fde86630e9 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -35,7 +35,7 @@ server cluster Basic = 40 { attribute boolean localConfigDisabled = 16; readonly attribute boolean reachable = 17; readonly attribute char_string uniqueID = 18; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster ColorControl = 768 { @@ -90,7 +90,7 @@ server cluster ColorControl = 768 { attribute bitmap8 colorControlOptions = 15; readonly attribute int16u coupleColorTempToLevelMinMireds = 16397; attribute int16u startUpColorTemperatureMireds = 16400; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct MoveColorRequest { INT16S rateX = 0; @@ -130,7 +130,7 @@ server cluster Descriptor = 29 { readonly attribute CLUSTER_ID serverList[] = 1; readonly attribute CLUSTER_ID clientList[] = 2; readonly attribute ENDPOINT_NO partsList[] = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -153,7 +153,7 @@ server cluster GeneralCommissioning = 48 { attribute int64u breadcrumb = 0; readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -190,7 +190,7 @@ server cluster GeneralCommissioning = 48 { server cluster Groups = 4 { readonly attribute bitmap8 nameSupport = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddGroupRequest { INT16U groupId = 0; @@ -268,7 +268,7 @@ server cluster Identify = 3 { attribute int16u identifyTime = 0; readonly attribute enum8 identifyType = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct IdentifyRequest { INT16U identifyTime = 0; @@ -294,7 +294,7 @@ server cluster LevelControl = 8 { } readonly attribute int8u currentLevel = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct MoveRequest { MoveMode moveMode = 0; @@ -407,8 +407,8 @@ server cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -485,7 +485,7 @@ server cluster OnOff = 6 { } readonly attribute boolean onOff = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; command Off(): DefaultSuccess = 0; command On(): DefaultSuccess = 1; @@ -520,7 +520,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -606,7 +606,7 @@ server cluster Scenes = 5 { readonly attribute int16u currentGroup = 2; readonly attribute boolean sceneValid = 3; readonly attribute bitmap8 nameSupport = 4; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddSceneRequest { INT16U groupId = 0; @@ -698,14 +698,14 @@ client cluster TemperatureMeasurement = 1026 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster TemperatureMeasurement = 1026 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter index 86eac98eddf62d..058c65c234e391 100644 --- a/examples/pump-app/pump-common/pump-app.matter +++ b/examples/pump-app/pump-common/pump-app.matter @@ -22,7 +22,7 @@ server cluster AdministratorCommissioning = 60 { readonly attribute int8u windowStatus = 0; readonly attribute fabric_idx adminFabricIndex = 1; readonly attribute int16u adminVendorId = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -68,7 +68,7 @@ server cluster Basic = 40 { readonly attribute char_string hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; readonly attribute char_string softwareVersionString = 10; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; command MfgSpecificPing(): DefaultSuccess = 0; } @@ -83,7 +83,7 @@ server cluster Descriptor = 29 { readonly attribute CLUSTER_ID serverList[] = 1; readonly attribute CLUSTER_ID clientList[] = 2; readonly attribute ENDPOINT_NO partsList[] = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster DiagnosticLogs = 50 { @@ -118,21 +118,21 @@ server cluster DiagnosticLogs = 50 { server cluster FixedLabel = 64 { readonly attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } client cluster FlowMeasurement = 1028 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster FlowMeasurement = 1028 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -157,8 +157,8 @@ server cluster GeneralCommissioning = 48 { readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; readonly attribute enum8 regulatoryConfig = 2; readonly attribute enum8 locationCapability = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -279,7 +279,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute ENUM8 activeHardwareFaults[] = 5; readonly attribute ENUM8 activeRadioFaults[] = 6; readonly attribute ENUM8 activeNetworkFaults[] = 7; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster LevelControl = 8 { @@ -294,7 +294,7 @@ server cluster LevelControl = 8 { } readonly attribute int8u currentLevel = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct MoveRequest { MoveMode moveMode = 0; @@ -412,8 +412,8 @@ server cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -490,7 +490,7 @@ server cluster OnOff = 6 { } readonly attribute boolean onOff = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; command Off(): DefaultSuccess = 0; command On(): DefaultSuccess = 1; @@ -532,7 +532,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -610,14 +610,14 @@ client cluster PressureMeasurement = 1027 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster PressureMeasurement = 1027 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster PumpConfigurationAndControl = 512 { @@ -712,8 +712,8 @@ server cluster PumpConfigurationAndControl = 512 { attribute enum8 operationMode = 32; attribute enum8 controlMode = 33; readonly attribute bitmap16 alarmMask = 34; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster SoftwareDiagnostics = 52 { @@ -733,22 +733,22 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute int64u currentHeapFree = 1; readonly attribute int64u currentHeapUsed = 2; readonly attribute int64u currentHeapHighWatermark = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } client cluster TemperatureMeasurement = 1026 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster TemperatureMeasurement = 1026 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster ThreadNetworkDiagnostics = 53 { @@ -891,13 +891,13 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute octet_string channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster UserLabel = 65 { attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter index 7d0b9ce9b97746..fcc69efb730f52 100644 --- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter +++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter @@ -22,7 +22,7 @@ server cluster AdministratorCommissioning = 60 { readonly attribute int8u windowStatus = 0; readonly attribute fabric_idx adminFabricIndex = 1; readonly attribute int16u adminVendorId = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -68,7 +68,7 @@ server cluster Basic = 40 { readonly attribute char_string hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; readonly attribute char_string softwareVersionString = 10; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; command MfgSpecificPing(): DefaultSuccess = 0; } @@ -83,7 +83,7 @@ server cluster Descriptor = 29 { readonly attribute CLUSTER_ID serverList[] = 1; readonly attribute CLUSTER_ID clientList[] = 2; readonly attribute ENDPOINT_NO partsList[] = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster DiagnosticLogs = 50 { @@ -139,20 +139,20 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute int64u overrunCount = 6; readonly attribute boolean carrierDetect = 7; readonly attribute int64u timeSinceReset = 8; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster FixedLabel = 64 { readonly attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } client cluster FlowMeasurement = 1028 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -177,8 +177,8 @@ server cluster GeneralCommissioning = 48 { readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; readonly attribute enum8 regulatoryConfig = 2; readonly attribute enum8 locationCapability = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -299,7 +299,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute ENUM8 activeHardwareFaults[] = 5; readonly attribute ENUM8 activeRadioFaults[] = 6; readonly attribute ENUM8 activeNetworkFaults[] = 7; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } client cluster LevelControl = 8 { @@ -314,7 +314,7 @@ client cluster LevelControl = 8 { } readonly attribute int8u currentLevel = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct MoveRequest { MoveMode moveMode = 0; @@ -432,8 +432,8 @@ server cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -510,7 +510,7 @@ client cluster OnOff = 6 { } readonly attribute boolean onOff = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; command Off(): DefaultSuccess = 0; command On(): DefaultSuccess = 1; @@ -552,7 +552,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -630,7 +630,7 @@ client cluster PressureMeasurement = 1027 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } client cluster PumpConfigurationAndControl = 512 { @@ -708,7 +708,7 @@ client cluster PumpConfigurationAndControl = 512 { readonly attribute enum8 effectiveControlMode = 18; readonly attribute int16s capacity = 19; attribute enum8 operationMode = 32; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster SoftwareDiagnostics = 52 { @@ -728,15 +728,15 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute int64u currentHeapFree = 1; readonly attribute int64u currentHeapUsed = 2; readonly attribute int64u currentHeapHighWatermark = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } client cluster TemperatureMeasurement = 1026 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster ThreadNetworkDiagnostics = 53 { @@ -879,13 +879,13 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute octet_string channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster UserLabel = 65 { attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster WiFiNetworkDiagnostics = 54 { @@ -945,8 +945,8 @@ server cluster WiFiNetworkDiagnostics = 54 { readonly attribute int32u packetUnicastTxCount = 10; readonly attribute int64u currentMaxRate = 11; readonly attribute int64u overrunCount = 12; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } diff --git a/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter b/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter index 905bde4e91c56c..1943328215ef9a 100644 --- a/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter +++ b/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter @@ -22,7 +22,7 @@ server cluster AdministratorCommissioning = 60 { readonly attribute int8u windowStatus = 0; readonly attribute fabric_idx adminFabricIndex = 1; readonly attribute int16u adminVendorId = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -68,7 +68,7 @@ server cluster Basic = 40 { readonly attribute char_string hardwareVersionString = 8; readonly attribute int32u softwareVersion = 9; readonly attribute char_string softwareVersionString = 10; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster Descriptor = 29 { @@ -81,7 +81,7 @@ server cluster Descriptor = 29 { readonly attribute CLUSTER_ID serverList[] = 1; readonly attribute CLUSTER_ID clientList[] = 2; readonly attribute ENDPOINT_NO partsList[] = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster DiagnosticLogs = 50 { @@ -137,13 +137,13 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute int64u overrunCount = 6; readonly attribute boolean carrierDetect = 7; readonly attribute int64u timeSinceReset = 8; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster FixedLabel = 64 { readonly attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -168,8 +168,8 @@ server cluster GeneralCommissioning = 48 { readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; readonly attribute enum8 regulatoryConfig = 2; readonly attribute enum8 locationCapability = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -290,7 +290,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute ENUM8 activeHardwareFaults[] = 5; readonly attribute ENUM8 activeRadioFaults[] = 6; readonly attribute ENUM8 activeNetworkFaults[] = 7; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster LocalizationConfiguration = 43 { @@ -356,8 +356,8 @@ server cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateWiFiNetworkRequest { OCTET_STRING ssid = 0; @@ -446,7 +446,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -526,20 +526,20 @@ server cluster SoftwareDiagnostics = 52 { } readonly attribute int64u currentHeapHighWatermark = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster TemperatureMeasurement = 1026 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster UserLabel = 65 { attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster WiFiNetworkDiagnostics = 54 { @@ -599,8 +599,8 @@ server cluster WiFiNetworkDiagnostics = 54 { readonly attribute int32u packetUnicastTxCount = 10; readonly attribute int64u currentMaxRate = 11; readonly attribute int64u overrunCount = 12; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index 9019756ebabaa4..08678f8f9dd7f5 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -22,7 +22,7 @@ server cluster AdministratorCommissioning = 60 { readonly attribute int8u windowStatus = 0; readonly attribute fabric_idx adminFabricIndex = 1; readonly attribute int16u adminVendorId = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -76,13 +76,13 @@ server cluster Basic = 40 { attribute boolean localConfigDisabled = 16; readonly attribute boolean reachable = 17; readonly attribute char_string uniqueID = 18; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; command MfgSpecificPing(): DefaultSuccess = 0; } server cluster Binding = 30 { - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct BindRequest { NODE_ID nodeId = 0; @@ -112,7 +112,7 @@ server cluster Descriptor = 29 { readonly attribute CLUSTER_ID serverList[] = 1; readonly attribute CLUSTER_ID clientList[] = 2; readonly attribute ENDPOINT_NO partsList[] = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster DiagnosticLogs = 50 { @@ -168,13 +168,13 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute int64u overrunCount = 6; readonly attribute boolean carrierDetect = 7; readonly attribute int64u timeSinceReset = 8; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster FixedLabel = 64 { readonly attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -199,8 +199,8 @@ server cluster GeneralCommissioning = 48 { readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; readonly attribute enum8 regulatoryConfig = 2; readonly attribute enum8 locationCapability = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -321,7 +321,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute ENUM8 activeHardwareFaults[] = 5; readonly attribute ENUM8 activeRadioFaults[] = 6; readonly attribute ENUM8 activeNetworkFaults[] = 7; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GroupKeyManagement = 63 { @@ -345,12 +345,12 @@ server cluster GroupKeyManagement = 63 { readonly attribute GroupKey groupKeyMap[] = 0; readonly attribute GroupInfo groupTable[] = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster Groups = 4 { readonly attribute bitmap8 nameSupport = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddGroupRequest { INT16U groupId = 0; @@ -428,7 +428,7 @@ client cluster Identify = 3 { attribute int16u identifyTime = 0; readonly attribute enum8 identifyType = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct IdentifyRequest { INT16U identifyTime = 0; @@ -467,7 +467,7 @@ server cluster Identify = 3 { attribute int16u identifyTime = 0; readonly attribute enum8 identifyType = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct IdentifyRequest { INT16U identifyTime = 0; @@ -544,8 +544,8 @@ server cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -626,7 +626,7 @@ server cluster OtaSoftwareUpdateProvider = 41 { kDownloadProtocolNotSupported = 3; } - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ApplyUpdateRequestRequest { OCTET_STRING updateToken = 0; @@ -705,7 +705,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -791,7 +791,7 @@ server cluster Scenes = 5 { readonly attribute int16u currentGroup = 2; readonly attribute boolean sceneValid = 3; readonly attribute bitmap8 nameSupport = 4; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddSceneRequest { INT16U groupId = 0; @@ -896,8 +896,8 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute int64u currentHeapFree = 1; readonly attribute int64u currentHeapUsed = 2; readonly attribute int64u currentHeapHighWatermark = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster Thermostat = 513 { @@ -924,8 +924,8 @@ server cluster Thermostat = 513 { readonly attribute enum8 startOfWeek = 32; readonly attribute int8u numberOfWeeklyTransitions = 33; readonly attribute int8u numberOfDailyTransitions = 34; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct GetWeeklyScheduleRequest { DayOfWeek daysToReturn = 0; @@ -1107,13 +1107,13 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute octet_string channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster UserLabel = 65 { attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster WiFiNetworkDiagnostics = 54 { @@ -1173,8 +1173,8 @@ server cluster WiFiNetworkDiagnostics = 54 { readonly attribute int32u packetUnicastTxCount = 10; readonly attribute int64u currentMaxRate = 11; readonly attribute int64u overrunCount = 12; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index fab11b136b0664..2b896b3e017f27 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -7,7 +7,7 @@ struct LabelStruct { } server cluster AccountLogin = 1294 { - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct GetSetupPINRequestRequest { CHAR_STRING tempAccountIdentifier = 0; @@ -43,7 +43,7 @@ server cluster AdministratorCommissioning = 60 { readonly attribute int8u windowStatus = 0; readonly attribute fabric_idx adminFabricIndex = 1; readonly attribute int16u adminVendorId = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -84,7 +84,7 @@ server cluster ApplicationBasic = 1293 { readonly attribute ApplicationStatusEnum applicationStatus = 5; readonly attribute char_string applicationVersion = 6; readonly attribute vendor_id allowedVendorList[] = 7; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster ApplicationLauncher = 1292 { @@ -106,7 +106,7 @@ server cluster ApplicationLauncher = 1292 { readonly attribute INT16U applicationLauncherList[] = 0; attribute ApplicationEP applicationLauncherApp = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct HideAppRequestRequest { ApplicationLauncherApplication application = 0; @@ -149,7 +149,7 @@ server cluster AudioOutput = 1291 { readonly attribute OutputInfo audioOutputList[] = 0; readonly attribute int8u currentAudioOutput = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct RenameOutputRequestRequest { INT8U index = 0; @@ -197,13 +197,13 @@ server cluster Basic = 40 { readonly attribute char_string serialNumber = 15; attribute boolean localConfigDisabled = 16; readonly attribute char_string uniqueID = 18; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; command MfgSpecificPing(): DefaultSuccess = 0; } client cluster Binding = 30 { - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct BindRequest { NODE_ID nodeId = 0; @@ -224,7 +224,7 @@ client cluster Binding = 30 { } server cluster Binding = 30 { - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct BindRequest { NODE_ID nodeId = 0; @@ -272,7 +272,7 @@ server cluster Channel = 1284 { readonly attribute ChannelInfo channelList[] = 0; attribute LineupInfo channelLineup = 1; attribute ChannelInfo currentChannel = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ChangeChannelByNumberRequestRequest { INT16U majorNumber = 0; @@ -363,7 +363,7 @@ server cluster ContentLauncher = 1290 { readonly attribute CHAR_STRING acceptHeaderList[] = 0; attribute bitmap32 supportedStreamingProtocols = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct LaunchContentRequestRequest { BOOLEAN autoPlay = 0; @@ -396,7 +396,7 @@ server cluster Descriptor = 29 { readonly attribute CLUSTER_ID serverList[] = 1; readonly attribute CLUSTER_ID clientList[] = 2; readonly attribute ENDPOINT_NO partsList[] = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster DiagnosticLogs = 50 { @@ -452,13 +452,13 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute int64u overrunCount = 6; readonly attribute boolean carrierDetect = 7; readonly attribute int64u timeSinceReset = 8; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster FixedLabel = 64 { readonly attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } client cluster GeneralCommissioning = 48 { @@ -483,8 +483,8 @@ client cluster GeneralCommissioning = 48 { readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; readonly attribute enum8 regulatoryConfig = 2; readonly attribute enum8 locationCapability = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -541,8 +541,8 @@ server cluster GeneralCommissioning = 48 { readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; readonly attribute enum8 regulatoryConfig = 2; readonly attribute enum8 locationCapability = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -663,7 +663,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute ENUM8 activeHardwareFaults[] = 5; readonly attribute ENUM8 activeRadioFaults[] = 6; readonly attribute ENUM8 activeNetworkFaults[] = 7; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GroupKeyManagement = 63 { @@ -687,7 +687,7 @@ server cluster GroupKeyManagement = 63 { readonly attribute GroupKey groupKeyMap[] = 0; readonly attribute GroupInfo groupTable[] = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster KeypadInput = 1289 { @@ -786,7 +786,7 @@ server cluster KeypadInput = 1289 { kInvalidKeyInCurrentState = 2; } - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct SendKeyRequestRequest { CecKeyCode keyCode = 0; @@ -820,8 +820,8 @@ server cluster LevelControl = 8 { attribute int16u offTransitionTime = 19; attribute int8u defaultMoveRate = 20; attribute int8u startUpCurrentLevel = 16384; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct MoveRequest { MoveMode moveMode = 0; @@ -882,7 +882,7 @@ server cluster LocalizationConfiguration = 43 { } server cluster LowPower = 1288 { - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; command Sleep(): DefaultSuccess = 0; } @@ -912,7 +912,7 @@ server cluster MediaInput = 1287 { readonly attribute InputInfo mediaInputList[] = 0; readonly attribute int8u currentMediaInput = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct RenameInputRequestRequest { INT8U index = 0; @@ -958,7 +958,7 @@ server cluster MediaPlayback = 1286 { readonly attribute single playbackSpeed = 4; readonly attribute int64u seekRangeEnd = 5; readonly attribute int64u seekRangeStart = 6; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct SeekRequestRequest { INT64U position = 0; @@ -1047,8 +1047,8 @@ client cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -1166,8 +1166,8 @@ server cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -1248,7 +1248,7 @@ server cluster OtaSoftwareUpdateProvider = 41 { kDownloadProtocolNotSupported = 3; } - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ApplyUpdateRequestRequest { OCTET_STRING updateToken = 0; @@ -1309,7 +1309,7 @@ server cluster OnOff = 6 { } readonly attribute boolean onOff = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; command Off(): DefaultSuccess = 0; command On(): DefaultSuccess = 1; @@ -1351,7 +1351,7 @@ client cluster OperationalCredentials = 62 { readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -1449,7 +1449,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -1527,7 +1527,7 @@ server cluster RelativeHumidityMeasurement = 1029 { readonly attribute int16u measuredValue = 0; readonly attribute int16u minMeasuredValue = 1; readonly attribute int16u maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster SoftwareDiagnostics = 52 { @@ -1547,8 +1547,8 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute int64u currentHeapFree = 1; readonly attribute int64u currentHeapUsed = 2; readonly attribute int64u currentHeapHighWatermark = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster TargetNavigator = 1285 { @@ -1565,7 +1565,7 @@ server cluster TargetNavigator = 1285 { readonly attribute TargetInfo targetNavigatorList[] = 0; readonly attribute int8u currentNavigatorTarget = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct NavigateTargetRequestRequest { INT8U target = 0; @@ -1720,18 +1720,18 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute octet_string channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster UserLabel = 65 { attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster WakeOnLan = 1283 { readonly attribute char_string wakeOnLanMacAddress = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster WiFiNetworkDiagnostics = 54 { @@ -1791,8 +1791,8 @@ server cluster WiFiNetworkDiagnostics = 54 { readonly attribute int32u packetUnicastTxCount = 10; readonly attribute int64u currentMaxRate = 11; readonly attribute int64u overrunCount = 12; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter index b380967a5dbdc1..ed780da7f8b1a4 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter @@ -7,7 +7,7 @@ struct LabelStruct { } client cluster AccountLogin = 1294 { - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct GetSetupPINRequestRequest { CHAR_STRING tempAccountIdentifier = 0; @@ -39,7 +39,7 @@ server cluster AdministratorCommissioning = 60 { readonly attribute int8u windowStatus = 0; readonly attribute fabric_idx adminFabricIndex = 1; readonly attribute int16u adminVendorId = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -73,7 +73,7 @@ client cluster ApplicationBasic = 1293 { readonly attribute int16u productId = 3; readonly attribute ApplicationStatusEnum applicationStatus = 5; readonly attribute char_string applicationVersion = 6; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } client cluster ApplicationLauncher = 1292 { @@ -89,7 +89,7 @@ client cluster ApplicationLauncher = 1292 { } readonly attribute INT16U applicationLauncherList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct HideAppRequestRequest { ApplicationLauncherApplication application = 0; @@ -126,7 +126,7 @@ client cluster AudioOutput = 1291 { } readonly attribute OutputInfo audioOutputList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct RenameOutputRequestRequest { INT8U index = 0; @@ -146,7 +146,7 @@ server cluster BarrierControl = 259 { readonly attribute bitmap16 barrierSafetyStatus = 2; readonly attribute bitmap8 barrierCapabilities = 3; readonly attribute int8u barrierPosition = 10; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct BarrierControlGoToPercentRequest { INT8U percentOpen = 0; @@ -190,7 +190,7 @@ server cluster Basic = 40 { attribute boolean localConfigDisabled = 16; readonly attribute boolean reachable = 17; readonly attribute char_string uniqueID = 18; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; command MfgSpecificPing(): DefaultSuccess = 0; } @@ -199,11 +199,11 @@ server cluster BinaryInputBasic = 15 { attribute boolean outOfService = 81; attribute boolean presentValue = 85; readonly attribute bitmap8 statusFlags = 111; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster Binding = 30 { - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct BindRequest { NODE_ID nodeId = 0; @@ -238,7 +238,7 @@ server cluster BridgedDeviceBasic = 57 { readonly attribute char_string productLabel = 14; readonly attribute char_string serialNumber = 15; readonly attribute boolean reachable = 17; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; command Leave(): DefaultSuccess = 2; command ReachableChanged(): DefaultSuccess = 3; @@ -274,7 +274,7 @@ client cluster Channel = 1284 { readonly attribute ChannelInfo channelList[] = 0; attribute LineupInfo channelLineup = 1; attribute ChannelInfo currentChannel = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ChangeChannelByNumberRequestRequest { INT16U majorNumber = 0; @@ -391,7 +391,7 @@ server cluster ColorControl = 768 { readonly attribute int16u colorTempPhysicalMax = 16396; readonly attribute int16u coupleColorTempToLevelMinMireds = 16397; attribute int16u startUpColorTemperatureMireds = 16400; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct MoveColorRequest { INT16S rateX = 0; @@ -582,7 +582,7 @@ client cluster ContentLauncher = 1290 { readonly attribute CHAR_STRING acceptHeaderList[] = 0; attribute bitmap32 supportedStreamingProtocols = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct LaunchContentRequestRequest { BOOLEAN autoPlay = 0; @@ -610,7 +610,7 @@ server cluster Descriptor = 29 { readonly attribute CLUSTER_ID serverList[] = 1; readonly attribute CLUSTER_ID clientList[] = 2; readonly attribute ENDPOINT_NO partsList[] = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster DiagnosticLogs = 50 { @@ -906,7 +906,7 @@ server cluster DoorLock = 257 { attribute int8u wrongCodeEntryLimit = 48; attribute int8u userCodeTemporaryDisableTime = 49; attribute boolean requirePINforRemoteOperation = 51; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ClearCredentialRequest { DlCredential credential = 0; @@ -1008,20 +1008,20 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute int64u overrunCount = 6; readonly attribute boolean carrierDetect = 7; readonly attribute int64u timeSinceReset = 8; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster FixedLabel = 64 { readonly attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster FlowMeasurement = 1028 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -1046,8 +1046,8 @@ server cluster GeneralCommissioning = 48 { readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; readonly attribute enum8 regulatoryConfig = 2; readonly attribute enum8 locationCapability = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -1168,7 +1168,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute ENUM8 activeHardwareFaults[] = 5; readonly attribute ENUM8 activeRadioFaults[] = 6; readonly attribute ENUM8 activeNetworkFaults[] = 7; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GroupKeyManagement = 63 { @@ -1192,12 +1192,12 @@ server cluster GroupKeyManagement = 63 { readonly attribute GroupKey groupKeyMap[] = 0; readonly attribute GroupInfo groupTable[] = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster Groups = 4 { readonly attribute bitmap8 nameSupport = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddGroupRequest { INT16U groupId = 0; @@ -1282,7 +1282,7 @@ server cluster IasZone = 1280 { readonly attribute bitmap16 zoneStatus = 2; attribute node_id iasCieAddress = 16; readonly attribute int8u zoneId = 17; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ZoneEnrollRequestRequest { IasZoneType zoneType = 0; @@ -1329,7 +1329,7 @@ server cluster Identify = 3 { } attribute int16u identifyTime = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct IdentifyRequest { INT16U identifyTime = 0; @@ -1439,7 +1439,7 @@ client cluster KeypadInput = 1289 { kInvalidKeyInCurrentState = 2; } - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct SendKeyRequestRequest { CecKeyCode keyCode = 0; @@ -1473,7 +1473,7 @@ server cluster LevelControl = 8 { attribute int16u offTransitionTime = 19; attribute int8u defaultMoveRate = 20; attribute int8u startUpCurrentLevel = 16384; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct MoveRequest { MoveMode moveMode = 0; @@ -1557,7 +1557,7 @@ client cluster MediaInput = 1287 { } readonly attribute InputInfo mediaInputList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct RenameInputRequestRequest { INT8U index = 0; @@ -1591,7 +1591,7 @@ client cluster MediaPlayback = 1286 { kSeekOutOfRange = 5; } - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct SeekRequestRequest { INT64U position = 0; @@ -1676,8 +1676,8 @@ server cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -1758,7 +1758,7 @@ server cluster OtaSoftwareUpdateProvider = 41 { kDownloadProtocolNotSupported = 3; } - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct ApplyUpdateRequestRequest { OCTET_STRING updateToken = 0; @@ -1806,7 +1806,7 @@ server cluster OccupancySensing = 1030 { readonly attribute bitmap8 occupancy = 0; readonly attribute enum8 occupancySensorType = 1; readonly attribute bitmap8 occupancySensorTypeBitmap = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster OnOff = 6 { @@ -1830,8 +1830,8 @@ server cluster OnOff = 6 { attribute int16u onTime = 16385; attribute int16u offWaitTime = 16386; attribute enum8 startUpOnOff = 16387; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; command Off(): DefaultSuccess = 0; command On(): DefaultSuccess = 1; @@ -1873,7 +1873,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -1951,14 +1951,14 @@ server cluster PressureMeasurement = 1027 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster RelativeHumidityMeasurement = 1029 { readonly attribute int16u measuredValue = 0; readonly attribute int16u minMeasuredValue = 1; readonly attribute int16u maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster Scenes = 5 { @@ -1973,7 +1973,7 @@ server cluster Scenes = 5 { readonly attribute int16u currentGroup = 2; readonly attribute boolean sceneValid = 3; readonly attribute bitmap8 nameSupport = 4; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddSceneRequest { INT16U groupId = 0; @@ -2078,8 +2078,8 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute int64u currentHeapFree = 1; readonly attribute int64u currentHeapUsed = 2; readonly attribute int64u currentHeapHighWatermark = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster Switch = 59 { @@ -2115,7 +2115,7 @@ server cluster Switch = 59 { readonly attribute int8u numberOfPositions = 0; readonly attribute int8u currentPosition = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } client cluster TargetNavigator = 1285 { @@ -2131,7 +2131,7 @@ client cluster TargetNavigator = 1285 { } readonly attribute TargetInfo targetNavigatorList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct NavigateTargetRequestRequest { INT8U target = 0; @@ -2145,7 +2145,7 @@ server cluster TemperatureMeasurement = 1026 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster TestCluster = 1295 { @@ -2190,7 +2190,7 @@ server cluster TestCluster = 1295 { attribute OCTET_STRING listOctetString[] = 27; attribute TestListStructOctet listStructOctetString[] = 28; attribute long_octet_string longOctetString = 29; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; response struct TestSpecificResponse { INT8U returnValue = 0; @@ -2216,8 +2216,8 @@ server cluster Thermostat = 513 { readonly attribute enum8 startOfWeek = 32; readonly attribute int8u numberOfWeeklyTransitions = 33; readonly attribute int8u numberOfDailyTransitions = 34; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; response struct GetWeeklyScheduleResponse { ENUM8 numberOfTransitionsForSequence = 0; @@ -2367,18 +2367,18 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute octet_string channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster UserLabel = 65 { attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster WakeOnLan = 1283 { readonly attribute char_string wakeOnLanMacAddress = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster WiFiNetworkDiagnostics = 54 { @@ -2438,8 +2438,8 @@ server cluster WiFiNetworkDiagnostics = 54 { readonly attribute int32u packetUnicastTxCount = 10; readonly attribute int64u currentMaxRate = 11; readonly attribute int64u overrunCount = 12; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster WindowCovering = 258 { @@ -2461,7 +2461,7 @@ server cluster WindowCovering = 258 { readonly attribute int16u installedClosedLimitTilt = 19; attribute bitmap8 mode = 23; readonly attribute bitmap16 safetyStatus = 26; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index 36bfd10e7adadf..c7206c376b16e3 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -22,7 +22,7 @@ server cluster AdministratorCommissioning = 60 { readonly attribute int8u windowStatus = 0; readonly attribute fabric_idx adminFabricIndex = 1; readonly attribute int16u adminVendorId = 2; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -75,7 +75,7 @@ server cluster Basic = 40 { readonly attribute char_string serialNumber = 15; attribute boolean localConfigDisabled = 16; readonly attribute boolean reachable = 17; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster Descriptor = 29 { @@ -88,7 +88,7 @@ server cluster Descriptor = 29 { readonly attribute CLUSTER_ID serverList[] = 1; readonly attribute CLUSTER_ID clientList[] = 2; readonly attribute ENDPOINT_NO partsList[] = 3; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster EthernetNetworkDiagnostics = 55 { @@ -114,13 +114,13 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute int64u overrunCount = 6; readonly attribute boolean carrierDetect = 7; readonly attribute int64u timeSinceReset = 8; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster FixedLabel = 64 { readonly attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster GeneralCommissioning = 48 { @@ -145,8 +145,8 @@ server cluster GeneralCommissioning = 48 { readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; readonly attribute enum8 regulatoryConfig = 2; readonly attribute enum8 locationCapability = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -267,7 +267,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute ENUM8 activeHardwareFaults[] = 5; readonly attribute ENUM8 activeRadioFaults[] = 6; readonly attribute ENUM8 activeNetworkFaults[] = 7; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster Identify = 3 { @@ -295,7 +295,7 @@ server cluster Identify = 3 { attribute int16u identifyTime = 0; readonly attribute enum8 identifyType = 1; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct IdentifyRequest { INT16U identifyTime = 0; @@ -378,8 +378,8 @@ server cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -474,7 +474,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -558,8 +558,8 @@ server cluster PowerSource = 47 { readonly attribute enum8 batteryChargeLevel = 14; readonly attribute ENUM8 activeBatteryFaults[] = 18; readonly attribute enum8 batteryChargeState = 26; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster SoftwareDiagnostics = 52 { @@ -579,8 +579,8 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute int64u currentHeapFree = 1; readonly attribute int64u currentHeapUsed = 2; readonly attribute int64u currentHeapHighWatermark = 3; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster ThreadNetworkDiagnostics = 53 { @@ -723,13 +723,13 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute octet_string channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster UserLabel = 65 { attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } server cluster WiFiNetworkDiagnostics = 54 { @@ -789,8 +789,8 @@ server cluster WiFiNetworkDiagnostics = 54 { readonly attribute int32u packetUnicastTxCount = 10; readonly attribute int64u currentMaxRate = 11; readonly attribute int64u overrunCount = 12; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } server cluster WindowCovering = 258 { @@ -812,8 +812,8 @@ server cluster WindowCovering = 258 { readonly attribute int16u installedClosedLimitTilt = 19; attribute bitmap8 mode = 23; readonly attribute bitmap16 safetyStatus = 26; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct GoToLiftPercentageRequest { Percent liftPercentageValue = 0; diff --git a/src/app/zap-templates/templates/app/MatterIDL.zapt b/src/app/zap-templates/templates/app/MatterIDL.zapt index e1f01ae81fde56..efa88f812e1126 100644 --- a/src/app/zap-templates/templates/app/MatterIDL.zapt +++ b/src/app/zap-templates/templates/app/MatterIDL.zapt @@ -35,6 +35,9 @@ readonly {{!marker to place a space even with whitespace removal~}} {{~/unless~}} {{~!TODO: write only attributes should also be supported~}} + {{#if isGlobalAttribute~}} + global {{!marker to place a space even with whitespace removal~}} + {{~/if~}} {{~#unless isReportableAttribute~}} nosubscribe {{!marker to place a space even with whitespace removal~}} {{~/unless~}} diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index a1ac966d363d2d..dca196240a3623 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -64,13 +64,13 @@ client cluster AccessControl = 31 { attribute AccessControlEntry acl[] = 0; attribute ExtensionEntry extension[] = 1; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster AccountLogin = 1294 { - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct GetSetupPINRequestRequest { CHAR_STRING tempAccountIdentifier = 0; @@ -106,8 +106,8 @@ client cluster AdministratorCommissioning = 60 { readonly attribute int8u windowStatus = 0; readonly attribute fabric_idx adminFabricIndex = 1; readonly attribute int16u adminVendorId = 2; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct OpenBasicCommissioningWindowRequest { INT16U commissioningTimeout = 0; @@ -148,8 +148,8 @@ client cluster ApplicationBasic = 1293 { readonly attribute ApplicationStatusEnum applicationStatus = 5; readonly attribute char_string applicationVersion = 6; readonly attribute vendor_id allowedVendorList[] = 7; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster ApplicationLauncher = 1292 { @@ -165,8 +165,8 @@ client cluster ApplicationLauncher = 1292 { } readonly attribute INT16U applicationLauncherList[] = 0; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct HideAppRequestRequest { ApplicationLauncherApplication application = 0; @@ -209,8 +209,8 @@ client cluster AudioOutput = 1291 { readonly attribute OutputInfo audioOutputList[] = 0; readonly attribute int8u currentAudioOutput = 1; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct RenameOutputRequestRequest { INT8U index = 0; @@ -230,8 +230,8 @@ client cluster BarrierControl = 259 { readonly attribute bitmap16 barrierSafetyStatus = 2; readonly attribute bitmap8 barrierCapabilities = 3; readonly attribute int8u barrierPosition = 10; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct BarrierControlGoToPercentRequest { INT8U percentOpen = 0; @@ -275,8 +275,8 @@ client cluster Basic = 40 { attribute boolean localConfigDisabled = 16; readonly attribute boolean reachable = 17; readonly attribute char_string uniqueID = 18; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; command MfgSpecificPing(): DefaultSuccess = 0; } @@ -285,13 +285,13 @@ client cluster BinaryInputBasic = 15 { attribute boolean outOfService = 81; attribute boolean presentValue = 85; readonly attribute bitmap8 statusFlags = 111; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster Binding = 30 { - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct BindRequest { NODE_ID nodeId = 0; @@ -317,8 +317,8 @@ client cluster BooleanState = 69 { } readonly attribute boolean stateValue = 0; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster BridgedActions = 37 { @@ -382,8 +382,8 @@ client cluster BridgedActions = 37 { readonly attribute ActionStruct actionList[] = 0; readonly attribute EndpointListStruct endpointList[] = 1; readonly attribute long_char_string setupUrl = 2; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct DisableActionRequest { INT16U actionID = 0; @@ -465,8 +465,8 @@ client cluster BridgedActions = 37 { } client cluster BridgedDeviceBasic = 57 { - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster Channel = 1284 { @@ -488,8 +488,8 @@ client cluster Channel = 1284 { } readonly attribute ChannelInfo channelList[] = 0; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct ChangeChannelByNumberRequestRequest { INT16U majorNumber = 0; @@ -613,8 +613,8 @@ client cluster ColorControl = 768 { readonly attribute int16u colorTempPhysicalMax = 16396; readonly attribute int16u coupleColorTempToLevelMinMireds = 16397; attribute int16u startUpColorTemperatureMireds = 16400; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct ColorLoopSetRequest { ColorLoopUpdateFlags updateFlags = 0; @@ -851,8 +851,8 @@ client cluster ContentLauncher = 1290 { readonly attribute CHAR_STRING acceptHeaderList[] = 0; attribute bitmap32 supportedStreamingProtocols = 1; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct LaunchContentRequestRequest { BOOLEAN autoPlay = 0; @@ -885,8 +885,8 @@ client cluster Descriptor = 29 { readonly attribute CLUSTER_ID serverList[] = 1; readonly attribute CLUSTER_ID clientList[] = 2; readonly attribute ENDPOINT_NO partsList[] = 3; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster DiagnosticLogs = 50 { @@ -909,7 +909,7 @@ client cluster DiagnosticLogs = 50 { kBdx = 1; } - readonly attribute attrib_id attributeList[] = 65531; + readonly global attribute attrib_id attributeList[] = 65531; request struct RetrieveLogsRequestRequest { LogsIntent intent = 0; @@ -1179,8 +1179,8 @@ client cluster DoorLock = 257 { attribute boolean enableOneTouchLocking = 41; attribute boolean enablePrivacyModeButton = 43; attribute int8u wrongCodeEntryLimit = 48; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct ClearCredentialRequest { DlCredential credential = 0; @@ -1271,8 +1271,8 @@ client cluster ElectricalMeasurement = 2820 { readonly attribute int16s activePower = 1291; readonly attribute int16s activePowerMin = 1292; readonly attribute int16s activePowerMax = 1293; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster EthernetNetworkDiagnostics = 55 { @@ -1298,17 +1298,17 @@ client cluster EthernetNetworkDiagnostics = 55 { readonly attribute int64u overrunCount = 6; readonly attribute boolean carrierDetect = 7; readonly attribute int64u timeSinceReset = 8; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; command ResetCounts(): DefaultSuccess = 0; } client cluster FixedLabel = 64 { readonly attribute LabelStruct labelList[] = 0; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster FlowMeasurement = 1028 { @@ -1316,8 +1316,8 @@ client cluster FlowMeasurement = 1028 { readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; readonly attribute int16u tolerance = 3; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster GeneralCommissioning = 48 { @@ -1342,8 +1342,8 @@ client cluster GeneralCommissioning = 48 { readonly attribute BasicCommissioningInfoType basicCommissioningInfoList[] = 1; readonly attribute enum8 regulatoryConfig = 2; readonly attribute enum8 locationCapability = 3; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct ArmFailSafeRequest { INT16U expiryLengthSeconds = 0; @@ -1464,8 +1464,8 @@ client cluster GeneralDiagnostics = 51 { readonly attribute ENUM8 activeHardwareFaults[] = 5; readonly attribute ENUM8 activeRadioFaults[] = 6; readonly attribute ENUM8 activeNetworkFaults[] = 7; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster GroupKeyManagement = 63 { @@ -1502,8 +1502,8 @@ client cluster GroupKeyManagement = 63 { readonly attribute GroupInfo groupTable[] = 1; readonly attribute int16u maxGroupsPerFabric = 2; readonly attribute int16u maxGroupKeysPerFabric = 3; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct KeySetReadRequest { INT16U groupKeySetID = 0; @@ -1537,8 +1537,8 @@ client cluster GroupKeyManagement = 63 { client cluster Groups = 4 { readonly attribute bitmap8 nameSupport = 0; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct AddGroupRequest { INT16U groupId = 0; @@ -1616,8 +1616,8 @@ client cluster Identify = 3 { attribute int16u identifyTime = 0; readonly attribute enum8 identifyType = 1; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct IdentifyRequest { INT16U identifyTime = 0; @@ -1648,8 +1648,8 @@ client cluster IlluminanceMeasurement = 1024 { readonly attribute int16u maxMeasuredValue = 2; readonly attribute int16u tolerance = 3; readonly attribute enum8 lightSensorType = 4; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster KeypadInput = 1289 { @@ -1748,8 +1748,8 @@ client cluster KeypadInput = 1289 { kInvalidKeyInCurrentState = 2; } - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct SendKeyRequestRequest { CecKeyCode keyCode = 0; @@ -1787,9 +1787,9 @@ client cluster LevelControl = 8 { attribute int16u offTransitionTime = 19; attribute int8u defaultMoveRate = 20; attribute int8u startUpCurrentLevel = 16384; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct MoveRequest { MoveMode moveMode = 0; @@ -1850,8 +1850,8 @@ client cluster LocalizationConfiguration = 43 { } client cluster LowPower = 1288 { - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; command Sleep(): DefaultSuccess = 0; } @@ -1881,8 +1881,8 @@ client cluster MediaInput = 1287 { readonly attribute InputInfo mediaInputList[] = 0; readonly attribute int8u currentMediaInput = 1; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct RenameInputRequestRequest { INT8U index = 0; @@ -1922,8 +1922,8 @@ client cluster MediaPlayback = 1286 { readonly attribute single playbackSpeed = 4; readonly attribute int64u seekRangeEnd = 5; readonly attribute int64u seekRangeStart = 6; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct SeekRequestRequest { INT64U position = 0; @@ -1966,8 +1966,8 @@ client cluster ModeSelect = 80 { attribute int8u onMode = 2; readonly attribute int8u startUpMode = 3; readonly attribute char_string description = 4; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct ChangeToModeRequest { INT8U newMode = 0; @@ -2034,8 +2034,8 @@ client cluster NetworkCommissioning = 49 { readonly attribute NetworkCommissioningStatus lastNetworkingStatus = 5; readonly attribute octet_string lastNetworkID = 6; readonly attribute int32u lastConnectErrorValue = 7; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct AddOrUpdateThreadNetworkRequest { OCTET_STRING operationalDataset = 0; @@ -2116,8 +2116,8 @@ client cluster OtaSoftwareUpdateProvider = 41 { kDownloadProtocolNotSupported = 3; } - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct ApplyUpdateRequestRequest { OCTET_STRING updateToken = 0; @@ -2217,8 +2217,8 @@ client cluster OtaSoftwareUpdateRequestor = 42 { readonly attribute boolean updatePossible = 1; readonly attribute OTAUpdateStateEnum updateState = 2; readonly attribute int8u updateStateProgress = 3; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct AnnounceOtaProviderRequest { node_id providerNodeId = 0; @@ -2235,8 +2235,8 @@ client cluster OccupancySensing = 1030 { readonly attribute bitmap8 occupancy = 0; readonly attribute enum8 occupancySensorType = 1; readonly attribute bitmap8 occupancySensorTypeBitmap = 2; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster OnOff = 6 { @@ -2260,9 +2260,9 @@ client cluster OnOff = 6 { attribute int16u onTime = 16385; attribute int16u offWaitTime = 16386; attribute enum8 startUpOnOff = 16387; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct OffWithEffectRequest { OnOffEffectIdentifier effectId = 0; @@ -2286,8 +2286,8 @@ client cluster OnOff = 6 { client cluster OnOffSwitchConfiguration = 7 { readonly attribute enum8 switchType = 0; attribute enum8 switchActions = 16; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster OperationalCredentials = 62 { @@ -2325,8 +2325,8 @@ client cluster OperationalCredentials = 62 { readonly attribute int8u commissionedFabrics = 3; readonly attribute OCTET_STRING trustedRootCertificates[] = 4; readonly attribute fabric_idx currentFabricIndex = 5; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct AddNOCRequest { OCTET_STRING NOCValue = 0; @@ -2410,23 +2410,23 @@ client cluster PowerSource = 47 { readonly attribute enum8 batteryChargeLevel = 14; readonly attribute ENUM8 activeBatteryFaults[] = 18; readonly attribute enum8 batteryChargeState = 26; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } client cluster PowerSourceConfiguration = 46 { readonly attribute INT8U sources[] = 0; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster PressureMeasurement = 1027 { readonly attribute int16s measuredValue = 0; readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster PumpConfigurationAndControl = 512 { @@ -2521,9 +2521,9 @@ client cluster PumpConfigurationAndControl = 512 { attribute enum8 operationMode = 32; attribute enum8 controlMode = 33; readonly attribute bitmap16 alarmMask = 34; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } client cluster RelativeHumidityMeasurement = 1029 { @@ -2531,8 +2531,8 @@ client cluster RelativeHumidityMeasurement = 1029 { readonly attribute int16u minMeasuredValue = 1; readonly attribute int16u maxMeasuredValue = 2; readonly attribute int16u tolerance = 3; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster Scenes = 5 { @@ -2547,8 +2547,8 @@ client cluster Scenes = 5 { readonly attribute int16u currentGroup = 2; readonly attribute boolean sceneValid = 3; readonly attribute bitmap8 nameSupport = 4; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct AddSceneRequest { INT16U groupId = 0; @@ -2653,9 +2653,9 @@ client cluster SoftwareDiagnostics = 52 { readonly attribute int64u currentHeapFree = 1; readonly attribute int64u currentHeapUsed = 2; readonly attribute int64u currentHeapHighWatermark = 3; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; command ResetWatermarks(): DefaultSuccess = 0; } @@ -2694,9 +2694,9 @@ client cluster Switch = 59 { readonly attribute int8u numberOfPositions = 0; readonly attribute int8u currentPosition = 1; readonly attribute int8u multiPressMax = 2; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; } client cluster TargetNavigator = 1285 { @@ -2713,8 +2713,8 @@ client cluster TargetNavigator = 1285 { readonly attribute TargetInfo targetNavigatorList[] = 0; readonly attribute int8u currentNavigatorTarget = 1; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct NavigateTargetRequestRequest { INT8U target = 0; @@ -2734,8 +2734,8 @@ client cluster TemperatureMeasurement = 1026 { readonly attribute int16s minMeasuredValue = 1; readonly attribute int16s maxMeasuredValue = 2; readonly attribute int16u tolerance = 3; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster TestCluster = 1295 { @@ -2880,8 +2880,8 @@ client cluster TestCluster = 1295 { attribute int8s nullableRangeRestrictedInt8s = 32807; attribute int16u nullableRangeRestrictedInt16u = 32808; attribute int16s nullableRangeRestrictedInt16s = 32809; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; request struct SimpleStructEchoRequestRequest { SimpleStruct arg1 = 0; @@ -3019,9 +3019,9 @@ client cluster Thermostat = 513 { readonly attribute enum8 startOfWeek = 32; readonly attribute int8u numberOfWeeklyTransitions = 33; readonly attribute int8u numberOfDailyTransitions = 34; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct GetWeeklyScheduleRequest { DayOfWeek daysToReturn = 0; @@ -3067,8 +3067,8 @@ client cluster ThermostatUserInterfaceConfiguration = 516 { attribute enum8 temperatureDisplayMode = 0; attribute enum8 keypadLockout = 1; attribute enum8 scheduleProgrammingVisibility = 2; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster ThreadNetworkDiagnostics = 53 { @@ -3211,22 +3211,22 @@ client cluster ThreadNetworkDiagnostics = 53 { readonly attribute octet_string channelMask = 60; readonly attribute OperationalDatasetComponents operationalDatasetComponents[] = 61; readonly attribute NetworkFault activeNetworkFaultsList[] = 62; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; command ResetCounts(): DefaultSuccess = 0; } client cluster UserLabel = 65 { attribute LabelStruct labelList[] = 0; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute int16u clusterRevision = 65533; } client cluster WakeOnLan = 1283 { readonly attribute char_string wakeOnLanMacAddress = 0; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster WiFiNetworkDiagnostics = 54 { @@ -3286,9 +3286,9 @@ client cluster WiFiNetworkDiagnostics = 54 { readonly attribute int32u packetUnicastTxCount = 10; readonly attribute int64u currentMaxRate = 11; readonly attribute int64u overrunCount = 12; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; command ResetCounts(): DefaultSuccess = 0; } @@ -3312,9 +3312,9 @@ client cluster WindowCovering = 258 { readonly attribute int16u installedClosedLimitTilt = 19; attribute bitmap8 mode = 23; readonly attribute bitmap16 safetyStatus = 26; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; request struct GoToLiftPercentageRequest { Percent liftPercentageValue = 0; From d9b77e908fe1836e1f8b9f6f8c9819c43e9f3c0c Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 20 Jan 2022 17:56:39 -0500 Subject: [PATCH 10/15] Add workflow for doing fuzzing builds. (#13670) * Add workflow for doing fuzzing builds. Summary of changes: 1) examples/all-clusters-app/all-clusters-common/BUILD.gn: Makes all-clusters-app compile when compiled on its own, without any client apps (like chip-tool) as part of the same build. It used to be sneaking in a use_default_client_callbacks from someone else's configuration, as best I can tell. 2) build/config/compiler/BUILD.gn: Add a define in the fuzzer config so we can compile slightly different main() code. 3) examples/all-clusters-app/linux/main.cpp: Add a fuzzer hook that tries to process the fuzzer-provided data as a message. 4) scripts/build: Add support for a "libfuzzer" variant. * Addressing review comments. * Add clean shutdown when the fuzzer decides to stop. --- .github/workflows/fuzzing-build.yaml | 131 ++++++++++++++++++ build/config/compiler/BUILD.gn | 3 - build/config/compiler/compiler.gni | 3 + .../all-clusters-common/BUILD.gn | 1 + examples/all-clusters-app/linux/BUILD.gn | 43 +++++- .../all-clusters-app/linux/fuzzing-main.cpp | 73 ++++++++++ .../all-clusters-app/linux/main-common.cpp | 118 ++++++++++++++++ examples/all-clusters-app/linux/main.cpp | 95 ------------- scripts/build/build/targets.py | 1 + scripts/build/builders/host.py | 8 +- 10 files changed, 373 insertions(+), 103 deletions(-) create mode 100644 .github/workflows/fuzzing-build.yaml create mode 100644 examples/all-clusters-app/linux/fuzzing-main.cpp create mode 100644 examples/all-clusters-app/linux/main-common.cpp diff --git a/.github/workflows/fuzzing-build.yaml b/.github/workflows/fuzzing-build.yaml new file mode 100644 index 00000000000000..ea96c4d94413e1 --- /dev/null +++ b/.github/workflows/fuzzing-build.yaml @@ -0,0 +1,131 @@ +# Copyright (c) 2021 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. + +name: Fuzzing Builds + +on: + # For now, only manual triggers. + workflow_dispatch: + +concurrency: + group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} + cancel-in-progress: true + +jobs: + build_linux_fuzzing: + name: Build on Linux + timeout-minutes: 90 + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: connectedhomeip/chip-build:0.5.48 + volumes: + - "/tmp/log_output:/tmp/test_logs" + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + - run: apt-get update + - run: apt-get install --fix-missing llvm-10 clang-10 + - name: + Try to ensure the objdir-clone dir exists + run: | + mkdir objdir-clone || true + - name: Bootstrap + timeout-minutes: 10 + run: scripts/build/gn_bootstrap.sh + - name: Uploading bootstrap logs + uses: actions/upload-artifact@v2 + if: ${{ always() }} && ${{ !env.ACT }} + with: + name: bootstrap-logs + path: | + .environment/gn_out/.ninja_log + .environment/pigweed-venv/*.log + - name: Build all-clusters-app + timeout-minutes: 20 + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-all-clusters-no-ble-libfuzzer-test-group \ + build \ + --copy-artifacts-to objdir-clone \ + " + - name: Uploading binaries + uses: actions/upload-artifact@v2 + if: ${{ !env.ACT }} + with: + name: + objdir-linux + path: objdir-clone/ + # objdirs are big; don't hold on to them too long. + retention-days: 5 + + build_darwin_fuzzing: + name: Build on Darwin + timeout-minutes: 90 + runs-on: macos-latest + if: github.actor != 'restyled-io[bot]' + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + - name: Setup Environment + run: brew install openssl pkg-config llvm + - name: Try to ensure the objdir-clone dir exists + run: | + mkdir objdir-clone || true + - name: Fix pkgconfig link + working-directory: /usr/local/lib/pkgconfig + run: | + pwd + ls -la /usr/local/Cellar/ + ls -la /usr/local/Cellar/openssl@1.1 + OPEN_SSL_VERSION=`ls -la /usr/local/Cellar/openssl@1.1 | cat | tail -n1 | awk '{print $NF}'` + ln -s /usr/local/Cellar/openssl@1.1/$OPEN_SSL_VERSION/lib/pkgconfig/* . + - name: Bootstrap + timeout-minutes: 25 + run: scripts/build/gn_bootstrap.sh + - name: Uploading bootstrap logs + uses: actions/upload-artifact@v2 + if: ${{ always() }} && ${{ !env.ACT }} + with: + name: bootstrap-logs + path: | + .environment/gn_out/.ninja_log + .environment/pigweed-venv/*.log + - name: Build all-clusters-app + timeout-minutes: 20 + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target darwin-x64-all-clusters-no-ble-asan-libfuzzer \ + build \ + --copy-artifacts-to objdir-clone \ + " + - name: Uploading binaries + uses: actions/upload-artifact@v2 + if: ${{ !env.ACT }} + with: + name: + crash-darwin + path: objdir-clone/ + # objdirs are big; don't hold on to them too long. + retention-days: 5 diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index 9df167b4f83234..f08497920fa488 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn @@ -307,9 +307,6 @@ declare_args() { # enable undefined behavior sanitizer is_ubsan = false - # enable libfuzzer - is_libfuzzer = false - # Exit on sanitize error. Generally standard libraries may get errors # so not stopping on the first error is often useful is_sanitize_fatal = true diff --git a/build/config/compiler/compiler.gni b/build/config/compiler/compiler.gni index 00bb1317576a26..f5b6414eca8ee4 100644 --- a/build/config/compiler/compiler.gni +++ b/build/config/compiler/compiler.gni @@ -41,4 +41,7 @@ declare_args() { # C++ standard level (value for -std flag). cpp_standard = "gnu++14" + + # enable libfuzzer + is_libfuzzer = false } diff --git a/examples/all-clusters-app/all-clusters-common/BUILD.gn b/examples/all-clusters-app/all-clusters-common/BUILD.gn index 0210fcedb2c646..90751a8106cea9 100644 --- a/examples/all-clusters-app/all-clusters-common/BUILD.gn +++ b/examples/all-clusters-app/all-clusters-common/BUILD.gn @@ -22,4 +22,5 @@ chip_data_model("all-clusters-common") { zap_pregenerated_dir = "${chip_root}/zzz_generated/all-clusters-app/zap-generated" is_server = true + use_default_client_callbacks = true } diff --git a/examples/all-clusters-app/linux/BUILD.gn b/examples/all-clusters-app/linux/BUILD.gn index 563c101cb91e7b..36d3d0aa3c10a9 100644 --- a/examples/all-clusters-app/linux/BUILD.gn +++ b/examples/all-clusters-app/linux/BUILD.gn @@ -14,17 +14,18 @@ import("//build_overrides/build.gni") import("//build_overrides/chip.gni") +import("${build_root}/config/compiler/compiler.gni") import("${chip_root}/src/lib/lib.gni") -executable("chip-all-clusters-app") { +source_set("chip-all-clusters-common") { sources = [ "${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp", "include/tv-callbacks.cpp", "include/tv-callbacks.h", - "main.cpp", + "main-common.cpp", ] deps = [ @@ -41,10 +42,44 @@ executable("chip-all-clusters-app") { if (chip_build_libshell) { defines = [ "ENABLE_CHIP_SHELL" ] } +} + +if (is_libfuzzer) { + executable("chip-all-clusters-app-fuzzing") { + sources = [ "fuzzing-main.cpp" ] + + deps = [ + ":chip-all-clusters-common", + "${chip_root}/examples/platform/linux:app-main", + ] + + cflags = [ "-Wconversion" ] + + output_dir = root_out_dir + } +} else { + executable("chip-all-clusters-app") { + sources = [ "main.cpp" ] - output_dir = root_out_dir + deps = [ + ":chip-all-clusters-common", + "${chip_root}/examples/platform/linux:app-main", + ] + + cflags = [ "-Wconversion" ] + + include_dirs = + [ "${chip_root}/examples/all-clusters-app/all-clusters-common/include" ] + + output_dir = root_out_dir + } } group("linux") { - deps = [ ":chip-all-clusters-app" ] + deps = [] + if (is_libfuzzer) { + deps += [ ":chip-all-clusters-app-fuzzing" ] + } else { + deps += [ ":chip-all-clusters-app" ] + } } diff --git a/examples/all-clusters-app/linux/fuzzing-main.cpp b/examples/all-clusters-app/linux/fuzzing-main.cpp new file mode 100644 index 00000000000000..f7fef1bb214fb1 --- /dev/null +++ b/examples/all-clusters-app/linux/fuzzing-main.cpp @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2022 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. + */ + +#include "AppMain.h" +#include + +using namespace chip; +using namespace chip::DeviceLayer; + +void CleanShutdown() +{ + Server::GetInstance().Shutdown(); + PlatformMgr().Shutdown(); + // TODO: We don't Platform::MemoryShutdown because ~CASESessionManager calls + // Dnssd::ResolverProxy::Shutdown, which starts doing Platform::Delete. + // Platform::MemoryShutdown(); +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t * aData, size_t aSize) +{ + static bool matterStackInitialized = false; + if (!matterStackInitialized) + { + // Might be simpler to do ChipLinuxAppInit() with argc == 0, argv set to + // just a fake executable name? + VerifyOrDie(Platform::MemoryInit() == CHIP_NO_ERROR); + VerifyOrDie(PlatformMgr().InitChipStack() == CHIP_NO_ERROR); + + // ChipLinuxAppMainLoop blocks, and we don't want that here. + VerifyOrDie(Server::GetInstance().Init() == CHIP_NO_ERROR); + + ApplicationInit(); + + // We don't start the event loop task, because we don't plan to deliver + // data on a separate thread. + + matterStackInitialized = true; + + // The fuzzer does not have a way to tell us when it's done, so just + // shut down things on exit. + atexit(CleanShutdown); + } + + // For now, just dump the data as a UDP payload into the session manager. + // But maybe we should try to separately extract a PeerAddress and data from + // the incoming data? + Transport::PeerAddress peerAddr; + System::PacketBufferHandle buf = + System::PacketBufferHandle::NewWithData(aData, aSize, /* aAdditionalSize = */ 0, /* aReservedSize = */ 0); + + // Ignoring the return value from OnMessageReceived, because we might be + // passing it all sorts of garbage that will cause it to fail. + Server::GetInstance().GetSecureSessionManager().OnMessageReceived(peerAddr, std::move(buf)); + + // Now process pending events until our sentinel is reached. + PlatformMgr().ScheduleWork([](intptr_t) { PlatformMgr().StopEventLoopTask(); }); + PlatformMgr().RunEventLoop(); + return 0; +} diff --git a/examples/all-clusters-app/linux/main-common.cpp b/examples/all-clusters-app/linux/main-common.cpp new file mode 100644 index 00000000000000..9497d1d0f5f072 --- /dev/null +++ b/examples/all-clusters-app/linux/main-common.cpp @@ -0,0 +1,118 @@ +/* + * + * Copyright (c) 2020 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. + */ + +#include "include/tv-callbacks.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::DeviceLayer; + +namespace { +static LowPowerManager lowPowerManager; +} // namespace + +bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj) +{ + emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS); + return true; +} + +void OnIdentifyStart(::Identify *) +{ + ChipLogProgress(Zcl, "OnIdentifyStart"); +} + +void OnIdentifyStop(::Identify *) +{ + ChipLogProgress(Zcl, "OnIdentifyStop"); +} + +void OnTriggerEffect(::Identify * identify) +{ + switch (identify->mCurrentEffectIdentifier) + { + case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BLINK: + ChipLogProgress(Zcl, "EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BLINK"); + break; + case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BREATHE: + ChipLogProgress(Zcl, "EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BREATHE"); + break; + case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_OKAY: + ChipLogProgress(Zcl, "EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_OKAY"); + break; + case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_CHANNEL_CHANGE: + ChipLogProgress(Zcl, "EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_CHANNEL_CHANGE"); + break; + default: + ChipLogProgress(Zcl, "No identifier effect"); + return; + } +} + +static Identify gIdentify0 = { + chip::EndpointId{ 0 }, OnIdentifyStart, OnIdentifyStop, EMBER_ZCL_IDENTIFY_IDENTIFY_TYPE_VISIBLE_LED, OnTriggerEffect, +}; + +static Identify gIdentify1 = { + chip::EndpointId{ 1 }, OnIdentifyStart, OnIdentifyStop, EMBER_ZCL_IDENTIFY_IDENTIFY_TYPE_VISIBLE_LED, OnTriggerEffect, +}; + +// Network commissioning +namespace { +// This file is being used by platforms other than Linux, so we need this check to disable related features since we only +// implemented them on linux. +#if CHIP_DEVICE_LAYER_TARGET_LINUX +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD +NetworkCommissioning::LinuxThreadDriver sLinuxThreadDriver; +Clusters::NetworkCommissioning::Instance sThreadNetworkCommissioningInstance(0 /* Endpoint Id */, &sLinuxThreadDriver); +#endif +#if CHIP_DEVICE_CONFIG_ENABLE_WPA +NetworkCommissioning::LinuxWiFiDriver sLinuxWiFiDriver; +Clusters::NetworkCommissioning::Instance sWiFiNetworkCommissioningInstance(1 /* Endpoint Id */, &sLinuxWiFiDriver); +#endif +#endif +} // namespace + +void ApplicationInit() +{ +#if CHIP_DEVICE_LAYER_TARGET_LINUX && defined(ZCL_USING_LEVEL_CONTROL_CLUSTER_SERVER) +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD + sThreadNetworkCommissioningInstance.Init(); +#endif +#if CHIP_DEVICE_CONFIG_ENABLE_WPA + sWiFiNetworkCommissioningInstance.Init(); +#endif +#endif +} + +void emberAfLowPowerClusterInitCallback(EndpointId endpoint) +{ + ChipLogProgress(Zcl, "TV Linux App: LowPower::SetDefaultDelegate"); + chip::app::Clusters::LowPower::SetDefaultDelegate(endpoint, &lowPowerManager); +} diff --git a/examples/all-clusters-app/linux/main.cpp b/examples/all-clusters-app/linux/main.cpp index 2c02d212ac84f9..3ae4959c2a64fd 100644 --- a/examples/all-clusters-app/linux/main.cpp +++ b/examples/all-clusters-app/linux/main.cpp @@ -16,98 +16,9 @@ * limitations under the License. */ -#include "include/tv-callbacks.h" -#include -#include -#include -#include -#include - #include "AppMain.h" #include "binding-handler.h" -using namespace chip; -using namespace chip::app; -using namespace chip::DeviceLayer; - -namespace { -static LowPowerManager lowPowerManager; -} // namespace - -bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj) -{ - emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS); - return true; -} - -void OnIdentifyStart(::Identify *) -{ - ChipLogProgress(Zcl, "OnIdentifyStart"); -} - -void OnIdentifyStop(::Identify *) -{ - ChipLogProgress(Zcl, "OnIdentifyStop"); -} - -void OnTriggerEffect(::Identify * identify) -{ - switch (identify->mCurrentEffectIdentifier) - { - case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BLINK: - ChipLogProgress(Zcl, "EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BLINK"); - break; - case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BREATHE: - ChipLogProgress(Zcl, "EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BREATHE"); - break; - case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_OKAY: - ChipLogProgress(Zcl, "EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_OKAY"); - break; - case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_CHANNEL_CHANGE: - ChipLogProgress(Zcl, "EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_CHANNEL_CHANGE"); - break; - default: - ChipLogProgress(Zcl, "No identifier effect"); - return; - } -} - -static Identify gIdentify0 = { - chip::EndpointId{ 0 }, OnIdentifyStart, OnIdentifyStop, EMBER_ZCL_IDENTIFY_IDENTIFY_TYPE_VISIBLE_LED, OnTriggerEffect, -}; - -static Identify gIdentify1 = { - chip::EndpointId{ 1 }, OnIdentifyStart, OnIdentifyStop, EMBER_ZCL_IDENTIFY_IDENTIFY_TYPE_VISIBLE_LED, OnTriggerEffect, -}; - -// Network commissioning -namespace { -// This file is being used by platforms other than Linux, so we need this check to disable related features since we only -// implemented them on linux. -#if CHIP_DEVICE_LAYER_TARGET_LINUX -#if CHIP_DEVICE_CONFIG_ENABLE_THREAD -NetworkCommissioning::LinuxThreadDriver sLinuxThreadDriver; -Clusters::NetworkCommissioning::Instance sThreadNetworkCommissioningInstance(0 /* Endpoint Id */, &sLinuxThreadDriver); -#endif -#if CHIP_DEVICE_CONFIG_ENABLE_WPA -NetworkCommissioning::LinuxWiFiDriver sLinuxWiFiDriver; -Clusters::NetworkCommissioning::Instance sWiFiNetworkCommissioningInstance(1 /* Endpoint Id */, &sLinuxWiFiDriver); -#endif -#endif -} // namespace - -void ApplicationInit() -{ -#if CHIP_DEVICE_LAYER_TARGET_LINUX && defined(ZCL_USING_LEVEL_CONTROL_CLUSTER_SERVER) -#if CHIP_DEVICE_CONFIG_ENABLE_THREAD - sThreadNetworkCommissioningInstance.Init(); -#endif -#if CHIP_DEVICE_CONFIG_ENABLE_WPA - sWiFiNetworkCommissioningInstance.Init(); -#endif -#endif -} - int main(int argc, char * argv[]) { VerifyOrDie(ChipLinuxAppInit(argc, argv) == 0); @@ -115,9 +26,3 @@ int main(int argc, char * argv[]) ChipLinuxAppMainLoop(); return 0; } - -void emberAfLowPowerClusterInitCallback(EndpointId endpoint) -{ - ChipLogProgress(Zcl, "TV Linux App: LowPower::SetDefaultDelegate"); - chip::app::Clusters::LowPower::SetDefaultDelegate(endpoint, &lowPowerManager); -} diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 8d38fbb20f8bf4..5e729c86d4fb23 100644 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -161,6 +161,7 @@ def HostTargets(): HostBuildVariant(name="no-ble", enable_ble=False), HostBuildVariant(name="tsan", conflicts=['asan'], use_tsan=True), HostBuildVariant(name="asan", conflicts=['tsan'], use_asan=True), + HostBuildVariant(name="libfuzzer", use_libfuzzer=True, use_clang=True), HostBuildVariant(name="test-group", validator=AcceptNameWithSubstrings(['-all-clusters', '-chip-tool']), test_group=True), HostBuildVariant(name="same-event-loop", diff --git a/scripts/build/builders/host.py b/scripts/build/builders/host.py index 047d7a2a959fef..58685b62092f5a 100644 --- a/scripts/build/builders/host.py +++ b/scripts/build/builders/host.py @@ -131,7 +131,7 @@ class HostBuilder(GnBuilder): def __init__(self, root, runner, app: HostApp, board=HostBoard.NATIVE, enable_ipv4=True, enable_ble=True, use_tsan=False, use_asan=False, separate_event_loop=True, - test_group=False): + test_group=False, use_libfuzzer=False, use_clang=False): super(HostBuilder, self).__init__( root=os.path.join(root, 'examples', app.ExamplePath()), runner=runner) @@ -159,6 +159,12 @@ def __init__(self, root, runner, app: HostApp, board=HostBoard.NATIVE, enable_ip self.extra_gn_options.append( 'chip_enable_group_messaging_tests=true') + if use_libfuzzer: + self.extra_gn_options.append('is_libfuzzer=true') + + if use_clang: + self.extra_gn_options.append('is_clang=true') + if app == HostApp.TESTS: self.extra_gn_options.append('chip_build_tests=true') self.build_command = 'check' From 3a2106c3fa2dccdc8fdff36bb48390525fd57d1d Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 20 Jan 2022 18:41:15 -0500 Subject: [PATCH 11/15] Ran zap regen (#13796) --- zzz_generated/app-common/app-common/zap-generated/ids/Events.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Events.h b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h index b42a2a5d588ad2..c63d8e453a3397 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Events.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h @@ -1,6 +1,6 @@ /* * - * Copyright (c) 2021 Project CHIP Authors + * Copyright (c) 2022 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. From bdab6c5f40ee1ef2659249d45a336665e4a04b9d Mon Sep 17 00:00:00 2001 From: Yuanyao Zhong <82843247+yyzhong-g@users.noreply.github.com> Date: Thu, 20 Jan 2022 18:59:16 -0500 Subject: [PATCH 12/15] Add tracing instructions in ESP32 README.md (#13722) * Add tracing instructions in ESP32 README.md * Restyled by gn * Restyled by prettier-markdown * Add "tokenized" to wordlist.txt * Change in src/trace/BUILD.gn file for PW_TRACE_BACKEND_SET flag Co-authored-by: Restyled.io --- .github/.wordlist.txt | 1 + config/esp32/components/chip/component.mk | 1 + examples/all-clusters-app/esp32/README.md | 14 ++++++++++++++ src/trace/BUILD.gn | 7 +++++-- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index c811299aae330f..9886a40b4d99a9 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -993,6 +993,7 @@ TLV tmp tngvndl TODO +tokenized toolchain toolchains topologies diff --git a/config/esp32/components/chip/component.mk b/config/esp32/components/chip/component.mk index 6b8714b1db620e..61ab9100fa78e7 100644 --- a/config/esp32/components/chip/component.mk +++ b/config/esp32/components/chip/component.mk @@ -136,6 +136,7 @@ ifeq ($(is_debug),false) endif if [[ "$(CONFIG_ENABLE_PW_RPC)" = "y" ]]; then \ echo "chip_build_pw_rpc_lib = true" >> $(OUTPUT_DIR)/args.gn ;\ + echo "chip_build_pw_trace_lib = true" >> $(OUTPUT_DIR)/args.gn ;\ echo "remove_default_configs = [\"//third_party/connectedhomeip/third_party/pigweed/repo/pw_build:cpp17\"]" >> $(OUTPUT_DIR)/args.gn ;\ echo "pw_log_BACKEND = \"//third_party/connectedhomeip/third_party/pigweed/repo/pw_log_basic\"" >> $(OUTPUT_DIR)/args.gn ;\ echo "pw_assert_BACKEND = \"//third_party/connectedhomeip/third_party/pigweed/repo/pw_assert_log\"" >> $(OUTPUT_DIR)/args.gn ;\ diff --git a/examples/all-clusters-app/esp32/README.md b/examples/all-clusters-app/esp32/README.md index 1f4ca1ca5a630e..cfb88c5606f70d 100644 --- a/examples/all-clusters-app/esp32/README.md +++ b/examples/all-clusters-app/esp32/README.md @@ -15,6 +15,7 @@ control. - [Flashing app using script](#flashing-app-using-script) - [Note](#note) - [Using the RPC console](#using-the-rpc-console) + - [Device Tracing](#device-tracing) --- @@ -295,3 +296,16 @@ From within the console you can then invoke rpcs: rpcs.chip.rpc.Lighting.Get() rpcs.chip.rpc.Lighting.Set(on=True, level=128, color=protos.chip.rpc.LightingColor(hue=5, saturation=5)) + +## Device Tracing + +Device tracing is available to analyze the device performance. To turn on +tracing, build with RPC enabled. See +[Using the RPC console](#using-the-rpc-console). + +Obtain tracing json file. + +``` + $ ./{PIGWEED_REPO}/pw_trace_tokenized/py/pw_trace_tokenized/get_trace.py -d {PORT} -o {OUTPUT_FILE} \ + -t {ELF_FILE} {PIGWEED_REPO}/pw_trace_tokenized/pw_trace_protos/trace_rpc.proto +``` diff --git a/src/trace/BUILD.gn b/src/trace/BUILD.gn index 546107ad45ce67..209909432dc0bd 100644 --- a/src/trace/BUILD.gn +++ b/src/trace/BUILD.gn @@ -18,11 +18,14 @@ declare_args() { chip_build_pw_trace_lib = false } +config("config") { + defines = [ "PW_TRACE_BACKEND_SET" ] +} + source_set("trace") { sources = [ "trace.h" ] - if (chip_build_pw_trace_lib) { - cflags = [ "-DPW_TRACE_BACKEND_SET=1" ] + public_configs = [ ":config" ] public_deps = [ "${dir_pigweed}/pw_trace" ] } } From 04f39b95919272038dfe185ae0fe858b6c756693 Mon Sep 17 00:00:00 2001 From: Chirag Atal <35214609+chiragatal@users.noreply.github.com> Date: Fri, 21 Jan 2022 05:34:46 +0530 Subject: [PATCH 13/15] Fix compilation errors in scenes-client and groups-client (#13754) --- src/app/clusters/groups-client/groups-client.cpp | 2 +- src/app/clusters/scenes-client/scenes-client.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/clusters/groups-client/groups-client.cpp b/src/app/clusters/groups-client/groups-client.cpp index 373561e115dde4..f69fa876dc43e3 100644 --- a/src/app/clusters/groups-client/groups-client.cpp +++ b/src/app/clusters/groups-client/groups-client.cpp @@ -76,7 +76,7 @@ bool emberAfGroupsClusterGetGroupMembershipResponseCallback(app::CommandHandler { emberAfGroupsClusterPrint(" [0x%2x]", emberAfGetInt16u(groupList + (i << 1), 0, 2)); } - emberAfGroupsClusterPrintln(""); + emberAfGroupsClusterPrintln("%s", ""); emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_SUCCESS); return true; } diff --git a/src/app/clusters/scenes-client/scenes-client.cpp b/src/app/clusters/scenes-client/scenes-client.cpp index 8a59aa0593c4ea..3f15fd9fe0f90b 100644 --- a/src/app/clusters/scenes-client/scenes-client.cpp +++ b/src/app/clusters/scenes-client/scenes-client.cpp @@ -42,7 +42,7 @@ #include #include -#include +#include using namespace chip; @@ -100,7 +100,7 @@ bool emberAfScenesClusterGetSceneMembershipResponseCallback(app::CommandHandler } } - emberAfScenesClusterPrintln(""); + emberAfScenesClusterPrintln("%s", ""); emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_SUCCESS); return true; } @@ -157,7 +157,7 @@ bool emberAfPluginScenesClientParseViewSceneResponse(const EmberAfClusterCommand } } - emberAfScenesClusterPrintln(""); + emberAfScenesClusterPrintln("%s", ""); emberAfSendDefaultResponse(cmd, EMBER_ZCL_STATUS_SUCCESS); return true; } From c24c34b0f94569ba31ffcda5ab76c98160136606 Mon Sep 17 00:00:00 2001 From: pankore <86098180+pankore@users.noreply.github.com> Date: Fri, 21 Jan 2022 08:15:54 +0800 Subject: [PATCH 14/15] [Ameba] Update dockerfile for 'otar' name change (#13695) --- integrations/docker/images/chip-build-ameba/Dockerfile | 2 +- integrations/docker/images/chip-build/version | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/integrations/docker/images/chip-build-ameba/Dockerfile b/integrations/docker/images/chip-build-ameba/Dockerfile index 1a0d97d29e5654..29127ce422c973 100644 --- a/integrations/docker/images/chip-build-ameba/Dockerfile +++ b/integrations/docker/images/chip-build-ameba/Dockerfile @@ -9,7 +9,7 @@ RUN set -x \ && cd ${AMEBA_DIR} \ && git clone --progress -b cmake_build https://github.com/pankore/ambd_sdk_with_chip_non_NDA.git \ && cd ambd_sdk_with_chip_non_NDA \ - && git reset --hard 4491131 \ + && git reset --hard 0eafdc7 \ && git submodule update --depth 1 --init --progress \ && cd project/realtek_amebaD_va0_example/GCC-RELEASE/project_hp/toolchain \ && cat asdk/asdk-10.3.0-linux-newlib-build-3638-x86_64.tar.bz2.part* > asdk/asdk-10.3.0-linux-newlib-build-3638-x86_64.tar.bz2 \ diff --git a/integrations/docker/images/chip-build/version b/integrations/docker/images/chip-build/version index 4a9997ad0d2342..4a43b1aab9af3e 100644 --- a/integrations/docker/images/chip-build/version +++ b/integrations/docker/images/chip-build/version @@ -1 +1 @@ -0.5.48 Version bump reason: [nrf] Bump west version +0.5.49 Version bump reason: [Ameba] Revise 'otar' to 'ota_requestor' From cf1b25478bbcb93164b09f9546865430a3b7d8e7 Mon Sep 17 00:00:00 2001 From: Michael Sandstedt Date: Thu, 20 Jan 2022 19:24:10 -0600 Subject: [PATCH 15/15] add isShortDiscriminator to SetupPayload (#13671) The SetupPayload (Onboarding Payload in spec terminology) should be fully self describing, but isn't because it does not record whether the discriminator is the short or long version. This commit makes the necessary additions to expose that information. This improvement is then used to simplify the code in SetUpCodePairer, which was passing around its own isShort bool. Instead, it now just uses the SetupPayload struct in all interfaces. --- src/controller/SetUpCodePairer.cpp | 31 ++++++++++--------- src/controller/SetUpCodePairer.h | 8 ++--- .../ManualSetupPayloadParser.cpp | 3 +- src/setup_payload/SetupPayload.h | 1 + 4 files changed, 23 insertions(+), 20 deletions(-) diff --git a/src/controller/SetUpCodePairer.cpp b/src/controller/SetUpCodePairer.cpp index ddb460051b40b9..16e0e04d14900d 100644 --- a/src/controller/SetUpCodePairer.cpp +++ b/src/controller/SetUpCodePairer.cpp @@ -44,27 +44,27 @@ CHIP_ERROR SetUpCodePairer::PairDevice(NodeId remoteId, const char * setUpCode) mRemoteId = remoteId; mSetUpPINCode = payload.setUpPINCode; - return Connect(payload.rendezvousInformation, payload.discriminator, !isQRCode); + return Connect(payload); } -CHIP_ERROR SetUpCodePairer::Connect(RendezvousInformationFlag rendezvousInformation, uint16_t discriminator, bool isShort) +CHIP_ERROR SetUpCodePairer::Connect(SetupPayload & payload) { CHIP_ERROR err = CHIP_NO_ERROR; bool isRunning = false; - bool searchOverAll = rendezvousInformation == RendezvousInformationFlag::kNone; - if (searchOverAll || rendezvousInformation == RendezvousInformationFlag::kBLE) + bool searchOverAll = payload.rendezvousInformation == RendezvousInformationFlag::kNone; + if (searchOverAll || payload.rendezvousInformation == RendezvousInformationFlag::kBLE) { - if (CHIP_NO_ERROR == (err = StartDiscoverOverBle(discriminator, isShort))) + if (CHIP_NO_ERROR == (err = StartDiscoverOverBle(payload))) { isRunning = true; } VerifyOrReturnError(searchOverAll || CHIP_NO_ERROR == err, err); } - if (searchOverAll || rendezvousInformation == RendezvousInformationFlag::kSoftAP) + if (searchOverAll || payload.rendezvousInformation == RendezvousInformationFlag::kSoftAP) { - if (CHIP_NO_ERROR == (err = StartDiscoverOverSoftAP(discriminator, isShort))) + if (CHIP_NO_ERROR == (err = StartDiscoverOverSoftAP(payload))) { isRunning = true; } @@ -73,8 +73,7 @@ CHIP_ERROR SetUpCodePairer::Connect(RendezvousInformationFlag rendezvousInformat // We always want to search on network because any node that has already been commissioned will use on-network regardless of the // QR code flag. - if (CHIP_NO_ERROR == - (err = StartDiscoverOverIP(isShort ? static_cast((discriminator >> 8) & 0x0F) : discriminator, isShort))) + if (CHIP_NO_ERROR == (err = StartDiscoverOverIP(payload))) { isRunning = true; } @@ -83,11 +82,11 @@ CHIP_ERROR SetUpCodePairer::Connect(RendezvousInformationFlag rendezvousInformat return isRunning ? CHIP_NO_ERROR : CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; } -CHIP_ERROR SetUpCodePairer::StartDiscoverOverBle(uint16_t discriminator, bool isShort) +CHIP_ERROR SetUpCodePairer::StartDiscoverOverBle(SetupPayload & payload) { #if CONFIG_NETWORK_LAYER_BLE VerifyOrReturnError(mBleLayer != nullptr, CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE); - return mBleLayer->NewBleConnectionByDiscriminator(discriminator, this, OnDiscoveredDeviceOverBleSuccess, + return mBleLayer->NewBleConnectionByDiscriminator(payload.discriminator, this, OnDiscoveredDeviceOverBleSuccess, OnDiscoveredDeviceOverBleError); #else return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; @@ -104,11 +103,13 @@ CHIP_ERROR SetUpCodePairer::StopConnectOverBle() #endif // CONFIG_NETWORK_LAYER_BLE } -CHIP_ERROR SetUpCodePairer::StartDiscoverOverIP(uint16_t discriminator, bool isShort) +CHIP_ERROR SetUpCodePairer::StartDiscoverOverIP(SetupPayload & payload) { #if CHIP_DEVICE_CONFIG_ENABLE_DNSSD - currentFilter.type = isShort ? Dnssd::DiscoveryFilterType::kShortDiscriminator : Dnssd::DiscoveryFilterType::kLongDiscriminator; - currentFilter.code = discriminator; + currentFilter.type = payload.isShortDiscriminator ? Dnssd::DiscoveryFilterType::kShortDiscriminator + : Dnssd::DiscoveryFilterType::kLongDiscriminator; + currentFilter.code = + payload.isShortDiscriminator ? static_cast((payload.discriminator >> 8) & 0x0F) : payload.discriminator; return mCommissioner->DiscoverCommissionableNodes(currentFilter); #else return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; @@ -123,7 +124,7 @@ CHIP_ERROR SetUpCodePairer::StopConnectOverIP() return CHIP_NO_ERROR; } -CHIP_ERROR SetUpCodePairer::StartDiscoverOverSoftAP(uint16_t discriminator, bool isShort) +CHIP_ERROR SetUpCodePairer::StartDiscoverOverSoftAP(SetupPayload & payload) { return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; } diff --git a/src/controller/SetUpCodePairer.h b/src/controller/SetUpCodePairer.h index 3b72831a331164..0ecd41c96b0597 100644 --- a/src/controller/SetUpCodePairer.h +++ b/src/controller/SetUpCodePairer.h @@ -65,12 +65,12 @@ class DLL_EXPORT SetUpCodePairer #endif // CONFIG_NETWORK_LAYER_BLE private: - CHIP_ERROR Connect(RendezvousInformationFlag rendezvousInformation, uint16_t discriminator, bool isShort); - CHIP_ERROR StartDiscoverOverBle(uint16_t discriminator, bool isShort); + CHIP_ERROR Connect(SetupPayload & paload); + CHIP_ERROR StartDiscoverOverBle(SetupPayload & payload); CHIP_ERROR StopConnectOverBle(); - CHIP_ERROR StartDiscoverOverIP(uint16_t discriminator, bool isShort); + CHIP_ERROR StartDiscoverOverIP(SetupPayload & payload); CHIP_ERROR StopConnectOverIP(); - CHIP_ERROR StartDiscoverOverSoftAP(uint16_t discriminator, bool isShort); + CHIP_ERROR StartDiscoverOverSoftAP(SetupPayload & payload); CHIP_ERROR StopConnectOverSoftAP(); void OnDeviceDiscovered(RendezvousParameters & params); diff --git a/src/setup_payload/ManualSetupPayloadParser.cpp b/src/setup_payload/ManualSetupPayloadParser.cpp index 0b59ffb53d2c16..6ef1f35ef636c6 100644 --- a/src/setup_payload/ManualSetupPayloadParser.cpp +++ b/src/setup_payload/ManualSetupPayloadParser.cpp @@ -193,7 +193,8 @@ CHIP_ERROR ManualSetupPayloadParser::populatePayload(SetupPayload & outPayload) static_assert(kSetupPINCodeFieldLengthInBits <= 32, "Won't fit in uint32_t"); outPayload.setUpPINCode = static_cast(setUpPINCode); static_assert(kManualSetupDiscriminatorFieldLengthInBits <= 16, "Won't fit in uint16_t"); - outPayload.discriminator = static_cast(discriminator); + outPayload.discriminator = static_cast(discriminator); + outPayload.isShortDiscriminator = true; return result; } diff --git a/src/setup_payload/SetupPayload.h b/src/setup_payload/SetupPayload.h index b6e000c2f0e131..298dd54ea12a69 100644 --- a/src/setup_payload/SetupPayload.h +++ b/src/setup_payload/SetupPayload.h @@ -119,6 +119,7 @@ struct PayloadContents bool isValidQRCodePayload() const; bool isValidManualCode() const; + bool isShortDiscriminator = false; bool operator==(PayloadContents & input) const; };