9#include "matter_bridged_device.h"
15 uint16_t
GetDeviceType()
const override {
return Nrf::MatterBridgedDevice::DeviceType::GenericSwitch; }
16 CHIP_ERROR
HandleRead(chip::ClusterId clusterId, chip::AttributeId attributeId, uint8_t *buffer,
17 uint16_t maxReadLength)
override;
19 size_t dataSize)
override;
20 CHIP_ERROR
HandleWrite(chip::ClusterId clusterId, chip::AttributeId attributeId, uint8_t *buffer,
23 if (clusterId != chip::app::Clusters::BridgedDeviceBasicInformation::Id) {
24 return CHIP_ERROR_INVALID_ARGUMENT;
27 switch (attributeId) {
28 case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::NodeLabel::Id:
29 return HandleWriteDeviceBasicInformation(clusterId, attributeId, buffer, size);
31 return CHIP_ERROR_INVALID_ARGUMENT;
37 CHIP_ERROR HandleReadSwitch(chip::AttributeId attributeId, uint8_t *buffer, uint16_t maxReadLength);
39 static constexpr uint16_t GetSwitchClusterRevision() {
return 1; }
41 static constexpr uint32_t GetSwitchClusterFeatureMap() {
return 2; }
42 static constexpr uint32_t GetSwitchClusterNumberOfPositions() {
return 2; }
44 uint8_t mCurrentPosition{};
GenericSwitchDevice(const char *nodeLabel)
uint16_t GetDeviceType() const override
Definition: generic_switch.h:15
CHIP_ERROR HandleRead(chip::ClusterId clusterId, chip::AttributeId attributeId, uint8_t *buffer, uint16_t maxReadLength) override
CHIP_ERROR HandleWrite(chip::ClusterId clusterId, chip::AttributeId attributeId, uint8_t *buffer, size_t size) override
Definition: generic_switch.h:20
CHIP_ERROR HandleAttributeChange(chip::ClusterId clusterId, chip::AttributeId attributeId, void *data, size_t dataSize) override
Definition: generic_switch.h:11