| /** |
| * |
| * 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. |
| */ |
| // This file is generated by ZAP. Please do not edit manually. |
| // |
| // |
| |
| #pragma once |
| |
| #include "../common/ModelCommand.h" |
| |
| /*----------------------------------------------------------------------------*\ |
| | Cluster Name | ID | |
| |---------------------------------------------------------------------+--------| |
| | BarrierControl | 0x0103 | |
| | Basic | 0x0000 | |
| | ColorControl | 0x0300 | |
| | DoorLock | 0x0101 | |
| | Groups | 0x0004 | |
| | Identify | 0x0003 | |
| | Level | 0x0008 | |
| | OnOff | 0x0006 | |
| | Scenes | 0x0005 | |
| | TemperatureMeasurement | 0x0402 | |
| \*----------------------------------------------------------------------------*/ |
| |
| #define BARRIER_CONTROL_CLUSTER_ID 0x0103 |
| #define BASIC_CLUSTER_ID 0x0000 |
| #define COLOR_CONTROL_CLUSTER_ID 0x0300 |
| #define DOOR_LOCK_CLUSTER_ID 0x0101 |
| #define GROUPS_CLUSTER_ID 0x0004 |
| #define IDENTIFY_CLUSTER_ID 0x0003 |
| #define LEVEL_CLUSTER_ID 0x0008 |
| #define ON_OFF_CLUSTER_ID 0x0006 |
| #define SCENES_CLUSTER_ID 0x0005 |
| #define TEMPERATURE_MEASUREMENT_CLUSTER_ID 0x0402 |
| |
| /*----------------------------------------------------------------------------*\ |
| | Cluster BarrierControl | 0x0103 | |
| |------------------------------------------------------------------------------| |
| | Commands: | | |
| | * GoToPercent | 0x00 | |
| | | | |
| |------------------------------------------------------------------------------| |
| | Attributes:: | | |
| | * MovingState | 0x0001 | |
| | * SafetyStatus | 0x0002 | |
| | * Capabilities | 0x0003 | |
| | * BarrierPosition | 0x000A | |
| \*----------------------------------------------------------------------------*/ |
| |
| /* |
| * Command GoToPercent |
| */ |
| class BarrierControlGoToPercent : public ModelCommand |
| { |
| public: |
| BarrierControlGoToPercent() : ModelCommand("go-to-percent", BARRIER_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("percentOpen", 0, UINT8_MAX, &mPercentOpen); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeBarrierControlClusterGoToPercentCommand(buffer->Start(), bufferSize, endPointId, mPercentOpen); |
| } |
| |
| private: |
| uint8_t mPercentOpen; |
| }; |
| |
| /* |
| * Attribute MovingState |
| */ |
| class ReadBarrierControlMovingState : public ModelCommand |
| { |
| public: |
| ReadBarrierControlMovingState() : ModelCommand("read", BARRIER_CONTROL_CLUSTER_ID) { AddArgument("attr-name", "moving-state"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeBarrierControlClusterReadMovingStateAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute SafetyStatus |
| */ |
| class ReadBarrierControlSafetyStatus : public ModelCommand |
| { |
| public: |
| ReadBarrierControlSafetyStatus() : ModelCommand("read", BARRIER_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("attr-name", "safety-status"); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeBarrierControlClusterReadSafetyStatusAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute Capabilities |
| */ |
| class ReadBarrierControlCapabilities : public ModelCommand |
| { |
| public: |
| ReadBarrierControlCapabilities() : ModelCommand("read", BARRIER_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("attr-name", "capabilities"); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeBarrierControlClusterReadCapabilitiesAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute BarrierPosition |
| */ |
| class ReadBarrierControlBarrierPosition : public ModelCommand |
| { |
| public: |
| ReadBarrierControlBarrierPosition() : ModelCommand("read", BARRIER_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("attr-name", "barrier-position"); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeBarrierControlClusterReadBarrierPositionAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /*----------------------------------------------------------------------------*\ |
| | Cluster Basic | 0x0000 | |
| |------------------------------------------------------------------------------| |
| | Commands: | | |
| | * ResetToFactoryDefaults | 0x00 | |
| | | | |
| |------------------------------------------------------------------------------| |
| | Attributes:: | | |
| | * ZCLVersion | 0x0000 | |
| | * ApplicationVersion | 0x0001 | |
| | * StackVersion | 0x0002 | |
| | * HWVersion | 0x0003 | |
| | * ManufacturerName | 0x0004 | |
| | * ModelIdentifier | 0x0005 | |
| | * DateCode | 0x0006 | |
| | * PowerSource | 0x0007 | |
| | * GenericDevice-Class | 0x0008 | |
| | * GenericDevice-Type | 0x0009 | |
| | * ProductCode | 0x000A | |
| | * ProductURL | 0x000B | |
| | * SWBuildID | 0x4000 | |
| \*----------------------------------------------------------------------------*/ |
| |
| /* |
| * Command ResetToFactoryDefaults |
| */ |
| class BasicResetToFactoryDefaults : public ModelCommand |
| { |
| public: |
| BasicResetToFactoryDefaults() : ModelCommand("reset-to-factory-defaults", BASIC_CLUSTER_ID) {} |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeBasicClusterResetToFactoryDefaultsCommand(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute ZCLVersion |
| */ |
| class ReadBasicZCLVersion : public ModelCommand |
| { |
| public: |
| ReadBasicZCLVersion() : ModelCommand("read", BASIC_CLUSTER_ID) { AddArgument("attr-name", "zclversion"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeBasicClusterReadZCLVersionAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute ApplicationVersion |
| */ |
| class ReadBasicApplicationVersion : public ModelCommand |
| { |
| public: |
| ReadBasicApplicationVersion() : ModelCommand("read", BASIC_CLUSTER_ID) { AddArgument("attr-name", "application-version"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeBasicClusterReadApplicationVersionAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute StackVersion |
| */ |
| class ReadBasicStackVersion : public ModelCommand |
| { |
| public: |
| ReadBasicStackVersion() : ModelCommand("read", BASIC_CLUSTER_ID) { AddArgument("attr-name", "stack-version"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeBasicClusterReadStackVersionAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute HWVersion |
| */ |
| class ReadBasicHWVersion : public ModelCommand |
| { |
| public: |
| ReadBasicHWVersion() : ModelCommand("read", BASIC_CLUSTER_ID) { AddArgument("attr-name", "hwversion"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeBasicClusterReadHWVersionAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute ManufacturerName |
| */ |
| class ReadBasicManufacturerName : public ModelCommand |
| { |
| public: |
| ReadBasicManufacturerName() : ModelCommand("read", BASIC_CLUSTER_ID) { AddArgument("attr-name", "manufacturer-name"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeBasicClusterReadManufacturerNameAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute ModelIdentifier |
| */ |
| class ReadBasicModelIdentifier : public ModelCommand |
| { |
| public: |
| ReadBasicModelIdentifier() : ModelCommand("read", BASIC_CLUSTER_ID) { AddArgument("attr-name", "model-identifier"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeBasicClusterReadModelIdentifierAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute DateCode |
| */ |
| class ReadBasicDateCode : public ModelCommand |
| { |
| public: |
| ReadBasicDateCode() : ModelCommand("read", BASIC_CLUSTER_ID) { AddArgument("attr-name", "date-code"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeBasicClusterReadDateCodeAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute PowerSource |
| */ |
| class ReadBasicPowerSource : public ModelCommand |
| { |
| public: |
| ReadBasicPowerSource() : ModelCommand("read", BASIC_CLUSTER_ID) { AddArgument("attr-name", "power-source"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeBasicClusterReadPowerSourceAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute GenericDeviceClass |
| */ |
| class ReadBasicGenericDeviceClass : public ModelCommand |
| { |
| public: |
| ReadBasicGenericDeviceClass() : ModelCommand("read", BASIC_CLUSTER_ID) { AddArgument("attr-name", "generic-device-class"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeBasicClusterReadGenericDeviceClassAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute GenericDeviceType |
| */ |
| class ReadBasicGenericDeviceType : public ModelCommand |
| { |
| public: |
| ReadBasicGenericDeviceType() : ModelCommand("read", BASIC_CLUSTER_ID) { AddArgument("attr-name", "generic-device-type"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeBasicClusterReadGenericDeviceTypeAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute ProductCode |
| */ |
| class ReadBasicProductCode : public ModelCommand |
| { |
| public: |
| ReadBasicProductCode() : ModelCommand("read", BASIC_CLUSTER_ID) { AddArgument("attr-name", "product-code"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeBasicClusterReadProductCodeAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute ProductURL |
| */ |
| class ReadBasicProductURL : public ModelCommand |
| { |
| public: |
| ReadBasicProductURL() : ModelCommand("read", BASIC_CLUSTER_ID) { AddArgument("attr-name", "product-url"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeBasicClusterReadProductURLAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute SWBuildID |
| */ |
| class ReadBasicSWBuildID : public ModelCommand |
| { |
| public: |
| ReadBasicSWBuildID() : ModelCommand("read", BASIC_CLUSTER_ID) { AddArgument("attr-name", "swbuild-id"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeBasicClusterReadSWBuildIDAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /*----------------------------------------------------------------------------*\ |
| | Cluster ColorControl | 0x0300 | |
| |------------------------------------------------------------------------------| |
| | Commands: | | |
| | * MoveColor | 0x08 | |
| | * MoveColorTemperature | 0x4B | |
| | * MoveHue | 0x01 | |
| | * MoveSaturation | 0x04 | |
| | * MoveToColor | 0x07 | |
| | * MoveToColorTemperature | 0x0A | |
| | * MoveToHue | 0x00 | |
| | * MoveToHueAndSaturation | 0x06 | |
| | * MoveToSaturation | 0x03 | |
| | * StepColor | 0x09 | |
| | * StepColorTemperature | 0x4C | |
| | * StepHue | 0x02 | |
| | * StepSaturation | 0x05 | |
| | * StopMoveStep | 0x47 | |
| | | | |
| |------------------------------------------------------------------------------| |
| | Attributes:: | | |
| | * CurrentHue | 0x0000 | |
| | * CurrentSaturation | 0x0001 | |
| | * CurrentX | 0x0003 | |
| | * CurrentY | 0x0004 | |
| | * ColorTemperatureMireds | 0x0007 | |
| | * ColorMode | 0x0008 | |
| | * Options | 0x000F | |
| | * NumberOfPrimaries | 0x0010 | |
| | * Primary1X | 0x0011 | |
| | * Primary1Y | 0x0012 | |
| | * Primary1Intensity | 0x0013 | |
| | * Primary2X | 0x0015 | |
| | * Primary2Y | 0x0016 | |
| | * Primary2Intensity | 0x0017 | |
| | * Primary3X | 0x0019 | |
| | * Primary3Y | 0x001A | |
| | * Primary3Intensity | 0x001B | |
| | * Primary4X | 0x0020 | |
| | * Primary4Y | 0x0021 | |
| | * Primary4Intensity | 0x0022 | |
| | * Primary5X | 0x0024 | |
| | * Primary5Y | 0x0025 | |
| | * Primary5Intensity | 0x0026 | |
| | * Primary6X | 0x0028 | |
| | * Primary6Y | 0x0029 | |
| | * Primary6Intensity | 0x002A | |
| | * EnhancedCurrentHue | 0x4000 | |
| | * EnhancedColorMode | 0x4001 | |
| | * ColorLoopActive | 0x4002 | |
| | * ColorLoopDirection | 0x4003 | |
| | * ColorLoopTime | 0x4004 | |
| | * ColorLoopStartEnhancedHue | 0x4005 | |
| | * ColorLoopStoredEnhancedHue | 0x4006 | |
| | * ColorCapabilities | 0x400A | |
| | * ColorTempPhysicalMinMireds | 0x400B | |
| | * ColorTempPhysicalMaxMireds | 0x400C | |
| | * CoupleColorTempToLevelMinMireds | 0x400D | |
| | * StartUpColorTemperatureMireds | 0x4010 | |
| \*----------------------------------------------------------------------------*/ |
| |
| /* |
| * Command MoveColor |
| */ |
| class ColorControlMoveColor : public ModelCommand |
| { |
| public: |
| ColorControlMoveColor() : ModelCommand("move-color", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("rateX", INT16_MIN, INT16_MAX, &mRateX); |
| AddArgument("rateY", INT16_MIN, INT16_MAX, &mRateY); |
| AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask); |
| AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterMoveColorCommand(buffer->Start(), bufferSize, endPointId, mRateX, mRateY, mOptionsMask, |
| mOptionsOverride); |
| } |
| |
| private: |
| int16_t mRateX; |
| int16_t mRateY; |
| uint8_t mOptionsMask; |
| uint8_t mOptionsOverride; |
| }; |
| |
| /* |
| * Command MoveColorTemperature |
| */ |
| class ColorControlMoveColorTemperature : public ModelCommand |
| { |
| public: |
| ColorControlMoveColorTemperature() : ModelCommand("move-color-temperature", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("moveMode", 0, UINT8_MAX, &mMoveMode); |
| AddArgument("rate", 0, UINT16_MAX, &mRate); |
| AddArgument("colorTemperatureMinimumMireds", 0, UINT16_MAX, &mColorTemperatureMinimumMireds); |
| AddArgument("colorTemperatureMaximumMireds", 0, UINT16_MAX, &mColorTemperatureMaximumMireds); |
| AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask); |
| AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterMoveColorTemperatureCommand(buffer->Start(), bufferSize, endPointId, mMoveMode, mRate, |
| mColorTemperatureMinimumMireds, mColorTemperatureMaximumMireds, |
| mOptionsMask, mOptionsOverride); |
| } |
| |
| private: |
| uint8_t mMoveMode; |
| uint16_t mRate; |
| uint16_t mColorTemperatureMinimumMireds; |
| uint16_t mColorTemperatureMaximumMireds; |
| uint8_t mOptionsMask; |
| uint8_t mOptionsOverride; |
| }; |
| |
| /* |
| * Command MoveHue |
| */ |
| class ColorControlMoveHue : public ModelCommand |
| { |
| public: |
| ColorControlMoveHue() : ModelCommand("move-hue", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("moveMode", 0, UINT8_MAX, &mMoveMode); |
| AddArgument("rate", 0, UINT8_MAX, &mRate); |
| AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask); |
| AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterMoveHueCommand(buffer->Start(), bufferSize, endPointId, mMoveMode, mRate, mOptionsMask, |
| mOptionsOverride); |
| } |
| |
| private: |
| uint8_t mMoveMode; |
| uint8_t mRate; |
| uint8_t mOptionsMask; |
| uint8_t mOptionsOverride; |
| }; |
| |
| /* |
| * Command MoveSaturation |
| */ |
| class ColorControlMoveSaturation : public ModelCommand |
| { |
| public: |
| ColorControlMoveSaturation() : ModelCommand("move-saturation", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("moveMode", 0, UINT8_MAX, &mMoveMode); |
| AddArgument("rate", 0, UINT8_MAX, &mRate); |
| AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask); |
| AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterMoveSaturationCommand(buffer->Start(), bufferSize, endPointId, mMoveMode, mRate, |
| mOptionsMask, mOptionsOverride); |
| } |
| |
| private: |
| uint8_t mMoveMode; |
| uint8_t mRate; |
| uint8_t mOptionsMask; |
| uint8_t mOptionsOverride; |
| }; |
| |
| /* |
| * Command MoveToColor |
| */ |
| class ColorControlMoveToColor : public ModelCommand |
| { |
| public: |
| ColorControlMoveToColor() : ModelCommand("move-to-color", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("colorX", 0, UINT16_MAX, &mColorX); |
| AddArgument("colorY", 0, UINT16_MAX, &mColorY); |
| AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime); |
| AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask); |
| AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterMoveToColorCommand(buffer->Start(), bufferSize, endPointId, mColorX, mColorY, |
| mTransitionTime, mOptionsMask, mOptionsOverride); |
| } |
| |
| private: |
| uint16_t mColorX; |
| uint16_t mColorY; |
| uint16_t mTransitionTime; |
| uint8_t mOptionsMask; |
| uint8_t mOptionsOverride; |
| }; |
| |
| /* |
| * Command MoveToColorTemperature |
| */ |
| class ColorControlMoveToColorTemperature : public ModelCommand |
| { |
| public: |
| ColorControlMoveToColorTemperature() : ModelCommand("move-to-color-temperature", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("colorTemperatureMireds", 0, UINT16_MAX, &mColorTemperatureMireds); |
| AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime); |
| AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask); |
| AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterMoveToColorTemperatureCommand( |
| buffer->Start(), bufferSize, endPointId, mColorTemperatureMireds, mTransitionTime, mOptionsMask, mOptionsOverride); |
| } |
| |
| private: |
| uint16_t mColorTemperatureMireds; |
| uint16_t mTransitionTime; |
| uint8_t mOptionsMask; |
| uint8_t mOptionsOverride; |
| }; |
| |
| /* |
| * Command MoveToHue |
| */ |
| class ColorControlMoveToHue : public ModelCommand |
| { |
| public: |
| ColorControlMoveToHue() : ModelCommand("move-to-hue", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("hue", 0, UINT8_MAX, &mHue); |
| AddArgument("direction", 0, UINT8_MAX, &mDirection); |
| AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime); |
| AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask); |
| AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterMoveToHueCommand(buffer->Start(), bufferSize, endPointId, mHue, mDirection, mTransitionTime, |
| mOptionsMask, mOptionsOverride); |
| } |
| |
| private: |
| uint8_t mHue; |
| uint8_t mDirection; |
| uint16_t mTransitionTime; |
| uint8_t mOptionsMask; |
| uint8_t mOptionsOverride; |
| }; |
| |
| /* |
| * Command MoveToHueAndSaturation |
| */ |
| class ColorControlMoveToHueAndSaturation : public ModelCommand |
| { |
| public: |
| ColorControlMoveToHueAndSaturation() : ModelCommand("move-to-hue-and-saturation", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("hue", 0, UINT8_MAX, &mHue); |
| AddArgument("saturation", 0, UINT8_MAX, &mSaturation); |
| AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime); |
| AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask); |
| AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterMoveToHueAndSaturationCommand(buffer->Start(), bufferSize, endPointId, mHue, mSaturation, |
| mTransitionTime, mOptionsMask, mOptionsOverride); |
| } |
| |
| private: |
| uint8_t mHue; |
| uint8_t mSaturation; |
| uint16_t mTransitionTime; |
| uint8_t mOptionsMask; |
| uint8_t mOptionsOverride; |
| }; |
| |
| /* |
| * Command MoveToSaturation |
| */ |
| class ColorControlMoveToSaturation : public ModelCommand |
| { |
| public: |
| ColorControlMoveToSaturation() : ModelCommand("move-to-saturation", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("saturation", 0, UINT8_MAX, &mSaturation); |
| AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime); |
| AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask); |
| AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterMoveToSaturationCommand(buffer->Start(), bufferSize, endPointId, mSaturation, |
| mTransitionTime, mOptionsMask, mOptionsOverride); |
| } |
| |
| private: |
| uint8_t mSaturation; |
| uint16_t mTransitionTime; |
| uint8_t mOptionsMask; |
| uint8_t mOptionsOverride; |
| }; |
| |
| /* |
| * Command StepColor |
| */ |
| class ColorControlStepColor : public ModelCommand |
| { |
| public: |
| ColorControlStepColor() : ModelCommand("step-color", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("stepX", INT16_MIN, INT16_MAX, &mStepX); |
| AddArgument("stepY", INT16_MIN, INT16_MAX, &mStepY); |
| AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime); |
| AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask); |
| AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterStepColorCommand(buffer->Start(), bufferSize, endPointId, mStepX, mStepY, mTransitionTime, |
| mOptionsMask, mOptionsOverride); |
| } |
| |
| private: |
| int16_t mStepX; |
| int16_t mStepY; |
| uint16_t mTransitionTime; |
| uint8_t mOptionsMask; |
| uint8_t mOptionsOverride; |
| }; |
| |
| /* |
| * Command StepColorTemperature |
| */ |
| class ColorControlStepColorTemperature : public ModelCommand |
| { |
| public: |
| ColorControlStepColorTemperature() : ModelCommand("step-color-temperature", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("stepMode", 0, UINT8_MAX, &mStepMode); |
| AddArgument("stepSize", 0, UINT16_MAX, &mStepSize); |
| AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime); |
| AddArgument("colorTemperatureMinimumMireds", 0, UINT16_MAX, &mColorTemperatureMinimumMireds); |
| AddArgument("colorTemperatureMaximumMireds", 0, UINT16_MAX, &mColorTemperatureMaximumMireds); |
| AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask); |
| AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterStepColorTemperatureCommand(buffer->Start(), bufferSize, endPointId, mStepMode, mStepSize, |
| mTransitionTime, mColorTemperatureMinimumMireds, |
| mColorTemperatureMaximumMireds, mOptionsMask, mOptionsOverride); |
| } |
| |
| private: |
| uint8_t mStepMode; |
| uint16_t mStepSize; |
| uint16_t mTransitionTime; |
| uint16_t mColorTemperatureMinimumMireds; |
| uint16_t mColorTemperatureMaximumMireds; |
| uint8_t mOptionsMask; |
| uint8_t mOptionsOverride; |
| }; |
| |
| /* |
| * Command StepHue |
| */ |
| class ColorControlStepHue : public ModelCommand |
| { |
| public: |
| ColorControlStepHue() : ModelCommand("step-hue", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("stepMode", 0, UINT8_MAX, &mStepMode); |
| AddArgument("stepSize", 0, UINT8_MAX, &mStepSize); |
| AddArgument("transitionTime", 0, UINT8_MAX, &mTransitionTime); |
| AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask); |
| AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterStepHueCommand(buffer->Start(), bufferSize, endPointId, mStepMode, mStepSize, |
| mTransitionTime, mOptionsMask, mOptionsOverride); |
| } |
| |
| private: |
| uint8_t mStepMode; |
| uint8_t mStepSize; |
| uint8_t mTransitionTime; |
| uint8_t mOptionsMask; |
| uint8_t mOptionsOverride; |
| }; |
| |
| /* |
| * Command StepSaturation |
| */ |
| class ColorControlStepSaturation : public ModelCommand |
| { |
| public: |
| ColorControlStepSaturation() : ModelCommand("step-saturation", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("stepMode", 0, UINT8_MAX, &mStepMode); |
| AddArgument("stepSize", 0, UINT8_MAX, &mStepSize); |
| AddArgument("transitionTime", 0, UINT8_MAX, &mTransitionTime); |
| AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask); |
| AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterStepSaturationCommand(buffer->Start(), bufferSize, endPointId, mStepMode, mStepSize, |
| mTransitionTime, mOptionsMask, mOptionsOverride); |
| } |
| |
| private: |
| uint8_t mStepMode; |
| uint8_t mStepSize; |
| uint8_t mTransitionTime; |
| uint8_t mOptionsMask; |
| uint8_t mOptionsOverride; |
| }; |
| |
| /* |
| * Command StopMoveStep |
| */ |
| class ColorControlStopMoveStep : public ModelCommand |
| { |
| public: |
| ColorControlStopMoveStep() : ModelCommand("stop-move-step", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask); |
| AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterStopMoveStepCommand(buffer->Start(), bufferSize, endPointId, mOptionsMask, |
| mOptionsOverride); |
| } |
| |
| private: |
| uint8_t mOptionsMask; |
| uint8_t mOptionsOverride; |
| }; |
| |
| /* |
| * Attribute CurrentHue |
| */ |
| class ReadColorControlCurrentHue : public ModelCommand |
| { |
| public: |
| ReadColorControlCurrentHue() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) { AddArgument("attr-name", "current-hue"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadCurrentHueAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute CurrentSaturation |
| */ |
| class ReadColorControlCurrentSaturation : public ModelCommand |
| { |
| public: |
| ReadColorControlCurrentSaturation() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("attr-name", "current-saturation"); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadCurrentSaturationAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute CurrentX |
| */ |
| class ReadColorControlCurrentX : public ModelCommand |
| { |
| public: |
| ReadColorControlCurrentX() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) { AddArgument("attr-name", "current-x"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadCurrentXAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute CurrentY |
| */ |
| class ReadColorControlCurrentY : public ModelCommand |
| { |
| public: |
| ReadColorControlCurrentY() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) { AddArgument("attr-name", "current-y"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadCurrentYAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute ColorTemperatureMireds |
| */ |
| class ReadColorControlColorTemperatureMireds : public ModelCommand |
| { |
| public: |
| ReadColorControlColorTemperatureMireds() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("attr-name", "color-temperature-mireds"); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadColorTemperatureMiredsAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute ColorMode |
| */ |
| class ReadColorControlColorMode : public ModelCommand |
| { |
| public: |
| ReadColorControlColorMode() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) { AddArgument("attr-name", "color-mode"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadColorModeAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute Options |
| */ |
| class ReadColorControlOptions : public ModelCommand |
| { |
| public: |
| ReadColorControlOptions() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) { AddArgument("attr-name", "options"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadOptionsAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute NumberOfPrimaries |
| */ |
| class ReadColorControlNumberOfPrimaries : public ModelCommand |
| { |
| public: |
| ReadColorControlNumberOfPrimaries() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("attr-name", "number-of-primaries"); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadNumberOfPrimariesAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute Primary1X |
| */ |
| class ReadColorControlPrimary1X : public ModelCommand |
| { |
| public: |
| ReadColorControlPrimary1X() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) { AddArgument("attr-name", "primary1-x"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadPrimary1XAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute Primary1Y |
| */ |
| class ReadColorControlPrimary1Y : public ModelCommand |
| { |
| public: |
| ReadColorControlPrimary1Y() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) { AddArgument("attr-name", "primary1-y"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadPrimary1YAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute Primary1Intensity |
| */ |
| class ReadColorControlPrimary1Intensity : public ModelCommand |
| { |
| public: |
| ReadColorControlPrimary1Intensity() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("attr-name", "primary1-intensity"); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadPrimary1IntensityAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute Primary2X |
| */ |
| class ReadColorControlPrimary2X : public ModelCommand |
| { |
| public: |
| ReadColorControlPrimary2X() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) { AddArgument("attr-name", "primary2-x"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadPrimary2XAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute Primary2Y |
| */ |
| class ReadColorControlPrimary2Y : public ModelCommand |
| { |
| public: |
| ReadColorControlPrimary2Y() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) { AddArgument("attr-name", "primary2-y"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadPrimary2YAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute Primary2Intensity |
| */ |
| class ReadColorControlPrimary2Intensity : public ModelCommand |
| { |
| public: |
| ReadColorControlPrimary2Intensity() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("attr-name", "primary2-intensity"); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadPrimary2IntensityAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute Primary3X |
| */ |
| class ReadColorControlPrimary3X : public ModelCommand |
| { |
| public: |
| ReadColorControlPrimary3X() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) { AddArgument("attr-name", "primary3-x"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadPrimary3XAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute Primary3Y |
| */ |
| class ReadColorControlPrimary3Y : public ModelCommand |
| { |
| public: |
| ReadColorControlPrimary3Y() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) { AddArgument("attr-name", "primary3-y"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadPrimary3YAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute Primary3Intensity |
| */ |
| class ReadColorControlPrimary3Intensity : public ModelCommand |
| { |
| public: |
| ReadColorControlPrimary3Intensity() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("attr-name", "primary3-intensity"); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadPrimary3IntensityAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute Primary4X |
| */ |
| class ReadColorControlPrimary4X : public ModelCommand |
| { |
| public: |
| ReadColorControlPrimary4X() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) { AddArgument("attr-name", "primary4-x"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadPrimary4XAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute Primary4Y |
| */ |
| class ReadColorControlPrimary4Y : public ModelCommand |
| { |
| public: |
| ReadColorControlPrimary4Y() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) { AddArgument("attr-name", "primary4-y"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadPrimary4YAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute Primary4Intensity |
| */ |
| class ReadColorControlPrimary4Intensity : public ModelCommand |
| { |
| public: |
| ReadColorControlPrimary4Intensity() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("attr-name", "primary4-intensity"); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadPrimary4IntensityAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute Primary5X |
| */ |
| class ReadColorControlPrimary5X : public ModelCommand |
| { |
| public: |
| ReadColorControlPrimary5X() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) { AddArgument("attr-name", "primary5-x"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadPrimary5XAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute Primary5Y |
| */ |
| class ReadColorControlPrimary5Y : public ModelCommand |
| { |
| public: |
| ReadColorControlPrimary5Y() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) { AddArgument("attr-name", "primary5-y"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadPrimary5YAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute Primary5Intensity |
| */ |
| class ReadColorControlPrimary5Intensity : public ModelCommand |
| { |
| public: |
| ReadColorControlPrimary5Intensity() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("attr-name", "primary5-intensity"); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadPrimary5IntensityAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute Primary6X |
| */ |
| class ReadColorControlPrimary6X : public ModelCommand |
| { |
| public: |
| ReadColorControlPrimary6X() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) { AddArgument("attr-name", "primary6-x"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadPrimary6XAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute Primary6Y |
| */ |
| class ReadColorControlPrimary6Y : public ModelCommand |
| { |
| public: |
| ReadColorControlPrimary6Y() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) { AddArgument("attr-name", "primary6-y"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadPrimary6YAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute Primary6Intensity |
| */ |
| class ReadColorControlPrimary6Intensity : public ModelCommand |
| { |
| public: |
| ReadColorControlPrimary6Intensity() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("attr-name", "primary6-intensity"); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadPrimary6IntensityAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute EnhancedCurrentHue |
| */ |
| class ReadColorControlEnhancedCurrentHue : public ModelCommand |
| { |
| public: |
| ReadColorControlEnhancedCurrentHue() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("attr-name", "enhanced-current-hue"); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadEnhancedCurrentHueAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute EnhancedColorMode |
| */ |
| class ReadColorControlEnhancedColorMode : public ModelCommand |
| { |
| public: |
| ReadColorControlEnhancedColorMode() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("attr-name", "enhanced-color-mode"); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadEnhancedColorModeAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute ColorLoopActive |
| */ |
| class ReadColorControlColorLoopActive : public ModelCommand |
| { |
| public: |
| ReadColorControlColorLoopActive() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("attr-name", "color-loop-active"); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadColorLoopActiveAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute ColorLoopDirection |
| */ |
| class ReadColorControlColorLoopDirection : public ModelCommand |
| { |
| public: |
| ReadColorControlColorLoopDirection() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("attr-name", "color-loop-direction"); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadColorLoopDirectionAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute ColorLoopTime |
| */ |
| class ReadColorControlColorLoopTime : public ModelCommand |
| { |
| public: |
| ReadColorControlColorLoopTime() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("attr-name", "color-loop-time"); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadColorLoopTimeAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute ColorLoopStartEnhancedHue |
| */ |
| class ReadColorControlColorLoopStartEnhancedHue : public ModelCommand |
| { |
| public: |
| ReadColorControlColorLoopStartEnhancedHue() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("attr-name", "color-loop-start-enhanced-hue"); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadColorLoopStartEnhancedHueAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute ColorLoopStoredEnhancedHue |
| */ |
| class ReadColorControlColorLoopStoredEnhancedHue : public ModelCommand |
| { |
| public: |
| ReadColorControlColorLoopStoredEnhancedHue() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("attr-name", "color-loop-stored-enhanced-hue"); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadColorLoopStoredEnhancedHueAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute ColorCapabilities |
| */ |
| class ReadColorControlColorCapabilities : public ModelCommand |
| { |
| public: |
| ReadColorControlColorCapabilities() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("attr-name", "color-capabilities"); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadColorCapabilitiesAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute ColorTempPhysicalMinMireds |
| */ |
| class ReadColorControlColorTempPhysicalMinMireds : public ModelCommand |
| { |
| public: |
| ReadColorControlColorTempPhysicalMinMireds() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("attr-name", "color-temp-physical-min-mireds"); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadColorTempPhysicalMinMiredsAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute ColorTempPhysicalMaxMireds |
| */ |
| class ReadColorControlColorTempPhysicalMaxMireds : public ModelCommand |
| { |
| public: |
| ReadColorControlColorTempPhysicalMaxMireds() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("attr-name", "color-temp-physical-max-mireds"); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadColorTempPhysicalMaxMiredsAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute CoupleColorTempToLevelMinMireds |
| */ |
| class ReadColorControlCoupleColorTempToLevelMinMireds : public ModelCommand |
| { |
| public: |
| ReadColorControlCoupleColorTempToLevelMinMireds() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("attr-name", "couple-color-temp-to-level-min-mireds"); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadCoupleColorTempToLevelMinMiredsAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute StartUpColorTemperatureMireds |
| */ |
| class ReadColorControlStartUpColorTemperatureMireds : public ModelCommand |
| { |
| public: |
| ReadColorControlStartUpColorTemperatureMireds() : ModelCommand("read", COLOR_CONTROL_CLUSTER_ID) |
| { |
| AddArgument("attr-name", "start-up-color-temperature-mireds"); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeColorControlClusterReadStartUpColorTemperatureMiredsAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /*----------------------------------------------------------------------------*\ |
| | Cluster DoorLock | 0x0101 | |
| |------------------------------------------------------------------------------| |
| | Commands: | | |
| | * ClearAllPINCodes | 0x08 | |
| | * ClearAllRFIDCodes | 0x19 | |
| | * ClearHolidaySchedule | 0x13 | |
| | * ClearPINCode | 0x07 | |
| | * ClearRFIDCode | 0x18 | |
| | * ClearWeekdaySchedule | 0x0D | |
| | * ClearYearDaySchedule | 0x10 | |
| | * GetHolidaySchedule | 0x12 | |
| | * GetLogRecord | 0x04 | |
| | * GetPINCode | 0x06 | |
| | * GetRFIDCode | 0x17 | |
| | * GetUserType | 0x15 | |
| | * GetWeekdaySchedule | 0x0C | |
| | * GetYearDaySchedule | 0x0F | |
| | * LockDoor | 0x00 | |
| | * SetHolidaySchedule | 0x11 | |
| | * SetPINCode | 0x05 | |
| | * SetRFIDCode | 0x16 | |
| | * SetUserType | 0x14 | |
| | * SetWeekdaySchedule | 0x0B | |
| | * SetYearDaySchedule | 0x0E | |
| | * UnlockDoor | 0x01 | |
| | * UnlockWithTimeout | 0x03 | |
| | | | |
| |------------------------------------------------------------------------------| |
| | Attributes:: | | |
| | * LockState | 0x0000 | |
| | * LockType | 0x0001 | |
| | * ActuatorEnabled | 0x0002 | |
| \*----------------------------------------------------------------------------*/ |
| |
| /* |
| * Command ClearAllPINCodes |
| */ |
| class DoorLockClearAllPINCodes : public ModelCommand |
| { |
| public: |
| DoorLockClearAllPINCodes() : ModelCommand("clear-all-pincodes", DOOR_LOCK_CLUSTER_ID) {} |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeDoorLockClusterClearAllPINCodesCommand(buffer->Start(), bufferSize, endPointId); |
| } |
| |
| // Cluster Specific Response: ClearAllPINCodesResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint8_t status = chip::Encoding::Read8(message); |
| |
| ChipLogProgress(chipTool, "ClearAllPINCodesResponse:"); |
| ChipLogProgress(chipTool, " status: 0x%02x", status); |
| |
| return true; |
| } |
| }; |
| |
| /* |
| * Command ClearAllRFIDCodes |
| */ |
| class DoorLockClearAllRFIDCodes : public ModelCommand |
| { |
| public: |
| DoorLockClearAllRFIDCodes() : ModelCommand("clear-all-rfidcodes", DOOR_LOCK_CLUSTER_ID) {} |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeDoorLockClusterClearAllRFIDCodesCommand(buffer->Start(), bufferSize, endPointId); |
| } |
| |
| // Cluster Specific Response: ClearAllRFIDCodesResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint8_t status = chip::Encoding::Read8(message); |
| |
| ChipLogProgress(chipTool, "ClearAllRFIDCodesResponse:"); |
| ChipLogProgress(chipTool, " status: 0x%02x", status); |
| |
| return true; |
| } |
| }; |
| |
| /* |
| * Command ClearHolidaySchedule |
| */ |
| class DoorLockClearHolidaySchedule : public ModelCommand |
| { |
| public: |
| DoorLockClearHolidaySchedule() : ModelCommand("clear-holiday-schedule", DOOR_LOCK_CLUSTER_ID) |
| { |
| AddArgument("holidayScheduleID", 0, UINT8_MAX, &mHolidayScheduleID); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeDoorLockClusterClearHolidayScheduleCommand(buffer->Start(), bufferSize, endPointId, mHolidayScheduleID); |
| } |
| |
| // Cluster Specific Response: ClearHolidayScheduleResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint8_t status = chip::Encoding::Read8(message); |
| |
| ChipLogProgress(chipTool, "ClearHolidayScheduleResponse:"); |
| ChipLogProgress(chipTool, " status: 0x%02x", status); |
| |
| return true; |
| } |
| |
| private: |
| uint8_t mHolidayScheduleID; |
| }; |
| |
| /* |
| * Command ClearPINCode |
| */ |
| class DoorLockClearPINCode : public ModelCommand |
| { |
| public: |
| DoorLockClearPINCode() : ModelCommand("clear-pincode", DOOR_LOCK_CLUSTER_ID) { AddArgument("userID", 0, UINT16_MAX, &mUserID); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeDoorLockClusterClearPINCodeCommand(buffer->Start(), bufferSize, endPointId, mUserID); |
| } |
| |
| // Cluster Specific Response: ClearPINCodeResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint8_t status = chip::Encoding::Read8(message); |
| |
| ChipLogProgress(chipTool, "ClearPINCodeResponse:"); |
| ChipLogProgress(chipTool, " status: 0x%02x", status); |
| |
| return true; |
| } |
| |
| private: |
| uint16_t mUserID; |
| }; |
| |
| /* |
| * Command ClearRFIDCode |
| */ |
| class DoorLockClearRFIDCode : public ModelCommand |
| { |
| public: |
| DoorLockClearRFIDCode() : ModelCommand("clear-rfidcode", DOOR_LOCK_CLUSTER_ID) |
| { |
| AddArgument("userID", 0, UINT16_MAX, &mUserID); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeDoorLockClusterClearRFIDCodeCommand(buffer->Start(), bufferSize, endPointId, mUserID); |
| } |
| |
| // Cluster Specific Response: ClearRFIDCodeResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint8_t status = chip::Encoding::Read8(message); |
| |
| ChipLogProgress(chipTool, "ClearRFIDCodeResponse:"); |
| ChipLogProgress(chipTool, " status: 0x%02x", status); |
| |
| return true; |
| } |
| |
| private: |
| uint16_t mUserID; |
| }; |
| |
| /* |
| * Command ClearWeekdaySchedule |
| */ |
| class DoorLockClearWeekdaySchedule : public ModelCommand |
| { |
| public: |
| DoorLockClearWeekdaySchedule() : ModelCommand("clear-weekday-schedule", DOOR_LOCK_CLUSTER_ID) |
| { |
| AddArgument("scheduleID", 0, UINT8_MAX, &mScheduleID); |
| AddArgument("userID", 0, UINT16_MAX, &mUserID); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeDoorLockClusterClearWeekdayScheduleCommand(buffer->Start(), bufferSize, endPointId, mScheduleID, mUserID); |
| } |
| |
| // Cluster Specific Response: ClearWeekdayScheduleResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint8_t status = chip::Encoding::Read8(message); |
| |
| ChipLogProgress(chipTool, "ClearWeekdayScheduleResponse:"); |
| ChipLogProgress(chipTool, " status: 0x%02x", status); |
| |
| return true; |
| } |
| |
| private: |
| uint8_t mScheduleID; |
| uint16_t mUserID; |
| }; |
| |
| /* |
| * Command ClearYearDaySchedule |
| */ |
| class DoorLockClearYearDaySchedule : public ModelCommand |
| { |
| public: |
| DoorLockClearYearDaySchedule() : ModelCommand("clear-year-day-schedule", DOOR_LOCK_CLUSTER_ID) |
| { |
| AddArgument("scheduleID", 0, UINT8_MAX, &mScheduleID); |
| AddArgument("userID", 0, UINT16_MAX, &mUserID); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeDoorLockClusterClearYearDayScheduleCommand(buffer->Start(), bufferSize, endPointId, mScheduleID, mUserID); |
| } |
| |
| // Cluster Specific Response: ClearYearDayScheduleResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint8_t status = chip::Encoding::Read8(message); |
| |
| ChipLogProgress(chipTool, "ClearYearDayScheduleResponse:"); |
| ChipLogProgress(chipTool, " status: 0x%02x", status); |
| |
| return true; |
| } |
| |
| private: |
| uint8_t mScheduleID; |
| uint16_t mUserID; |
| }; |
| |
| /* |
| * Command GetHolidaySchedule |
| */ |
| class DoorLockGetHolidaySchedule : public ModelCommand |
| { |
| public: |
| DoorLockGetHolidaySchedule() : ModelCommand("get-holiday-schedule", DOOR_LOCK_CLUSTER_ID) |
| { |
| AddArgument("holidayScheduleID", 0, UINT8_MAX, &mHolidayScheduleID); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeDoorLockClusterGetHolidayScheduleCommand(buffer->Start(), bufferSize, endPointId, mHolidayScheduleID); |
| } |
| |
| // Cluster Specific Response: GetHolidayScheduleResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint8_t holidayScheduleID = chip::Encoding::Read8(message); |
| uint8_t status = chip::Encoding::Read8(message); |
| uint32_t localStartTime = chip::Encoding::LittleEndian::Read32(message); |
| uint32_t localEndTime = chip::Encoding::LittleEndian::Read32(message); |
| uint8_t operatingModeDuringHoliday = chip::Encoding::Read8(message); |
| |
| ChipLogProgress(chipTool, "GetHolidayScheduleResponse:"); |
| ChipLogProgress(chipTool, " holidayScheduleID: 0x%02x", holidayScheduleID); |
| ChipLogProgress(chipTool, " status: 0x%02x", status); |
| ChipLogProgress(chipTool, " localStartTime: 0x%08x", localStartTime); |
| ChipLogProgress(chipTool, " localEndTime: 0x%08x", localEndTime); |
| ChipLogProgress(chipTool, " operatingModeDuringHoliday: 0x%02x", operatingModeDuringHoliday); |
| |
| return true; |
| } |
| |
| private: |
| uint8_t mHolidayScheduleID; |
| }; |
| |
| /* |
| * Command GetLogRecord |
| */ |
| class DoorLockGetLogRecord : public ModelCommand |
| { |
| public: |
| DoorLockGetLogRecord() : ModelCommand("get-log-record", DOOR_LOCK_CLUSTER_ID) |
| { |
| AddArgument("logIndex", 0, UINT16_MAX, &mLogIndex); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeDoorLockClusterGetLogRecordCommand(buffer->Start(), bufferSize, endPointId, mLogIndex); |
| } |
| |
| // Cluster Specific Response: GetLogRecordResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint16_t logEntryID = chip::Encoding::LittleEndian::Read16(message); |
| uint32_t timestamp = chip::Encoding::LittleEndian::Read32(message); |
| uint8_t eventType = chip::Encoding::Read8(message); |
| uint8_t sourceOperationEvent = chip::Encoding::Read8(message); |
| uint8_t eventIDOrAlarmCode = chip::Encoding::Read8(message); |
| uint16_t userID = chip::Encoding::LittleEndian::Read16(message); |
| uint8_t msgLen = chip::Encoding::Read8(message); |
| |
| ChipLogProgress(chipTool, "GetLogRecordResponse:"); |
| ChipLogProgress(chipTool, " logEntryID: 0x%04x", logEntryID); |
| ChipLogProgress(chipTool, " timestamp: 0x%08x", timestamp); |
| ChipLogProgress(chipTool, " eventType: 0x%02x", eventType); |
| ChipLogProgress(chipTool, " sourceOperationEvent: 0x%02x", sourceOperationEvent); |
| ChipLogProgress(chipTool, " eventIDOrAlarmCode: 0x%02x", eventIDOrAlarmCode); |
| ChipLogProgress(chipTool, " userID: 0x%04x", userID); |
| ChipLogProgress(chipTool, " pIN len: 0x%02x", msgLen); |
| |
| return true; |
| } |
| |
| private: |
| uint16_t mLogIndex; |
| }; |
| |
| /* |
| * Command GetPINCode |
| */ |
| class DoorLockGetPINCode : public ModelCommand |
| { |
| public: |
| DoorLockGetPINCode() : ModelCommand("get-pincode", DOOR_LOCK_CLUSTER_ID) { AddArgument("userID", 0, UINT16_MAX, &mUserID); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeDoorLockClusterGetPINCodeCommand(buffer->Start(), bufferSize, endPointId, mUserID); |
| } |
| |
| // Cluster Specific Response: GetPINCodeResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint16_t userID = chip::Encoding::LittleEndian::Read16(message); |
| uint8_t userStatus = chip::Encoding::Read8(message); |
| uint8_t userType = chip::Encoding::Read8(message); |
| uint8_t msgLen = chip::Encoding::Read8(message); |
| |
| ChipLogProgress(chipTool, "GetPINCodeResponse:"); |
| ChipLogProgress(chipTool, " userID: 0x%04x", userID); |
| ChipLogProgress(chipTool, " userStatus: 0x%02x", userStatus); |
| ChipLogProgress(chipTool, " userType: 0x%02x", userType); |
| ChipLogProgress(chipTool, " code len: 0x%02x", msgLen); |
| |
| return true; |
| } |
| |
| private: |
| uint16_t mUserID; |
| }; |
| |
| /* |
| * Command GetRFIDCode |
| */ |
| class DoorLockGetRFIDCode : public ModelCommand |
| { |
| public: |
| DoorLockGetRFIDCode() : ModelCommand("get-rfidcode", DOOR_LOCK_CLUSTER_ID) { AddArgument("userID", 0, UINT16_MAX, &mUserID); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeDoorLockClusterGetRFIDCodeCommand(buffer->Start(), bufferSize, endPointId, mUserID); |
| } |
| |
| // Cluster Specific Response: GetRFIDCodeResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint16_t userID = chip::Encoding::LittleEndian::Read16(message); |
| uint8_t userStatus = chip::Encoding::Read8(message); |
| uint8_t userType = chip::Encoding::Read8(message); |
| uint8_t msgLen = chip::Encoding::Read8(message); |
| |
| ChipLogProgress(chipTool, "GetRFIDCodeResponse:"); |
| ChipLogProgress(chipTool, " userID: 0x%04x", userID); |
| ChipLogProgress(chipTool, " userStatus: 0x%02x", userStatus); |
| ChipLogProgress(chipTool, " userType: 0x%02x", userType); |
| ChipLogProgress(chipTool, " rFIDCode len: 0x%02x", msgLen); |
| |
| return true; |
| } |
| |
| private: |
| uint16_t mUserID; |
| }; |
| |
| /* |
| * Command GetUserType |
| */ |
| class DoorLockGetUserType : public ModelCommand |
| { |
| public: |
| DoorLockGetUserType() : ModelCommand("get-user-type", DOOR_LOCK_CLUSTER_ID) { AddArgument("userID", 0, UINT16_MAX, &mUserID); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeDoorLockClusterGetUserTypeCommand(buffer->Start(), bufferSize, endPointId, mUserID); |
| } |
| |
| // Cluster Specific Response: GetUserTypeResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint16_t userID = chip::Encoding::LittleEndian::Read16(message); |
| uint8_t userType = chip::Encoding::Read8(message); |
| |
| ChipLogProgress(chipTool, "GetUserTypeResponse:"); |
| ChipLogProgress(chipTool, " userID: 0x%04x", userID); |
| ChipLogProgress(chipTool, " userType: 0x%02x", userType); |
| |
| return true; |
| } |
| |
| private: |
| uint16_t mUserID; |
| }; |
| |
| /* |
| * Command GetWeekdaySchedule |
| */ |
| class DoorLockGetWeekdaySchedule : public ModelCommand |
| { |
| public: |
| DoorLockGetWeekdaySchedule() : ModelCommand("get-weekday-schedule", DOOR_LOCK_CLUSTER_ID) |
| { |
| AddArgument("scheduleID", 0, UINT8_MAX, &mScheduleID); |
| AddArgument("userID", 0, UINT16_MAX, &mUserID); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeDoorLockClusterGetWeekdayScheduleCommand(buffer->Start(), bufferSize, endPointId, mScheduleID, mUserID); |
| } |
| |
| // Cluster Specific Response: GetWeekdayScheduleResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint8_t scheduleID = chip::Encoding::Read8(message); |
| uint16_t userID = chip::Encoding::LittleEndian::Read16(message); |
| uint8_t status = chip::Encoding::Read8(message); |
| uint8_t daysMask = chip::Encoding::Read8(message); |
| uint8_t startHour = chip::Encoding::Read8(message); |
| uint8_t startMinute = chip::Encoding::Read8(message); |
| uint8_t endHour = chip::Encoding::Read8(message); |
| uint8_t endMinute = chip::Encoding::Read8(message); |
| |
| ChipLogProgress(chipTool, "GetWeekdayScheduleResponse:"); |
| ChipLogProgress(chipTool, " scheduleID: 0x%02x", scheduleID); |
| ChipLogProgress(chipTool, " userID: 0x%04x", userID); |
| ChipLogProgress(chipTool, " status: 0x%02x", status); |
| ChipLogProgress(chipTool, " daysMask: 0x%02x", daysMask); |
| ChipLogProgress(chipTool, " startHour: 0x%02x", startHour); |
| ChipLogProgress(chipTool, " startMinute: 0x%02x", startMinute); |
| ChipLogProgress(chipTool, " endHour: 0x%02x", endHour); |
| ChipLogProgress(chipTool, " endMinute: 0x%02x", endMinute); |
| |
| return true; |
| } |
| |
| private: |
| uint8_t mScheduleID; |
| uint16_t mUserID; |
| }; |
| |
| /* |
| * Command GetYearDaySchedule |
| */ |
| class DoorLockGetYearDaySchedule : public ModelCommand |
| { |
| public: |
| DoorLockGetYearDaySchedule() : ModelCommand("get-year-day-schedule", DOOR_LOCK_CLUSTER_ID) |
| { |
| AddArgument("scheduleID", 0, UINT8_MAX, &mScheduleID); |
| AddArgument("userID", 0, UINT16_MAX, &mUserID); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeDoorLockClusterGetYearDayScheduleCommand(buffer->Start(), bufferSize, endPointId, mScheduleID, mUserID); |
| } |
| |
| // Cluster Specific Response: GetYearDayScheduleResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint8_t scheduleID = chip::Encoding::Read8(message); |
| uint16_t userID = chip::Encoding::LittleEndian::Read16(message); |
| uint8_t status = chip::Encoding::Read8(message); |
| uint32_t localStartTime = chip::Encoding::LittleEndian::Read32(message); |
| uint32_t localEndTime = chip::Encoding::LittleEndian::Read32(message); |
| |
| ChipLogProgress(chipTool, "GetYearDayScheduleResponse:"); |
| ChipLogProgress(chipTool, " scheduleID: 0x%02x", scheduleID); |
| ChipLogProgress(chipTool, " userID: 0x%04x", userID); |
| ChipLogProgress(chipTool, " status: 0x%02x", status); |
| ChipLogProgress(chipTool, " localStartTime: 0x%08x", localStartTime); |
| ChipLogProgress(chipTool, " localEndTime: 0x%08x", localEndTime); |
| |
| return true; |
| } |
| |
| private: |
| uint8_t mScheduleID; |
| uint16_t mUserID; |
| }; |
| |
| /* |
| * Command LockDoor |
| */ |
| class DoorLockLockDoor : public ModelCommand |
| { |
| public: |
| DoorLockLockDoor() : ModelCommand("lock-door", DOOR_LOCK_CLUSTER_ID) { AddArgument("pINOrRFIDCode", &mPINOrRFIDCode); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeDoorLockClusterLockDoorCommand(buffer->Start(), bufferSize, endPointId, mPINOrRFIDCode); |
| } |
| |
| // Cluster Specific Response: LockDoorResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint8_t status = chip::Encoding::Read8(message); |
| |
| ChipLogProgress(chipTool, "LockDoorResponse:"); |
| ChipLogProgress(chipTool, " status: 0x%02x", status); |
| |
| return true; |
| } |
| |
| private: |
| char * mPINOrRFIDCode; |
| }; |
| |
| /* |
| * Command SetHolidaySchedule |
| */ |
| class DoorLockSetHolidaySchedule : public ModelCommand |
| { |
| public: |
| DoorLockSetHolidaySchedule() : ModelCommand("set-holiday-schedule", DOOR_LOCK_CLUSTER_ID) |
| { |
| AddArgument("holidayScheduleID", 0, UINT8_MAX, &mHolidayScheduleID); |
| AddArgument("localStartTime", 0, UINT32_MAX, &mLocalStartTime); |
| AddArgument("localEndTime", 0, UINT32_MAX, &mLocalEndTime); |
| AddArgument("operatingModeDuringHoliday", 0, UINT8_MAX, &mOperatingModeDuringHoliday); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeDoorLockClusterSetHolidayScheduleCommand(buffer->Start(), bufferSize, endPointId, mHolidayScheduleID, |
| mLocalStartTime, mLocalEndTime, mOperatingModeDuringHoliday); |
| } |
| |
| // Cluster Specific Response: SetHolidayScheduleResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint8_t status = chip::Encoding::Read8(message); |
| |
| ChipLogProgress(chipTool, "SetHolidayScheduleResponse:"); |
| ChipLogProgress(chipTool, " status: 0x%02x", status); |
| |
| return true; |
| } |
| |
| private: |
| uint8_t mHolidayScheduleID; |
| uint32_t mLocalStartTime; |
| uint32_t mLocalEndTime; |
| uint8_t mOperatingModeDuringHoliday; |
| }; |
| |
| /* |
| * Command SetPINCode |
| */ |
| class DoorLockSetPINCode : public ModelCommand |
| { |
| public: |
| DoorLockSetPINCode() : ModelCommand("set-pincode", DOOR_LOCK_CLUSTER_ID) |
| { |
| AddArgument("userID", 0, UINT16_MAX, &mUserID); |
| AddArgument("userStatus", 0, UINT8_MAX, &mUserStatus); |
| AddArgument("userType", 0, UINT8_MAX, &mUserType); |
| AddArgument("pIN", &mPIN); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeDoorLockClusterSetPINCodeCommand(buffer->Start(), bufferSize, endPointId, mUserID, mUserStatus, mUserType, |
| mPIN); |
| } |
| |
| // Cluster Specific Response: SetPINCodeResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint8_t status = chip::Encoding::Read8(message); |
| |
| ChipLogProgress(chipTool, "SetPINCodeResponse:"); |
| ChipLogProgress(chipTool, " status: 0x%02x", status); |
| |
| return true; |
| } |
| |
| private: |
| uint16_t mUserID; |
| uint8_t mUserStatus; |
| uint8_t mUserType; |
| char * mPIN; |
| }; |
| |
| /* |
| * Command SetRFIDCode |
| */ |
| class DoorLockSetRFIDCode : public ModelCommand |
| { |
| public: |
| DoorLockSetRFIDCode() : ModelCommand("set-rfidcode", DOOR_LOCK_CLUSTER_ID) |
| { |
| AddArgument("userID", 0, UINT16_MAX, &mUserID); |
| AddArgument("userStatus", 0, UINT8_MAX, &mUserStatus); |
| AddArgument("userType", 0, UINT8_MAX, &mUserType); |
| AddArgument("rFIDCode", &mRFIDCode); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeDoorLockClusterSetRFIDCodeCommand(buffer->Start(), bufferSize, endPointId, mUserID, mUserStatus, mUserType, |
| mRFIDCode); |
| } |
| |
| // Cluster Specific Response: SetRFIDCodeResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint8_t status = chip::Encoding::Read8(message); |
| |
| ChipLogProgress(chipTool, "SetRFIDCodeResponse:"); |
| ChipLogProgress(chipTool, " status: 0x%02x", status); |
| |
| return true; |
| } |
| |
| private: |
| uint16_t mUserID; |
| uint8_t mUserStatus; |
| uint8_t mUserType; |
| char * mRFIDCode; |
| }; |
| |
| /* |
| * Command SetUserType |
| */ |
| class DoorLockSetUserType : public ModelCommand |
| { |
| public: |
| DoorLockSetUserType() : ModelCommand("set-user-type", DOOR_LOCK_CLUSTER_ID) |
| { |
| AddArgument("userID", 0, UINT16_MAX, &mUserID); |
| AddArgument("userType", 0, UINT8_MAX, &mUserType); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeDoorLockClusterSetUserTypeCommand(buffer->Start(), bufferSize, endPointId, mUserID, mUserType); |
| } |
| |
| // Cluster Specific Response: SetUserTypeResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint8_t status = chip::Encoding::Read8(message); |
| |
| ChipLogProgress(chipTool, "SetUserTypeResponse:"); |
| ChipLogProgress(chipTool, " status: 0x%02x", status); |
| |
| return true; |
| } |
| |
| private: |
| uint16_t mUserID; |
| uint8_t mUserType; |
| }; |
| |
| /* |
| * Command SetWeekdaySchedule |
| */ |
| class DoorLockSetWeekdaySchedule : public ModelCommand |
| { |
| public: |
| DoorLockSetWeekdaySchedule() : ModelCommand("set-weekday-schedule", DOOR_LOCK_CLUSTER_ID) |
| { |
| AddArgument("scheduleID", 0, UINT8_MAX, &mScheduleID); |
| AddArgument("userID", 0, UINT16_MAX, &mUserID); |
| AddArgument("daysMask", 0, UINT8_MAX, &mDaysMask); |
| AddArgument("startHour", 0, UINT8_MAX, &mStartHour); |
| AddArgument("startMinute", 0, UINT8_MAX, &mStartMinute); |
| AddArgument("endHour", 0, UINT8_MAX, &mEndHour); |
| AddArgument("endMinute", 0, UINT8_MAX, &mEndMinute); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeDoorLockClusterSetWeekdayScheduleCommand(buffer->Start(), bufferSize, endPointId, mScheduleID, mUserID, |
| mDaysMask, mStartHour, mStartMinute, mEndHour, mEndMinute); |
| } |
| |
| // Cluster Specific Response: SetWeekdayScheduleResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint8_t status = chip::Encoding::Read8(message); |
| |
| ChipLogProgress(chipTool, "SetWeekdayScheduleResponse:"); |
| ChipLogProgress(chipTool, " status: 0x%02x", status); |
| |
| return true; |
| } |
| |
| private: |
| uint8_t mScheduleID; |
| uint16_t mUserID; |
| uint8_t mDaysMask; |
| uint8_t mStartHour; |
| uint8_t mStartMinute; |
| uint8_t mEndHour; |
| uint8_t mEndMinute; |
| }; |
| |
| /* |
| * Command SetYearDaySchedule |
| */ |
| class DoorLockSetYearDaySchedule : public ModelCommand |
| { |
| public: |
| DoorLockSetYearDaySchedule() : ModelCommand("set-year-day-schedule", DOOR_LOCK_CLUSTER_ID) |
| { |
| AddArgument("scheduleID", 0, UINT8_MAX, &mScheduleID); |
| AddArgument("userID", 0, UINT16_MAX, &mUserID); |
| AddArgument("localStartTime", 0, UINT32_MAX, &mLocalStartTime); |
| AddArgument("localEndTime", 0, UINT32_MAX, &mLocalEndTime); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeDoorLockClusterSetYearDayScheduleCommand(buffer->Start(), bufferSize, endPointId, mScheduleID, mUserID, |
| mLocalStartTime, mLocalEndTime); |
| } |
| |
| // Cluster Specific Response: SetYearDayScheduleResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint8_t status = chip::Encoding::Read8(message); |
| |
| ChipLogProgress(chipTool, "SetYearDayScheduleResponse:"); |
| ChipLogProgress(chipTool, " status: 0x%02x", status); |
| |
| return true; |
| } |
| |
| private: |
| uint8_t mScheduleID; |
| uint16_t mUserID; |
| uint32_t mLocalStartTime; |
| uint32_t mLocalEndTime; |
| }; |
| |
| /* |
| * Command UnlockDoor |
| */ |
| class DoorLockUnlockDoor : public ModelCommand |
| { |
| public: |
| DoorLockUnlockDoor() : ModelCommand("unlock-door", DOOR_LOCK_CLUSTER_ID) { AddArgument("pINOrRFIDCode", &mPINOrRFIDCode); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeDoorLockClusterUnlockDoorCommand(buffer->Start(), bufferSize, endPointId, mPINOrRFIDCode); |
| } |
| |
| // Cluster Specific Response: UnlockDoorResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint8_t status = chip::Encoding::Read8(message); |
| |
| ChipLogProgress(chipTool, "UnlockDoorResponse:"); |
| ChipLogProgress(chipTool, " status: 0x%02x", status); |
| |
| return true; |
| } |
| |
| private: |
| char * mPINOrRFIDCode; |
| }; |
| |
| /* |
| * Command UnlockWithTimeout |
| */ |
| class DoorLockUnlockWithTimeout : public ModelCommand |
| { |
| public: |
| DoorLockUnlockWithTimeout() : ModelCommand("unlock-with-timeout", DOOR_LOCK_CLUSTER_ID) |
| { |
| AddArgument("timeoutInSeconds", 0, UINT16_MAX, &mTimeoutInSeconds); |
| AddArgument("pINOrRFIDCode", &mPINOrRFIDCode); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeDoorLockClusterUnlockWithTimeoutCommand(buffer->Start(), bufferSize, endPointId, mTimeoutInSeconds, |
| mPINOrRFIDCode); |
| } |
| |
| // Cluster Specific Response: UnlockWithTimeoutResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint8_t status = chip::Encoding::Read8(message); |
| |
| ChipLogProgress(chipTool, "UnlockWithTimeoutResponse:"); |
| ChipLogProgress(chipTool, " status: 0x%02x", status); |
| |
| return true; |
| } |
| |
| private: |
| uint16_t mTimeoutInSeconds; |
| char * mPINOrRFIDCode; |
| }; |
| |
| /* |
| * Attribute LockState |
| */ |
| class ReadDoorLockLockState : public ModelCommand |
| { |
| public: |
| ReadDoorLockLockState() : ModelCommand("read", DOOR_LOCK_CLUSTER_ID) { AddArgument("attr-name", "lock-state"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeDoorLockClusterReadLockStateAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute LockType |
| */ |
| class ReadDoorLockLockType : public ModelCommand |
| { |
| public: |
| ReadDoorLockLockType() : ModelCommand("read", DOOR_LOCK_CLUSTER_ID) { AddArgument("attr-name", "lock-type"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeDoorLockClusterReadLockTypeAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute ActuatorEnabled |
| */ |
| class ReadDoorLockActuatorEnabled : public ModelCommand |
| { |
| public: |
| ReadDoorLockActuatorEnabled() : ModelCommand("read", DOOR_LOCK_CLUSTER_ID) { AddArgument("attr-name", "actuator-enabled"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeDoorLockClusterReadActuatorEnabledAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /*----------------------------------------------------------------------------*\ |
| | Cluster Groups | 0x0004 | |
| |------------------------------------------------------------------------------| |
| | Commands: | | |
| | * AddGroup | 0x00 | |
| | * AddGroupIfIdentifying | 0x05 | |
| | * GetGroupMembership | 0x02 | |
| | * RemoveAllGroups | 0x04 | |
| | * RemoveGroup | 0x03 | |
| | * ViewGroup | 0x01 | |
| | | | |
| |------------------------------------------------------------------------------| |
| | Attributes:: | | |
| | * NameSupport | 0x0000 | |
| \*----------------------------------------------------------------------------*/ |
| |
| /* |
| * Command AddGroup |
| */ |
| class GroupsAddGroup : public ModelCommand |
| { |
| public: |
| GroupsAddGroup() : ModelCommand("add-group", GROUPS_CLUSTER_ID) |
| { |
| AddArgument("groupId", 0, UINT16_MAX, &mGroupId); |
| AddArgument("groupName", &mGroupName); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeGroupsClusterAddGroupCommand(buffer->Start(), bufferSize, endPointId, mGroupId, mGroupName); |
| } |
| |
| // Cluster Specific Response: AddGroupResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint8_t status = chip::Encoding::Read8(message); |
| uint16_t groupId = chip::Encoding::LittleEndian::Read16(message); |
| |
| ChipLogProgress(chipTool, "AddGroupResponse:"); |
| ChipLogProgress(chipTool, " status: 0x%02x", status); |
| ChipLogProgress(chipTool, " groupId: 0x%04x", groupId); |
| |
| return true; |
| } |
| |
| private: |
| uint16_t mGroupId; |
| char * mGroupName; |
| }; |
| |
| /* |
| * Command AddGroupIfIdentifying |
| */ |
| class GroupsAddGroupIfIdentifying : public ModelCommand |
| { |
| public: |
| GroupsAddGroupIfIdentifying() : ModelCommand("add-group-if-identifying", GROUPS_CLUSTER_ID) |
| { |
| AddArgument("groupId", 0, UINT16_MAX, &mGroupId); |
| AddArgument("groupName", &mGroupName); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeGroupsClusterAddGroupIfIdentifyingCommand(buffer->Start(), bufferSize, endPointId, mGroupId, mGroupName); |
| } |
| |
| private: |
| uint16_t mGroupId; |
| char * mGroupName; |
| }; |
| |
| /* |
| * Command GetGroupMembership |
| */ |
| class GroupsGetGroupMembership : public ModelCommand |
| { |
| public: |
| GroupsGetGroupMembership() : ModelCommand("get-group-membership", GROUPS_CLUSTER_ID) |
| { |
| AddArgument("groupList", 0, UINT16_MAX, &mGroupList); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeGroupsClusterGetGroupMembershipCommand(buffer->Start(), bufferSize, endPointId, mGroupList); |
| } |
| |
| // Cluster Specific Response: GetGroupMembershipResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint8_t capacity = chip::Encoding::Read8(message); |
| uint16_t groupList = chip::Encoding::LittleEndian::Read16(message); |
| |
| ChipLogProgress(chipTool, "GetGroupMembershipResponse:"); |
| ChipLogProgress(chipTool, " capacity: 0x%02x", capacity); |
| ChipLogProgress(chipTool, " groupList: 0x%04x", groupList); |
| |
| return true; |
| } |
| |
| private: |
| uint16_t mGroupList; |
| }; |
| |
| /* |
| * Command RemoveAllGroups |
| */ |
| class GroupsRemoveAllGroups : public ModelCommand |
| { |
| public: |
| GroupsRemoveAllGroups() : ModelCommand("remove-all-groups", GROUPS_CLUSTER_ID) {} |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeGroupsClusterRemoveAllGroupsCommand(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Command RemoveGroup |
| */ |
| class GroupsRemoveGroup : public ModelCommand |
| { |
| public: |
| GroupsRemoveGroup() : ModelCommand("remove-group", GROUPS_CLUSTER_ID) { AddArgument("groupId", 0, UINT16_MAX, &mGroupId); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeGroupsClusterRemoveGroupCommand(buffer->Start(), bufferSize, endPointId, mGroupId); |
| } |
| |
| // Cluster Specific Response: RemoveGroupResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint8_t status = chip::Encoding::Read8(message); |
| uint16_t groupId = chip::Encoding::LittleEndian::Read16(message); |
| |
| ChipLogProgress(chipTool, "RemoveGroupResponse:"); |
| ChipLogProgress(chipTool, " status: 0x%02x", status); |
| ChipLogProgress(chipTool, " groupId: 0x%04x", groupId); |
| |
| return true; |
| } |
| |
| private: |
| uint16_t mGroupId; |
| }; |
| |
| /* |
| * Command ViewGroup |
| */ |
| class GroupsViewGroup : public ModelCommand |
| { |
| public: |
| GroupsViewGroup() : ModelCommand("view-group", GROUPS_CLUSTER_ID) { AddArgument("groupId", 0, UINT16_MAX, &mGroupId); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeGroupsClusterViewGroupCommand(buffer->Start(), bufferSize, endPointId, mGroupId); |
| } |
| |
| // Cluster Specific Response: ViewGroupResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint8_t status = chip::Encoding::Read8(message); |
| uint16_t groupId = chip::Encoding::LittleEndian::Read16(message); |
| uint8_t msgLen = chip::Encoding::Read8(message); |
| |
| ChipLogProgress(chipTool, "ViewGroupResponse:"); |
| ChipLogProgress(chipTool, " status: 0x%02x", status); |
| ChipLogProgress(chipTool, " groupId: 0x%04x", groupId); |
| ChipLogProgress(chipTool, " groupName len: 0x%02x", msgLen); |
| |
| return true; |
| } |
| |
| private: |
| uint16_t mGroupId; |
| }; |
| |
| /* |
| * Attribute NameSupport |
| */ |
| class ReadGroupsNameSupport : public ModelCommand |
| { |
| public: |
| ReadGroupsNameSupport() : ModelCommand("read", GROUPS_CLUSTER_ID) { AddArgument("attr-name", "name-support"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeGroupsClusterReadNameSupportAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /*----------------------------------------------------------------------------*\ |
| | Cluster Identify | 0x0003 | |
| |------------------------------------------------------------------------------| |
| | Commands: | | |
| | * Identify | 0x00 | |
| | * IdentifyQuery | 0x01 | |
| | | | |
| |------------------------------------------------------------------------------| |
| | Attributes:: | | |
| | * IdentifyTime | 0x0000 | |
| \*----------------------------------------------------------------------------*/ |
| |
| /* |
| * Command Identify |
| */ |
| class IdentifyIdentify : public ModelCommand |
| { |
| public: |
| IdentifyIdentify() : ModelCommand("identify", IDENTIFY_CLUSTER_ID) |
| { |
| AddArgument("identifyTime", 0, UINT16_MAX, &mIdentifyTime); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeIdentifyClusterIdentifyCommand(buffer->Start(), bufferSize, endPointId, mIdentifyTime); |
| } |
| |
| private: |
| uint16_t mIdentifyTime; |
| }; |
| |
| /* |
| * Command IdentifyQuery |
| */ |
| class IdentifyIdentifyQuery : public ModelCommand |
| { |
| public: |
| IdentifyIdentifyQuery() : ModelCommand("identify-query", IDENTIFY_CLUSTER_ID) {} |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeIdentifyClusterIdentifyQueryCommand(buffer->Start(), bufferSize, endPointId); |
| } |
| |
| // Cluster Specific Response: IdentifyQueryResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint16_t timeout = chip::Encoding::LittleEndian::Read16(message); |
| |
| ChipLogProgress(chipTool, "IdentifyQueryResponse:"); |
| ChipLogProgress(chipTool, " timeout: 0x%04x", timeout); |
| |
| return true; |
| } |
| }; |
| |
| /* |
| * Attribute IdentifyTime |
| */ |
| class ReadIdentifyIdentifyTime : public ModelCommand |
| { |
| public: |
| ReadIdentifyIdentifyTime() : ModelCommand("read", IDENTIFY_CLUSTER_ID) { AddArgument("attr-name", "identify-time"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeIdentifyClusterReadIdentifyTimeAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /*----------------------------------------------------------------------------*\ |
| | Cluster Level | 0x0008 | |
| |------------------------------------------------------------------------------| |
| | Commands: | | |
| | * Move | 0x01 | |
| | * MoveToLevel | 0x00 | |
| | * MoveToLevelWithOnOff | 0x04 | |
| | * MoveWithOnOff | 0x05 | |
| | * Step | 0x02 | |
| | * StepWithOnOff | 0x06 | |
| | * Stop | 0x03 | |
| | * StopWithOnOff | 0x07 | |
| | | | |
| |------------------------------------------------------------------------------| |
| | Attributes:: | | |
| | * CurrentLevel | 0x0000 | |
| | * RemainingTime | 0x0001 | |
| | * Options | 0x000F | |
| \*----------------------------------------------------------------------------*/ |
| |
| /* |
| * Command Move |
| */ |
| class LevelMove : public ModelCommand |
| { |
| public: |
| LevelMove() : ModelCommand("move", LEVEL_CLUSTER_ID) |
| { |
| AddArgument("moveMode", 0, UINT8_MAX, &mMoveMode); |
| AddArgument("rate", 0, UINT8_MAX, &mRate); |
| AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask); |
| AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeLevelClusterMoveCommand(buffer->Start(), bufferSize, endPointId, mMoveMode, mRate, mOptionsMask, |
| mOptionsOverride); |
| } |
| |
| private: |
| uint8_t mMoveMode; |
| uint8_t mRate; |
| uint8_t mOptionsMask; |
| uint8_t mOptionsOverride; |
| }; |
| |
| /* |
| * Command MoveToLevel |
| */ |
| class LevelMoveToLevel : public ModelCommand |
| { |
| public: |
| LevelMoveToLevel() : ModelCommand("move-to-level", LEVEL_CLUSTER_ID) |
| { |
| AddArgument("level", 0, UINT8_MAX, &mLevel); |
| AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime); |
| AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask); |
| AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeLevelClusterMoveToLevelCommand(buffer->Start(), bufferSize, endPointId, mLevel, mTransitionTime, mOptionsMask, |
| mOptionsOverride); |
| } |
| |
| private: |
| uint8_t mLevel; |
| uint16_t mTransitionTime; |
| uint8_t mOptionsMask; |
| uint8_t mOptionsOverride; |
| }; |
| |
| /* |
| * Command MoveToLevelWithOnOff |
| */ |
| class LevelMoveToLevelWithOnOff : public ModelCommand |
| { |
| public: |
| LevelMoveToLevelWithOnOff() : ModelCommand("move-to-level-with-on-off", LEVEL_CLUSTER_ID) |
| { |
| AddArgument("level", 0, UINT8_MAX, &mLevel); |
| AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime); |
| AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask); |
| AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeLevelClusterMoveToLevelWithOnOffCommand(buffer->Start(), bufferSize, endPointId, mLevel, mTransitionTime, |
| mOptionsMask, mOptionsOverride); |
| } |
| |
| private: |
| uint8_t mLevel; |
| uint16_t mTransitionTime; |
| uint8_t mOptionsMask; |
| uint8_t mOptionsOverride; |
| }; |
| |
| /* |
| * Command MoveWithOnOff |
| */ |
| class LevelMoveWithOnOff : public ModelCommand |
| { |
| public: |
| LevelMoveWithOnOff() : ModelCommand("move-with-on-off", LEVEL_CLUSTER_ID) |
| { |
| AddArgument("moveMode", 0, UINT8_MAX, &mMoveMode); |
| AddArgument("rate", 0, UINT8_MAX, &mRate); |
| AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask); |
| AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeLevelClusterMoveWithOnOffCommand(buffer->Start(), bufferSize, endPointId, mMoveMode, mRate, mOptionsMask, |
| mOptionsOverride); |
| } |
| |
| private: |
| uint8_t mMoveMode; |
| uint8_t mRate; |
| uint8_t mOptionsMask; |
| uint8_t mOptionsOverride; |
| }; |
| |
| /* |
| * Command Step |
| */ |
| class LevelStep : public ModelCommand |
| { |
| public: |
| LevelStep() : ModelCommand("step", LEVEL_CLUSTER_ID) |
| { |
| AddArgument("stepMode", 0, UINT8_MAX, &mStepMode); |
| AddArgument("stepSize", 0, UINT8_MAX, &mStepSize); |
| AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime); |
| AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask); |
| AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeLevelClusterStepCommand(buffer->Start(), bufferSize, endPointId, mStepMode, mStepSize, mTransitionTime, |
| mOptionsMask, mOptionsOverride); |
| } |
| |
| private: |
| uint8_t mStepMode; |
| uint8_t mStepSize; |
| uint16_t mTransitionTime; |
| uint8_t mOptionsMask; |
| uint8_t mOptionsOverride; |
| }; |
| |
| /* |
| * Command StepWithOnOff |
| */ |
| class LevelStepWithOnOff : public ModelCommand |
| { |
| public: |
| LevelStepWithOnOff() : ModelCommand("step-with-on-off", LEVEL_CLUSTER_ID) |
| { |
| AddArgument("stepMode", 0, UINT8_MAX, &mStepMode); |
| AddArgument("stepSize", 0, UINT8_MAX, &mStepSize); |
| AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime); |
| AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask); |
| AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeLevelClusterStepWithOnOffCommand(buffer->Start(), bufferSize, endPointId, mStepMode, mStepSize, |
| mTransitionTime, mOptionsMask, mOptionsOverride); |
| } |
| |
| private: |
| uint8_t mStepMode; |
| uint8_t mStepSize; |
| uint16_t mTransitionTime; |
| uint8_t mOptionsMask; |
| uint8_t mOptionsOverride; |
| }; |
| |
| /* |
| * Command Stop |
| */ |
| class LevelStop : public ModelCommand |
| { |
| public: |
| LevelStop() : ModelCommand("stop", LEVEL_CLUSTER_ID) |
| { |
| AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask); |
| AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeLevelClusterStopCommand(buffer->Start(), bufferSize, endPointId, mOptionsMask, mOptionsOverride); |
| } |
| |
| private: |
| uint8_t mOptionsMask; |
| uint8_t mOptionsOverride; |
| }; |
| |
| /* |
| * Command StopWithOnOff |
| */ |
| class LevelStopWithOnOff : public ModelCommand |
| { |
| public: |
| LevelStopWithOnOff() : ModelCommand("stop-with-on-off", LEVEL_CLUSTER_ID) |
| { |
| AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask); |
| AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeLevelClusterStopWithOnOffCommand(buffer->Start(), bufferSize, endPointId, mOptionsMask, mOptionsOverride); |
| } |
| |
| private: |
| uint8_t mOptionsMask; |
| uint8_t mOptionsOverride; |
| }; |
| |
| /* |
| * Attribute CurrentLevel |
| */ |
| class ReadLevelCurrentLevel : public ModelCommand |
| { |
| public: |
| ReadLevelCurrentLevel() : ModelCommand("read", LEVEL_CLUSTER_ID) { AddArgument("attr-name", "current-level"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeLevelClusterReadCurrentLevelAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute RemainingTime |
| */ |
| class ReadLevelRemainingTime : public ModelCommand |
| { |
| public: |
| ReadLevelRemainingTime() : ModelCommand("read", LEVEL_CLUSTER_ID) { AddArgument("attr-name", "remaining-time"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeLevelClusterReadRemainingTimeAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute Options |
| */ |
| class ReadLevelOptions : public ModelCommand |
| { |
| public: |
| ReadLevelOptions() : ModelCommand("read", LEVEL_CLUSTER_ID) { AddArgument("attr-name", "options"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeLevelClusterReadOptionsAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /*----------------------------------------------------------------------------*\ |
| | Cluster OnOff | 0x0006 | |
| |------------------------------------------------------------------------------| |
| | Commands: | | |
| | * Off | 0x00 | |
| | * On | 0x01 | |
| | * Toggle | 0x02 | |
| | | | |
| |------------------------------------------------------------------------------| |
| | Attributes:: | | |
| | * OnOff | 0x0000 | |
| \*----------------------------------------------------------------------------*/ |
| |
| /* |
| * Command Off |
| */ |
| class OnOffOff : public ModelCommand |
| { |
| public: |
| OnOffOff() : ModelCommand("off", ON_OFF_CLUSTER_ID) {} |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeOnOffClusterOffCommand(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Command On |
| */ |
| class OnOffOn : public ModelCommand |
| { |
| public: |
| OnOffOn() : ModelCommand("on", ON_OFF_CLUSTER_ID) {} |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeOnOffClusterOnCommand(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Command Toggle |
| */ |
| class OnOffToggle : public ModelCommand |
| { |
| public: |
| OnOffToggle() : ModelCommand("toggle", ON_OFF_CLUSTER_ID) {} |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeOnOffClusterToggleCommand(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute OnOff |
| */ |
| class ReadOnOffOnOff : public ModelCommand |
| { |
| public: |
| ReadOnOffOnOff() : ModelCommand("read", ON_OFF_CLUSTER_ID) { AddArgument("attr-name", "on-off"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeOnOffClusterReadOnOffAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /*----------------------------------------------------------------------------*\ |
| | Cluster Scenes | 0x0005 | |
| |------------------------------------------------------------------------------| |
| | Commands: | | |
| | * AddScene | 0x00 | |
| | * CopyScene | 0x42 | |
| | * EnhancedAddScene | 0x40 | |
| | * EnhancedViewScene | 0x41 | |
| | * GetSceneMembership | 0x06 | |
| | * RecallScene | 0x05 | |
| | * RemoveAllScenes | 0x03 | |
| | * RemoveScene | 0x02 | |
| | * StoreScene | 0x04 | |
| | * ViewScene | 0x01 | |
| | | | |
| |------------------------------------------------------------------------------| |
| | Attributes:: | | |
| | * SceneCount | 0x0000 | |
| | * CurrentScene | 0x0001 | |
| | * CurrentGroup | 0x0002 | |
| | * SceneValid | 0x0003 | |
| | * NameSupport | 0x0004 | |
| \*----------------------------------------------------------------------------*/ |
| |
| /* |
| * Command AddScene |
| */ |
| class ScenesAddScene : public ModelCommand |
| { |
| public: |
| ScenesAddScene() : ModelCommand("add-scene", SCENES_CLUSTER_ID) |
| { |
| AddArgument("groupID", 0, UINT16_MAX, &mGroupID); |
| AddArgument("sceneID", 0, UINT8_MAX, &mSceneID); |
| AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime); |
| AddArgument("sceneName", &mSceneName); |
| // FIXME - SExtensionFieldSetList is not supported. |
| AddArgument("extensionFieldSets", &mExtensionFieldSets); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeScenesClusterAddSceneCommand(buffer->Start(), bufferSize, endPointId, mGroupID, mSceneID, mTransitionTime, |
| mSceneName, mExtensionFieldSets); |
| } |
| |
| // Cluster Specific Response: AddSceneResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint8_t status = chip::Encoding::Read8(message); |
| uint16_t groupID = chip::Encoding::LittleEndian::Read16(message); |
| uint8_t sceneID = chip::Encoding::Read8(message); |
| |
| ChipLogProgress(chipTool, "AddSceneResponse:"); |
| ChipLogProgress(chipTool, " status: 0x%02x", status); |
| ChipLogProgress(chipTool, " groupID: 0x%04x", groupID); |
| ChipLogProgress(chipTool, " sceneID: 0x%02x", sceneID); |
| |
| return true; |
| } |
| |
| private: |
| uint16_t mGroupID; |
| uint8_t mSceneID; |
| uint16_t mTransitionTime; |
| char * mSceneName; |
| void * mExtensionFieldSets; |
| }; |
| |
| /* |
| * Command CopyScene |
| */ |
| class ScenesCopyScene : public ModelCommand |
| { |
| public: |
| ScenesCopyScene() : ModelCommand("copy-scene", SCENES_CLUSTER_ID) |
| { |
| AddArgument("mode", 0, UINT8_MAX, &mMode); |
| AddArgument("groupIdentifierFrom", 0, UINT16_MAX, &mGroupIdentifierFrom); |
| AddArgument("sceneIdentifierFrom", 0, UINT8_MAX, &mSceneIdentifierFrom); |
| AddArgument("groupIdentifierTo", 0, UINT16_MAX, &mGroupIdentifierTo); |
| AddArgument("sceneIdentifierTo", 0, UINT8_MAX, &mSceneIdentifierTo); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeScenesClusterCopySceneCommand(buffer->Start(), bufferSize, endPointId, mMode, mGroupIdentifierFrom, |
| mSceneIdentifierFrom, mGroupIdentifierTo, mSceneIdentifierTo); |
| } |
| |
| // Cluster Specific Response: CopySceneResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint8_t status = chip::Encoding::Read8(message); |
| uint16_t groupIdentifierFrom = chip::Encoding::LittleEndian::Read16(message); |
| uint8_t sceneIdentifierFrom = chip::Encoding::Read8(message); |
| |
| ChipLogProgress(chipTool, "CopySceneResponse:"); |
| ChipLogProgress(chipTool, " status: 0x%02x", status); |
| ChipLogProgress(chipTool, " groupIdentifierFrom: 0x%04x", groupIdentifierFrom); |
| ChipLogProgress(chipTool, " sceneIdentifierFrom: 0x%02x", sceneIdentifierFrom); |
| |
| return true; |
| } |
| |
| private: |
| uint8_t mMode; |
| uint16_t mGroupIdentifierFrom; |
| uint8_t mSceneIdentifierFrom; |
| uint16_t mGroupIdentifierTo; |
| uint8_t mSceneIdentifierTo; |
| }; |
| |
| /* |
| * Command EnhancedAddScene |
| */ |
| class ScenesEnhancedAddScene : public ModelCommand |
| { |
| public: |
| ScenesEnhancedAddScene() : ModelCommand("enhanced-add-scene", SCENES_CLUSTER_ID) |
| { |
| AddArgument("groupID", 0, UINT16_MAX, &mGroupID); |
| AddArgument("sceneID", 0, UINT8_MAX, &mSceneID); |
| AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime); |
| AddArgument("sceneName", &mSceneName); |
| // FIXME - SExtensionFieldSetList is not supported. |
| AddArgument("extensionFieldSets", &mExtensionFieldSets); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeScenesClusterEnhancedAddSceneCommand(buffer->Start(), bufferSize, endPointId, mGroupID, mSceneID, |
| mTransitionTime, mSceneName, mExtensionFieldSets); |
| } |
| |
| // Cluster Specific Response: EnhancedAddSceneResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint8_t status = chip::Encoding::Read8(message); |
| uint16_t groupID = chip::Encoding::LittleEndian::Read16(message); |
| uint8_t sceneID = chip::Encoding::Read8(message); |
| |
| ChipLogProgress(chipTool, "EnhancedAddSceneResponse:"); |
| ChipLogProgress(chipTool, " status: 0x%02x", status); |
| ChipLogProgress(chipTool, " groupID: 0x%04x", groupID); |
| ChipLogProgress(chipTool, " sceneID: 0x%02x", sceneID); |
| |
| return true; |
| } |
| |
| private: |
| uint16_t mGroupID; |
| uint8_t mSceneID; |
| uint16_t mTransitionTime; |
| char * mSceneName; |
| void * mExtensionFieldSets; |
| }; |
| |
| /* |
| * Command EnhancedViewScene |
| */ |
| class ScenesEnhancedViewScene : public ModelCommand |
| { |
| public: |
| ScenesEnhancedViewScene() : ModelCommand("enhanced-view-scene", SCENES_CLUSTER_ID) |
| { |
| AddArgument("groupID", 0, UINT16_MAX, &mGroupID); |
| AddArgument("sceneID", 0, UINT8_MAX, &mSceneID); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeScenesClusterEnhancedViewSceneCommand(buffer->Start(), bufferSize, endPointId, mGroupID, mSceneID); |
| } |
| |
| // Cluster Specific Response: EnhancedViewSceneResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint8_t status = chip::Encoding::Read8(message); |
| uint16_t groupID = chip::Encoding::LittleEndian::Read16(message); |
| uint8_t sceneID = chip::Encoding::Read8(message); |
| uint16_t transitionTime = chip::Encoding::LittleEndian::Read16(message); |
| uint8_t msgLen = chip::Encoding::Read8(message); |
| // FIXME - SExtensionFieldSetList is not supported. |
| void * extensionFieldSets; |
| |
| ChipLogProgress(chipTool, "EnhancedViewSceneResponse:"); |
| ChipLogProgress(chipTool, " status: 0x%02x", status); |
| ChipLogProgress(chipTool, " groupID: 0x%04x", groupID); |
| ChipLogProgress(chipTool, " sceneID: 0x%02x", sceneID); |
| ChipLogProgress(chipTool, " transitionTime: 0x%04x", transitionTime); |
| ChipLogProgress(chipTool, " sceneName len: 0x%02x", msgLen); |
| |
| return true; |
| } |
| |
| private: |
| uint16_t mGroupID; |
| uint8_t mSceneID; |
| }; |
| |
| /* |
| * Command GetSceneMembership |
| */ |
| class ScenesGetSceneMembership : public ModelCommand |
| { |
| public: |
| ScenesGetSceneMembership() : ModelCommand("get-scene-membership", SCENES_CLUSTER_ID) |
| { |
| AddArgument("groupID", 0, UINT16_MAX, &mGroupID); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeScenesClusterGetSceneMembershipCommand(buffer->Start(), bufferSize, endPointId, mGroupID); |
| } |
| |
| // Cluster Specific Response: GetSceneMembershipResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint8_t status = chip::Encoding::Read8(message); |
| uint8_t capacity = chip::Encoding::Read8(message); |
| uint16_t groupID = chip::Encoding::LittleEndian::Read16(message); |
| uint8_t sceneList = chip::Encoding::Read8(message); |
| |
| ChipLogProgress(chipTool, "GetSceneMembershipResponse:"); |
| ChipLogProgress(chipTool, " status: 0x%02x", status); |
| ChipLogProgress(chipTool, " capacity: 0x%02x", capacity); |
| ChipLogProgress(chipTool, " groupID: 0x%04x", groupID); |
| ChipLogProgress(chipTool, " sceneList: 0x%02x", sceneList); |
| |
| return true; |
| } |
| |
| private: |
| uint16_t mGroupID; |
| }; |
| |
| /* |
| * Command RecallScene |
| */ |
| class ScenesRecallScene : public ModelCommand |
| { |
| public: |
| ScenesRecallScene() : ModelCommand("recall-scene", SCENES_CLUSTER_ID) |
| { |
| AddArgument("groupID", 0, UINT16_MAX, &mGroupID); |
| AddArgument("sceneID", 0, UINT8_MAX, &mSceneID); |
| AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeScenesClusterRecallSceneCommand(buffer->Start(), bufferSize, endPointId, mGroupID, mSceneID, mTransitionTime); |
| } |
| |
| private: |
| uint16_t mGroupID; |
| uint8_t mSceneID; |
| uint16_t mTransitionTime; |
| }; |
| |
| /* |
| * Command RemoveAllScenes |
| */ |
| class ScenesRemoveAllScenes : public ModelCommand |
| { |
| public: |
| ScenesRemoveAllScenes() : ModelCommand("remove-all-scenes", SCENES_CLUSTER_ID) |
| { |
| AddArgument("groupID", 0, UINT16_MAX, &mGroupID); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeScenesClusterRemoveAllScenesCommand(buffer->Start(), bufferSize, endPointId, mGroupID); |
| } |
| |
| // Cluster Specific Response: RemoveAllScenesResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint8_t status = chip::Encoding::Read8(message); |
| uint16_t groupID = chip::Encoding::LittleEndian::Read16(message); |
| |
| ChipLogProgress(chipTool, "RemoveAllScenesResponse:"); |
| ChipLogProgress(chipTool, " status: 0x%02x", status); |
| ChipLogProgress(chipTool, " groupID: 0x%04x", groupID); |
| |
| return true; |
| } |
| |
| private: |
| uint16_t mGroupID; |
| }; |
| |
| /* |
| * Command RemoveScene |
| */ |
| class ScenesRemoveScene : public ModelCommand |
| { |
| public: |
| ScenesRemoveScene() : ModelCommand("remove-scene", SCENES_CLUSTER_ID) |
| { |
| AddArgument("groupID", 0, UINT16_MAX, &mGroupID); |
| AddArgument("sceneID", 0, UINT8_MAX, &mSceneID); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeScenesClusterRemoveSceneCommand(buffer->Start(), bufferSize, endPointId, mGroupID, mSceneID); |
| } |
| |
| // Cluster Specific Response: RemoveSceneResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint8_t status = chip::Encoding::Read8(message); |
| uint16_t groupID = chip::Encoding::LittleEndian::Read16(message); |
| uint8_t sceneID = chip::Encoding::Read8(message); |
| |
| ChipLogProgress(chipTool, "RemoveSceneResponse:"); |
| ChipLogProgress(chipTool, " status: 0x%02x", status); |
| ChipLogProgress(chipTool, " groupID: 0x%04x", groupID); |
| ChipLogProgress(chipTool, " sceneID: 0x%02x", sceneID); |
| |
| return true; |
| } |
| |
| private: |
| uint16_t mGroupID; |
| uint8_t mSceneID; |
| }; |
| |
| /* |
| * Command StoreScene |
| */ |
| class ScenesStoreScene : public ModelCommand |
| { |
| public: |
| ScenesStoreScene() : ModelCommand("store-scene", SCENES_CLUSTER_ID) |
| { |
| AddArgument("groupID", 0, UINT16_MAX, &mGroupID); |
| AddArgument("sceneID", 0, UINT8_MAX, &mSceneID); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeScenesClusterStoreSceneCommand(buffer->Start(), bufferSize, endPointId, mGroupID, mSceneID); |
| } |
| |
| // Cluster Specific Response: StoreSceneResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint8_t status = chip::Encoding::Read8(message); |
| uint16_t groupID = chip::Encoding::LittleEndian::Read16(message); |
| uint8_t sceneID = chip::Encoding::Read8(message); |
| |
| ChipLogProgress(chipTool, "StoreSceneResponse:"); |
| ChipLogProgress(chipTool, " status: 0x%02x", status); |
| ChipLogProgress(chipTool, " groupID: 0x%04x", groupID); |
| ChipLogProgress(chipTool, " sceneID: 0x%02x", sceneID); |
| |
| return true; |
| } |
| |
| private: |
| uint16_t mGroupID; |
| uint8_t mSceneID; |
| }; |
| |
| /* |
| * Command ViewScene |
| */ |
| class ScenesViewScene : public ModelCommand |
| { |
| public: |
| ScenesViewScene() : ModelCommand("view-scene", SCENES_CLUSTER_ID) |
| { |
| AddArgument("groupID", 0, UINT16_MAX, &mGroupID); |
| AddArgument("sceneID", 0, UINT8_MAX, &mSceneID); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeScenesClusterViewSceneCommand(buffer->Start(), bufferSize, endPointId, mGroupID, mSceneID); |
| } |
| |
| // Cluster Specific Response: ViewSceneResponse |
| bool HandleClusterResponse(uint8_t * message, uint16_t messageLen) const override |
| { |
| uint8_t status = chip::Encoding::Read8(message); |
| uint16_t groupID = chip::Encoding::LittleEndian::Read16(message); |
| uint8_t sceneID = chip::Encoding::Read8(message); |
| uint16_t transitionTime = chip::Encoding::LittleEndian::Read16(message); |
| uint8_t msgLen = chip::Encoding::Read8(message); |
| // FIXME - SExtensionFieldSetList is not supported. |
| void * extensionFieldSets; |
| |
| ChipLogProgress(chipTool, "ViewSceneResponse:"); |
| ChipLogProgress(chipTool, " status: 0x%02x", status); |
| ChipLogProgress(chipTool, " groupID: 0x%04x", groupID); |
| ChipLogProgress(chipTool, " sceneID: 0x%02x", sceneID); |
| ChipLogProgress(chipTool, " transitionTime: 0x%04x", transitionTime); |
| ChipLogProgress(chipTool, " sceneName len: 0x%02x", msgLen); |
| |
| return true; |
| } |
| |
| private: |
| uint16_t mGroupID; |
| uint8_t mSceneID; |
| }; |
| |
| /* |
| * Attribute SceneCount |
| */ |
| class ReadScenesSceneCount : public ModelCommand |
| { |
| public: |
| ReadScenesSceneCount() : ModelCommand("read", SCENES_CLUSTER_ID) { AddArgument("attr-name", "scene-count"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeScenesClusterReadSceneCountAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute CurrentScene |
| */ |
| class ReadScenesCurrentScene : public ModelCommand |
| { |
| public: |
| ReadScenesCurrentScene() : ModelCommand("read", SCENES_CLUSTER_ID) { AddArgument("attr-name", "current-scene"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeScenesClusterReadCurrentSceneAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute CurrentGroup |
| */ |
| class ReadScenesCurrentGroup : public ModelCommand |
| { |
| public: |
| ReadScenesCurrentGroup() : ModelCommand("read", SCENES_CLUSTER_ID) { AddArgument("attr-name", "current-group"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeScenesClusterReadCurrentGroupAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute SceneValid |
| */ |
| class ReadScenesSceneValid : public ModelCommand |
| { |
| public: |
| ReadScenesSceneValid() : ModelCommand("read", SCENES_CLUSTER_ID) { AddArgument("attr-name", "scene-valid"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeScenesClusterReadSceneValidAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute NameSupport |
| */ |
| class ReadScenesNameSupport : public ModelCommand |
| { |
| public: |
| ReadScenesNameSupport() : ModelCommand("read", SCENES_CLUSTER_ID) { AddArgument("attr-name", "name-support"); } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeScenesClusterReadNameSupportAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /*----------------------------------------------------------------------------*\ |
| | Cluster TemperatureMeasurement | 0x0402 | |
| |------------------------------------------------------------------------------| |
| | Commands: | | |
| | | | |
| |------------------------------------------------------------------------------| |
| | Attributes:: | | |
| | * MeasuredValue | 0x0000 | |
| | * MinMeasuredValue | 0x0001 | |
| | * MaxMeasuredValue | 0x0002 | |
| \*----------------------------------------------------------------------------*/ |
| |
| /* |
| * Attribute MeasuredValue |
| */ |
| class ReadTemperatureMeasurementMeasuredValue : public ModelCommand |
| { |
| public: |
| ReadTemperatureMeasurementMeasuredValue() : ModelCommand("read", TEMPERATURE_MEASUREMENT_CLUSTER_ID) |
| { |
| AddArgument("attr-name", "measured-value"); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeTemperatureMeasurementClusterReadMeasuredValueAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute MinMeasuredValue |
| */ |
| class ReadTemperatureMeasurementMinMeasuredValue : public ModelCommand |
| { |
| public: |
| ReadTemperatureMeasurementMinMeasuredValue() : ModelCommand("read", TEMPERATURE_MEASUREMENT_CLUSTER_ID) |
| { |
| AddArgument("attr-name", "min-measured-value"); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeTemperatureMeasurementClusterReadMinMeasuredValueAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /* |
| * Attribute MaxMeasuredValue |
| */ |
| class ReadTemperatureMeasurementMaxMeasuredValue : public ModelCommand |
| { |
| public: |
| ReadTemperatureMeasurementMaxMeasuredValue() : ModelCommand("read", TEMPERATURE_MEASUREMENT_CLUSTER_ID) |
| { |
| AddArgument("attr-name", "max-measured-value"); |
| } |
| |
| size_t EncodeCommand(PacketBuffer * buffer, size_t bufferSize, uint16_t endPointId) override |
| { |
| return encodeTemperatureMeasurementClusterReadMaxMeasuredValueAttribute(buffer->Start(), bufferSize, endPointId); |
| } |
| }; |
| |
| /*----------------------------------------------------------------------------*\ |
| | Register all Clusters commands | |
| \*----------------------------------------------------------------------------*/ |
| void registerClusterBarrierControl(Commands & commands) |
| { |
| const char * clusterName = "BarrierControl"; |
| |
| commands_list clusterCommands = { |
| make_unique<BarrierControlGoToPercent>(), make_unique<ReadBarrierControlMovingState>(), |
| make_unique<ReadBarrierControlSafetyStatus>(), make_unique<ReadBarrierControlCapabilities>(), |
| make_unique<ReadBarrierControlBarrierPosition>(), |
| }; |
| |
| commands.Register(clusterName, clusterCommands); |
| } |
| |
| void registerClusterBasic(Commands & commands) |
| { |
| const char * clusterName = "Basic"; |
| |
| commands_list clusterCommands = { |
| make_unique<BasicResetToFactoryDefaults>(), make_unique<ReadBasicZCLVersion>(), |
| make_unique<ReadBasicApplicationVersion>(), make_unique<ReadBasicStackVersion>(), |
| make_unique<ReadBasicHWVersion>(), make_unique<ReadBasicManufacturerName>(), |
| make_unique<ReadBasicModelIdentifier>(), make_unique<ReadBasicDateCode>(), |
| make_unique<ReadBasicPowerSource>(), make_unique<ReadBasicGenericDeviceClass>(), |
| make_unique<ReadBasicGenericDeviceType>(), make_unique<ReadBasicProductCode>(), |
| make_unique<ReadBasicProductURL>(), make_unique<ReadBasicSWBuildID>(), |
| }; |
| |
| commands.Register(clusterName, clusterCommands); |
| } |
| |
| void registerClusterColorControl(Commands & commands) |
| { |
| const char * clusterName = "ColorControl"; |
| |
| commands_list clusterCommands = { |
| make_unique<ColorControlMoveColor>(), |
| make_unique<ColorControlMoveColorTemperature>(), |
| make_unique<ColorControlMoveHue>(), |
| make_unique<ColorControlMoveSaturation>(), |
| make_unique<ColorControlMoveToColor>(), |
| make_unique<ColorControlMoveToColorTemperature>(), |
| make_unique<ColorControlMoveToHue>(), |
| make_unique<ColorControlMoveToHueAndSaturation>(), |
| make_unique<ColorControlMoveToSaturation>(), |
| make_unique<ColorControlStepColor>(), |
| make_unique<ColorControlStepColorTemperature>(), |
| make_unique<ColorControlStepHue>(), |
| make_unique<ColorControlStepSaturation>(), |
| make_unique<ColorControlStopMoveStep>(), |
| make_unique<ReadColorControlCurrentHue>(), |
| make_unique<ReadColorControlCurrentSaturation>(), |
| make_unique<ReadColorControlCurrentX>(), |
| make_unique<ReadColorControlCurrentY>(), |
| make_unique<ReadColorControlColorTemperatureMireds>(), |
| make_unique<ReadColorControlColorMode>(), |
| make_unique<ReadColorControlOptions>(), |
| make_unique<ReadColorControlNumberOfPrimaries>(), |
| make_unique<ReadColorControlPrimary1X>(), |
| make_unique<ReadColorControlPrimary1Y>(), |
| make_unique<ReadColorControlPrimary1Intensity>(), |
| make_unique<ReadColorControlPrimary2X>(), |
| make_unique<ReadColorControlPrimary2Y>(), |
| make_unique<ReadColorControlPrimary2Intensity>(), |
| make_unique<ReadColorControlPrimary3X>(), |
| make_unique<ReadColorControlPrimary3Y>(), |
| make_unique<ReadColorControlPrimary3Intensity>(), |
| make_unique<ReadColorControlPrimary4X>(), |
| make_unique<ReadColorControlPrimary4Y>(), |
| make_unique<ReadColorControlPrimary4Intensity>(), |
| make_unique<ReadColorControlPrimary5X>(), |
| make_unique<ReadColorControlPrimary5Y>(), |
| make_unique<ReadColorControlPrimary5Intensity>(), |
| make_unique<ReadColorControlPrimary6X>(), |
| make_unique<ReadColorControlPrimary6Y>(), |
| make_unique<ReadColorControlPrimary6Intensity>(), |
| make_unique<ReadColorControlEnhancedCurrentHue>(), |
| make_unique<ReadColorControlEnhancedColorMode>(), |
| make_unique<ReadColorControlColorLoopActive>(), |
| make_unique<ReadColorControlColorLoopDirection>(), |
| make_unique<ReadColorControlColorLoopTime>(), |
| make_unique<ReadColorControlColorLoopStartEnhancedHue>(), |
| make_unique<ReadColorControlColorLoopStoredEnhancedHue>(), |
| make_unique<ReadColorControlColorCapabilities>(), |
| make_unique<ReadColorControlColorTempPhysicalMinMireds>(), |
| make_unique<ReadColorControlColorTempPhysicalMaxMireds>(), |
| make_unique<ReadColorControlCoupleColorTempToLevelMinMireds>(), |
| make_unique<ReadColorControlStartUpColorTemperatureMireds>(), |
| }; |
| |
| commands.Register(clusterName, clusterCommands); |
| } |
| |
| void registerClusterDoorLock(Commands & commands) |
| { |
| const char * clusterName = "DoorLock"; |
| |
| commands_list clusterCommands = { |
| make_unique<DoorLockClearAllPINCodes>(), |
| make_unique<DoorLockClearAllRFIDCodes>(), |
| make_unique<DoorLockClearHolidaySchedule>(), |
| make_unique<DoorLockClearPINCode>(), |
| make_unique<DoorLockClearRFIDCode>(), |
| make_unique<DoorLockClearWeekdaySchedule>(), |
| make_unique<DoorLockClearYearDaySchedule>(), |
| make_unique<DoorLockGetHolidaySchedule>(), |
| make_unique<DoorLockGetLogRecord>(), |
| make_unique<DoorLockGetPINCode>(), |
| make_unique<DoorLockGetRFIDCode>(), |
| make_unique<DoorLockGetUserType>(), |
| make_unique<DoorLockGetWeekdaySchedule>(), |
| make_unique<DoorLockGetYearDaySchedule>(), |
| make_unique<DoorLockLockDoor>(), |
| make_unique<DoorLockSetHolidaySchedule>(), |
| make_unique<DoorLockSetPINCode>(), |
| make_unique<DoorLockSetRFIDCode>(), |
| make_unique<DoorLockSetUserType>(), |
| make_unique<DoorLockSetWeekdaySchedule>(), |
| make_unique<DoorLockSetYearDaySchedule>(), |
| make_unique<DoorLockUnlockDoor>(), |
| make_unique<DoorLockUnlockWithTimeout>(), |
| make_unique<ReadDoorLockLockState>(), |
| make_unique<ReadDoorLockLockType>(), |
| make_unique<ReadDoorLockActuatorEnabled>(), |
| }; |
| |
| commands.Register(clusterName, clusterCommands); |
| } |
| |
| void registerClusterGroups(Commands & commands) |
| { |
| const char * clusterName = "Groups"; |
| |
| commands_list clusterCommands = { |
| make_unique<GroupsAddGroup>(), make_unique<GroupsAddGroupIfIdentifying>(), make_unique<GroupsGetGroupMembership>(), |
| make_unique<GroupsRemoveAllGroups>(), make_unique<GroupsRemoveGroup>(), make_unique<GroupsViewGroup>(), |
| make_unique<ReadGroupsNameSupport>(), |
| }; |
| |
| commands.Register(clusterName, clusterCommands); |
| } |
| |
| void registerClusterIdentify(Commands & commands) |
| { |
| const char * clusterName = "Identify"; |
| |
| commands_list clusterCommands = { |
| make_unique<IdentifyIdentify>(), |
| make_unique<IdentifyIdentifyQuery>(), |
| make_unique<ReadIdentifyIdentifyTime>(), |
| }; |
| |
| commands.Register(clusterName, clusterCommands); |
| } |
| |
| void registerClusterLevel(Commands & commands) |
| { |
| const char * clusterName = "Level"; |
| |
| commands_list clusterCommands = { |
| make_unique<LevelMove>(), |
| make_unique<LevelMoveToLevel>(), |
| make_unique<LevelMoveToLevelWithOnOff>(), |
| make_unique<LevelMoveWithOnOff>(), |
| make_unique<LevelStep>(), |
| make_unique<LevelStepWithOnOff>(), |
| make_unique<LevelStop>(), |
| make_unique<LevelStopWithOnOff>(), |
| make_unique<ReadLevelCurrentLevel>(), |
| make_unique<ReadLevelRemainingTime>(), |
| make_unique<ReadLevelOptions>(), |
| }; |
| |
| commands.Register(clusterName, clusterCommands); |
| } |
| |
| void registerClusterOnOff(Commands & commands) |
| { |
| const char * clusterName = "OnOff"; |
| |
| commands_list clusterCommands = { |
| make_unique<OnOffOff>(), |
| make_unique<OnOffOn>(), |
| make_unique<OnOffToggle>(), |
| make_unique<ReadOnOffOnOff>(), |
| }; |
| |
| commands.Register(clusterName, clusterCommands); |
| } |
| |
| void registerClusterScenes(Commands & commands) |
| { |
| const char * clusterName = "Scenes"; |
| |
| commands_list clusterCommands = { |
| make_unique<ScenesAddScene>(), make_unique<ScenesCopyScene>(), make_unique<ScenesEnhancedAddScene>(), |
| make_unique<ScenesEnhancedViewScene>(), make_unique<ScenesGetSceneMembership>(), make_unique<ScenesRecallScene>(), |
| make_unique<ScenesRemoveAllScenes>(), make_unique<ScenesRemoveScene>(), make_unique<ScenesStoreScene>(), |
| make_unique<ScenesViewScene>(), make_unique<ReadScenesSceneCount>(), make_unique<ReadScenesCurrentScene>(), |
| make_unique<ReadScenesCurrentGroup>(), make_unique<ReadScenesSceneValid>(), make_unique<ReadScenesNameSupport>(), |
| }; |
| |
| commands.Register(clusterName, clusterCommands); |
| } |
| |
| void registerClusterTemperatureMeasurement(Commands & commands) |
| { |
| const char * clusterName = "TemperatureMeasurement"; |
| |
| commands_list clusterCommands = { |
| make_unique<ReadTemperatureMeasurementMeasuredValue>(), |
| make_unique<ReadTemperatureMeasurementMinMeasuredValue>(), |
| make_unique<ReadTemperatureMeasurementMaxMeasuredValue>(), |
| }; |
| |
| commands.Register(clusterName, clusterCommands); |
| } |
| |
| void registerClusters(Commands & commands) |
| { |
| registerClusterBarrierControl(commands); |
| registerClusterBasic(commands); |
| registerClusterColorControl(commands); |
| registerClusterDoorLock(commands); |
| registerClusterGroups(commands); |
| registerClusterIdentify(commands); |
| registerClusterLevel(commands); |
| registerClusterOnOff(commands); |
| registerClusterScenes(commands); |
| registerClusterTemperatureMeasurement(commands); |
| } |