45729 lines
1.8 MiB
45729 lines
1.8 MiB
/*
|
|
*
|
|
* Copyright (c) 2022 Project CHIP Authors
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* 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
|
|
|
|
/**
|
|
* @file
|
|
* This file contains definitions for accessors around clusters attributes.
|
|
*/
|
|
|
|
#include <app-common/zap-generated/attributes/Accessors.h>
|
|
|
|
#include <app-common/zap-generated/attribute-type.h>
|
|
#include <app-common/zap-generated/ids/Attributes.h>
|
|
#include <app-common/zap-generated/ids/Clusters.h>
|
|
#include <app/util/attribute-storage-null-handling.h>
|
|
#include <app/util/attribute-table.h>
|
|
#include <app/util/odd-sized-integers.h>
|
|
#include <lib/core/CHIPEncoding.h>
|
|
#include <lib/support/logging/CHIPLogging.h>
|
|
|
|
namespace chip {
|
|
namespace app {
|
|
namespace Clusters {
|
|
|
|
namespace Identify {
|
|
namespace Attributes {
|
|
|
|
namespace IdentifyTime {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Identify::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Identify::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Identify::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace IdentifyTime
|
|
|
|
namespace IdentifyType {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::Identify::IdentifyTypeEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::Identify::IdentifyTypeEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Identify::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Identify::IdentifyTypeEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::Identify::IdentifyTypeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Identify::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Identify::IdentifyTypeEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::Identify::IdentifyTypeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Identify::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace IdentifyType
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Identify::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Identify::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Identify::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Identify::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Identify::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Identify::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // Identify
|
|
|
|
namespace Groups {
|
|
namespace Attributes {
|
|
|
|
namespace NameSupport {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::Groups::NameSupportBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::Groups::NameSupportBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Groups::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::Groups::NameSupportBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::Groups::NameSupportBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Groups::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::Groups::NameSupportBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::Groups::NameSupportBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Groups::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace NameSupport
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Groups::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Groups::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Groups::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Groups::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Groups::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Groups::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // Groups
|
|
|
|
namespace OnOff {
|
|
namespace Attributes {
|
|
|
|
namespace OnOff {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value)
|
|
{ using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OnOff::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OnOff::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OnOff::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace OnOff
|
|
|
|
namespace GlobalSceneControl {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value)
|
|
{ using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OnOff::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OnOff::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OnOff::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace GlobalSceneControl
|
|
|
|
namespace OnTime {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OnOff::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OnOff::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OnOff::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace OnTime
|
|
|
|
namespace OffWaitTime {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OnOff::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OnOff::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OnOff::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace OffWaitTime
|
|
|
|
namespace StartUpOnOff {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::app::Clusters::OnOff::StartUpOnOffEnum> & value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::OnOff::StartUpOnOffEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OnOff::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::OnOff::StartUpOnOffEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::OnOff::StartUpOnOffEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OnOff::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::OnOff::StartUpOnOffEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::OnOff::StartUpOnOffEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OnOff::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::OnOff::StartUpOnOffEnum>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OnOff::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::OnOff::StartUpOnOffEnum>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OnOff::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::app::Clusters::OnOff::StartUpOnOffEnum> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::app::Clusters::OnOff::StartUpOnOffEnum> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace StartUpOnOff
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OnOff::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OnOff::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OnOff::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OnOff::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OnOff::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OnOff::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // OnOff
|
|
|
|
namespace LevelControl {
|
|
namespace Attributes {
|
|
|
|
namespace CurrentLevel {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LevelControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LevelControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace CurrentLevel
|
|
|
|
namespace RemainingTime {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LevelControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace RemainingTime
|
|
|
|
namespace MinLevel {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LevelControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace MinLevel
|
|
|
|
namespace MaxLevel {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LevelControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace MaxLevel
|
|
|
|
namespace CurrentFrequency {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LevelControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace CurrentFrequency
|
|
|
|
namespace MinFrequency {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LevelControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace MinFrequency
|
|
|
|
namespace MaxFrequency {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LevelControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace MaxFrequency
|
|
|
|
namespace Options {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::LevelControl::OptionsBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::LevelControl::OptionsBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::LevelControl::OptionsBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::LevelControl::OptionsBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LevelControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::LevelControl::OptionsBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::LevelControl::OptionsBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Options
|
|
|
|
namespace OnOffTransitionTime {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LevelControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace OnOffTransitionTime
|
|
|
|
namespace OnLevel {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LevelControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LevelControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace OnLevel
|
|
|
|
namespace OnTransitionTime {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LevelControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LevelControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace OnTransitionTime
|
|
|
|
namespace OffTransitionTime {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LevelControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LevelControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace OffTransitionTime
|
|
|
|
namespace DefaultMoveRate {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LevelControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LevelControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace DefaultMoveRate
|
|
|
|
namespace StartUpCurrentLevel {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LevelControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LevelControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace StartUpCurrentLevel
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LevelControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LevelControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // LevelControl
|
|
|
|
namespace PulseWidthModulation {
|
|
namespace Attributes {
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PulseWidthModulation::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PulseWidthModulation::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PulseWidthModulation::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PulseWidthModulation::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PulseWidthModulation::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PulseWidthModulation::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // PulseWidthModulation
|
|
|
|
namespace Descriptor {
|
|
namespace Attributes {
|
|
|
|
} // namespace Attributes
|
|
} // Descriptor
|
|
|
|
namespace Binding {
|
|
namespace Attributes {
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Binding::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Binding::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Binding::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Binding::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Binding::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Binding::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // Binding
|
|
|
|
namespace AccessControl {
|
|
namespace Attributes {
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::AccessControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::AccessControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::AccessControl::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
} // namespace Attributes
|
|
} // AccessControl
|
|
|
|
namespace Actions {
|
|
namespace Attributes {
|
|
|
|
namespace SetupURL {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value)
|
|
{
|
|
uint8_t zclString[512 + 2];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Actions::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfLongStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint16_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 512, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[2], 512);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(512 < NumericAttributeTraits<uint16_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 512, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[512 + 2];
|
|
auto length = static_cast<uint16_t>(value.size());
|
|
Encoding::LittleEndian::Put16(zclString, length);
|
|
memcpy(&zclString[2], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Actions::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_LONG_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value)
|
|
{
|
|
|
|
static_assert(512 < NumericAttributeTraits<uint16_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 512, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[512 + 2];
|
|
auto length = static_cast<uint16_t>(value.size());
|
|
Encoding::LittleEndian::Put16(zclString, length);
|
|
memcpy(&zclString[2], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::Actions::Id, Id, zclString, ZCL_LONG_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace SetupURL
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Actions::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Actions::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Actions::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Actions::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Actions::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Actions::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // Actions
|
|
|
|
namespace BasicInformation {
|
|
namespace Attributes {
|
|
|
|
namespace NodeLabel {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value)
|
|
{
|
|
uint8_t zclString[32 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BasicInformation::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 32, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[1], 32);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(32 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 32, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[32 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BasicInformation::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value)
|
|
{
|
|
|
|
static_assert(32 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 32, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[32 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::BasicInformation::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace NodeLabel
|
|
|
|
namespace LocalConfigDisabled {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value)
|
|
{ using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BasicInformation::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BasicInformation::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BasicInformation::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace LocalConfigDisabled
|
|
|
|
namespace Reachable {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value)
|
|
{ using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BasicInformation::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BasicInformation::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BasicInformation::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Reachable
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BasicInformation::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BasicInformation::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BasicInformation::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BasicInformation::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BasicInformation::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BasicInformation::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // BasicInformation
|
|
|
|
namespace OtaSoftwareUpdateProvider {
|
|
namespace Attributes {
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OtaSoftwareUpdateProvider::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OtaSoftwareUpdateProvider::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OtaSoftwareUpdateProvider::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OtaSoftwareUpdateProvider::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OtaSoftwareUpdateProvider::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OtaSoftwareUpdateProvider::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // OtaSoftwareUpdateProvider
|
|
|
|
namespace OtaSoftwareUpdateRequestor {
|
|
namespace Attributes {
|
|
|
|
namespace UpdatePossible {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value)
|
|
{ using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace UpdatePossible
|
|
|
|
namespace UpdateState {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::OtaSoftwareUpdateRequestor::UpdateStateEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::OtaSoftwareUpdateRequestor::UpdateStateEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::OtaSoftwareUpdateRequestor::UpdateStateEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::OtaSoftwareUpdateRequestor::UpdateStateEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::OtaSoftwareUpdateRequestor::UpdateStateEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::OtaSoftwareUpdateRequestor::UpdateStateEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace UpdateState
|
|
|
|
namespace UpdateStateProgress {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace UpdateStateProgress
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // OtaSoftwareUpdateRequestor
|
|
|
|
namespace LocalizationConfiguration {
|
|
namespace Attributes {
|
|
|
|
namespace ActiveLocale {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value)
|
|
{
|
|
uint8_t zclString[35 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LocalizationConfiguration::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 35, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[1], 35);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(35 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 35, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[35 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LocalizationConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value)
|
|
{
|
|
|
|
static_assert(35 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 35, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[35 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::LocalizationConfiguration::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ActiveLocale
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LocalizationConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LocalizationConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LocalizationConfiguration::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LocalizationConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LocalizationConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LocalizationConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // LocalizationConfiguration
|
|
|
|
namespace TimeFormatLocalization {
|
|
namespace Attributes {
|
|
|
|
namespace HourFormat {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::TimeFormatLocalization::HourFormatEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::TimeFormatLocalization::HourFormatEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::TimeFormatLocalization::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::TimeFormatLocalization::HourFormatEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::TimeFormatLocalization::HourFormatEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::TimeFormatLocalization::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::TimeFormatLocalization::HourFormatEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::TimeFormatLocalization::HourFormatEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::TimeFormatLocalization::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace HourFormat
|
|
|
|
namespace ActiveCalendarType {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::TimeFormatLocalization::CalendarTypeEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::TimeFormatLocalization::CalendarTypeEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::TimeFormatLocalization::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::TimeFormatLocalization::CalendarTypeEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::TimeFormatLocalization::CalendarTypeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::TimeFormatLocalization::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::TimeFormatLocalization::CalendarTypeEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::TimeFormatLocalization::CalendarTypeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::TimeFormatLocalization::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ActiveCalendarType
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::TimeFormatLocalization::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::TimeFormatLocalization::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::TimeFormatLocalization::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::TimeFormatLocalization::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::TimeFormatLocalization::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::TimeFormatLocalization::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // TimeFormatLocalization
|
|
|
|
namespace UnitLocalization {
|
|
namespace Attributes {
|
|
|
|
namespace TemperatureUnit {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::UnitLocalization::TempUnitEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::UnitLocalization::TempUnitEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitLocalization::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::UnitLocalization::TempUnitEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::UnitLocalization::TempUnitEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitLocalization::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::UnitLocalization::TempUnitEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::UnitLocalization::TempUnitEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitLocalization::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace TemperatureUnit
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitLocalization::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitLocalization::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitLocalization::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitLocalization::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitLocalization::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitLocalization::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // UnitLocalization
|
|
|
|
namespace PowerSourceConfiguration {
|
|
namespace Attributes {
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PowerSourceConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSourceConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSourceConfiguration::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PowerSourceConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSourceConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSourceConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // PowerSourceConfiguration
|
|
|
|
namespace PowerSource {
|
|
namespace Attributes {
|
|
|
|
namespace Status {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::PowerSource::PowerSourceStatusEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::PowerSource::PowerSourceStatusEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::PowerSource::PowerSourceStatusEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::PowerSource::PowerSourceStatusEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::PowerSource::PowerSourceStatusEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::PowerSource::PowerSourceStatusEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Status
|
|
|
|
namespace Order {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Order
|
|
|
|
namespace Description {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value)
|
|
{
|
|
uint8_t zclString[60 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 60, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[1], 60);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(60 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 60, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[60 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value)
|
|
{
|
|
|
|
static_assert(60 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 60, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[60 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Description
|
|
|
|
namespace WiredAssessedInputVoltage {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint32_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace WiredAssessedInputVoltage
|
|
|
|
namespace WiredAssessedInputFrequency {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace WiredAssessedInputFrequency
|
|
|
|
namespace WiredCurrentType {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::PowerSource::WiredCurrentTypeEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::PowerSource::WiredCurrentTypeEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::PowerSource::WiredCurrentTypeEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::PowerSource::WiredCurrentTypeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::PowerSource::WiredCurrentTypeEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::PowerSource::WiredCurrentTypeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace WiredCurrentType
|
|
|
|
namespace WiredAssessedCurrent {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint32_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace WiredAssessedCurrent
|
|
|
|
namespace WiredNominalVoltage {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace WiredNominalVoltage
|
|
|
|
namespace WiredMaximumCurrent {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace WiredMaximumCurrent
|
|
|
|
namespace WiredPresent {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value)
|
|
{ using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace WiredPresent
|
|
|
|
namespace BatVoltage {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint32_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace BatVoltage
|
|
|
|
namespace BatPercentRemaining {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace BatPercentRemaining
|
|
|
|
namespace BatTimeRemaining {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint32_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace BatTimeRemaining
|
|
|
|
namespace BatChargeLevel {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::PowerSource::BatChargeLevelEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::PowerSource::BatChargeLevelEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::PowerSource::BatChargeLevelEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::PowerSource::BatChargeLevelEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::PowerSource::BatChargeLevelEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::PowerSource::BatChargeLevelEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace BatChargeLevel
|
|
|
|
namespace BatReplacementNeeded {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value)
|
|
{ using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace BatReplacementNeeded
|
|
|
|
namespace BatReplaceability {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::PowerSource::BatReplaceabilityEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::PowerSource::BatReplaceabilityEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::PowerSource::BatReplaceabilityEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::PowerSource::BatReplaceabilityEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::PowerSource::BatReplaceabilityEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::PowerSource::BatReplaceabilityEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace BatReplaceability
|
|
|
|
namespace BatPresent {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value)
|
|
{ using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace BatPresent
|
|
|
|
namespace BatReplacementDescription {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value)
|
|
{
|
|
uint8_t zclString[60 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 60, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[1], 60);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(60 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 60, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[60 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value)
|
|
{
|
|
|
|
static_assert(60 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 60, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[60 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace BatReplacementDescription
|
|
|
|
namespace BatCommonDesignation {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::PowerSource::BatCommonDesignationEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::PowerSource::BatCommonDesignationEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::PowerSource::BatCommonDesignationEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::PowerSource::BatCommonDesignationEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM16_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::PowerSource::BatCommonDesignationEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::PowerSource::BatCommonDesignationEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_ENUM16_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace BatCommonDesignation
|
|
|
|
namespace BatANSIDesignation {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value)
|
|
{
|
|
uint8_t zclString[20 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 20, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[1], 20);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(20 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 20, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[20 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value)
|
|
{
|
|
|
|
static_assert(20 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 20, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[20 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace BatANSIDesignation
|
|
|
|
namespace BatIECDesignation {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value)
|
|
{
|
|
uint8_t zclString[20 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 20, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[1], 20);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(20 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 20, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[20 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value)
|
|
{
|
|
|
|
static_assert(20 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 20, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[20 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace BatIECDesignation
|
|
|
|
namespace BatApprovedChemistry {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::PowerSource::BatApprovedChemistryEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::PowerSource::BatApprovedChemistryEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::PowerSource::BatApprovedChemistryEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::PowerSource::BatApprovedChemistryEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM16_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::PowerSource::BatApprovedChemistryEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::PowerSource::BatApprovedChemistryEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_ENUM16_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace BatApprovedChemistry
|
|
|
|
namespace BatCapacity {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace BatCapacity
|
|
|
|
namespace BatQuantity {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace BatQuantity
|
|
|
|
namespace BatChargeState {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::PowerSource::BatChargeStateEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::PowerSource::BatChargeStateEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::PowerSource::BatChargeStateEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::PowerSource::BatChargeStateEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::PowerSource::BatChargeStateEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::PowerSource::BatChargeStateEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace BatChargeState
|
|
|
|
namespace BatTimeToFullCharge {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint32_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace BatTimeToFullCharge
|
|
|
|
namespace BatFunctionalWhileCharging {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value)
|
|
{ using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace BatFunctionalWhileCharging
|
|
|
|
namespace BatChargingCurrent {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint32_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace BatChargingCurrent
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerSource::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // PowerSource
|
|
|
|
namespace GeneralCommissioning {
|
|
namespace Attributes {
|
|
|
|
namespace Breadcrumb {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint64_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint64_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint64_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint64_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::GeneralCommissioning::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT64U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint64_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint64_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Breadcrumb
|
|
|
|
namespace TCAcceptedVersion {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::GeneralCommissioning::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace TCAcceptedVersion
|
|
|
|
namespace TCMinRequiredVersion {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::GeneralCommissioning::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace TCMinRequiredVersion
|
|
|
|
namespace TCAcknowledgements {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::GeneralCommissioning::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP16_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace TCAcknowledgements
|
|
|
|
namespace TCAcknowledgementsRequired {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value)
|
|
{ using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::GeneralCommissioning::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace TCAcknowledgementsRequired
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::GeneralCommissioning::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::GeneralCommissioning::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // GeneralCommissioning
|
|
|
|
namespace NetworkCommissioning {
|
|
namespace Attributes {
|
|
|
|
namespace MaxNetworks {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::NetworkCommissioning::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace MaxNetworks
|
|
|
|
namespace ScanMaxTimeSeconds {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::NetworkCommissioning::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ScanMaxTimeSeconds
|
|
|
|
namespace ConnectMaxTimeSeconds {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::NetworkCommissioning::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ConnectMaxTimeSeconds
|
|
|
|
namespace InterfaceEnabled {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value)
|
|
{ using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::NetworkCommissioning::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace InterfaceEnabled
|
|
|
|
namespace LastNetworkingStatus {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::app::Clusters::NetworkCommissioning::NetworkCommissioningStatusEnum> & value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::NetworkCommissioning::NetworkCommissioningStatusEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::NetworkCommissioning::NetworkCommissioningStatusEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::NetworkCommissioning::NetworkCommissioningStatusEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::NetworkCommissioning::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::NetworkCommissioning::NetworkCommissioningStatusEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::NetworkCommissioning::NetworkCommissioningStatusEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::NetworkCommissioning::NetworkCommissioningStatusEnum>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::NetworkCommissioning::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::NetworkCommissioning::NetworkCommissioningStatusEnum>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::app::Clusters::NetworkCommissioning::NetworkCommissioningStatusEnum> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::app::Clusters::NetworkCommissioning::NetworkCommissioningStatusEnum> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace LastNetworkingStatus
|
|
|
|
namespace LastNetworkID {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::MutableByteSpan> & value)
|
|
{ if (value.IsNull()) {
|
|
ChipLogError(Zcl, "Null Nullable<Span> passed to NetworkCommissioning::LastNetworkID::Get");
|
|
return Protocols::InteractionModel::Status::Failure;
|
|
}
|
|
|
|
|
|
uint8_t zclString[32 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
value.SetNull();
|
|
return Protocols::InteractionModel::Status::Success;
|
|
}
|
|
auto & span = value.Value();
|
|
|
|
VerifyOrReturnError(span.size() == 32, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(span.data(), &zclString[1], 32);
|
|
span.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::ByteSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(32 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 32, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[32 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::NetworkCommissioning::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::ByteSpan value)
|
|
{
|
|
|
|
static_assert(32 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 32, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[32 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
uint8_t zclString[1] = { 0xFF };
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::NetworkCommissioning::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
uint8_t zclString[1] = { 0xFF };
|
|
return emberAfWriteAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::ByteSpan> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::ByteSpan> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace LastNetworkID
|
|
|
|
namespace LastConnectErrorValue {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<int32_t> & value)
|
|
{ using Traits = NumericAttributeTraits<int32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::NetworkCommissioning::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT32S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, writable, ZCL_INT32S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int32_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::NetworkCommissioning::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT32S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<int32_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, writable, ZCL_INT32S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int32_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int32_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace LastConnectErrorValue
|
|
|
|
namespace SupportedThreadFeatures {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::NetworkCommissioning::ThreadCapabilitiesBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::NetworkCommissioning::ThreadCapabilitiesBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::NetworkCommissioning::ThreadCapabilitiesBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::NetworkCommissioning::ThreadCapabilitiesBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::NetworkCommissioning::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP16_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::NetworkCommissioning::ThreadCapabilitiesBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::NetworkCommissioning::ThreadCapabilitiesBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace SupportedThreadFeatures
|
|
|
|
namespace ThreadVersion {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::NetworkCommissioning::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ThreadVersion
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::NetworkCommissioning::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::NetworkCommissioning::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // NetworkCommissioning
|
|
|
|
namespace DiagnosticLogs {
|
|
namespace Attributes {
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DiagnosticLogs::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DiagnosticLogs::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DiagnosticLogs::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DiagnosticLogs::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DiagnosticLogs::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DiagnosticLogs::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // DiagnosticLogs
|
|
|
|
namespace GeneralDiagnostics {
|
|
namespace Attributes {
|
|
|
|
namespace TestEventTriggersEnabled {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value)
|
|
{ using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::GeneralDiagnostics::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace TestEventTriggersEnabled
|
|
|
|
} // namespace Attributes
|
|
} // GeneralDiagnostics
|
|
|
|
namespace SoftwareDiagnostics {
|
|
namespace Attributes {
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::SoftwareDiagnostics::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // SoftwareDiagnostics
|
|
|
|
namespace ThreadNetworkDiagnostics {
|
|
namespace Attributes {
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // ThreadNetworkDiagnostics
|
|
|
|
namespace WiFiNetworkDiagnostics {
|
|
namespace Attributes {
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // WiFiNetworkDiagnostics
|
|
|
|
namespace EthernetNetworkDiagnostics {
|
|
namespace Attributes {
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // EthernetNetworkDiagnostics
|
|
|
|
namespace TimeSynchronization {
|
|
namespace Attributes {
|
|
|
|
namespace TimeSource {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::TimeSynchronization::TimeSourceEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::TimeSynchronization::TimeSourceEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::TimeSynchronization::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::TimeSynchronization::TimeSourceEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::TimeSynchronization::TimeSourceEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::TimeSynchronization::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::TimeSynchronization::TimeSourceEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::TimeSynchronization::TimeSourceEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::TimeSynchronization::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace TimeSource
|
|
|
|
namespace TimeZoneDatabase {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::TimeSynchronization::TimeZoneDatabaseEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::TimeSynchronization::TimeZoneDatabaseEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::TimeSynchronization::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::TimeSynchronization::TimeZoneDatabaseEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::TimeSynchronization::TimeZoneDatabaseEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::TimeSynchronization::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::TimeSynchronization::TimeZoneDatabaseEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::TimeSynchronization::TimeZoneDatabaseEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::TimeSynchronization::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace TimeZoneDatabase
|
|
|
|
namespace NTPServerAvailable {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value)
|
|
{ using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::TimeSynchronization::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::TimeSynchronization::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::TimeSynchronization::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace NTPServerAvailable
|
|
|
|
namespace SupportsDNSResolve {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value)
|
|
{ using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::TimeSynchronization::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::TimeSynchronization::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::TimeSynchronization::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace SupportsDNSResolve
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::TimeSynchronization::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::TimeSynchronization::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::TimeSynchronization::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::TimeSynchronization::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::TimeSynchronization::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::TimeSynchronization::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // TimeSynchronization
|
|
|
|
namespace BridgedDeviceBasicInformation {
|
|
namespace Attributes {
|
|
|
|
namespace VendorName {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value)
|
|
{
|
|
uint8_t zclString[32 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 32, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[1], 32);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(32 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 32, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[32 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value)
|
|
{
|
|
|
|
static_assert(32 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 32, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[32 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace VendorName
|
|
|
|
namespace VendorID {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::VendorId * value)
|
|
{ using Traits = NumericAttributeTraits<chip::VendorId>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::VendorId value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::VendorId>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_VENDOR_ID_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::VendorId value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::VendorId>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, writable, ZCL_VENDOR_ID_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace VendorID
|
|
|
|
namespace ProductName {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value)
|
|
{
|
|
uint8_t zclString[32 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 32, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[1], 32);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(32 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 32, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[32 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value)
|
|
{
|
|
|
|
static_assert(32 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 32, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[32 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ProductName
|
|
|
|
namespace ProductID {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ProductID
|
|
|
|
namespace NodeLabel {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value)
|
|
{
|
|
uint8_t zclString[32 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 32, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[1], 32);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(32 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 32, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[32 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value)
|
|
{
|
|
|
|
static_assert(32 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 32, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[32 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace NodeLabel
|
|
|
|
namespace HardwareVersion {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace HardwareVersion
|
|
|
|
namespace HardwareVersionString {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value)
|
|
{
|
|
uint8_t zclString[64 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 64, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[1], 64);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(64 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 64, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[64 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value)
|
|
{
|
|
|
|
static_assert(64 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 64, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[64 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace HardwareVersionString
|
|
|
|
namespace SoftwareVersion {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace SoftwareVersion
|
|
|
|
namespace SoftwareVersionString {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value)
|
|
{
|
|
uint8_t zclString[64 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 64, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[1], 64);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(64 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 64, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[64 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value)
|
|
{
|
|
|
|
static_assert(64 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 64, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[64 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace SoftwareVersionString
|
|
|
|
namespace ManufacturingDate {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value)
|
|
{
|
|
uint8_t zclString[16 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 16, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[1], 16);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(16 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 16, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[16 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value)
|
|
{
|
|
|
|
static_assert(16 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 16, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[16 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ManufacturingDate
|
|
|
|
namespace PartNumber {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value)
|
|
{
|
|
uint8_t zclString[32 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 32, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[1], 32);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(32 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 32, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[32 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value)
|
|
{
|
|
|
|
static_assert(32 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 32, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[32 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace PartNumber
|
|
|
|
namespace ProductURL {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value)
|
|
{
|
|
uint8_t zclString[256 + 2];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfLongStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint16_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 256, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[2], 256);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(256 < NumericAttributeTraits<uint16_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 256, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[256 + 2];
|
|
auto length = static_cast<uint16_t>(value.size());
|
|
Encoding::LittleEndian::Put16(zclString, length);
|
|
memcpy(&zclString[2], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_LONG_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value)
|
|
{
|
|
|
|
static_assert(256 < NumericAttributeTraits<uint16_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 256, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[256 + 2];
|
|
auto length = static_cast<uint16_t>(value.size());
|
|
Encoding::LittleEndian::Put16(zclString, length);
|
|
memcpy(&zclString[2], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, zclString, ZCL_LONG_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ProductURL
|
|
|
|
namespace ProductLabel {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value)
|
|
{
|
|
uint8_t zclString[64 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 64, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[1], 64);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(64 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 64, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[64 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value)
|
|
{
|
|
|
|
static_assert(64 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 64, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[64 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ProductLabel
|
|
|
|
namespace SerialNumber {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value)
|
|
{
|
|
uint8_t zclString[32 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 32, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[1], 32);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(32 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 32, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[32 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value)
|
|
{
|
|
|
|
static_assert(32 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 32, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[32 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace SerialNumber
|
|
|
|
namespace Reachable {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value)
|
|
{ using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Reachable
|
|
|
|
namespace UniqueID {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value)
|
|
{
|
|
uint8_t zclString[32 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 32, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[1], 32);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(32 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 32, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[32 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value)
|
|
{
|
|
|
|
static_assert(32 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 32, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[32 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace UniqueID
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // BridgedDeviceBasicInformation
|
|
|
|
namespace Switch {
|
|
namespace Attributes {
|
|
|
|
namespace NumberOfPositions {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Switch::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Switch::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Switch::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace NumberOfPositions
|
|
|
|
namespace CurrentPosition {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Switch::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Switch::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Switch::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace CurrentPosition
|
|
|
|
namespace MultiPressMax {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Switch::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Switch::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Switch::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace MultiPressMax
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Switch::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Switch::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Switch::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Switch::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Switch::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Switch::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // Switch
|
|
|
|
namespace AdministratorCommissioning {
|
|
namespace Attributes {
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::AdministratorCommissioning::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::AdministratorCommissioning::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::AdministratorCommissioning::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::AdministratorCommissioning::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::AdministratorCommissioning::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::AdministratorCommissioning::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // AdministratorCommissioning
|
|
|
|
namespace OperationalCredentials {
|
|
namespace Attributes {
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OperationalCredentials::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OperationalCredentials::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // OperationalCredentials
|
|
|
|
namespace GroupKeyManagement {
|
|
namespace Attributes {
|
|
|
|
} // namespace Attributes
|
|
} // GroupKeyManagement
|
|
|
|
namespace FixedLabel {
|
|
namespace Attributes {
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::FixedLabel::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::FixedLabel::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::FixedLabel::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::FixedLabel::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::FixedLabel::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::FixedLabel::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // FixedLabel
|
|
|
|
namespace UserLabel {
|
|
namespace Attributes {
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UserLabel::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UserLabel::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UserLabel::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UserLabel::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UserLabel::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UserLabel::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // UserLabel
|
|
|
|
namespace ProxyConfiguration {
|
|
namespace Attributes {
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ProxyConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ProxyConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ProxyConfiguration::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ProxyConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ProxyConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ProxyConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // ProxyConfiguration
|
|
|
|
namespace ProxyDiscovery {
|
|
namespace Attributes {
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ProxyDiscovery::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ProxyDiscovery::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ProxyDiscovery::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ProxyDiscovery::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ProxyDiscovery::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ProxyDiscovery::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // ProxyDiscovery
|
|
|
|
namespace ProxyValid {
|
|
namespace Attributes {
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ProxyValid::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ProxyValid::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ProxyValid::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ProxyValid::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ProxyValid::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ProxyValid::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // ProxyValid
|
|
|
|
namespace BooleanState {
|
|
namespace Attributes {
|
|
|
|
namespace StateValue {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value)
|
|
{ using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BooleanState::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BooleanState::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BooleanState::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace StateValue
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BooleanState::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BooleanState::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BooleanState::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BooleanState::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BooleanState::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BooleanState::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // BooleanState
|
|
|
|
namespace IcdManagement {
|
|
namespace Attributes {
|
|
|
|
namespace UserActiveModeTriggerHint {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::IcdManagement::UserActiveModeTriggerBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::IcdManagement::UserActiveModeTriggerBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::IcdManagement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::IcdManagement::UserActiveModeTriggerBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::IcdManagement::UserActiveModeTriggerBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::IcdManagement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::IcdManagement::UserActiveModeTriggerBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::IcdManagement::UserActiveModeTriggerBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::IcdManagement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace UserActiveModeTriggerHint
|
|
|
|
namespace UserActiveModeTriggerInstruction {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value)
|
|
{
|
|
uint8_t zclString[128 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::IcdManagement::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 128, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[1], 128);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(128 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 128, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[128 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::IcdManagement::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value)
|
|
{
|
|
|
|
static_assert(128 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 128, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[128 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::IcdManagement::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace UserActiveModeTriggerInstruction
|
|
|
|
namespace OperatingMode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::IcdManagement::OperatingModeEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::IcdManagement::OperatingModeEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::IcdManagement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::IcdManagement::OperatingModeEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::IcdManagement::OperatingModeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::IcdManagement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::IcdManagement::OperatingModeEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::IcdManagement::OperatingModeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::IcdManagement::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace OperatingMode
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::IcdManagement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::IcdManagement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::IcdManagement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::IcdManagement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::IcdManagement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::IcdManagement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // IcdManagement
|
|
|
|
namespace Timer {
|
|
namespace Attributes {
|
|
|
|
namespace SetTime {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Timer::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Timer::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Timer::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace SetTime
|
|
|
|
namespace TimeRemaining {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Timer::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Timer::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Timer::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace TimeRemaining
|
|
|
|
namespace TimerState {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::Timer::TimerStatusEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::Timer::TimerStatusEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Timer::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Timer::TimerStatusEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::Timer::TimerStatusEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Timer::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Timer::TimerStatusEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::Timer::TimerStatusEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Timer::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace TimerState
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Timer::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Timer::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Timer::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Timer::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Timer::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Timer::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // Timer
|
|
|
|
namespace OvenCavityOperationalState {
|
|
namespace Attributes {
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OvenCavityOperationalState::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OvenCavityOperationalState::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OvenCavityOperationalState::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OvenCavityOperationalState::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OvenCavityOperationalState::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OvenCavityOperationalState::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // OvenCavityOperationalState
|
|
|
|
namespace OvenMode {
|
|
namespace Attributes {
|
|
|
|
namespace CurrentMode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OvenMode::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OvenMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OvenMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace CurrentMode
|
|
|
|
namespace StartUpMode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OvenMode::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OvenMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OvenMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OvenMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OvenMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace StartUpMode
|
|
|
|
namespace OnMode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OvenMode::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OvenMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OvenMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OvenMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OvenMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace OnMode
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OvenMode::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OvenMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OvenMode::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OvenMode::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OvenMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OvenMode::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // OvenMode
|
|
|
|
namespace LaundryDryerControls {
|
|
namespace Attributes {
|
|
|
|
namespace SelectedDrynessLevel {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::app::Clusters::LaundryDryerControls::DrynessLevelEnum> & value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::LaundryDryerControls::DrynessLevelEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LaundryDryerControls::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::LaundryDryerControls::DrynessLevelEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::LaundryDryerControls::DrynessLevelEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LaundryDryerControls::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::LaundryDryerControls::DrynessLevelEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::LaundryDryerControls::DrynessLevelEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LaundryDryerControls::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::LaundryDryerControls::DrynessLevelEnum>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LaundryDryerControls::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::LaundryDryerControls::DrynessLevelEnum>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LaundryDryerControls::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::app::Clusters::LaundryDryerControls::DrynessLevelEnum> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::app::Clusters::LaundryDryerControls::DrynessLevelEnum> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace SelectedDrynessLevel
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LaundryDryerControls::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LaundryDryerControls::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LaundryDryerControls::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LaundryDryerControls::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LaundryDryerControls::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LaundryDryerControls::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // LaundryDryerControls
|
|
|
|
namespace ModeSelect {
|
|
namespace Attributes {
|
|
|
|
namespace Description {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value)
|
|
{
|
|
uint8_t zclString[64 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ModeSelect::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 64, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[1], 64);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(64 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 64, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[64 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ModeSelect::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value)
|
|
{
|
|
|
|
static_assert(64 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 64, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[64 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::ModeSelect::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Description
|
|
|
|
namespace StandardNamespace {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ModeSelect::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ModeSelect::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM16_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ModeSelect::Id, Id, writable, ZCL_ENUM16_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ModeSelect::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM16_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ModeSelect::Id, Id, writable, ZCL_ENUM16_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace StandardNamespace
|
|
|
|
namespace CurrentMode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ModeSelect::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ModeSelect::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace CurrentMode
|
|
|
|
namespace StartUpMode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ModeSelect::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ModeSelect::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ModeSelect::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace StartUpMode
|
|
|
|
namespace OnMode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ModeSelect::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ModeSelect::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ModeSelect::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace OnMode
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ModeSelect::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ModeSelect::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ModeSelect::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ModeSelect::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ModeSelect::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ModeSelect::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // ModeSelect
|
|
|
|
namespace LaundryWasherMode {
|
|
namespace Attributes {
|
|
|
|
namespace StartUpMode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LaundryWasherMode::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LaundryWasherMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LaundryWasherMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace StartUpMode
|
|
|
|
namespace OnMode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LaundryWasherMode::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LaundryWasherMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LaundryWasherMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace OnMode
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LaundryWasherMode::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LaundryWasherMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherMode::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // LaundryWasherMode
|
|
|
|
namespace RefrigeratorAndTemperatureControlledCabinetMode {
|
|
namespace Attributes {
|
|
|
|
namespace StartUpMode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace StartUpMode
|
|
|
|
namespace OnMode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace OnMode
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // RefrigeratorAndTemperatureControlledCabinetMode
|
|
|
|
namespace LaundryWasherControls {
|
|
namespace Attributes {
|
|
|
|
namespace SpinSpeedCurrent {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LaundryWasherControls::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LaundryWasherControls::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherControls::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LaundryWasherControls::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherControls::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace SpinSpeedCurrent
|
|
|
|
namespace NumberOfRinses {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::LaundryWasherControls::NumberOfRinsesEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::LaundryWasherControls::NumberOfRinsesEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LaundryWasherControls::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::LaundryWasherControls::NumberOfRinsesEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::LaundryWasherControls::NumberOfRinsesEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LaundryWasherControls::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::LaundryWasherControls::NumberOfRinsesEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::LaundryWasherControls::NumberOfRinsesEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherControls::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace NumberOfRinses
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LaundryWasherControls::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LaundryWasherControls::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherControls::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LaundryWasherControls::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LaundryWasherControls::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherControls::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // LaundryWasherControls
|
|
|
|
namespace RvcRunMode {
|
|
namespace Attributes {
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::RvcRunMode::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::RvcRunMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::RvcRunMode::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // RvcRunMode
|
|
|
|
namespace RvcCleanMode {
|
|
namespace Attributes {
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::RvcCleanMode::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::RvcCleanMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::RvcCleanMode::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // RvcCleanMode
|
|
|
|
namespace TemperatureControl {
|
|
namespace Attributes {
|
|
|
|
namespace TemperatureSetpoint {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::TemperatureControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::TemperatureControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::TemperatureControl::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace TemperatureSetpoint
|
|
|
|
namespace MinTemperature {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::TemperatureControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::TemperatureControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::TemperatureControl::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace MinTemperature
|
|
|
|
namespace MaxTemperature {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::TemperatureControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::TemperatureControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::TemperatureControl::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace MaxTemperature
|
|
|
|
namespace Step {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::TemperatureControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::TemperatureControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::TemperatureControl::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Step
|
|
|
|
namespace SelectedTemperatureLevel {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::TemperatureControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::TemperatureControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::TemperatureControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace SelectedTemperatureLevel
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::TemperatureControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::TemperatureControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::TemperatureControl::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::TemperatureControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::TemperatureControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::TemperatureControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // TemperatureControl
|
|
|
|
namespace RefrigeratorAlarm {
|
|
namespace Attributes {
|
|
|
|
namespace Mask {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::RefrigeratorAlarm::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::RefrigeratorAlarm::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAlarm::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Mask
|
|
|
|
namespace State {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::RefrigeratorAlarm::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::RefrigeratorAlarm::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAlarm::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace State
|
|
|
|
namespace Supported {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::RefrigeratorAlarm::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::RefrigeratorAlarm::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::RefrigeratorAlarm::AlarmBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAlarm::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Supported
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::RefrigeratorAlarm::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::RefrigeratorAlarm::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAlarm::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::RefrigeratorAlarm::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::RefrigeratorAlarm::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAlarm::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // RefrigeratorAlarm
|
|
|
|
namespace DishwasherMode {
|
|
namespace Attributes {
|
|
|
|
namespace StartUpMode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DishwasherMode::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DishwasherMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DishwasherMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DishwasherMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DishwasherMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace StartUpMode
|
|
|
|
namespace OnMode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DishwasherMode::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DishwasherMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DishwasherMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DishwasherMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DishwasherMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace OnMode
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DishwasherMode::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DishwasherMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DishwasherMode::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // DishwasherMode
|
|
|
|
namespace AirQuality {
|
|
namespace Attributes {
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::AirQuality::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::AirQuality::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::AirQuality::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // AirQuality
|
|
|
|
namespace SmokeCoAlarm {
|
|
namespace Attributes {
|
|
|
|
namespace ExpressedState {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::SmokeCoAlarm::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::SmokeCoAlarm::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::SmokeCoAlarm::ExpressedStateEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::SmokeCoAlarm::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ExpressedState
|
|
|
|
namespace SmokeState {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::SmokeCoAlarm::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::SmokeCoAlarm::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::SmokeCoAlarm::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace SmokeState
|
|
|
|
namespace COState {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::SmokeCoAlarm::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::SmokeCoAlarm::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::SmokeCoAlarm::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace COState
|
|
|
|
namespace BatteryAlert {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::SmokeCoAlarm::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::SmokeCoAlarm::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::SmokeCoAlarm::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace BatteryAlert
|
|
|
|
namespace DeviceMuted {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::MuteStateEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::SmokeCoAlarm::MuteStateEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::SmokeCoAlarm::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::MuteStateEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::SmokeCoAlarm::MuteStateEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::SmokeCoAlarm::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::MuteStateEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::SmokeCoAlarm::MuteStateEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::SmokeCoAlarm::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace DeviceMuted
|
|
|
|
namespace TestInProgress {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value)
|
|
{ using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::SmokeCoAlarm::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::SmokeCoAlarm::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::SmokeCoAlarm::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace TestInProgress
|
|
|
|
namespace HardwareFaultAlert {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value)
|
|
{ using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::SmokeCoAlarm::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::SmokeCoAlarm::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::SmokeCoAlarm::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace HardwareFaultAlert
|
|
|
|
namespace EndOfServiceAlert {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::EndOfServiceEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::SmokeCoAlarm::EndOfServiceEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::SmokeCoAlarm::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::EndOfServiceEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::SmokeCoAlarm::EndOfServiceEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::SmokeCoAlarm::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::EndOfServiceEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::SmokeCoAlarm::EndOfServiceEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::SmokeCoAlarm::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace EndOfServiceAlert
|
|
|
|
namespace InterconnectSmokeAlarm {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::SmokeCoAlarm::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::SmokeCoAlarm::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::SmokeCoAlarm::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace InterconnectSmokeAlarm
|
|
|
|
namespace InterconnectCOAlarm {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::SmokeCoAlarm::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::SmokeCoAlarm::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::SmokeCoAlarm::AlarmStateEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::SmokeCoAlarm::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace InterconnectCOAlarm
|
|
|
|
namespace ContaminationState {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::ContaminationStateEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::SmokeCoAlarm::ContaminationStateEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::SmokeCoAlarm::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::ContaminationStateEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::SmokeCoAlarm::ContaminationStateEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::SmokeCoAlarm::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::ContaminationStateEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::SmokeCoAlarm::ContaminationStateEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::SmokeCoAlarm::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ContaminationState
|
|
|
|
namespace SmokeSensitivityLevel {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::SensitivityEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::SmokeCoAlarm::SensitivityEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::SmokeCoAlarm::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::SensitivityEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::SmokeCoAlarm::SensitivityEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::SmokeCoAlarm::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::SmokeCoAlarm::SensitivityEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::SmokeCoAlarm::SensitivityEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::SmokeCoAlarm::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace SmokeSensitivityLevel
|
|
|
|
namespace ExpiryDate {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::SmokeCoAlarm::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::SmokeCoAlarm::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::SmokeCoAlarm::Id, Id, writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ExpiryDate
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::SmokeCoAlarm::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::SmokeCoAlarm::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::SmokeCoAlarm::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::SmokeCoAlarm::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::SmokeCoAlarm::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::SmokeCoAlarm::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // SmokeCoAlarm
|
|
|
|
namespace DishwasherAlarm {
|
|
namespace Attributes {
|
|
|
|
namespace Mask {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::DishwasherAlarm::AlarmBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::DishwasherAlarm::AlarmBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DishwasherAlarm::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::DishwasherAlarm::AlarmBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::DishwasherAlarm::AlarmBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DishwasherAlarm::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::DishwasherAlarm::AlarmBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::DishwasherAlarm::AlarmBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DishwasherAlarm::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Mask
|
|
|
|
namespace Latch {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::DishwasherAlarm::AlarmBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::DishwasherAlarm::AlarmBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DishwasherAlarm::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::DishwasherAlarm::AlarmBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::DishwasherAlarm::AlarmBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DishwasherAlarm::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::DishwasherAlarm::AlarmBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::DishwasherAlarm::AlarmBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DishwasherAlarm::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Latch
|
|
|
|
namespace State {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::DishwasherAlarm::AlarmBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::DishwasherAlarm::AlarmBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DishwasherAlarm::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::DishwasherAlarm::AlarmBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::DishwasherAlarm::AlarmBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DishwasherAlarm::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::DishwasherAlarm::AlarmBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::DishwasherAlarm::AlarmBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DishwasherAlarm::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace State
|
|
|
|
namespace Supported {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::DishwasherAlarm::AlarmBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::DishwasherAlarm::AlarmBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DishwasherAlarm::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::DishwasherAlarm::AlarmBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::DishwasherAlarm::AlarmBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DishwasherAlarm::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::DishwasherAlarm::AlarmBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::DishwasherAlarm::AlarmBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DishwasherAlarm::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Supported
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DishwasherAlarm::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DishwasherAlarm::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DishwasherAlarm::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DishwasherAlarm::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DishwasherAlarm::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DishwasherAlarm::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // DishwasherAlarm
|
|
|
|
namespace MicrowaveOvenMode {
|
|
namespace Attributes {
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::MicrowaveOvenMode::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::MicrowaveOvenMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::MicrowaveOvenMode::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // MicrowaveOvenMode
|
|
|
|
namespace MicrowaveOvenControl {
|
|
namespace Attributes {
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::MicrowaveOvenControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::MicrowaveOvenControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // MicrowaveOvenControl
|
|
|
|
namespace OperationalState {
|
|
namespace Attributes {
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OperationalState::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OperationalState::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OperationalState::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OperationalState::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OperationalState::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OperationalState::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // OperationalState
|
|
|
|
namespace RvcOperationalState {
|
|
namespace Attributes {
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::RvcOperationalState::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::RvcOperationalState::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // RvcOperationalState
|
|
|
|
namespace ScenesManagement {
|
|
namespace Attributes {
|
|
|
|
namespace LastConfiguredBy {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::NodeId> & value)
|
|
{ using Traits = NumericAttributeTraits<chip::NodeId>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ScenesManagement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::NodeId value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::NodeId>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ScenesManagement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_NODE_ID_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::NodeId value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::NodeId>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ScenesManagement::Id, Id, writable, ZCL_NODE_ID_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::NodeId>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ScenesManagement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_NODE_ID_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::NodeId>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ScenesManagement::Id, Id, writable, ZCL_NODE_ID_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::NodeId> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::NodeId> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace LastConfiguredBy
|
|
|
|
namespace SceneTableSize {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ScenesManagement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ScenesManagement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ScenesManagement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace SceneTableSize
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ScenesManagement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ScenesManagement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ScenesManagement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ScenesManagement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ScenesManagement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ScenesManagement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // ScenesManagement
|
|
|
|
namespace HepaFilterMonitoring {
|
|
namespace Attributes {
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::HepaFilterMonitoring::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::HepaFilterMonitoring::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::HepaFilterMonitoring::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // HepaFilterMonitoring
|
|
|
|
namespace ActivatedCarbonFilterMonitoring {
|
|
namespace Attributes {
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ActivatedCarbonFilterMonitoring::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ActivatedCarbonFilterMonitoring::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ActivatedCarbonFilterMonitoring::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // ActivatedCarbonFilterMonitoring
|
|
|
|
namespace BooleanStateConfiguration {
|
|
namespace Attributes {
|
|
|
|
namespace SupportedSensitivityLevels {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BooleanStateConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BooleanStateConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BooleanStateConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace SupportedSensitivityLevels
|
|
|
|
namespace DefaultSensitivityLevel {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BooleanStateConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BooleanStateConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BooleanStateConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace DefaultSensitivityLevel
|
|
|
|
namespace AlarmsActive {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::BooleanStateConfiguration::AlarmModeBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::BooleanStateConfiguration::AlarmModeBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BooleanStateConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::BooleanStateConfiguration::AlarmModeBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::BooleanStateConfiguration::AlarmModeBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BooleanStateConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::BooleanStateConfiguration::AlarmModeBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::BooleanStateConfiguration::AlarmModeBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BooleanStateConfiguration::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace AlarmsActive
|
|
|
|
namespace AlarmsSuppressed {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::BooleanStateConfiguration::AlarmModeBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::BooleanStateConfiguration::AlarmModeBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BooleanStateConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::BooleanStateConfiguration::AlarmModeBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::BooleanStateConfiguration::AlarmModeBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BooleanStateConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::BooleanStateConfiguration::AlarmModeBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::BooleanStateConfiguration::AlarmModeBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BooleanStateConfiguration::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace AlarmsSuppressed
|
|
|
|
namespace AlarmsEnabled {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::BooleanStateConfiguration::AlarmModeBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::BooleanStateConfiguration::AlarmModeBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BooleanStateConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::BooleanStateConfiguration::AlarmModeBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::BooleanStateConfiguration::AlarmModeBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BooleanStateConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::BooleanStateConfiguration::AlarmModeBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::BooleanStateConfiguration::AlarmModeBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BooleanStateConfiguration::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace AlarmsEnabled
|
|
|
|
namespace AlarmsSupported {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::BooleanStateConfiguration::AlarmModeBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::BooleanStateConfiguration::AlarmModeBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BooleanStateConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::BooleanStateConfiguration::AlarmModeBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::BooleanStateConfiguration::AlarmModeBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BooleanStateConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::BooleanStateConfiguration::AlarmModeBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::BooleanStateConfiguration::AlarmModeBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BooleanStateConfiguration::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace AlarmsSupported
|
|
|
|
namespace SensorFault {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::BooleanStateConfiguration::SensorFaultBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::BooleanStateConfiguration::SensorFaultBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BooleanStateConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::BooleanStateConfiguration::SensorFaultBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::BooleanStateConfiguration::SensorFaultBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BooleanStateConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP16_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::BooleanStateConfiguration::SensorFaultBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::BooleanStateConfiguration::SensorFaultBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BooleanStateConfiguration::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace SensorFault
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BooleanStateConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BooleanStateConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BooleanStateConfiguration::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BooleanStateConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BooleanStateConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BooleanStateConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // BooleanStateConfiguration
|
|
|
|
namespace ValveConfigurationAndControl {
|
|
namespace Attributes {
|
|
|
|
namespace OpenDuration {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint32_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ValveConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ValveConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace OpenDuration
|
|
|
|
namespace DefaultOpenDuration {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint32_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ValveConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ValveConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace DefaultOpenDuration
|
|
|
|
namespace AutoCloseTime {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint64_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint64_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint64_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint64_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ValveConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_EPOCH_US_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint64_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint64_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_EPOCH_US_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint64_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ValveConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_EPOCH_US_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint64_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_EPOCH_US_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint64_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint64_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace AutoCloseTime
|
|
|
|
namespace CurrentState {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::app::Clusters::ValveConfigurationAndControl::ValveStateEnum> & value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::ValveConfigurationAndControl::ValveStateEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::ValveConfigurationAndControl::ValveStateEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::ValveConfigurationAndControl::ValveStateEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ValveConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::ValveConfigurationAndControl::ValveStateEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::ValveConfigurationAndControl::ValveStateEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::ValveConfigurationAndControl::ValveStateEnum>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ValveConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::ValveConfigurationAndControl::ValveStateEnum>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::app::Clusters::ValveConfigurationAndControl::ValveStateEnum> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::app::Clusters::ValveConfigurationAndControl::ValveStateEnum> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace CurrentState
|
|
|
|
namespace TargetState {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::app::Clusters::ValveConfigurationAndControl::ValveStateEnum> & value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::ValveConfigurationAndControl::ValveStateEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::ValveConfigurationAndControl::ValveStateEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::ValveConfigurationAndControl::ValveStateEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ValveConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::ValveConfigurationAndControl::ValveStateEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::ValveConfigurationAndControl::ValveStateEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::ValveConfigurationAndControl::ValveStateEnum>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ValveConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::ValveConfigurationAndControl::ValveStateEnum>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::app::Clusters::ValveConfigurationAndControl::ValveStateEnum> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::app::Clusters::ValveConfigurationAndControl::ValveStateEnum> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace TargetState
|
|
|
|
namespace CurrentLevel {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::Percent> & value)
|
|
{ using Traits = NumericAttributeTraits<chip::Percent>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::Percent value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ValveConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_PERCENT_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::Percent value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_PERCENT_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ValveConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_PERCENT_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_PERCENT_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::Percent> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::Percent> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace CurrentLevel
|
|
|
|
namespace TargetLevel {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::Percent> & value)
|
|
{ using Traits = NumericAttributeTraits<chip::Percent>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::Percent value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ValveConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_PERCENT_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::Percent value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_PERCENT_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ValveConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_PERCENT_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_PERCENT_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::Percent> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::Percent> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace TargetLevel
|
|
|
|
namespace DefaultOpenLevel {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::Percent * value)
|
|
{ using Traits = NumericAttributeTraits<chip::Percent>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::Percent value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ValveConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_PERCENT_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::Percent value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_PERCENT_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace DefaultOpenLevel
|
|
|
|
namespace ValveFault {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::ValveConfigurationAndControl::ValveFaultBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::ValveConfigurationAndControl::ValveFaultBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::ValveConfigurationAndControl::ValveFaultBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::ValveConfigurationAndControl::ValveFaultBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ValveConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP16_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::ValveConfigurationAndControl::ValveFaultBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::ValveConfigurationAndControl::ValveFaultBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ValveFault
|
|
|
|
namespace LevelStep {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ValveConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace LevelStep
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ValveConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ValveConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ValveConfigurationAndControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // ValveConfigurationAndControl
|
|
|
|
namespace ElectricalPowerMeasurement {
|
|
namespace Attributes {
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ElectricalPowerMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ElectricalPowerMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ElectricalPowerMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // ElectricalPowerMeasurement
|
|
|
|
namespace ElectricalEnergyMeasurement {
|
|
namespace Attributes {
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ElectricalEnergyMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ElectricalEnergyMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ElectricalEnergyMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // ElectricalEnergyMeasurement
|
|
|
|
namespace WaterHeaterManagement {
|
|
namespace Attributes {
|
|
|
|
} // namespace Attributes
|
|
} // WaterHeaterManagement
|
|
|
|
namespace DemandResponseLoadControl {
|
|
namespace Attributes {
|
|
|
|
namespace NumberOfLoadControlPrograms {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DemandResponseLoadControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DemandResponseLoadControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DemandResponseLoadControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace NumberOfLoadControlPrograms
|
|
|
|
namespace NumberOfEventsPerProgram {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DemandResponseLoadControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DemandResponseLoadControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DemandResponseLoadControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace NumberOfEventsPerProgram
|
|
|
|
namespace NumberOfTransitions {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DemandResponseLoadControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DemandResponseLoadControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DemandResponseLoadControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace NumberOfTransitions
|
|
|
|
namespace DefaultRandomStart {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DemandResponseLoadControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DemandResponseLoadControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DemandResponseLoadControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace DefaultRandomStart
|
|
|
|
namespace DefaultRandomDuration {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DemandResponseLoadControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DemandResponseLoadControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DemandResponseLoadControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace DefaultRandomDuration
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DemandResponseLoadControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DemandResponseLoadControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DemandResponseLoadControl::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DemandResponseLoadControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DemandResponseLoadControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DemandResponseLoadControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // DemandResponseLoadControl
|
|
|
|
namespace Messages {
|
|
namespace Attributes {
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Messages::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Messages::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Messages::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Messages::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Messages::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Messages::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // Messages
|
|
|
|
namespace DeviceEnergyManagement {
|
|
namespace Attributes {
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DeviceEnergyManagement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DeviceEnergyManagement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DeviceEnergyManagement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // DeviceEnergyManagement
|
|
|
|
namespace EnergyEvse {
|
|
namespace Attributes {
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::EnergyEvse::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::EnergyEvse::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::EnergyEvse::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // EnergyEvse
|
|
|
|
namespace EnergyPreference {
|
|
namespace Attributes {
|
|
|
|
namespace CurrentEnergyBalance {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::EnergyPreference::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::EnergyPreference::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::EnergyPreference::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace CurrentEnergyBalance
|
|
|
|
namespace CurrentLowPowerModeSensitivity {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::EnergyPreference::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::EnergyPreference::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::EnergyPreference::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace CurrentLowPowerModeSensitivity
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::EnergyPreference::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::EnergyPreference::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::EnergyPreference::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::EnergyPreference::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::EnergyPreference::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::EnergyPreference::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // EnergyPreference
|
|
|
|
namespace PowerTopology {
|
|
namespace Attributes {
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PowerTopology::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PowerTopology::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PowerTopology::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // PowerTopology
|
|
|
|
namespace EnergyEvseMode {
|
|
namespace Attributes {
|
|
|
|
namespace StartUpMode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::EnergyEvseMode::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::EnergyEvseMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::EnergyEvseMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::EnergyEvseMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::EnergyEvseMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace StartUpMode
|
|
|
|
namespace OnMode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::EnergyEvseMode::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::EnergyEvseMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::EnergyEvseMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::EnergyEvseMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::EnergyEvseMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace OnMode
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::EnergyEvseMode::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::EnergyEvseMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::EnergyEvseMode::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // EnergyEvseMode
|
|
|
|
namespace WaterHeaterMode {
|
|
namespace Attributes {
|
|
|
|
namespace StartUpMode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WaterHeaterMode::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WaterHeaterMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WaterHeaterMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WaterHeaterMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WaterHeaterMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace StartUpMode
|
|
|
|
namespace OnMode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WaterHeaterMode::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WaterHeaterMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WaterHeaterMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WaterHeaterMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WaterHeaterMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace OnMode
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WaterHeaterMode::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WaterHeaterMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WaterHeaterMode::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // WaterHeaterMode
|
|
|
|
namespace DeviceEnergyManagementMode {
|
|
namespace Attributes {
|
|
|
|
namespace StartUpMode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DeviceEnergyManagementMode::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DeviceEnergyManagementMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DeviceEnergyManagementMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DeviceEnergyManagementMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DeviceEnergyManagementMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace StartUpMode
|
|
|
|
namespace OnMode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DeviceEnergyManagementMode::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DeviceEnergyManagementMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DeviceEnergyManagementMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DeviceEnergyManagementMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DeviceEnergyManagementMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace OnMode
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DeviceEnergyManagementMode::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DeviceEnergyManagementMode::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DeviceEnergyManagementMode::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // DeviceEnergyManagementMode
|
|
|
|
namespace DoorLock {
|
|
namespace Attributes {
|
|
|
|
namespace LockState {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::app::Clusters::DoorLock::DlLockState> & value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::DoorLock::DlLockState>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::DoorLock::DlLockState value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::DoorLock::DlLockState>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::DoorLock::DlLockState value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::DoorLock::DlLockState>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::DoorLock::DlLockState>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::DoorLock::DlLockState>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::app::Clusters::DoorLock::DlLockState> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::app::Clusters::DoorLock::DlLockState> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace LockState
|
|
|
|
namespace LockType {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::DoorLock::DlLockType * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::DoorLock::DlLockType>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::DoorLock::DlLockType value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::DoorLock::DlLockType>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::DoorLock::DlLockType value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::DoorLock::DlLockType>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace LockType
|
|
|
|
namespace ActuatorEnabled {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value)
|
|
{ using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ActuatorEnabled
|
|
|
|
namespace DoorState {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::app::Clusters::DoorLock::DoorStateEnum> & value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::DoorLock::DoorStateEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::DoorLock::DoorStateEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::DoorLock::DoorStateEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::DoorLock::DoorStateEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::DoorLock::DoorStateEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::DoorLock::DoorStateEnum>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::DoorLock::DoorStateEnum>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::app::Clusters::DoorLock::DoorStateEnum> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::app::Clusters::DoorLock::DoorStateEnum> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace DoorState
|
|
|
|
namespace DoorOpenEvents {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace DoorOpenEvents
|
|
|
|
namespace DoorClosedEvents {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace DoorClosedEvents
|
|
|
|
namespace OpenPeriod {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace OpenPeriod
|
|
|
|
namespace NumberOfTotalUsersSupported {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace NumberOfTotalUsersSupported
|
|
|
|
namespace NumberOfPINUsersSupported {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace NumberOfPINUsersSupported
|
|
|
|
namespace NumberOfRFIDUsersSupported {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace NumberOfRFIDUsersSupported
|
|
|
|
namespace NumberOfWeekDaySchedulesSupportedPerUser {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace NumberOfWeekDaySchedulesSupportedPerUser
|
|
|
|
namespace NumberOfYearDaySchedulesSupportedPerUser {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace NumberOfYearDaySchedulesSupportedPerUser
|
|
|
|
namespace NumberOfHolidaySchedulesSupported {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace NumberOfHolidaySchedulesSupported
|
|
|
|
namespace MaxPINCodeLength {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace MaxPINCodeLength
|
|
|
|
namespace MinPINCodeLength {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace MinPINCodeLength
|
|
|
|
namespace MaxRFIDCodeLength {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace MaxRFIDCodeLength
|
|
|
|
namespace MinRFIDCodeLength {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace MinRFIDCodeLength
|
|
|
|
namespace CredentialRulesSupport {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::DoorLock::DlCredentialRuleMask> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::DoorLock::DlCredentialRuleMask>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::DoorLock::DlCredentialRuleMask> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::DoorLock::DlCredentialRuleMask>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::DoorLock::DlCredentialRuleMask> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::DoorLock::DlCredentialRuleMask>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace CredentialRulesSupport
|
|
|
|
namespace NumberOfCredentialsSupportedPerUser {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace NumberOfCredentialsSupportedPerUser
|
|
|
|
namespace Language {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value)
|
|
{
|
|
uint8_t zclString[3 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 3, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[1], 3);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(3 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 3, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[3 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value)
|
|
{
|
|
|
|
static_assert(3 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 3, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[3 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Language
|
|
|
|
namespace LEDSettings {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace LEDSettings
|
|
|
|
namespace AutoRelockTime {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace AutoRelockTime
|
|
|
|
namespace SoundVolume {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace SoundVolume
|
|
|
|
namespace OperatingMode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::DoorLock::OperatingModeEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::DoorLock::OperatingModeEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::DoorLock::OperatingModeEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::DoorLock::OperatingModeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::DoorLock::OperatingModeEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::DoorLock::OperatingModeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace OperatingMode
|
|
|
|
namespace SupportedOperatingModes {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::DoorLock::DlSupportedOperatingModes> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::DoorLock::DlSupportedOperatingModes>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::DoorLock::DlSupportedOperatingModes> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::DoorLock::DlSupportedOperatingModes>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP16_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::DoorLock::DlSupportedOperatingModes> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::DoorLock::DlSupportedOperatingModes>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace SupportedOperatingModes
|
|
|
|
namespace DefaultConfigurationRegister {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::DoorLock::DlDefaultConfigurationRegister> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::DoorLock::DlDefaultConfigurationRegister>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::DoorLock::DlDefaultConfigurationRegister> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::DoorLock::DlDefaultConfigurationRegister>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP16_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::DoorLock::DlDefaultConfigurationRegister> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::DoorLock::DlDefaultConfigurationRegister>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace DefaultConfigurationRegister
|
|
|
|
namespace EnableLocalProgramming {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value)
|
|
{ using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace EnableLocalProgramming
|
|
|
|
namespace EnableOneTouchLocking {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value)
|
|
{ using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace EnableOneTouchLocking
|
|
|
|
namespace EnableInsideStatusLED {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value)
|
|
{ using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace EnableInsideStatusLED
|
|
|
|
namespace EnablePrivacyModeButton {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value)
|
|
{ using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace EnablePrivacyModeButton
|
|
|
|
namespace LocalProgrammingFeatures {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::DoorLock::DlLocalProgrammingFeatures> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::DoorLock::DlLocalProgrammingFeatures>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::DoorLock::DlLocalProgrammingFeatures> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::DoorLock::DlLocalProgrammingFeatures>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::DoorLock::DlLocalProgrammingFeatures> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::DoorLock::DlLocalProgrammingFeatures>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace LocalProgrammingFeatures
|
|
|
|
namespace WrongCodeEntryLimit {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace WrongCodeEntryLimit
|
|
|
|
namespace UserCodeTemporaryDisableTime {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace UserCodeTemporaryDisableTime
|
|
|
|
namespace SendPINOverTheAir {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value)
|
|
{ using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace SendPINOverTheAir
|
|
|
|
namespace RequirePINforRemoteOperation {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value)
|
|
{ using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace RequirePINforRemoteOperation
|
|
|
|
namespace ExpiringUserTimeout {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ExpiringUserTimeout
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::DoorLock::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // DoorLock
|
|
|
|
namespace WindowCovering {
|
|
namespace Attributes {
|
|
|
|
namespace Type {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::WindowCovering::Type * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::WindowCovering::Type>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::WindowCovering::Type value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::WindowCovering::Type>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WindowCovering::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::WindowCovering::Type value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::WindowCovering::Type>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Type
|
|
|
|
namespace PhysicalClosedLimitLift {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WindowCovering::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace PhysicalClosedLimitLift
|
|
|
|
namespace PhysicalClosedLimitTilt {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WindowCovering::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace PhysicalClosedLimitTilt
|
|
|
|
namespace CurrentPositionLift {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WindowCovering::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WindowCovering::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace CurrentPositionLift
|
|
|
|
namespace CurrentPositionTilt {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WindowCovering::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WindowCovering::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace CurrentPositionTilt
|
|
|
|
namespace NumberOfActuationsLift {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WindowCovering::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace NumberOfActuationsLift
|
|
|
|
namespace NumberOfActuationsTilt {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WindowCovering::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace NumberOfActuationsTilt
|
|
|
|
namespace ConfigStatus {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::WindowCovering::ConfigStatus> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::WindowCovering::ConfigStatus>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::WindowCovering::ConfigStatus> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::WindowCovering::ConfigStatus>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WindowCovering::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::WindowCovering::ConfigStatus> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::WindowCovering::ConfigStatus>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ConfigStatus
|
|
|
|
namespace CurrentPositionLiftPercentage {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::Percent> & value)
|
|
{ using Traits = NumericAttributeTraits<chip::Percent>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::Percent value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WindowCovering::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_PERCENT_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::Percent value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_PERCENT_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WindowCovering::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_PERCENT_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_PERCENT_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::Percent> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::Percent> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace CurrentPositionLiftPercentage
|
|
|
|
namespace CurrentPositionTiltPercentage {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::Percent> & value)
|
|
{ using Traits = NumericAttributeTraits<chip::Percent>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::Percent value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WindowCovering::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_PERCENT_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::Percent value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_PERCENT_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WindowCovering::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_PERCENT_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_PERCENT_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::Percent> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::Percent> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace CurrentPositionTiltPercentage
|
|
|
|
namespace OperationalStatus {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::WindowCovering::OperationalStatus> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::WindowCovering::OperationalStatus>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::WindowCovering::OperationalStatus> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::WindowCovering::OperationalStatus>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WindowCovering::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::WindowCovering::OperationalStatus> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::WindowCovering::OperationalStatus>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace OperationalStatus
|
|
|
|
namespace TargetPositionLiftPercent100ths {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::Percent100ths> & value)
|
|
{ using Traits = NumericAttributeTraits<chip::Percent100ths>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::Percent100ths value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent100ths>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WindowCovering::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_PERCENT100THS_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::Percent100ths value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent100ths>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_PERCENT100THS_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent100ths>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WindowCovering::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_PERCENT100THS_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent100ths>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_PERCENT100THS_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::Percent100ths> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::Percent100ths> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace TargetPositionLiftPercent100ths
|
|
|
|
namespace TargetPositionTiltPercent100ths {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::Percent100ths> & value)
|
|
{ using Traits = NumericAttributeTraits<chip::Percent100ths>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::Percent100ths value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent100ths>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WindowCovering::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_PERCENT100THS_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::Percent100ths value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent100ths>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_PERCENT100THS_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent100ths>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WindowCovering::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_PERCENT100THS_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent100ths>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_PERCENT100THS_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::Percent100ths> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::Percent100ths> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace TargetPositionTiltPercent100ths
|
|
|
|
namespace EndProductType {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::WindowCovering::EndProductType * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::WindowCovering::EndProductType>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::WindowCovering::EndProductType value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::WindowCovering::EndProductType>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WindowCovering::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::WindowCovering::EndProductType value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::WindowCovering::EndProductType>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace EndProductType
|
|
|
|
namespace CurrentPositionLiftPercent100ths {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::Percent100ths> & value)
|
|
{ using Traits = NumericAttributeTraits<chip::Percent100ths>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::Percent100ths value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent100ths>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WindowCovering::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_PERCENT100THS_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::Percent100ths value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent100ths>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_PERCENT100THS_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent100ths>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WindowCovering::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_PERCENT100THS_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent100ths>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_PERCENT100THS_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::Percent100ths> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::Percent100ths> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace CurrentPositionLiftPercent100ths
|
|
|
|
namespace CurrentPositionTiltPercent100ths {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::Percent100ths> & value)
|
|
{ using Traits = NumericAttributeTraits<chip::Percent100ths>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::Percent100ths value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent100ths>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WindowCovering::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_PERCENT100THS_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::Percent100ths value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent100ths>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_PERCENT100THS_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent100ths>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WindowCovering::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_PERCENT100THS_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent100ths>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_PERCENT100THS_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::Percent100ths> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::Percent100ths> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace CurrentPositionTiltPercent100ths
|
|
|
|
namespace InstalledOpenLimitLift {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WindowCovering::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace InstalledOpenLimitLift
|
|
|
|
namespace InstalledClosedLimitLift {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WindowCovering::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace InstalledClosedLimitLift
|
|
|
|
namespace InstalledOpenLimitTilt {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WindowCovering::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace InstalledOpenLimitTilt
|
|
|
|
namespace InstalledClosedLimitTilt {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WindowCovering::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace InstalledClosedLimitTilt
|
|
|
|
namespace Mode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::WindowCovering::Mode> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::WindowCovering::Mode>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::WindowCovering::Mode> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::WindowCovering::Mode>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WindowCovering::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::WindowCovering::Mode> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::WindowCovering::Mode>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Mode
|
|
|
|
namespace SafetyStatus {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::WindowCovering::SafetyStatus> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::WindowCovering::SafetyStatus>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::WindowCovering::SafetyStatus> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::WindowCovering::SafetyStatus>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WindowCovering::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP16_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::WindowCovering::SafetyStatus> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::WindowCovering::SafetyStatus>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace SafetyStatus
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WindowCovering::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WindowCovering::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // WindowCovering
|
|
|
|
namespace ServiceArea {
|
|
namespace Attributes {
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ServiceArea::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ServiceArea::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ServiceArea::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // ServiceArea
|
|
|
|
namespace PumpConfigurationAndControl {
|
|
namespace Attributes {
|
|
|
|
namespace MaxPressure {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<int16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace MaxPressure
|
|
|
|
namespace MaxSpeed {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace MaxSpeed
|
|
|
|
namespace MaxFlow {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace MaxFlow
|
|
|
|
namespace MinConstPressure {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<int16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace MinConstPressure
|
|
|
|
namespace MaxConstPressure {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<int16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace MaxConstPressure
|
|
|
|
namespace MinCompPressure {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<int16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace MinCompPressure
|
|
|
|
namespace MaxCompPressure {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<int16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace MaxCompPressure
|
|
|
|
namespace MinConstSpeed {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace MinConstSpeed
|
|
|
|
namespace MaxConstSpeed {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace MaxConstSpeed
|
|
|
|
namespace MinConstFlow {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace MinConstFlow
|
|
|
|
namespace MaxConstFlow {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace MaxConstFlow
|
|
|
|
namespace MinConstTemp {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<int16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace MinConstTemp
|
|
|
|
namespace MaxConstTemp {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<int16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace MaxConstTemp
|
|
|
|
namespace PumpStatus {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::PumpConfigurationAndControl::PumpStatusBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::PumpConfigurationAndControl::PumpStatusBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::PumpConfigurationAndControl::PumpStatusBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::PumpConfigurationAndControl::PumpStatusBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP16_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::PumpConfigurationAndControl::PumpStatusBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::PumpConfigurationAndControl::PumpStatusBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace PumpStatus
|
|
|
|
namespace EffectiveOperationMode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::PumpConfigurationAndControl::OperationModeEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::PumpConfigurationAndControl::OperationModeEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::PumpConfigurationAndControl::OperationModeEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::PumpConfigurationAndControl::OperationModeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::PumpConfigurationAndControl::OperationModeEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::PumpConfigurationAndControl::OperationModeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace EffectiveOperationMode
|
|
|
|
namespace EffectiveControlMode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::PumpConfigurationAndControl::ControlModeEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::PumpConfigurationAndControl::ControlModeEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::PumpConfigurationAndControl::ControlModeEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::PumpConfigurationAndControl::ControlModeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::PumpConfigurationAndControl::ControlModeEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::PumpConfigurationAndControl::ControlModeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace EffectiveControlMode
|
|
|
|
namespace Capacity {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<int16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace Capacity
|
|
|
|
namespace Speed {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace Speed
|
|
|
|
namespace LifetimeRunningHours {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint32_t> & value)
|
|
{ using Traits = NumericAttributeTraits<OddSizedInteger<3, false>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<3, false>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT24U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<3, false>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT24U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<3, false>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT24U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<3, false>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT24U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace LifetimeRunningHours
|
|
|
|
namespace Power {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint32_t> & value)
|
|
{ using Traits = NumericAttributeTraits<OddSizedInteger<3, false>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<3, false>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT24U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<3, false>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT24U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<3, false>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT24U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<3, false>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT24U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace Power
|
|
|
|
namespace LifetimeEnergyConsumed {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint32_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace LifetimeEnergyConsumed
|
|
|
|
namespace OperationMode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::PumpConfigurationAndControl::OperationModeEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::PumpConfigurationAndControl::OperationModeEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::PumpConfigurationAndControl::OperationModeEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::PumpConfigurationAndControl::OperationModeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::PumpConfigurationAndControl::OperationModeEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::PumpConfigurationAndControl::OperationModeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace OperationMode
|
|
|
|
namespace ControlMode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::PumpConfigurationAndControl::ControlModeEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::PumpConfigurationAndControl::ControlModeEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::PumpConfigurationAndControl::ControlModeEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::PumpConfigurationAndControl::ControlModeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::PumpConfigurationAndControl::ControlModeEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::PumpConfigurationAndControl::ControlModeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ControlMode
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PumpConfigurationAndControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // PumpConfigurationAndControl
|
|
|
|
namespace Thermostat {
|
|
namespace Attributes {
|
|
|
|
namespace LocalTemperature {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<int16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace LocalTemperature
|
|
|
|
namespace OutdoorTemperature {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<int16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace OutdoorTemperature
|
|
|
|
namespace Occupancy {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::Thermostat::OccupancyBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::Thermostat::OccupancyBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::Thermostat::OccupancyBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::Thermostat::OccupancyBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::Thermostat::OccupancyBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::Thermostat::OccupancyBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Occupancy
|
|
|
|
namespace AbsMinHeatSetpointLimit {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace AbsMinHeatSetpointLimit
|
|
|
|
namespace AbsMaxHeatSetpointLimit {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace AbsMaxHeatSetpointLimit
|
|
|
|
namespace AbsMinCoolSetpointLimit {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace AbsMinCoolSetpointLimit
|
|
|
|
namespace AbsMaxCoolSetpointLimit {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace AbsMaxCoolSetpointLimit
|
|
|
|
namespace PICoolingDemand {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace PICoolingDemand
|
|
|
|
namespace PIHeatingDemand {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace PIHeatingDemand
|
|
|
|
namespace HVACSystemTypeConfiguration {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::Thermostat::HVACSystemTypeBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::Thermostat::HVACSystemTypeBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::Thermostat::HVACSystemTypeBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::Thermostat::HVACSystemTypeBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::Thermostat::HVACSystemTypeBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::Thermostat::HVACSystemTypeBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace HVACSystemTypeConfiguration
|
|
|
|
namespace LocalTemperatureCalibration {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, int8_t * value)
|
|
{ using Traits = NumericAttributeTraits<int8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace LocalTemperatureCalibration
|
|
|
|
namespace OccupiedCoolingSetpoint {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace OccupiedCoolingSetpoint
|
|
|
|
namespace OccupiedHeatingSetpoint {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace OccupiedHeatingSetpoint
|
|
|
|
namespace UnoccupiedCoolingSetpoint {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace UnoccupiedCoolingSetpoint
|
|
|
|
namespace UnoccupiedHeatingSetpoint {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace UnoccupiedHeatingSetpoint
|
|
|
|
namespace MinHeatSetpointLimit {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace MinHeatSetpointLimit
|
|
|
|
namespace MaxHeatSetpointLimit {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace MaxHeatSetpointLimit
|
|
|
|
namespace MinCoolSetpointLimit {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace MinCoolSetpointLimit
|
|
|
|
namespace MaxCoolSetpointLimit {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace MaxCoolSetpointLimit
|
|
|
|
namespace MinSetpointDeadBand {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, int8_t * value)
|
|
{ using Traits = NumericAttributeTraits<int8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace MinSetpointDeadBand
|
|
|
|
namespace RemoteSensing {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::Thermostat::RemoteSensingBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::Thermostat::RemoteSensingBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::Thermostat::RemoteSensingBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::Thermostat::RemoteSensingBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::Thermostat::RemoteSensingBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::Thermostat::RemoteSensingBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace RemoteSensing
|
|
|
|
namespace ControlSequenceOfOperation {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::Thermostat::ControlSequenceOfOperationEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::Thermostat::ControlSequenceOfOperationEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Thermostat::ControlSequenceOfOperationEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::Thermostat::ControlSequenceOfOperationEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Thermostat::ControlSequenceOfOperationEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::Thermostat::ControlSequenceOfOperationEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ControlSequenceOfOperation
|
|
|
|
namespace SystemMode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::Thermostat::SystemModeEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::Thermostat::SystemModeEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Thermostat::SystemModeEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::Thermostat::SystemModeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Thermostat::SystemModeEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::Thermostat::SystemModeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace SystemMode
|
|
|
|
namespace ThermostatRunningMode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::Thermostat::ThermostatRunningModeEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::Thermostat::ThermostatRunningModeEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Thermostat::ThermostatRunningModeEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::Thermostat::ThermostatRunningModeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Thermostat::ThermostatRunningModeEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::Thermostat::ThermostatRunningModeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ThermostatRunningMode
|
|
|
|
namespace StartOfWeek {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::Thermostat::StartOfWeekEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::Thermostat::StartOfWeekEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Thermostat::StartOfWeekEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::Thermostat::StartOfWeekEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Thermostat::StartOfWeekEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::Thermostat::StartOfWeekEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace StartOfWeek
|
|
|
|
namespace NumberOfWeeklyTransitions {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace NumberOfWeeklyTransitions
|
|
|
|
namespace NumberOfDailyTransitions {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace NumberOfDailyTransitions
|
|
|
|
namespace TemperatureSetpointHold {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::Thermostat::TemperatureSetpointHoldEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::Thermostat::TemperatureSetpointHoldEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Thermostat::TemperatureSetpointHoldEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::Thermostat::TemperatureSetpointHoldEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Thermostat::TemperatureSetpointHoldEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::Thermostat::TemperatureSetpointHoldEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace TemperatureSetpointHold
|
|
|
|
namespace TemperatureSetpointHoldDuration {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace TemperatureSetpointHoldDuration
|
|
|
|
namespace ThermostatProgrammingOperationMode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::Thermostat::ProgrammingOperationModeBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::Thermostat::ProgrammingOperationModeBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::Thermostat::ProgrammingOperationModeBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::Thermostat::ProgrammingOperationModeBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::Thermostat::ProgrammingOperationModeBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::Thermostat::ProgrammingOperationModeBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ThermostatProgrammingOperationMode
|
|
|
|
namespace ThermostatRunningState {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::Thermostat::RelayStateBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::Thermostat::RelayStateBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::Thermostat::RelayStateBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::Thermostat::RelayStateBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP16_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::Thermostat::RelayStateBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::Thermostat::RelayStateBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ThermostatRunningState
|
|
|
|
namespace SetpointChangeSource {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::Thermostat::SetpointChangeSourceEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::Thermostat::SetpointChangeSourceEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Thermostat::SetpointChangeSourceEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::Thermostat::SetpointChangeSourceEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Thermostat::SetpointChangeSourceEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::Thermostat::SetpointChangeSourceEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace SetpointChangeSource
|
|
|
|
namespace SetpointChangeAmount {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<int16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace SetpointChangeAmount
|
|
|
|
namespace SetpointChangeSourceTimestamp {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace SetpointChangeSourceTimestamp
|
|
|
|
namespace OccupiedSetback {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace OccupiedSetback
|
|
|
|
namespace OccupiedSetbackMin {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace OccupiedSetbackMin
|
|
|
|
namespace OccupiedSetbackMax {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace OccupiedSetbackMax
|
|
|
|
namespace UnoccupiedSetback {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace UnoccupiedSetback
|
|
|
|
namespace UnoccupiedSetbackMin {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace UnoccupiedSetbackMin
|
|
|
|
namespace UnoccupiedSetbackMax {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace UnoccupiedSetbackMax
|
|
|
|
namespace EmergencyHeatDelta {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace EmergencyHeatDelta
|
|
|
|
namespace ACType {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::Thermostat::ACTypeEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::Thermostat::ACTypeEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Thermostat::ACTypeEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::Thermostat::ACTypeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Thermostat::ACTypeEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::Thermostat::ACTypeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ACType
|
|
|
|
namespace ACCapacity {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ACCapacity
|
|
|
|
namespace ACRefrigerantType {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::Thermostat::ACRefrigerantTypeEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::Thermostat::ACRefrigerantTypeEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Thermostat::ACRefrigerantTypeEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::Thermostat::ACRefrigerantTypeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Thermostat::ACRefrigerantTypeEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::Thermostat::ACRefrigerantTypeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ACRefrigerantType
|
|
|
|
namespace ACCompressorType {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::Thermostat::ACCompressorTypeEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::Thermostat::ACCompressorTypeEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Thermostat::ACCompressorTypeEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::Thermostat::ACCompressorTypeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Thermostat::ACCompressorTypeEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::Thermostat::ACCompressorTypeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ACCompressorType
|
|
|
|
namespace ACErrorCode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::Thermostat::ACErrorCodeBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::Thermostat::ACErrorCodeBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::Thermostat::ACErrorCodeBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::Thermostat::ACErrorCodeBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::Thermostat::ACErrorCodeBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::Thermostat::ACErrorCodeBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ACErrorCode
|
|
|
|
namespace ACLouverPosition {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::Thermostat::ACLouverPositionEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::Thermostat::ACLouverPositionEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Thermostat::ACLouverPositionEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::Thermostat::ACLouverPositionEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Thermostat::ACLouverPositionEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::Thermostat::ACLouverPositionEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ACLouverPosition
|
|
|
|
namespace ACCoilTemperature {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<int16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace ACCoilTemperature
|
|
|
|
namespace ACCapacityformat {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::Thermostat::ACCapacityFormatEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::Thermostat::ACCapacityFormatEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Thermostat::ACCapacityFormatEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::Thermostat::ACCapacityFormatEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Thermostat::ACCapacityFormatEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::Thermostat::ACCapacityFormatEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ACCapacityformat
|
|
|
|
namespace NumberOfPresets {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace NumberOfPresets
|
|
|
|
namespace NumberOfSchedules {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace NumberOfSchedules
|
|
|
|
namespace NumberOfScheduleTransitions {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace NumberOfScheduleTransitions
|
|
|
|
namespace NumberOfScheduleTransitionPerDay {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NumberOfScheduleTransitionPerDay
|
|
|
|
namespace ActivePresetHandle {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::MutableByteSpan> & value)
|
|
{ if (value.IsNull()) {
|
|
ChipLogError(Zcl, "Null Nullable<Span> passed to Thermostat::ActivePresetHandle::Get");
|
|
return Protocols::InteractionModel::Status::Failure;
|
|
}
|
|
|
|
|
|
uint8_t zclString[16 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
value.SetNull();
|
|
return Protocols::InteractionModel::Status::Success;
|
|
}
|
|
auto & span = value.Value();
|
|
|
|
VerifyOrReturnError(span.size() == 16, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(span.data(), &zclString[1], 16);
|
|
span.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::ByteSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(16 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 16, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[16 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::ByteSpan value)
|
|
{
|
|
|
|
static_assert(16 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 16, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[16 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
uint8_t zclString[1] = { 0xFF };
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
uint8_t zclString[1] = { 0xFF };
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::ByteSpan> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::ByteSpan> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace ActivePresetHandle
|
|
|
|
namespace ActiveScheduleHandle {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::MutableByteSpan> & value)
|
|
{ if (value.IsNull()) {
|
|
ChipLogError(Zcl, "Null Nullable<Span> passed to Thermostat::ActiveScheduleHandle::Get");
|
|
return Protocols::InteractionModel::Status::Failure;
|
|
}
|
|
|
|
|
|
uint8_t zclString[16 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
value.SetNull();
|
|
return Protocols::InteractionModel::Status::Success;
|
|
}
|
|
auto & span = value.Value();
|
|
|
|
VerifyOrReturnError(span.size() == 16, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(span.data(), &zclString[1], 16);
|
|
span.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::ByteSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(16 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 16, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[16 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::ByteSpan value)
|
|
{
|
|
|
|
static_assert(16 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 16, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[16 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
uint8_t zclString[1] = { 0xFF };
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
uint8_t zclString[1] = { 0xFF };
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::ByteSpan> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::ByteSpan> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace ActiveScheduleHandle
|
|
|
|
namespace SetpointHoldExpiryTimestamp {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint32_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace SetpointHoldExpiryTimestamp
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Thermostat::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // Thermostat
|
|
|
|
namespace FanControl {
|
|
namespace Attributes {
|
|
|
|
namespace FanMode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::FanControl::FanModeEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::FanControl::FanModeEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::FanControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::FanControl::FanModeEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::FanControl::FanModeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::FanControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::FanControl::FanModeEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::FanControl::FanModeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::FanControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FanMode
|
|
|
|
namespace FanModeSequence {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::FanControl::FanModeSequenceEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::FanControl::FanModeSequenceEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::FanControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::FanControl::FanModeSequenceEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::FanControl::FanModeSequenceEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::FanControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::FanControl::FanModeSequenceEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::FanControl::FanModeSequenceEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::FanControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FanModeSequence
|
|
|
|
namespace PercentSetting {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::Percent> & value)
|
|
{ using Traits = NumericAttributeTraits<chip::Percent>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::FanControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::Percent value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::FanControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_PERCENT_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::Percent value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::FanControl::Id, Id, writable, ZCL_PERCENT_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::FanControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_PERCENT_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::FanControl::Id, Id, writable, ZCL_PERCENT_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::Percent> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::Percent> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace PercentSetting
|
|
|
|
namespace PercentCurrent {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::Percent * value)
|
|
{ using Traits = NumericAttributeTraits<chip::Percent>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::FanControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::Percent value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::FanControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_PERCENT_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::Percent value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::Percent>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::FanControl::Id, Id, writable, ZCL_PERCENT_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace PercentCurrent
|
|
|
|
namespace SpeedMax {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::FanControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::FanControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::FanControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace SpeedMax
|
|
|
|
namespace SpeedSetting {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::FanControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::FanControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::FanControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::FanControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::FanControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace SpeedSetting
|
|
|
|
namespace SpeedCurrent {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::FanControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::FanControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::FanControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace SpeedCurrent
|
|
|
|
namespace RockSupport {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::FanControl::RockBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::FanControl::RockBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::FanControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::FanControl::RockBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::FanControl::RockBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::FanControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::FanControl::RockBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::FanControl::RockBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::FanControl::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace RockSupport
|
|
|
|
namespace RockSetting {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::FanControl::RockBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::FanControl::RockBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::FanControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::FanControl::RockBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::FanControl::RockBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::FanControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::FanControl::RockBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::FanControl::RockBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::FanControl::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace RockSetting
|
|
|
|
namespace WindSupport {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::FanControl::WindBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::FanControl::WindBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::FanControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::FanControl::WindBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::FanControl::WindBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::FanControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::FanControl::WindBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::FanControl::WindBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::FanControl::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace WindSupport
|
|
|
|
namespace WindSetting {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::FanControl::WindBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::FanControl::WindBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::FanControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::FanControl::WindBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::FanControl::WindBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::FanControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::FanControl::WindBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::FanControl::WindBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::FanControl::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace WindSetting
|
|
|
|
namespace AirflowDirection {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::FanControl::AirflowDirectionEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::FanControl::AirflowDirectionEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::FanControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::FanControl::AirflowDirectionEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::FanControl::AirflowDirectionEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::FanControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::FanControl::AirflowDirectionEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::FanControl::AirflowDirectionEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::FanControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace AirflowDirection
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::FanControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::FanControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::FanControl::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::FanControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::FanControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::FanControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // FanControl
|
|
|
|
namespace ThermostatUserInterfaceConfiguration {
|
|
namespace Attributes {
|
|
|
|
namespace TemperatureDisplayMode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::ThermostatUserInterfaceConfiguration::TemperatureDisplayModeEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::ThermostatUserInterfaceConfiguration::TemperatureDisplayModeEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::ThermostatUserInterfaceConfiguration::TemperatureDisplayModeEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::ThermostatUserInterfaceConfiguration::TemperatureDisplayModeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::ThermostatUserInterfaceConfiguration::TemperatureDisplayModeEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::ThermostatUserInterfaceConfiguration::TemperatureDisplayModeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace TemperatureDisplayMode
|
|
|
|
namespace KeypadLockout {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::ThermostatUserInterfaceConfiguration::KeypadLockoutEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::ThermostatUserInterfaceConfiguration::KeypadLockoutEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::ThermostatUserInterfaceConfiguration::KeypadLockoutEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::ThermostatUserInterfaceConfiguration::KeypadLockoutEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::ThermostatUserInterfaceConfiguration::KeypadLockoutEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::ThermostatUserInterfaceConfiguration::KeypadLockoutEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace KeypadLockout
|
|
|
|
namespace ScheduleProgrammingVisibility {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::ThermostatUserInterfaceConfiguration::ScheduleProgrammingVisibilityEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::ThermostatUserInterfaceConfiguration::ScheduleProgrammingVisibilityEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::ThermostatUserInterfaceConfiguration::ScheduleProgrammingVisibilityEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::ThermostatUserInterfaceConfiguration::ScheduleProgrammingVisibilityEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::ThermostatUserInterfaceConfiguration::ScheduleProgrammingVisibilityEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::ThermostatUserInterfaceConfiguration::ScheduleProgrammingVisibilityEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ScheduleProgrammingVisibility
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // ThermostatUserInterfaceConfiguration
|
|
|
|
namespace ColorControl {
|
|
namespace Attributes {
|
|
|
|
namespace CurrentHue {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace CurrentHue
|
|
|
|
namespace CurrentSaturation {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace CurrentSaturation
|
|
|
|
namespace RemainingTime {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace RemainingTime
|
|
|
|
namespace CurrentX {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace CurrentX
|
|
|
|
namespace CurrentY {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace CurrentY
|
|
|
|
namespace DriftCompensation {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::ColorControl::DriftCompensationEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::ColorControl::DriftCompensationEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::ColorControl::DriftCompensationEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::ColorControl::DriftCompensationEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::ColorControl::DriftCompensationEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::ColorControl::DriftCompensationEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace DriftCompensation
|
|
|
|
namespace CompensationText {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value)
|
|
{
|
|
uint8_t zclString[254 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 254, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[1], 254);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(254 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 254, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[254 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value)
|
|
{
|
|
|
|
static_assert(254 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 254, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[254 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace CompensationText
|
|
|
|
namespace ColorTemperatureMireds {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ColorTemperatureMireds
|
|
|
|
namespace ColorMode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::ColorControl::ColorModeEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::ColorControl::ColorModeEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::ColorControl::ColorModeEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::ColorControl::ColorModeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::ColorControl::ColorModeEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::ColorControl::ColorModeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ColorMode
|
|
|
|
namespace Options {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::ColorControl::OptionsBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Options
|
|
|
|
namespace NumberOfPrimaries {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NumberOfPrimaries
|
|
|
|
namespace Primary1X {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Primary1X
|
|
|
|
namespace Primary1Y {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Primary1Y
|
|
|
|
namespace Primary1Intensity {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace Primary1Intensity
|
|
|
|
namespace Primary2X {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Primary2X
|
|
|
|
namespace Primary2Y {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Primary2Y
|
|
|
|
namespace Primary2Intensity {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace Primary2Intensity
|
|
|
|
namespace Primary3X {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Primary3X
|
|
|
|
namespace Primary3Y {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Primary3Y
|
|
|
|
namespace Primary3Intensity {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace Primary3Intensity
|
|
|
|
namespace Primary4X {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Primary4X
|
|
|
|
namespace Primary4Y {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Primary4Y
|
|
|
|
namespace Primary4Intensity {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace Primary4Intensity
|
|
|
|
namespace Primary5X {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Primary5X
|
|
|
|
namespace Primary5Y {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Primary5Y
|
|
|
|
namespace Primary5Intensity {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace Primary5Intensity
|
|
|
|
namespace Primary6X {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Primary6X
|
|
|
|
namespace Primary6Y {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Primary6Y
|
|
|
|
namespace Primary6Intensity {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace Primary6Intensity
|
|
|
|
namespace WhitePointX {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace WhitePointX
|
|
|
|
namespace WhitePointY {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace WhitePointY
|
|
|
|
namespace ColorPointRX {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ColorPointRX
|
|
|
|
namespace ColorPointRY {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ColorPointRY
|
|
|
|
namespace ColorPointRIntensity {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace ColorPointRIntensity
|
|
|
|
namespace ColorPointGX {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ColorPointGX
|
|
|
|
namespace ColorPointGY {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ColorPointGY
|
|
|
|
namespace ColorPointGIntensity {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace ColorPointGIntensity
|
|
|
|
namespace ColorPointBX {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ColorPointBX
|
|
|
|
namespace ColorPointBY {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ColorPointBY
|
|
|
|
namespace ColorPointBIntensity {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace ColorPointBIntensity
|
|
|
|
namespace EnhancedCurrentHue {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace EnhancedCurrentHue
|
|
|
|
namespace EnhancedColorMode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::ColorControl::EnhancedColorModeEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::ColorControl::EnhancedColorModeEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::ColorControl::EnhancedColorModeEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::ColorControl::EnhancedColorModeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::ColorControl::EnhancedColorModeEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::ColorControl::EnhancedColorModeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace EnhancedColorMode
|
|
|
|
namespace ColorLoopActive {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ColorLoopActive
|
|
|
|
namespace ColorLoopDirection {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ColorLoopDirection
|
|
|
|
namespace ColorLoopTime {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ColorLoopTime
|
|
|
|
namespace ColorLoopStartEnhancedHue {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ColorLoopStartEnhancedHue
|
|
|
|
namespace ColorLoopStoredEnhancedHue {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ColorLoopStoredEnhancedHue
|
|
|
|
namespace ColorCapabilities {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::ColorControl::ColorCapabilitiesBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::ColorControl::ColorCapabilitiesBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::ColorControl::ColorCapabilitiesBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::ColorControl::ColorCapabilitiesBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP16_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::ColorControl::ColorCapabilitiesBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::ColorControl::ColorCapabilitiesBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ColorCapabilities
|
|
|
|
namespace ColorTempPhysicalMinMireds {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ColorTempPhysicalMinMireds
|
|
|
|
namespace ColorTempPhysicalMaxMireds {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ColorTempPhysicalMaxMireds
|
|
|
|
namespace CoupleColorTempToLevelMinMireds {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace CoupleColorTempToLevelMinMireds
|
|
|
|
namespace StartUpColorTemperatureMireds {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace StartUpColorTemperatureMireds
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ColorControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // ColorControl
|
|
|
|
namespace BallastConfiguration {
|
|
namespace Attributes {
|
|
|
|
namespace PhysicalMinLevel {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BallastConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace PhysicalMinLevel
|
|
|
|
namespace PhysicalMaxLevel {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BallastConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace PhysicalMaxLevel
|
|
|
|
namespace BallastStatus {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::BallastConfiguration::BallastStatusBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::BallastConfiguration::BallastStatusBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::BallastConfiguration::BallastStatusBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::BallastConfiguration::BallastStatusBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BallastConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::BallastConfiguration::BallastStatusBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::BallastConfiguration::BallastStatusBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace BallastStatus
|
|
|
|
namespace MinLevel {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BallastConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace MinLevel
|
|
|
|
namespace MaxLevel {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BallastConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace MaxLevel
|
|
|
|
namespace IntrinsicBallastFactor {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BallastConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BallastConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace IntrinsicBallastFactor
|
|
|
|
namespace BallastFactorAdjustment {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BallastConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BallastConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace BallastFactorAdjustment
|
|
|
|
namespace LampQuantity {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BallastConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace LampQuantity
|
|
|
|
namespace LampType {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value)
|
|
{
|
|
uint8_t zclString[16 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 16, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[1], 16);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(16 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 16, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[16 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BallastConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value)
|
|
{
|
|
|
|
static_assert(16 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 16, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[16 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace LampType
|
|
|
|
namespace LampManufacturer {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value)
|
|
{
|
|
uint8_t zclString[16 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 16, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[1], 16);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(16 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 16, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[16 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BallastConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value)
|
|
{
|
|
|
|
static_assert(16 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 16, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[16 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace LampManufacturer
|
|
|
|
namespace LampRatedHours {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint32_t> & value)
|
|
{ using Traits = NumericAttributeTraits<OddSizedInteger<3, false>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<3, false>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BallastConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT24U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<3, false>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT24U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<3, false>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BallastConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT24U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<3, false>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT24U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace LampRatedHours
|
|
|
|
namespace LampBurnHours {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint32_t> & value)
|
|
{ using Traits = NumericAttributeTraits<OddSizedInteger<3, false>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<3, false>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BallastConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT24U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<3, false>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT24U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<3, false>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BallastConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT24U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<3, false>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT24U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace LampBurnHours
|
|
|
|
namespace LampAlarmMode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::BallastConfiguration::LampAlarmModeBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::BallastConfiguration::LampAlarmModeBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::BallastConfiguration::LampAlarmModeBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::BallastConfiguration::LampAlarmModeBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BallastConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::BallastConfiguration::LampAlarmModeBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::BallastConfiguration::LampAlarmModeBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace LampAlarmMode
|
|
|
|
namespace LampBurnHoursTripPoint {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint32_t> & value)
|
|
{ using Traits = NumericAttributeTraits<OddSizedInteger<3, false>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<3, false>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BallastConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT24U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<3, false>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT24U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<3, false>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BallastConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT24U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<3, false>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT24U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace LampBurnHoursTripPoint
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BallastConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::BallastConfiguration::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // BallastConfiguration
|
|
|
|
namespace IlluminanceMeasurement {
|
|
namespace Attributes {
|
|
|
|
namespace MeasuredValue {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::IlluminanceMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::IlluminanceMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace MeasuredValue
|
|
|
|
namespace MinMeasuredValue {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::IlluminanceMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::IlluminanceMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace MinMeasuredValue
|
|
|
|
namespace MaxMeasuredValue {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::IlluminanceMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::IlluminanceMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace MaxMeasuredValue
|
|
|
|
namespace Tolerance {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::IlluminanceMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Tolerance
|
|
|
|
namespace LightSensorType {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::app::Clusters::IlluminanceMeasurement::LightSensorTypeEnum> & value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::IlluminanceMeasurement::LightSensorTypeEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::IlluminanceMeasurement::LightSensorTypeEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::IlluminanceMeasurement::LightSensorTypeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::IlluminanceMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::IlluminanceMeasurement::LightSensorTypeEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::IlluminanceMeasurement::LightSensorTypeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::IlluminanceMeasurement::LightSensorTypeEnum>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::IlluminanceMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::IlluminanceMeasurement::LightSensorTypeEnum>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::app::Clusters::IlluminanceMeasurement::LightSensorTypeEnum> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::app::Clusters::IlluminanceMeasurement::LightSensorTypeEnum> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace LightSensorType
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::IlluminanceMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::IlluminanceMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // IlluminanceMeasurement
|
|
|
|
namespace TemperatureMeasurement {
|
|
namespace Attributes {
|
|
|
|
namespace MeasuredValue {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<int16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::TemperatureMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::TemperatureMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace MeasuredValue
|
|
|
|
namespace MinMeasuredValue {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<int16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::TemperatureMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::TemperatureMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace MinMeasuredValue
|
|
|
|
namespace MaxMeasuredValue {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<int16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::TemperatureMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::TemperatureMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace MaxMeasuredValue
|
|
|
|
namespace Tolerance {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::TemperatureMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Tolerance
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::TemperatureMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::TemperatureMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // TemperatureMeasurement
|
|
|
|
namespace PressureMeasurement {
|
|
namespace Attributes {
|
|
|
|
namespace MeasuredValue {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<int16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PressureMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PressureMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace MeasuredValue
|
|
|
|
namespace MinMeasuredValue {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<int16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PressureMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PressureMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace MinMeasuredValue
|
|
|
|
namespace MaxMeasuredValue {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<int16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PressureMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PressureMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace MaxMeasuredValue
|
|
|
|
namespace Tolerance {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PressureMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Tolerance
|
|
|
|
namespace ScaledValue {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<int16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PressureMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PressureMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace ScaledValue
|
|
|
|
namespace MinScaledValue {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<int16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PressureMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PressureMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace MinScaledValue
|
|
|
|
namespace MaxScaledValue {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<int16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PressureMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PressureMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace MaxScaledValue
|
|
|
|
namespace ScaledTolerance {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PressureMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ScaledTolerance
|
|
|
|
namespace Scale {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, int8_t * value)
|
|
{ using Traits = NumericAttributeTraits<int8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PressureMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Scale
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PressureMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::PressureMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // PressureMeasurement
|
|
|
|
namespace FlowMeasurement {
|
|
namespace Attributes {
|
|
|
|
namespace MeasuredValue {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::FlowMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::FlowMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace MeasuredValue
|
|
|
|
namespace MinMeasuredValue {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::FlowMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::FlowMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace MinMeasuredValue
|
|
|
|
namespace MaxMeasuredValue {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::FlowMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::FlowMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace MaxMeasuredValue
|
|
|
|
namespace Tolerance {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::FlowMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Tolerance
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::FlowMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::FlowMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // FlowMeasurement
|
|
|
|
namespace RelativeHumidityMeasurement {
|
|
namespace Attributes {
|
|
|
|
namespace MeasuredValue {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace MeasuredValue
|
|
|
|
namespace MinMeasuredValue {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace MinMeasuredValue
|
|
|
|
namespace MaxMeasuredValue {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace MaxMeasuredValue
|
|
|
|
namespace Tolerance {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Tolerance
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // RelativeHumidityMeasurement
|
|
|
|
namespace OccupancySensing {
|
|
namespace Attributes {
|
|
|
|
namespace Occupancy {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::OccupancySensing::OccupancyBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::OccupancySensing::OccupancyBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::OccupancySensing::OccupancyBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::OccupancySensing::OccupancyBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OccupancySensing::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::OccupancySensing::OccupancyBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::OccupancySensing::OccupancyBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Occupancy
|
|
|
|
namespace OccupancySensorType {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::OccupancySensing::OccupancySensorTypeEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::OccupancySensing::OccupancySensorTypeEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::OccupancySensing::OccupancySensorTypeEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::OccupancySensing::OccupancySensorTypeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OccupancySensing::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::OccupancySensing::OccupancySensorTypeEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::OccupancySensing::OccupancySensorTypeEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace OccupancySensorType
|
|
|
|
namespace OccupancySensorTypeBitmap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::OccupancySensing::OccupancySensorTypeBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::OccupancySensing::OccupancySensorTypeBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::OccupancySensing::OccupancySensorTypeBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::OccupancySensing::OccupancySensorTypeBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OccupancySensing::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::OccupancySensing::OccupancySensorTypeBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::OccupancySensing::OccupancySensorTypeBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace OccupancySensorTypeBitmap
|
|
|
|
namespace PIROccupiedToUnoccupiedDelay {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OccupancySensing::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace PIROccupiedToUnoccupiedDelay
|
|
|
|
namespace PIRUnoccupiedToOccupiedDelay {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OccupancySensing::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace PIRUnoccupiedToOccupiedDelay
|
|
|
|
namespace PIRUnoccupiedToOccupiedThreshold {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OccupancySensing::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace PIRUnoccupiedToOccupiedThreshold
|
|
|
|
namespace UltrasonicOccupiedToUnoccupiedDelay {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OccupancySensing::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace UltrasonicOccupiedToUnoccupiedDelay
|
|
|
|
namespace UltrasonicUnoccupiedToOccupiedDelay {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OccupancySensing::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace UltrasonicUnoccupiedToOccupiedDelay
|
|
|
|
namespace UltrasonicUnoccupiedToOccupiedThreshold {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OccupancySensing::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace UltrasonicUnoccupiedToOccupiedThreshold
|
|
|
|
namespace PhysicalContactOccupiedToUnoccupiedDelay {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OccupancySensing::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace PhysicalContactOccupiedToUnoccupiedDelay
|
|
|
|
namespace PhysicalContactUnoccupiedToOccupiedDelay {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OccupancySensing::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace PhysicalContactUnoccupiedToOccupiedDelay
|
|
|
|
namespace PhysicalContactUnoccupiedToOccupiedThreshold {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OccupancySensing::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace PhysicalContactUnoccupiedToOccupiedThreshold
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OccupancySensing::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // OccupancySensing
|
|
|
|
namespace CarbonMonoxideConcentrationMeasurement {
|
|
namespace Attributes {
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // CarbonMonoxideConcentrationMeasurement
|
|
|
|
namespace CarbonDioxideConcentrationMeasurement {
|
|
namespace Attributes {
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // CarbonDioxideConcentrationMeasurement
|
|
|
|
namespace NitrogenDioxideConcentrationMeasurement {
|
|
namespace Attributes {
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // NitrogenDioxideConcentrationMeasurement
|
|
|
|
namespace OzoneConcentrationMeasurement {
|
|
namespace Attributes {
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // OzoneConcentrationMeasurement
|
|
|
|
namespace Pm25ConcentrationMeasurement {
|
|
namespace Attributes {
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Pm25ConcentrationMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Pm25ConcentrationMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Pm25ConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // Pm25ConcentrationMeasurement
|
|
|
|
namespace FormaldehydeConcentrationMeasurement {
|
|
namespace Attributes {
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::FormaldehydeConcentrationMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::FormaldehydeConcentrationMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::FormaldehydeConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // FormaldehydeConcentrationMeasurement
|
|
|
|
namespace Pm1ConcentrationMeasurement {
|
|
namespace Attributes {
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Pm1ConcentrationMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Pm1ConcentrationMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Pm1ConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // Pm1ConcentrationMeasurement
|
|
|
|
namespace Pm10ConcentrationMeasurement {
|
|
namespace Attributes {
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Pm10ConcentrationMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Pm10ConcentrationMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Pm10ConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // Pm10ConcentrationMeasurement
|
|
|
|
namespace TotalVolatileOrganicCompoundsConcentrationMeasurement {
|
|
namespace Attributes {
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // TotalVolatileOrganicCompoundsConcentrationMeasurement
|
|
|
|
namespace RadonConcentrationMeasurement {
|
|
namespace Attributes {
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::RadonConcentrationMeasurement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::RadonConcentrationMeasurement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::RadonConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // RadonConcentrationMeasurement
|
|
|
|
namespace WiFiNetworkManagement {
|
|
namespace Attributes {
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WiFiNetworkManagement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WiFiNetworkManagement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WiFiNetworkManagement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WiFiNetworkManagement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WiFiNetworkManagement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WiFiNetworkManagement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // WiFiNetworkManagement
|
|
|
|
namespace ThreadBorderRouterManagement {
|
|
namespace Attributes {
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ThreadBorderRouterManagement::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ThreadBorderRouterManagement::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ThreadBorderRouterManagement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // ThreadBorderRouterManagement
|
|
|
|
namespace ThreadNetworkDirectory {
|
|
namespace Attributes {
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ThreadNetworkDirectory::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ThreadNetworkDirectory::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ThreadNetworkDirectory::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ThreadNetworkDirectory::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ThreadNetworkDirectory::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ThreadNetworkDirectory::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // ThreadNetworkDirectory
|
|
|
|
namespace WakeOnLan {
|
|
namespace Attributes {
|
|
|
|
namespace MACAddress {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value)
|
|
{
|
|
uint8_t zclString[12 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WakeOnLan::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 12, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[1], 12);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(12 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 12, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[12 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WakeOnLan::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value)
|
|
{
|
|
|
|
static_assert(12 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 12, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[12 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::WakeOnLan::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace MACAddress
|
|
|
|
namespace LinkLocalAddress {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableByteSpan & value)
|
|
{
|
|
uint8_t zclString[16 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WakeOnLan::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 16, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[1], 16);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::ByteSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(16 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 16, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[16 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WakeOnLan::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::ByteSpan value)
|
|
{
|
|
|
|
static_assert(16 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 16, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[16 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::WakeOnLan::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace LinkLocalAddress
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WakeOnLan::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WakeOnLan::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WakeOnLan::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WakeOnLan::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WakeOnLan::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WakeOnLan::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // WakeOnLan
|
|
|
|
namespace Channel {
|
|
namespace Attributes {
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Channel::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Channel::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Channel::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Channel::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Channel::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Channel::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // Channel
|
|
|
|
namespace TargetNavigator {
|
|
namespace Attributes {
|
|
|
|
namespace CurrentTarget {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::TargetNavigator::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::TargetNavigator::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::TargetNavigator::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace CurrentTarget
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::TargetNavigator::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::TargetNavigator::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::TargetNavigator::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::TargetNavigator::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::TargetNavigator::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::TargetNavigator::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // TargetNavigator
|
|
|
|
namespace MediaPlayback {
|
|
namespace Attributes {
|
|
|
|
namespace CurrentState {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::MediaPlayback::PlaybackStateEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::MediaPlayback::PlaybackStateEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::MediaPlayback::PlaybackStateEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::MediaPlayback::PlaybackStateEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::MediaPlayback::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::MediaPlayback::PlaybackStateEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::MediaPlayback::PlaybackStateEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace CurrentState
|
|
|
|
namespace StartTime {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint64_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint64_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint64_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint64_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::MediaPlayback::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_EPOCH_US_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint64_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint64_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_EPOCH_US_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint64_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::MediaPlayback::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_EPOCH_US_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint64_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_EPOCH_US_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint64_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint64_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace StartTime
|
|
|
|
namespace Duration {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint64_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint64_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint64_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint64_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::MediaPlayback::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT64U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint64_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint64_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint64_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::MediaPlayback::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT64U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint64_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint64_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint64_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace Duration
|
|
|
|
namespace PlaybackSpeed {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, float * value)
|
|
{ using Traits = NumericAttributeTraits<float>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, float value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<float>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::MediaPlayback::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_SINGLE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, float value)
|
|
{
|
|
using Traits = NumericAttributeTraits<float>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace PlaybackSpeed
|
|
|
|
namespace SeekRangeEnd {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint64_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint64_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint64_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint64_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::MediaPlayback::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT64U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint64_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint64_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint64_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::MediaPlayback::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT64U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint64_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint64_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint64_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace SeekRangeEnd
|
|
|
|
namespace SeekRangeStart {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint64_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint64_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint64_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint64_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::MediaPlayback::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT64U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint64_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint64_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint64_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::MediaPlayback::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT64U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint64_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint64_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint64_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace SeekRangeStart
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::MediaPlayback::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::MediaPlayback::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // MediaPlayback
|
|
|
|
namespace MediaInput {
|
|
namespace Attributes {
|
|
|
|
namespace CurrentInput {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::MediaInput::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::MediaInput::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::MediaInput::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace CurrentInput
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::MediaInput::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::MediaInput::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::MediaInput::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::MediaInput::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::MediaInput::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::MediaInput::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // MediaInput
|
|
|
|
namespace LowPower {
|
|
namespace Attributes {
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LowPower::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LowPower::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LowPower::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::LowPower::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::LowPower::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::LowPower::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // LowPower
|
|
|
|
namespace KeypadInput {
|
|
namespace Attributes {
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::KeypadInput::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::KeypadInput::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::KeypadInput::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::KeypadInput::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::KeypadInput::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::KeypadInput::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // KeypadInput
|
|
|
|
namespace ContentLauncher {
|
|
namespace Attributes {
|
|
|
|
namespace SupportedStreamingProtocols {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::ContentLauncher::SupportedProtocolsBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::ContentLauncher::SupportedProtocolsBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ContentLauncher::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::ContentLauncher::SupportedProtocolsBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::ContentLauncher::SupportedProtocolsBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ContentLauncher::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::ContentLauncher::SupportedProtocolsBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::ContentLauncher::SupportedProtocolsBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ContentLauncher::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace SupportedStreamingProtocols
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ContentLauncher::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ContentLauncher::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ContentLauncher::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ContentLauncher::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ContentLauncher::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ContentLauncher::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // ContentLauncher
|
|
|
|
namespace AudioOutput {
|
|
namespace Attributes {
|
|
|
|
namespace CurrentOutput {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::AudioOutput::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::AudioOutput::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::AudioOutput::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace CurrentOutput
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::AudioOutput::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::AudioOutput::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::AudioOutput::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::AudioOutput::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::AudioOutput::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::AudioOutput::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // AudioOutput
|
|
|
|
namespace ApplicationLauncher {
|
|
namespace Attributes {
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ApplicationLauncher::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ApplicationLauncher::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // ApplicationLauncher
|
|
|
|
namespace ApplicationBasic {
|
|
namespace Attributes {
|
|
|
|
namespace VendorName {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value)
|
|
{
|
|
uint8_t zclString[32 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 32, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[1], 32);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(32 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 32, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[32 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ApplicationBasic::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value)
|
|
{
|
|
|
|
static_assert(32 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 32, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[32 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace VendorName
|
|
|
|
namespace VendorID {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::VendorId * value)
|
|
{ using Traits = NumericAttributeTraits<chip::VendorId>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::VendorId value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::VendorId>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ApplicationBasic::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_VENDOR_ID_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::VendorId value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::VendorId>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_VENDOR_ID_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace VendorID
|
|
|
|
namespace ApplicationName {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value)
|
|
{
|
|
uint8_t zclString[256 + 2];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfLongStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint16_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 256, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[2], 256);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(256 < NumericAttributeTraits<uint16_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 256, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[256 + 2];
|
|
auto length = static_cast<uint16_t>(value.size());
|
|
Encoding::LittleEndian::Put16(zclString, length);
|
|
memcpy(&zclString[2], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ApplicationBasic::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_LONG_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value)
|
|
{
|
|
|
|
static_assert(256 < NumericAttributeTraits<uint16_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 256, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[256 + 2];
|
|
auto length = static_cast<uint16_t>(value.size());
|
|
Encoding::LittleEndian::Put16(zclString, length);
|
|
memcpy(&zclString[2], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, ZCL_LONG_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ApplicationName
|
|
|
|
namespace ProductID {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ApplicationBasic::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ProductID
|
|
|
|
namespace Status {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ApplicationBasic::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Status
|
|
|
|
namespace ApplicationVersion {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value)
|
|
{
|
|
uint8_t zclString[32 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 32, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[1], 32);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(32 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 32, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[32 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ApplicationBasic::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value)
|
|
{
|
|
|
|
static_assert(32 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 32, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[32 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ApplicationVersion
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ApplicationBasic::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ApplicationBasic::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // ApplicationBasic
|
|
|
|
namespace AccountLogin {
|
|
namespace Attributes {
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::AccountLogin::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::AccountLogin::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::AccountLogin::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::AccountLogin::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::AccountLogin::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::AccountLogin::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // AccountLogin
|
|
|
|
namespace ContentControl {
|
|
namespace Attributes {
|
|
|
|
namespace Enabled {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value)
|
|
{ using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ContentControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ContentControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Enabled
|
|
|
|
namespace OnDemandRatingThreshold {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value)
|
|
{
|
|
uint8_t zclString[8 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ContentControl::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 8, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[1], 8);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(8 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 8, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[8 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ContentControl::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value)
|
|
{
|
|
|
|
static_assert(8 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 8, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[8 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace OnDemandRatingThreshold
|
|
|
|
namespace ScheduledContentRatingThreshold {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value)
|
|
{
|
|
uint8_t zclString[8 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ContentControl::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 8, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[1], 8);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(8 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 8, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[8 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ContentControl::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value)
|
|
{
|
|
|
|
static_assert(8 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 8, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[8 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ScheduledContentRatingThreshold
|
|
|
|
namespace ScreenDailyTime {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ContentControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ContentControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ScreenDailyTime
|
|
|
|
namespace RemainingScreenTime {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ContentControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ContentControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace RemainingScreenTime
|
|
|
|
namespace BlockUnrated {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value)
|
|
{ using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ContentControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ContentControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace BlockUnrated
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ContentControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ContentControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ContentControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ContentControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // ContentControl
|
|
|
|
namespace ContentAppObserver {
|
|
namespace Attributes {
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ContentAppObserver::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ContentAppObserver::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ContentAppObserver::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::ContentAppObserver::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::ContentAppObserver::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::ContentAppObserver::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // ContentAppObserver
|
|
|
|
namespace WebRTCTransportProvider {
|
|
namespace Attributes {
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WebRTCTransportProvider::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WebRTCTransportProvider::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WebRTCTransportProvider::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WebRTCTransportProvider::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::WebRTCTransportProvider::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::WebRTCTransportProvider::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // WebRTCTransportProvider
|
|
|
|
namespace Chime {
|
|
namespace Attributes {
|
|
|
|
namespace ActiveChimeID {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Chime::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Chime::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Chime::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ActiveChimeID
|
|
|
|
namespace Enabled {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value)
|
|
{ using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Chime::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Chime::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Chime::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Enabled
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Chime::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Chime::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Chime::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Chime::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::Chime::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::Chime::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // Chime
|
|
|
|
namespace EcosystemInformation {
|
|
namespace Attributes {
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::EcosystemInformation::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::EcosystemInformation::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::EcosystemInformation::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::EcosystemInformation::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::EcosystemInformation::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::EcosystemInformation::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // EcosystemInformation
|
|
|
|
namespace CommissionerControl {
|
|
namespace Attributes {
|
|
|
|
namespace SupportedDeviceCategories {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::CommissionerControl::SupportedDeviceCategoryBitmap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::CommissionerControl::SupportedDeviceCategoryBitmap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::CommissionerControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::CommissionerControl::SupportedDeviceCategoryBitmap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::CommissionerControl::SupportedDeviceCategoryBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::CommissionerControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::CommissionerControl::SupportedDeviceCategoryBitmap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::CommissionerControl::SupportedDeviceCategoryBitmap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::CommissionerControl::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace SupportedDeviceCategories
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::CommissionerControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::CommissionerControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::CommissionerControl::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::CommissionerControl::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::CommissionerControl::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::CommissionerControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // CommissionerControl
|
|
|
|
namespace UnitTesting {
|
|
namespace Attributes {
|
|
|
|
namespace Boolean {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value)
|
|
{ using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Boolean
|
|
|
|
namespace Bitmap8 {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap8MaskMap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap8MaskMap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap8MaskMap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap8MaskMap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap8MaskMap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap8MaskMap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Bitmap8
|
|
|
|
namespace Bitmap16 {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap16MaskMap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap16MaskMap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap16MaskMap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap16MaskMap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP16_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap16MaskMap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap16MaskMap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Bitmap16
|
|
|
|
namespace Bitmap32 {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap32MaskMap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap32MaskMap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap32MaskMap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap32MaskMap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap32MaskMap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap32MaskMap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Bitmap32
|
|
|
|
namespace Bitmap64 {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap64MaskMap> * value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap64MaskMap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap64MaskMap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap64MaskMap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP64_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap64MaskMap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap64MaskMap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_BITMAP64_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Bitmap64
|
|
|
|
namespace Int8u {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Int8u
|
|
|
|
namespace Int16u {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Int16u
|
|
|
|
namespace Int24u {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<OddSizedInteger<3, false>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<3, false>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT24U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<3, false>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT24U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Int24u
|
|
|
|
namespace Int32u {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Int32u
|
|
|
|
namespace Int40u {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint64_t * value)
|
|
{ using Traits = NumericAttributeTraits<OddSizedInteger<5, false>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint64_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<5, false>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT40U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint64_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<5, false>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT40U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Int40u
|
|
|
|
namespace Int48u {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint64_t * value)
|
|
{ using Traits = NumericAttributeTraits<OddSizedInteger<6, false>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint64_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<6, false>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT48U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint64_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<6, false>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT48U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Int48u
|
|
|
|
namespace Int56u {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint64_t * value)
|
|
{ using Traits = NumericAttributeTraits<OddSizedInteger<7, false>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint64_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<7, false>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT56U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint64_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<7, false>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT56U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Int56u
|
|
|
|
namespace Int64u {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint64_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint64_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint64_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint64_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT64U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint64_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint64_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Int64u
|
|
|
|
namespace Int8s {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, int8_t * value)
|
|
{ using Traits = NumericAttributeTraits<int8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Int8s
|
|
|
|
namespace Int16s {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Int16s
|
|
|
|
namespace Int24s {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, int32_t * value)
|
|
{ using Traits = NumericAttributeTraits<OddSizedInteger<3, true>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<3, true>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT24S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<3, true>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT24S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Int24s
|
|
|
|
namespace Int32s {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, int32_t * value)
|
|
{ using Traits = NumericAttributeTraits<int32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT32S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT32S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Int32s
|
|
|
|
namespace Int40s {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, int64_t * value)
|
|
{ using Traits = NumericAttributeTraits<OddSizedInteger<5, true>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int64_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<5, true>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT40S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int64_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<5, true>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT40S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Int40s
|
|
|
|
namespace Int48s {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, int64_t * value)
|
|
{ using Traits = NumericAttributeTraits<OddSizedInteger<6, true>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int64_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<6, true>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT48S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int64_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<6, true>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT48S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Int48s
|
|
|
|
namespace Int56s {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, int64_t * value)
|
|
{ using Traits = NumericAttributeTraits<OddSizedInteger<7, true>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int64_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<7, true>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT56S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int64_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<7, true>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT56S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Int56s
|
|
|
|
namespace Int64s {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, int64_t * value)
|
|
{ using Traits = NumericAttributeTraits<int64_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int64_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int64_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT64S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int64_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int64_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT64S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Int64s
|
|
|
|
namespace Enum8 {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Enum8
|
|
|
|
namespace Enum16 {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM16_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_ENUM16_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Enum16
|
|
|
|
namespace FloatSingle {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, float * value)
|
|
{ using Traits = NumericAttributeTraits<float>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, float value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<float>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_SINGLE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, float value)
|
|
{
|
|
using Traits = NumericAttributeTraits<float>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FloatSingle
|
|
|
|
namespace FloatDouble {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, double * value)
|
|
{ using Traits = NumericAttributeTraits<double>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, double value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<double>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_DOUBLE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, double value)
|
|
{
|
|
using Traits = NumericAttributeTraits<double>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_DOUBLE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FloatDouble
|
|
|
|
namespace OctetString {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableByteSpan & value)
|
|
{
|
|
uint8_t zclString[10 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 10, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[1], 10);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::ByteSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(10 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 10, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[10 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::ByteSpan value)
|
|
{
|
|
|
|
static_assert(10 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 10, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[10 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace OctetString
|
|
|
|
namespace LongOctetString {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableByteSpan & value)
|
|
{
|
|
uint8_t zclString[1000 + 2];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfLongStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint16_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 1000, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[2], 1000);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::ByteSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(1000 < NumericAttributeTraits<uint16_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 1000, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[1000 + 2];
|
|
auto length = static_cast<uint16_t>(value.size());
|
|
Encoding::LittleEndian::Put16(zclString, length);
|
|
memcpy(&zclString[2], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_LONG_OCTET_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::ByteSpan value)
|
|
{
|
|
|
|
static_assert(1000 < NumericAttributeTraits<uint16_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 1000, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[1000 + 2];
|
|
auto length = static_cast<uint16_t>(value.size());
|
|
Encoding::LittleEndian::Put16(zclString, length);
|
|
memcpy(&zclString[2], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, zclString, ZCL_LONG_OCTET_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace LongOctetString
|
|
|
|
namespace CharString {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value)
|
|
{
|
|
uint8_t zclString[10 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 10, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[1], 10);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(10 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 10, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[10 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value)
|
|
{
|
|
|
|
static_assert(10 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 10, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[10 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace CharString
|
|
|
|
namespace LongCharString {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value)
|
|
{
|
|
uint8_t zclString[1000 + 2];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfLongStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint16_t>::kNullValue)
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
|
|
VerifyOrReturnError(value.size() == 1000, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(value.data(), &zclString[2], 1000);
|
|
value.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(1000 < NumericAttributeTraits<uint16_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 1000, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[1000 + 2];
|
|
auto length = static_cast<uint16_t>(value.size());
|
|
Encoding::LittleEndian::Put16(zclString, length);
|
|
memcpy(&zclString[2], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_LONG_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value)
|
|
{
|
|
|
|
static_assert(1000 < NumericAttributeTraits<uint16_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 1000, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[1000 + 2];
|
|
auto length = static_cast<uint16_t>(value.size());
|
|
Encoding::LittleEndian::Put16(zclString, length);
|
|
memcpy(&zclString[2], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, zclString, ZCL_LONG_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace LongCharString
|
|
|
|
namespace EpochUs {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint64_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint64_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint64_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint64_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_EPOCH_US_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint64_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint64_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_EPOCH_US_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace EpochUs
|
|
|
|
namespace EpochS {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace EpochS
|
|
|
|
namespace VendorId {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::VendorId * value)
|
|
{ using Traits = NumericAttributeTraits<chip::VendorId>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::VendorId value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::VendorId>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_VENDOR_ID_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::VendorId value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::VendorId>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_VENDOR_ID_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace VendorId
|
|
|
|
namespace EnumAttr {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::UnitTesting::SimpleEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::UnitTesting::SimpleEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::UnitTesting::SimpleEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::UnitTesting::SimpleEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::UnitTesting::SimpleEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::UnitTesting::SimpleEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace EnumAttr
|
|
|
|
namespace RangeRestrictedInt8u {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace RangeRestrictedInt8u
|
|
|
|
namespace RangeRestrictedInt8s {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, int8_t * value)
|
|
{ using Traits = NumericAttributeTraits<int8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace RangeRestrictedInt8s
|
|
|
|
namespace RangeRestrictedInt16u {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace RangeRestrictedInt16u
|
|
|
|
namespace RangeRestrictedInt16s {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace RangeRestrictedInt16s
|
|
|
|
namespace TimedWriteBoolean {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value)
|
|
{ using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace TimedWriteBoolean
|
|
|
|
namespace GlobalEnum {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::Globals::TestGlobalEnum * value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::Globals::TestGlobalEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Globals::TestGlobalEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::Globals::TestGlobalEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Globals::TestGlobalEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::Globals::TestGlobalEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace GlobalEnum
|
|
|
|
namespace Unsupported {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value)
|
|
{ using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace Unsupported
|
|
|
|
namespace ReadFailureCode {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ReadFailureCode
|
|
|
|
namespace FailureInt32U {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FailureInt32U
|
|
|
|
namespace NullableBoolean {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<bool> & value)
|
|
{ using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<bool> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<bool> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NullableBoolean
|
|
|
|
namespace NullableBitmap8 {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap8MaskMap>> & value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap8MaskMap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap8MaskMap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap8MaskMap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap8MaskMap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap8MaskMap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap8MaskMap>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap8MaskMap>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap8MaskMap>> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap8MaskMap>> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NullableBitmap8
|
|
|
|
namespace NullableBitmap16 {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap16MaskMap>> & value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap16MaskMap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap16MaskMap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap16MaskMap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP16_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap16MaskMap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap16MaskMap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap16MaskMap>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP16_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap16MaskMap>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap16MaskMap>> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap16MaskMap>> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NullableBitmap16
|
|
|
|
namespace NullableBitmap32 {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap32MaskMap>> & value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap32MaskMap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap32MaskMap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap32MaskMap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap32MaskMap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap32MaskMap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap32MaskMap>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap32MaskMap>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap32MaskMap>> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap32MaskMap>> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NullableBitmap32
|
|
|
|
namespace NullableBitmap64 {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap64MaskMap>> & value)
|
|
{ using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap64MaskMap>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap64MaskMap> value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap64MaskMap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP64_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap64MaskMap> value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap64MaskMap>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_BITMAP64_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap64MaskMap>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP64_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap64MaskMap>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_BITMAP64_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap64MaskMap>> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::BitMask<chip::app::Clusters::UnitTesting::Bitmap64MaskMap>> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NullableBitmap64
|
|
|
|
namespace NullableInt8u {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NullableInt8u
|
|
|
|
namespace NullableInt16u {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NullableInt16u
|
|
|
|
namespace NullableInt24u {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint32_t> & value)
|
|
{ using Traits = NumericAttributeTraits<OddSizedInteger<3, false>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<3, false>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT24U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<3, false>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT24U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<3, false>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT24U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<3, false>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT24U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NullableInt24u
|
|
|
|
namespace NullableInt32u {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint32_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint32_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NullableInt32u
|
|
|
|
namespace NullableInt40u {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint64_t> & value)
|
|
{ using Traits = NumericAttributeTraits<OddSizedInteger<5, false>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint64_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<5, false>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT40U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint64_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<5, false>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT40U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<5, false>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT40U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<5, false>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT40U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint64_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint64_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NullableInt40u
|
|
|
|
namespace NullableInt48u {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint64_t> & value)
|
|
{ using Traits = NumericAttributeTraits<OddSizedInteger<6, false>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint64_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<6, false>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT48U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint64_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<6, false>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT48U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<6, false>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT48U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<6, false>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT48U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint64_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint64_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NullableInt48u
|
|
|
|
namespace NullableInt56u {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint64_t> & value)
|
|
{ using Traits = NumericAttributeTraits<OddSizedInteger<7, false>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint64_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<7, false>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT56U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint64_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<7, false>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT56U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<7, false>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT56U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<7, false>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT56U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint64_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint64_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NullableInt56u
|
|
|
|
namespace NullableInt64u {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint64_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint64_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint64_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint64_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT64U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint64_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint64_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint64_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT64U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint64_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint64_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint64_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NullableInt64u
|
|
|
|
namespace NullableInt8s {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<int8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<int8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<int8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NullableInt8s
|
|
|
|
namespace NullableInt16s {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<int16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NullableInt16s
|
|
|
|
namespace NullableInt24s {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<int32_t> & value)
|
|
{ using Traits = NumericAttributeTraits<OddSizedInteger<3, true>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<3, true>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT24S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<3, true>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT24S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<3, true>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT24S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<3, true>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT24S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int32_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int32_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NullableInt24s
|
|
|
|
namespace NullableInt32s {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<int32_t> & value)
|
|
{ using Traits = NumericAttributeTraits<int32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT32S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT32S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int32_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT32S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<int32_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT32S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int32_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int32_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NullableInt32s
|
|
|
|
namespace NullableInt40s {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<int64_t> & value)
|
|
{ using Traits = NumericAttributeTraits<OddSizedInteger<5, true>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int64_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<5, true>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT40S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int64_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<5, true>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT40S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<5, true>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT40S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<5, true>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT40S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int64_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int64_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NullableInt40s
|
|
|
|
namespace NullableInt48s {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<int64_t> & value)
|
|
{ using Traits = NumericAttributeTraits<OddSizedInteger<6, true>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int64_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<6, true>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT48S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int64_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<6, true>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT48S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<6, true>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT48S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<6, true>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT48S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int64_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int64_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NullableInt48s
|
|
|
|
namespace NullableInt56s {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<int64_t> & value)
|
|
{ using Traits = NumericAttributeTraits<OddSizedInteger<7, true>>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int64_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<7, true>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT56S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int64_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<7, true>>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT56S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<7, true>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT56S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<OddSizedInteger<7, true>>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT56S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int64_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int64_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NullableInt56s
|
|
|
|
namespace NullableInt64s {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<int64_t> & value)
|
|
{ using Traits = NumericAttributeTraits<int64_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int64_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int64_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT64S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int64_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int64_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT64S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int64_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT64S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<int64_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT64S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int64_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int64_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NullableInt64s
|
|
|
|
namespace NullableEnum8 {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NullableEnum8
|
|
|
|
namespace NullableEnum16 {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM16_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_ENUM16_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM16_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_ENUM16_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NullableEnum16
|
|
|
|
namespace NullableFloatSingle {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<float> & value)
|
|
{ using Traits = NumericAttributeTraits<float>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, float value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<float>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_SINGLE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, float value)
|
|
{
|
|
using Traits = NumericAttributeTraits<float>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<float>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_SINGLE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<float>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<float> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<float> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NullableFloatSingle
|
|
|
|
namespace NullableFloatDouble {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<double> & value)
|
|
{ using Traits = NumericAttributeTraits<double>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, double value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<double>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_DOUBLE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, double value)
|
|
{
|
|
using Traits = NumericAttributeTraits<double>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_DOUBLE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<double>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_DOUBLE_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<double>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_DOUBLE_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<double> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<double> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NullableFloatDouble
|
|
|
|
namespace NullableOctetString {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::MutableByteSpan> & value)
|
|
{ if (value.IsNull()) {
|
|
ChipLogError(Zcl, "Null Nullable<Span> passed to UnitTesting::NullableOctetString::Get");
|
|
return Protocols::InteractionModel::Status::Failure;
|
|
}
|
|
|
|
|
|
uint8_t zclString[10 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
value.SetNull();
|
|
return Protocols::InteractionModel::Status::Success;
|
|
}
|
|
auto & span = value.Value();
|
|
|
|
VerifyOrReturnError(span.size() == 10, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(span.data(), &zclString[1], 10);
|
|
span.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::ByteSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(10 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 10, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[10 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::ByteSpan value)
|
|
{
|
|
|
|
static_assert(10 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 10, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[10 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
uint8_t zclString[1] = { 0xFF };
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
uint8_t zclString[1] = { 0xFF };
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::ByteSpan> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::ByteSpan> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NullableOctetString
|
|
|
|
namespace NullableCharString {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::MutableCharSpan> & value)
|
|
{ if (value.IsNull()) {
|
|
ChipLogError(Zcl, "Null Nullable<Span> passed to UnitTesting::NullableCharString::Get");
|
|
return Protocols::InteractionModel::Status::Failure;
|
|
}
|
|
|
|
|
|
uint8_t zclString[10 + 1];
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, zclString, sizeof(zclString));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
size_t length = emberAfStringLength(zclString);
|
|
if (length == NumericAttributeTraits<uint8_t>::kNullValue)
|
|
{
|
|
value.SetNull();
|
|
return Protocols::InteractionModel::Status::Success;
|
|
}
|
|
auto & span = value.Value();
|
|
|
|
VerifyOrReturnError(span.size() == 10, Protocols::InteractionModel::Status::InvalidDataType);
|
|
memcpy(span.data(), &zclString[1], 10);
|
|
span.reduce_size(length);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty)
|
|
{
|
|
|
|
static_assert(10 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 10, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[10 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value)
|
|
{
|
|
|
|
static_assert(10 < NumericAttributeTraits<uint8_t>::kNullValue,
|
|
"value.size() might be too big");
|
|
VerifyOrReturnError(value.size() <= 10, Protocols::InteractionModel::Status::ConstraintError);
|
|
uint8_t zclString[10 + 1];
|
|
auto length = static_cast<uint8_t>(value.size());
|
|
Encoding::Put8(zclString, length);
|
|
memcpy(&zclString[1], value.data(), value.size());
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
uint8_t zclString[1] = { 0xFF };
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
uint8_t zclString[1] = { 0xFF };
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::CharSpan> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::CharSpan> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NullableCharString
|
|
|
|
namespace NullableEnumAttr {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::app::Clusters::UnitTesting::SimpleEnum> & value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::UnitTesting::SimpleEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::UnitTesting::SimpleEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::UnitTesting::SimpleEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::UnitTesting::SimpleEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::UnitTesting::SimpleEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::UnitTesting::SimpleEnum>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::UnitTesting::SimpleEnum>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::app::Clusters::UnitTesting::SimpleEnum> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::app::Clusters::UnitTesting::SimpleEnum> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NullableEnumAttr
|
|
|
|
namespace NullableRangeRestrictedInt8u {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NullableRangeRestrictedInt8u
|
|
|
|
namespace NullableRangeRestrictedInt8s {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<int8_t> & value)
|
|
{ using Traits = NumericAttributeTraits<int8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<int8_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int8_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int8_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NullableRangeRestrictedInt8s
|
|
|
|
namespace NullableRangeRestrictedInt16u {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<uint16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<uint16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NullableRangeRestrictedInt16u
|
|
|
|
namespace NullableRangeRestrictedInt16s {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<int16_t> & value)
|
|
{ using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<int16_t>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<int16_t> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NullableRangeRestrictedInt16s
|
|
|
|
namespace WriteOnlyInt8u {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace WriteOnlyInt8u
|
|
|
|
namespace NullableGlobalEnum {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable<chip::app::Clusters::Globals::TestGlobalEnum> & value)
|
|
{ using Traits = NumericAttributeTraits<chip::app::Clusters::Globals::TestGlobalEnum>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (Traits::IsNullValue(temp))
|
|
{
|
|
value.SetNull();
|
|
}
|
|
else
|
|
{
|
|
value.SetNonNull() = Traits::StorageToWorking(temp);
|
|
}
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Globals::TestGlobalEnum value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::Globals::TestGlobalEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Globals::TestGlobalEnum value)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::Globals::TestGlobalEnum>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ true, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::Globals::TestGlobalEnum>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status SetNull(EndpointId endpoint)
|
|
{
|
|
using Traits = NumericAttributeTraits<chip::app::Clusters::Globals::TestGlobalEnum>;
|
|
Traits::StorageType value;
|
|
Traits::SetNull(value);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(value);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::app::Clusters::Globals::TestGlobalEnum> & value, MarkAttributeDirty markDirty)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint, markDirty);
|
|
}
|
|
|
|
return Set(endpoint, value.Value(), markDirty);
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable<chip::app::Clusters::Globals::TestGlobalEnum> & value)
|
|
{
|
|
if (value.IsNull()) {
|
|
return SetNull(endpoint);
|
|
}
|
|
|
|
return Set(endpoint, value.Value());
|
|
}
|
|
|
|
} // namespace NullableGlobalEnum
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
namespace MeiInt8u {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint8_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::UnitTesting::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint8_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace MeiInt8u
|
|
|
|
} // namespace Attributes
|
|
} // UnitTesting
|
|
|
|
namespace FaultInjection {
|
|
namespace Attributes {
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::FaultInjection::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::FaultInjection::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::FaultInjection::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::FaultInjection::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::FaultInjection::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::FaultInjection::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // FaultInjection
|
|
|
|
namespace SampleMei {
|
|
namespace Attributes {
|
|
|
|
namespace FlipFlop {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value)
|
|
{ using Traits = NumericAttributeTraits<bool>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::SampleMei::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::SampleMei::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
|
|
{
|
|
using Traits = NumericAttributeTraits<bool>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::SampleMei::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FlipFlop
|
|
|
|
namespace FeatureMap {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint32_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::SampleMei::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::SampleMei::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint32_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::SampleMei::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace FeatureMap
|
|
|
|
namespace ClusterRevision {
|
|
|
|
|
|
|
|
|
|
Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
|
|
{ using Traits = NumericAttributeTraits<uint16_t>;
|
|
Traits::StorageType temp;
|
|
uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
|
|
Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::SampleMei::Id, Id, readable, sizeof(temp));
|
|
VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
*value = Traits::StorageToWorking(temp);
|
|
return status;
|
|
}
|
|
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(
|
|
ConcreteAttributePath(endpoint, Clusters::SampleMei::Id, Id),
|
|
EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
|
|
}
|
|
|
|
Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
|
|
{
|
|
using Traits = NumericAttributeTraits<uint16_t>;
|
|
if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
|
|
{
|
|
return Protocols::InteractionModel::Status::ConstraintError;
|
|
}
|
|
Traits::StorageType storageValue;
|
|
Traits::WorkingToStorage(value, storageValue);
|
|
uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
|
|
return emberAfWriteAttribute(endpoint, Clusters::SampleMei::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
|
|
}
|
|
|
|
|
|
} // namespace ClusterRevision
|
|
|
|
} // namespace Attributes
|
|
} // SampleMei
|
|
|
|
|
|
} // Clusters
|
|
} // app
|
|
} // chip
|