| /* |
| * |
| * Copyright (c) 2021 Project CHIP Authors |
| * |
| * Licensed under the Apache License, Version 2.0 (the "License"); |
| * you may not use this file except in compliance with the License. |
| * You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| |
| // THIS FILE IS GENERATED BY ZAP |
| |
| #include <zap-generated/tests/CHIPClustersTest.h> |
| |
| #include <app/InteractionModelEngine.h> |
| #include <app/util/basic-types.h> |
| |
| #include <app-common/zap-generated/ids/Attributes.h> |
| #include <zap-generated/CHIPClientCallbacks.h> |
| |
| using namespace chip::app::Clusters; |
| using namespace chip::System; |
| using namespace chip::Encoding::LittleEndian; |
| |
| namespace chip { |
| namespace Controller { |
| |
| CHIP_ERROR AccountLoginClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR AdministratorCommissioningClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ApplicationBasicClusterTest::WriteAttributeVendorName(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| chip::CharSpan vendorName) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ApplicationBasic::Attributes::VendorName::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, vendorName)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ApplicationBasicClusterTest::WriteAttributeVendorId(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t vendorId) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ApplicationBasic::Attributes::VendorId::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, vendorId)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ApplicationBasicClusterTest::WriteAttributeApplicationName(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| chip::CharSpan applicationName) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ApplicationBasic::Attributes::ApplicationName::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, applicationName)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ApplicationBasicClusterTest::WriteAttributeProductId(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t productId) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ApplicationBasic::Attributes::ProductId::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, productId)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ApplicationBasicClusterTest::WriteAttributeApplicationId(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| chip::CharSpan applicationId) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ApplicationBasic::Attributes::ApplicationId::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, applicationId)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ApplicationBasicClusterTest::WriteAttributeCatalogVendorId(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t catalogVendorId) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ApplicationBasic::Attributes::CatalogVendorId::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, catalogVendorId)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ApplicationBasicClusterTest::WriteAttributeApplicationStatus(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t applicationStatus) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ApplicationBasic::Attributes::ApplicationStatus::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, applicationStatus)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ApplicationBasicClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ApplicationLauncherClusterTest::WriteAttributeCatalogVendorId(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t catalogVendorId) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ApplicationLauncher::Attributes::CatalogVendorId::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, catalogVendorId)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ApplicationLauncherClusterTest::WriteAttributeApplicationId(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t applicationId) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ApplicationLauncher::Attributes::ApplicationId::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, applicationId)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ApplicationLauncherClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR AudioOutputClusterTest::WriteAttributeCurrentAudioOutput(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t currentAudioOutput) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = AudioOutput::Attributes::CurrentAudioOutput::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, currentAudioOutput)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR AudioOutputClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BarrierControlClusterTest::WriteAttributeBarrierMovingState(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t barrierMovingState) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = BarrierControl::Attributes::BarrierMovingState::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, barrierMovingState)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BarrierControlClusterTest::WriteAttributeBarrierSafetyStatus(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t barrierSafetyStatus) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = BarrierControl::Attributes::BarrierSafetyStatus::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, barrierSafetyStatus)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BarrierControlClusterTest::WriteAttributeBarrierCapabilities(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t barrierCapabilities) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = BarrierControl::Attributes::BarrierCapabilities::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, barrierCapabilities)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BarrierControlClusterTest::WriteAttributeBarrierPosition(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t barrierPosition) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = BarrierControl::Attributes::BarrierPosition::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, barrierPosition)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BarrierControlClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BasicClusterTest::WriteAttributeInteractionModelVersion(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t interactionModelVersion) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Basic::Attributes::InteractionModelVersion::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, interactionModelVersion)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BasicClusterTest::WriteAttributeVendorName(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, chip::CharSpan vendorName) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Basic::Attributes::VendorName::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, vendorName)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BasicClusterTest::WriteAttributeVendorID(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t vendorID) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Basic::Attributes::VendorID::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, vendorID)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BasicClusterTest::WriteAttributeProductName(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, chip::CharSpan productName) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Basic::Attributes::ProductName::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, productName)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BasicClusterTest::WriteAttributeProductID(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t productID) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Basic::Attributes::ProductID::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, productID)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BasicClusterTest::WriteAttributeHardwareVersion(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t hardwareVersion) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Basic::Attributes::HardwareVersion::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, hardwareVersion)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BasicClusterTest::WriteAttributeHardwareVersionString(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| chip::CharSpan hardwareVersionString) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Basic::Attributes::HardwareVersionString::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, hardwareVersionString)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BasicClusterTest::WriteAttributeSoftwareVersion(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint32_t softwareVersion) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Basic::Attributes::SoftwareVersion::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, softwareVersion)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BasicClusterTest::WriteAttributeSoftwareVersionString(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| chip::CharSpan softwareVersionString) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Basic::Attributes::SoftwareVersionString::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, softwareVersionString)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BasicClusterTest::WriteAttributeManufacturingDate(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| chip::CharSpan manufacturingDate) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Basic::Attributes::ManufacturingDate::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, manufacturingDate)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BasicClusterTest::WriteAttributePartNumber(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, chip::CharSpan partNumber) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Basic::Attributes::PartNumber::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, partNumber)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BasicClusterTest::WriteAttributeProductURL(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, chip::CharSpan productURL) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Basic::Attributes::ProductURL::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, productURL)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BasicClusterTest::WriteAttributeProductLabel(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, chip::CharSpan productLabel) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Basic::Attributes::ProductLabel::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, productLabel)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BasicClusterTest::WriteAttributeSerialNumber(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, chip::CharSpan serialNumber) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Basic::Attributes::SerialNumber::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, serialNumber)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BasicClusterTest::WriteAttributeReachable(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, bool reachable) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Basic::Attributes::Reachable::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, reachable)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BasicClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BinaryInputBasicClusterTest::WriteAttributeStatusFlags(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint8_t statusFlags) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = BinaryInputBasic::Attributes::StatusFlags::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, statusFlags)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BinaryInputBasicClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BindingClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BooleanStateClusterTest::WriteAttributeStateValue(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, bool stateValue) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = BooleanState::Attributes::StateValue::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, stateValue)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BooleanStateClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BridgedDeviceBasicClusterTest::WriteAttributeVendorName(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| chip::CharSpan vendorName) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = BridgedDeviceBasic::Attributes::VendorName::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, vendorName)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BridgedDeviceBasicClusterTest::WriteAttributeVendorID(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t vendorID) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = BridgedDeviceBasic::Attributes::VendorID::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, vendorID)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BridgedDeviceBasicClusterTest::WriteAttributeProductName(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| chip::CharSpan productName) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = BridgedDeviceBasic::Attributes::ProductName::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, productName)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BridgedDeviceBasicClusterTest::WriteAttributeHardwareVersion(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t hardwareVersion) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = BridgedDeviceBasic::Attributes::HardwareVersion::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, hardwareVersion)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BridgedDeviceBasicClusterTest::WriteAttributeHardwareVersionString(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| chip::CharSpan hardwareVersionString) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = BridgedDeviceBasic::Attributes::HardwareVersionString::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, hardwareVersionString)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BridgedDeviceBasicClusterTest::WriteAttributeSoftwareVersion(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t softwareVersion) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = BridgedDeviceBasic::Attributes::SoftwareVersion::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, softwareVersion)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BridgedDeviceBasicClusterTest::WriteAttributeSoftwareVersionString(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| chip::CharSpan softwareVersionString) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = BridgedDeviceBasic::Attributes::SoftwareVersionString::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, softwareVersionString)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BridgedDeviceBasicClusterTest::WriteAttributeManufacturingDate(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| chip::CharSpan manufacturingDate) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = BridgedDeviceBasic::Attributes::ManufacturingDate::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, manufacturingDate)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BridgedDeviceBasicClusterTest::WriteAttributePartNumber(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| chip::CharSpan partNumber) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = BridgedDeviceBasic::Attributes::PartNumber::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, partNumber)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BridgedDeviceBasicClusterTest::WriteAttributeProductURL(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| chip::CharSpan productURL) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = BridgedDeviceBasic::Attributes::ProductURL::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, productURL)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BridgedDeviceBasicClusterTest::WriteAttributeProductLabel(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| chip::CharSpan productLabel) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = BridgedDeviceBasic::Attributes::ProductLabel::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, productLabel)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BridgedDeviceBasicClusterTest::WriteAttributeSerialNumber(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| chip::CharSpan serialNumber) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = BridgedDeviceBasic::Attributes::SerialNumber::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, serialNumber)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BridgedDeviceBasicClusterTest::WriteAttributeReachable(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, bool reachable) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = BridgedDeviceBasic::Attributes::Reachable::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, reachable)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR BridgedDeviceBasicClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributeCurrentHue(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint8_t currentHue) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::CurrentHue::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, currentHue)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributeCurrentSaturation(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t currentSaturation) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::CurrentSaturation::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, currentSaturation)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributeRemainingTime(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t remainingTime) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::RemainingTime::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, remainingTime)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributeCurrentX(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t currentX) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::CurrentX::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, currentX)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributeCurrentY(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t currentY) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::CurrentY::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, currentY)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributeDriftCompensation(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t driftCompensation) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::DriftCompensation::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, driftCompensation)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributeCompensationText(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| chip::CharSpan compensationText) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::CompensationText::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, compensationText)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributeColorTemperature(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t colorTemperature) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::ColorTemperature::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, colorTemperature)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributeColorMode(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint8_t colorMode) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::ColorMode::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, colorMode)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributeNumberOfPrimaries(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t numberOfPrimaries) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::NumberOfPrimaries::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, numberOfPrimaries)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary1X(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t primary1X) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::Primary1X::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, primary1X)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary1Y(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t primary1Y) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::Primary1Y::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, primary1Y)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary1Intensity(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t primary1Intensity) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::Primary1Intensity::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, primary1Intensity)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary2X(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t primary2X) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::Primary2X::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, primary2X)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary2Y(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t primary2Y) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::Primary2Y::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, primary2Y)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary2Intensity(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t primary2Intensity) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::Primary2Intensity::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, primary2Intensity)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary3X(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t primary3X) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::Primary3X::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, primary3X)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary3Y(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t primary3Y) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::Primary3Y::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, primary3Y)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary3Intensity(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t primary3Intensity) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::Primary3Intensity::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, primary3Intensity)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary4X(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t primary4X) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::Primary4X::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, primary4X)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary4Y(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t primary4Y) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::Primary4Y::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, primary4Y)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary4Intensity(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t primary4Intensity) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::Primary4Intensity::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, primary4Intensity)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary5X(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t primary5X) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::Primary5X::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, primary5X)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary5Y(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t primary5Y) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::Primary5Y::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, primary5Y)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary5Intensity(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t primary5Intensity) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::Primary5Intensity::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, primary5Intensity)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary6X(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t primary6X) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::Primary6X::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, primary6X)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary6Y(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t primary6Y) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::Primary6Y::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, primary6Y)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary6Intensity(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t primary6Intensity) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::Primary6Intensity::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, primary6Intensity)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributeEnhancedCurrentHue(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t enhancedCurrentHue) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::EnhancedCurrentHue::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, enhancedCurrentHue)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributeEnhancedColorMode(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t enhancedColorMode) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::EnhancedColorMode::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, enhancedColorMode)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributeColorLoopActive(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint8_t colorLoopActive) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::ColorLoopActive::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, colorLoopActive)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributeColorLoopDirection(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t colorLoopDirection) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::ColorLoopDirection::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, colorLoopDirection)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributeColorLoopTime(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t colorLoopTime) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::ColorLoopTime::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, colorLoopTime)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributeColorLoopStartEnhancedHue(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t colorLoopStartEnhancedHue) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::ColorLoopStartEnhancedHue::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, colorLoopStartEnhancedHue)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributeColorLoopStoredEnhancedHue(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t colorLoopStoredEnhancedHue) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::ColorLoopStoredEnhancedHue::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, colorLoopStoredEnhancedHue)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributeColorCapabilities(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t colorCapabilities) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::ColorCapabilities::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, colorCapabilities)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributeColorTempPhysicalMin(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t colorTempPhysicalMin) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::ColorTempPhysicalMin::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, colorTempPhysicalMin)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributeColorTempPhysicalMax(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t colorTempPhysicalMax) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::ColorTempPhysicalMax::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, colorTempPhysicalMax)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributeCoupleColorTempToLevelMinMireds(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t coupleColorTempToLevelMinMireds) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ColorControl::Attributes::CoupleColorTempToLevelMinMireds::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, coupleColorTempToLevelMinMireds)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ColorControlClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ContentLauncherClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR DescriptorClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR DoorLockClusterTest::WriteAttributeLockState(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint8_t lockState) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = DoorLock::Attributes::LockState::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, lockState)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR DoorLockClusterTest::WriteAttributeLockType(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint8_t lockType) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = DoorLock::Attributes::LockType::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, lockType)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR DoorLockClusterTest::WriteAttributeActuatorEnabled(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, bool actuatorEnabled) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = DoorLock::Attributes::ActuatorEnabled::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, actuatorEnabled)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR DoorLockClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ElectricalMeasurementClusterTest::WriteAttributeMeasurementType(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t measurementType) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ElectricalMeasurement::Attributes::MeasurementType::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, measurementType)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ElectricalMeasurementClusterTest::WriteAttributeTotalActivePower(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| int32_t totalActivePower) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ElectricalMeasurement::Attributes::TotalActivePower::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, totalActivePower)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ElectricalMeasurementClusterTest::WriteAttributeRmsVoltage(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t rmsVoltage) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ElectricalMeasurement::Attributes::RmsVoltage::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, rmsVoltage)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ElectricalMeasurementClusterTest::WriteAttributeRmsVoltageMin(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t rmsVoltageMin) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ElectricalMeasurement::Attributes::RmsVoltageMin::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, rmsVoltageMin)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ElectricalMeasurementClusterTest::WriteAttributeRmsVoltageMax(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t rmsVoltageMax) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ElectricalMeasurement::Attributes::RmsVoltageMax::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, rmsVoltageMax)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ElectricalMeasurementClusterTest::WriteAttributeRmsCurrent(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t rmsCurrent) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ElectricalMeasurement::Attributes::RmsCurrent::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, rmsCurrent)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ElectricalMeasurementClusterTest::WriteAttributeRmsCurrentMin(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t rmsCurrentMin) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ElectricalMeasurement::Attributes::RmsCurrentMin::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, rmsCurrentMin)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ElectricalMeasurementClusterTest::WriteAttributeRmsCurrentMax(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t rmsCurrentMax) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ElectricalMeasurement::Attributes::RmsCurrentMax::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, rmsCurrentMax)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ElectricalMeasurementClusterTest::WriteAttributeActivePower(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| int16_t activePower) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ElectricalMeasurement::Attributes::ActivePower::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, activePower)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ElectricalMeasurementClusterTest::WriteAttributeActivePowerMin(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| int16_t activePowerMin) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ElectricalMeasurement::Attributes::ActivePowerMin::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, activePowerMin)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ElectricalMeasurementClusterTest::WriteAttributeActivePowerMax(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| int16_t activePowerMax) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ElectricalMeasurement::Attributes::ActivePowerMax::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, activePowerMax)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ElectricalMeasurementClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR EthernetNetworkDiagnosticsClusterTest::WriteAttributePHYRate(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint8_t PHYRate) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = EthernetNetworkDiagnostics::Attributes::PHYRate::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, PHYRate)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR EthernetNetworkDiagnosticsClusterTest::WriteAttributeFullDuplex(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| bool fullDuplex) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = EthernetNetworkDiagnostics::Attributes::FullDuplex::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, fullDuplex)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR EthernetNetworkDiagnosticsClusterTest::WriteAttributePacketRxCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint64_t packetRxCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = EthernetNetworkDiagnostics::Attributes::PacketRxCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, packetRxCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR EthernetNetworkDiagnosticsClusterTest::WriteAttributePacketTxCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint64_t packetTxCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = EthernetNetworkDiagnostics::Attributes::PacketTxCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, packetTxCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR EthernetNetworkDiagnosticsClusterTest::WriteAttributeTxErrCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint64_t txErrCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = EthernetNetworkDiagnostics::Attributes::TxErrCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, txErrCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR EthernetNetworkDiagnosticsClusterTest::WriteAttributeCollisionCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint64_t collisionCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = EthernetNetworkDiagnostics::Attributes::CollisionCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, collisionCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR EthernetNetworkDiagnosticsClusterTest::WriteAttributeOverrunCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint64_t overrunCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = EthernetNetworkDiagnostics::Attributes::OverrunCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, overrunCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR EthernetNetworkDiagnosticsClusterTest::WriteAttributeCarrierDetect(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| bool carrierDetect) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = EthernetNetworkDiagnostics::Attributes::CarrierDetect::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, carrierDetect)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR EthernetNetworkDiagnosticsClusterTest::WriteAttributeTimeSinceReset(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint64_t timeSinceReset) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = EthernetNetworkDiagnostics::Attributes::TimeSinceReset::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, timeSinceReset)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR EthernetNetworkDiagnosticsClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR FixedLabelClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR FlowMeasurementClusterTest::WriteAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, int16_t measuredValue) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = FlowMeasurement::Attributes::MeasuredValue::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, measuredValue)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR FlowMeasurementClusterTest::WriteAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| int16_t minMeasuredValue) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = FlowMeasurement::Attributes::MinMeasuredValue::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, minMeasuredValue)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR FlowMeasurementClusterTest::WriteAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| int16_t maxMeasuredValue) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = FlowMeasurement::Attributes::MaxMeasuredValue::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, maxMeasuredValue)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR FlowMeasurementClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR GeneralCommissioningClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR GeneralDiagnosticsClusterTest::WriteAttributeRebootCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t rebootCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = GeneralDiagnostics::Attributes::RebootCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, rebootCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR GeneralDiagnosticsClusterTest::WriteAttributeUpTime(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint64_t upTime) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = GeneralDiagnostics::Attributes::UpTime::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, upTime)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR GeneralDiagnosticsClusterTest::WriteAttributeTotalOperationalHours(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t totalOperationalHours) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = GeneralDiagnostics::Attributes::TotalOperationalHours::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, totalOperationalHours)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR GeneralDiagnosticsClusterTest::WriteAttributeBootReasons(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint8_t bootReasons) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = GeneralDiagnostics::Attributes::BootReasons::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, bootReasons)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR GeneralDiagnosticsClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR GroupKeyManagementClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR GroupsClusterTest::WriteAttributeNameSupport(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint8_t nameSupport) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Groups::Attributes::NameSupport::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, nameSupport)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR GroupsClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR IdentifyClusterTest::WriteAttributeIdentifyType(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint8_t identifyType) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Identify::Attributes::IdentifyType::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, identifyType)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR IdentifyClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR KeypadInputClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR LevelControlClusterTest::WriteAttributeCurrentLevel(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint8_t currentLevel) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = LevelControl::Attributes::CurrentLevel::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, currentLevel)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR LevelControlClusterTest::WriteAttributeRemainingTime(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t remainingTime) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = LevelControl::Attributes::RemainingTime::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, remainingTime)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR LevelControlClusterTest::WriteAttributeMinLevel(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint8_t minLevel) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = LevelControl::Attributes::MinLevel::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, minLevel)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR LevelControlClusterTest::WriteAttributeMaxLevel(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint8_t maxLevel) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = LevelControl::Attributes::MaxLevel::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, maxLevel)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR LevelControlClusterTest::WriteAttributeCurrentFrequency(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t currentFrequency) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = LevelControl::Attributes::CurrentFrequency::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, currentFrequency)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR LevelControlClusterTest::WriteAttributeMinFrequency(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t minFrequency) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = LevelControl::Attributes::MinFrequency::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, minFrequency)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR LevelControlClusterTest::WriteAttributeMaxFrequency(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t maxFrequency) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = LevelControl::Attributes::MaxFrequency::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, maxFrequency)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR LevelControlClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR LowPowerClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR MediaInputClusterTest::WriteAttributeCurrentMediaInput(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t currentMediaInput) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = MediaInput::Attributes::CurrentMediaInput::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, currentMediaInput)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR MediaInputClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR MediaPlaybackClusterTest::WriteAttributePlaybackState(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint8_t playbackState) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = MediaPlayback::Attributes::PlaybackState::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, playbackState)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR MediaPlaybackClusterTest::WriteAttributeStartTime(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint64_t startTime) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = MediaPlayback::Attributes::StartTime::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, startTime)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR MediaPlaybackClusterTest::WriteAttributeDuration(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint64_t duration) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = MediaPlayback::Attributes::Duration::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, duration)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR MediaPlaybackClusterTest::WriteAttributePositionUpdatedAt(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint64_t positionUpdatedAt) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = MediaPlayback::Attributes::PositionUpdatedAt::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, positionUpdatedAt)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR MediaPlaybackClusterTest::WriteAttributePosition(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint64_t position) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = MediaPlayback::Attributes::Position::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, position)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR MediaPlaybackClusterTest::WriteAttributePlaybackSpeed(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint64_t playbackSpeed) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = MediaPlayback::Attributes::PlaybackSpeed::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, playbackSpeed)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR MediaPlaybackClusterTest::WriteAttributeSeekRangeEnd(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint64_t seekRangeEnd) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = MediaPlayback::Attributes::SeekRangeEnd::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, seekRangeEnd)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR MediaPlaybackClusterTest::WriteAttributeSeekRangeStart(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint64_t seekRangeStart) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = MediaPlayback::Attributes::SeekRangeStart::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, seekRangeStart)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR MediaPlaybackClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR NetworkCommissioningClusterTest::WriteAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint32_t featureMap) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::FeatureMap::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, featureMap)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR NetworkCommissioningClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR OtaSoftwareUpdateProviderClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR OtaSoftwareUpdateRequestorClusterTest::WriteAttributeUpdatePossible(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| bool updatePossible) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = OtaSoftwareUpdateRequestor::Attributes::UpdatePossible::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, updatePossible)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR OtaSoftwareUpdateRequestorClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR OccupancySensingClusterTest::WriteAttributeOccupancy(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint8_t occupancy) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = OccupancySensing::Attributes::Occupancy::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, occupancy)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR OccupancySensingClusterTest::WriteAttributeOccupancySensorType(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t occupancySensorType) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = OccupancySensing::Attributes::OccupancySensorType::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, occupancySensorType)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR OccupancySensingClusterTest::WriteAttributeOccupancySensorTypeBitmap(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t occupancySensorTypeBitmap) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = OccupancySensing::Attributes::OccupancySensorTypeBitmap::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, occupancySensorTypeBitmap)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR OccupancySensingClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR OnOffClusterTest::WriteAttributeOnOff(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, |
| bool onOff) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = OnOff::Attributes::OnOff::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, onOff)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR OnOffClusterTest::WriteAttributeGlobalSceneControl(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, bool globalSceneControl) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = OnOff::Attributes::GlobalSceneControl::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, globalSceneControl)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR OnOffClusterTest::WriteAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint32_t featureMap) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::FeatureMap::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, featureMap)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR OnOffClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR OnOffSwitchConfigurationClusterTest::WriteAttributeSwitchType(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t switchType) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = OnOffSwitchConfiguration::Attributes::SwitchType::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, switchType)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR OnOffSwitchConfigurationClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR OperationalCredentialsClusterTest::WriteAttributeSupportedFabrics(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t supportedFabrics) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = OperationalCredentials::Attributes::SupportedFabrics::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, supportedFabrics)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR OperationalCredentialsClusterTest::WriteAttributeCommissionedFabrics(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t commissionedFabrics) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = OperationalCredentials::Attributes::CommissionedFabrics::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, commissionedFabrics)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR OperationalCredentialsClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PowerSourceClusterTest::WriteAttributeStatus(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint8_t status) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = PowerSource::Attributes::Status::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, status)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PowerSourceClusterTest::WriteAttributeOrder(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint8_t order) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = PowerSource::Attributes::Order::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, order)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PowerSourceClusterTest::WriteAttributeDescription(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, chip::CharSpan description) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = PowerSource::Attributes::Description::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, description)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PowerSourceClusterTest::WriteAttributeBatteryVoltage(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint32_t batteryVoltage) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = PowerSource::Attributes::BatteryVoltage::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, batteryVoltage)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PowerSourceClusterTest::WriteAttributeBatteryPercentRemaining(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t batteryPercentRemaining) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = PowerSource::Attributes::BatteryPercentRemaining::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, batteryPercentRemaining)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PowerSourceClusterTest::WriteAttributeBatteryTimeRemaining(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t batteryTimeRemaining) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = PowerSource::Attributes::BatteryTimeRemaining::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, batteryTimeRemaining)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PowerSourceClusterTest::WriteAttributeBatteryChargeLevel(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t batteryChargeLevel) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = PowerSource::Attributes::BatteryChargeLevel::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, batteryChargeLevel)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PowerSourceClusterTest::WriteAttributeBatteryChargeState(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t batteryChargeState) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = PowerSource::Attributes::BatteryChargeState::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, batteryChargeState)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PowerSourceClusterTest::WriteAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint32_t featureMap) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::FeatureMap::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, featureMap)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PowerSourceClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PressureMeasurementClusterTest::WriteAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| int16_t measuredValue) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = PressureMeasurement::Attributes::MeasuredValue::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, measuredValue)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PressureMeasurementClusterTest::WriteAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| int16_t minMeasuredValue) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = PressureMeasurement::Attributes::MinMeasuredValue::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, minMeasuredValue)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PressureMeasurementClusterTest::WriteAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| int16_t maxMeasuredValue) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = PressureMeasurement::Attributes::MaxMeasuredValue::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, maxMeasuredValue)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PressureMeasurementClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeMaxPressure(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| int16_t maxPressure) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = PumpConfigurationAndControl::Attributes::MaxPressure::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, maxPressure)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeMaxSpeed(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t maxSpeed) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = PumpConfigurationAndControl::Attributes::MaxSpeed::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, maxSpeed)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeMaxFlow(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t maxFlow) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = PumpConfigurationAndControl::Attributes::MaxFlow::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, maxFlow)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeMinConstPressure(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| int16_t minConstPressure) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = PumpConfigurationAndControl::Attributes::MinConstPressure::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, minConstPressure)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeMaxConstPressure(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| int16_t maxConstPressure) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = PumpConfigurationAndControl::Attributes::MaxConstPressure::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, maxConstPressure)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeMinCompPressure(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| int16_t minCompPressure) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = PumpConfigurationAndControl::Attributes::MinCompPressure::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, minCompPressure)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeMaxCompPressure(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| int16_t maxCompPressure) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = PumpConfigurationAndControl::Attributes::MaxCompPressure::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, maxCompPressure)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeMinConstSpeed(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t minConstSpeed) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = PumpConfigurationAndControl::Attributes::MinConstSpeed::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, minConstSpeed)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeMaxConstSpeed(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t maxConstSpeed) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = PumpConfigurationAndControl::Attributes::MaxConstSpeed::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, maxConstSpeed)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeMinConstFlow(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t minConstFlow) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = PumpConfigurationAndControl::Attributes::MinConstFlow::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, minConstFlow)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeMaxConstFlow(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t maxConstFlow) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = PumpConfigurationAndControl::Attributes::MaxConstFlow::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, maxConstFlow)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeMinConstTemp(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| int16_t minConstTemp) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = PumpConfigurationAndControl::Attributes::MinConstTemp::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, minConstTemp)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeMaxConstTemp(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| int16_t maxConstTemp) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = PumpConfigurationAndControl::Attributes::MaxConstTemp::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, maxConstTemp)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributePumpStatus(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t pumpStatus) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = PumpConfigurationAndControl::Attributes::PumpStatus::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, pumpStatus)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeEffectiveOperationMode(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t effectiveOperationMode) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = PumpConfigurationAndControl::Attributes::EffectiveOperationMode::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, effectiveOperationMode)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeEffectiveControlMode(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t effectiveControlMode) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = PumpConfigurationAndControl::Attributes::EffectiveControlMode::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, effectiveControlMode)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeCapacity(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| int16_t capacity) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = PumpConfigurationAndControl::Attributes::Capacity::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, capacity)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeSpeed(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t speed) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = PumpConfigurationAndControl::Attributes::Speed::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, speed)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeLifetimeEnergyConsumed(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t lifetimeEnergyConsumed) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = PumpConfigurationAndControl::Attributes::LifetimeEnergyConsumed::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, lifetimeEnergyConsumed)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeAlarmMask(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t alarmMask) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = PumpConfigurationAndControl::Attributes::AlarmMask::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, alarmMask)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t featureMap) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::FeatureMap::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, featureMap)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR RelativeHumidityMeasurementClusterTest::WriteAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t measuredValue) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = RelativeHumidityMeasurement::Attributes::MeasuredValue::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, measuredValue)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR RelativeHumidityMeasurementClusterTest::WriteAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t minMeasuredValue) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = RelativeHumidityMeasurement::Attributes::MinMeasuredValue::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, minMeasuredValue)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR RelativeHumidityMeasurementClusterTest::WriteAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t maxMeasuredValue) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, maxMeasuredValue)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR RelativeHumidityMeasurementClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ScenesClusterTest::WriteAttributeSceneCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint8_t sceneCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Scenes::Attributes::SceneCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, sceneCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ScenesClusterTest::WriteAttributeCurrentScene(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint8_t currentScene) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Scenes::Attributes::CurrentScene::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, currentScene)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ScenesClusterTest::WriteAttributeCurrentGroup(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t currentGroup) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Scenes::Attributes::CurrentGroup::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, currentGroup)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ScenesClusterTest::WriteAttributeSceneValid(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, bool sceneValid) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Scenes::Attributes::SceneValid::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, sceneValid)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ScenesClusterTest::WriteAttributeNameSupport(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint8_t nameSupport) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Scenes::Attributes::NameSupport::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, nameSupport)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ScenesClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR SoftwareDiagnosticsClusterTest::WriteAttributeCurrentHeapFree(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint64_t currentHeapFree) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = SoftwareDiagnostics::Attributes::CurrentHeapFree::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, currentHeapFree)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR SoftwareDiagnosticsClusterTest::WriteAttributeCurrentHeapUsed(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint64_t currentHeapUsed) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = SoftwareDiagnostics::Attributes::CurrentHeapUsed::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, currentHeapUsed)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR SoftwareDiagnosticsClusterTest::WriteAttributeCurrentHeapHighWatermark(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint64_t currentHeapHighWatermark) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = SoftwareDiagnostics::Attributes::CurrentHeapHighWatermark::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, currentHeapHighWatermark)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR SoftwareDiagnosticsClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR SwitchClusterTest::WriteAttributeNumberOfPositions(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint8_t numberOfPositions) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Switch::Attributes::NumberOfPositions::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, numberOfPositions)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR SwitchClusterTest::WriteAttributeCurrentPosition(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint8_t currentPosition) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Switch::Attributes::CurrentPosition::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, currentPosition)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR SwitchClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR TvChannelClusterTest::WriteAttributeTvChannelLineup(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| chip::ByteSpan tvChannelLineup) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = TvChannel::Attributes::TvChannelLineup::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, tvChannelLineup)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR TvChannelClusterTest::WriteAttributeCurrentTvChannel(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| chip::ByteSpan currentTvChannel) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = TvChannel::Attributes::CurrentTvChannel::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, currentTvChannel)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR TvChannelClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR TargetNavigatorClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR TemperatureMeasurementClusterTest::WriteAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| int16_t measuredValue) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = TemperatureMeasurement::Attributes::MeasuredValue::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, measuredValue)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR TemperatureMeasurementClusterTest::WriteAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| int16_t minMeasuredValue) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = TemperatureMeasurement::Attributes::MinMeasuredValue::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, minMeasuredValue)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR TemperatureMeasurementClusterTest::WriteAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| int16_t maxMeasuredValue) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = TemperatureMeasurement::Attributes::MaxMeasuredValue::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, maxMeasuredValue)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR TemperatureMeasurementClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR TestClusterClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThermostatClusterTest::WriteAttributeLocalTemperature(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, int16_t localTemperature) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Thermostat::Attributes::LocalTemperature::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, localTemperature)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThermostatClusterTest::WriteAttributeAbsMinHeatSetpointLimit(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| int16_t absMinHeatSetpointLimit) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Thermostat::Attributes::AbsMinHeatSetpointLimit::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, absMinHeatSetpointLimit)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThermostatClusterTest::WriteAttributeAbsMaxHeatSetpointLimit(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| int16_t absMaxHeatSetpointLimit) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Thermostat::Attributes::AbsMaxHeatSetpointLimit::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, absMaxHeatSetpointLimit)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThermostatClusterTest::WriteAttributeAbsMinCoolSetpointLimit(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| int16_t absMinCoolSetpointLimit) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Thermostat::Attributes::AbsMinCoolSetpointLimit::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, absMinCoolSetpointLimit)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThermostatClusterTest::WriteAttributeAbsMaxCoolSetpointLimit(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| int16_t absMaxCoolSetpointLimit) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Thermostat::Attributes::AbsMaxCoolSetpointLimit::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, absMaxCoolSetpointLimit)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThermostatClusterTest::WriteAttributeStartOfWeek(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint8_t startOfWeek) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Thermostat::Attributes::StartOfWeek::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, startOfWeek)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThermostatClusterTest::WriteAttributeNumberOfWeeklyTransitions(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t numberOfWeeklyTransitions) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Thermostat::Attributes::NumberOfWeeklyTransitions::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, numberOfWeeklyTransitions)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThermostatClusterTest::WriteAttributeNumberOfDailyTransitions(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t numberOfDailyTransitions) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Thermostat::Attributes::NumberOfDailyTransitions::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, numberOfDailyTransitions)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThermostatClusterTest::WriteAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint32_t featureMap) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::FeatureMap::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, featureMap)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThermostatClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThermostatUserInterfaceConfigurationClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeChannel(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint8_t channel) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::Channel::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, channel)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRoutingRole(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t routingRole) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::RoutingRole::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, routingRole)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeNetworkName(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| chip::ByteSpan networkName) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::NetworkName::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, networkName)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributePanId(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t panId) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::PanId::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, panId)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeExtendedPanId(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint64_t extendedPanId) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::ExtendedPanId::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, extendedPanId)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeMeshLocalPrefix(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| chip::ByteSpan meshLocalPrefix) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::MeshLocalPrefix::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, meshLocalPrefix)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeOverrunCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint64_t overrunCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::OverrunCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, overrunCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributePartitionId(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t partitionId) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::PartitionId::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, partitionId)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeWeighting(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint8_t weighting) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::Weighting::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, weighting)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeDataVersion(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t dataVersion) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::DataVersion::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, dataVersion)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeStableDataVersion(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t stableDataVersion) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::StableDataVersion::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, stableDataVersion)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeLeaderRouterId(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t leaderRouterId) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::LeaderRouterId::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, leaderRouterId)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeDetachedRoleCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t detachedRoleCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::DetachedRoleCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, detachedRoleCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeChildRoleCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t childRoleCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::ChildRoleCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, childRoleCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRouterRoleCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t routerRoleCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::RouterRoleCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, routerRoleCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeLeaderRoleCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t leaderRoleCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::LeaderRoleCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, leaderRoleCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeAttachAttemptCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t attachAttemptCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::AttachAttemptCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, attachAttemptCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributePartitionIdChangeCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t partitionIdChangeCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::PartitionIdChangeCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, partitionIdChangeCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeBetterPartitionAttachAttemptCount( |
| Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t betterPartitionAttachAttemptCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::BetterPartitionAttachAttemptCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, betterPartitionAttachAttemptCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeParentChangeCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t parentChangeCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::ParentChangeCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, parentChangeCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxTotalCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t txTotalCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::TxTotalCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, txTotalCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxUnicastCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t txUnicastCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::TxUnicastCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, txUnicastCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxBroadcastCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t txBroadcastCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::TxBroadcastCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, txBroadcastCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxAckRequestedCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t txAckRequestedCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::TxAckRequestedCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, txAckRequestedCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxAckedCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t txAckedCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::TxAckedCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, txAckedCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxNoAckRequestedCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t txNoAckRequestedCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::TxNoAckRequestedCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, txNoAckRequestedCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxDataCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t txDataCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::TxDataCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, txDataCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxDataPollCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t txDataPollCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::TxDataPollCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, txDataPollCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxBeaconCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t txBeaconCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::TxBeaconCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, txBeaconCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxBeaconRequestCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t txBeaconRequestCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::TxBeaconRequestCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, txBeaconRequestCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxOtherCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t txOtherCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::TxOtherCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, txOtherCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxRetryCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t txRetryCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::TxRetryCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, txRetryCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxDirectMaxRetryExpiryCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t txDirectMaxRetryExpiryCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::TxDirectMaxRetryExpiryCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, txDirectMaxRetryExpiryCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxIndirectMaxRetryExpiryCount( |
| Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint32_t txIndirectMaxRetryExpiryCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::TxIndirectMaxRetryExpiryCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, txIndirectMaxRetryExpiryCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxErrCcaCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t txErrCcaCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::TxErrCcaCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, txErrCcaCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxErrAbortCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t txErrAbortCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::TxErrAbortCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, txErrAbortCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxErrBusyChannelCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t txErrBusyChannelCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::TxErrBusyChannelCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, txErrBusyChannelCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxTotalCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t rxTotalCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::RxTotalCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, rxTotalCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxUnicastCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t rxUnicastCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::RxUnicastCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, rxUnicastCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxBroadcastCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t rxBroadcastCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::RxBroadcastCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, rxBroadcastCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxDataCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t rxDataCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::RxDataCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, rxDataCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxDataPollCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t rxDataPollCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::RxDataPollCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, rxDataPollCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxBeaconCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t rxBeaconCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::RxBeaconCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, rxBeaconCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxBeaconRequestCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t rxBeaconRequestCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::RxBeaconRequestCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, rxBeaconRequestCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxOtherCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t rxOtherCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::RxOtherCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, rxOtherCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxAddressFilteredCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t rxAddressFilteredCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::RxAddressFilteredCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, rxAddressFilteredCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxDestAddrFilteredCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t rxDestAddrFilteredCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::RxDestAddrFilteredCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, rxDestAddrFilteredCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxDuplicatedCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t rxDuplicatedCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::RxDuplicatedCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, rxDuplicatedCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxErrNoFrameCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t rxErrNoFrameCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::RxErrNoFrameCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, rxErrNoFrameCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxErrUnknownNeighborCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t rxErrUnknownNeighborCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::RxErrUnknownNeighborCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, rxErrUnknownNeighborCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxErrInvalidSrcAddrCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t rxErrInvalidSrcAddrCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::RxErrInvalidSrcAddrCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, rxErrInvalidSrcAddrCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxErrSecCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t rxErrSecCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::RxErrSecCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, rxErrSecCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxErrFcsCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t rxErrFcsCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::RxErrFcsCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, rxErrFcsCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxErrOtherCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t rxErrOtherCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::RxErrOtherCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, rxErrOtherCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeActiveTimestamp(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint64_t activeTimestamp) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::ActiveTimestamp::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, activeTimestamp)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributePendingTimestamp(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint64_t pendingTimestamp) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::PendingTimestamp::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, pendingTimestamp)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeDelay(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint32_t delay) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::Delay::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, delay)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeChannelMask(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| chip::ByteSpan channelMask) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = ThreadNetworkDiagnostics::Attributes::ChannelMask::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, channelMask)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WakeOnLanClusterTest::WriteAttributeWakeOnLanMacAddress(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| chip::CharSpan wakeOnLanMacAddress) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = WakeOnLan::Attributes::WakeOnLanMacAddress::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, wakeOnLanMacAddress)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WakeOnLanClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WiFiNetworkDiagnosticsClusterTest::WriteAttributeBssid(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, chip::ByteSpan bssid) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = WiFiNetworkDiagnostics::Attributes::Bssid::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, bssid)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WiFiNetworkDiagnosticsClusterTest::WriteAttributeSecurityType(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t securityType) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = WiFiNetworkDiagnostics::Attributes::SecurityType::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, securityType)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WiFiNetworkDiagnosticsClusterTest::WriteAttributeWiFiVersion(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t wiFiVersion) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = WiFiNetworkDiagnostics::Attributes::WiFiVersion::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, wiFiVersion)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WiFiNetworkDiagnosticsClusterTest::WriteAttributeChannelNumber(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t channelNumber) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = WiFiNetworkDiagnostics::Attributes::ChannelNumber::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, channelNumber)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WiFiNetworkDiagnosticsClusterTest::WriteAttributeRssi(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, int8_t rssi) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = WiFiNetworkDiagnostics::Attributes::Rssi::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, rssi)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WiFiNetworkDiagnosticsClusterTest::WriteAttributeBeaconLostCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t beaconLostCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = WiFiNetworkDiagnostics::Attributes::BeaconLostCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, beaconLostCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WiFiNetworkDiagnosticsClusterTest::WriteAttributeBeaconRxCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t beaconRxCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = WiFiNetworkDiagnostics::Attributes::BeaconRxCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, beaconRxCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WiFiNetworkDiagnosticsClusterTest::WriteAttributePacketMulticastRxCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t packetMulticastRxCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = WiFiNetworkDiagnostics::Attributes::PacketMulticastRxCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, packetMulticastRxCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WiFiNetworkDiagnosticsClusterTest::WriteAttributePacketMulticastTxCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t packetMulticastTxCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = WiFiNetworkDiagnostics::Attributes::PacketMulticastTxCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, packetMulticastTxCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WiFiNetworkDiagnosticsClusterTest::WriteAttributePacketUnicastRxCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t packetUnicastRxCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = WiFiNetworkDiagnostics::Attributes::PacketUnicastRxCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, packetUnicastRxCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WiFiNetworkDiagnosticsClusterTest::WriteAttributePacketUnicastTxCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint32_t packetUnicastTxCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = WiFiNetworkDiagnostics::Attributes::PacketUnicastTxCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, packetUnicastTxCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WiFiNetworkDiagnosticsClusterTest::WriteAttributeCurrentMaxRate(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint64_t currentMaxRate) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = WiFiNetworkDiagnostics::Attributes::CurrentMaxRate::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, currentMaxRate)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WiFiNetworkDiagnosticsClusterTest::WriteAttributeOverrunCount(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint64_t overrunCount) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = WiFiNetworkDiagnostics::Attributes::OverrunCount::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, overrunCount)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WiFiNetworkDiagnosticsClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WindowCoveringClusterTest::WriteAttributeType(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint8_t type) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = WindowCovering::Attributes::Type::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, type)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WindowCoveringClusterTest::WriteAttributeCurrentPositionLift(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t currentPositionLift) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = WindowCovering::Attributes::CurrentPositionLift::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, currentPositionLift)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WindowCoveringClusterTest::WriteAttributeCurrentPositionTilt(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t currentPositionTilt) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = WindowCovering::Attributes::CurrentPositionTilt::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, currentPositionTilt)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WindowCoveringClusterTest::WriteAttributeConfigStatus(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint8_t configStatus) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = WindowCovering::Attributes::ConfigStatus::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, configStatus)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WindowCoveringClusterTest::WriteAttributeCurrentPositionLiftPercentage(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t currentPositionLiftPercentage) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = WindowCovering::Attributes::CurrentPositionLiftPercentage::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, currentPositionLiftPercentage)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WindowCoveringClusterTest::WriteAttributeCurrentPositionTiltPercentage(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t currentPositionTiltPercentage) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = WindowCovering::Attributes::CurrentPositionTiltPercentage::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, currentPositionTiltPercentage)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WindowCoveringClusterTest::WriteAttributeOperationalStatus(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint8_t operationalStatus) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = WindowCovering::Attributes::OperationalStatus::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, operationalStatus)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WindowCoveringClusterTest::WriteAttributeTargetPositionLiftPercent100ths(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t targetPositionLiftPercent100ths) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = WindowCovering::Attributes::TargetPositionLiftPercent100ths::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, targetPositionLiftPercent100ths)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WindowCoveringClusterTest::WriteAttributeTargetPositionTiltPercent100ths(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t targetPositionTiltPercent100ths) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = WindowCovering::Attributes::TargetPositionTiltPercent100ths::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, targetPositionTiltPercent100ths)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WindowCoveringClusterTest::WriteAttributeEndProductType(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint8_t endProductType) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = WindowCovering::Attributes::EndProductType::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, endProductType)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WindowCoveringClusterTest::WriteAttributeCurrentPositionLiftPercent100ths(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t currentPositionLiftPercent100ths) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = WindowCovering::Attributes::CurrentPositionLiftPercent100ths::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, currentPositionLiftPercent100ths)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WindowCoveringClusterTest::WriteAttributeCurrentPositionTiltPercent100ths(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t currentPositionTiltPercent100ths) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = WindowCovering::Attributes::CurrentPositionTiltPercent100ths::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, currentPositionTiltPercent100ths)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WindowCoveringClusterTest::WriteAttributeInstalledOpenLimitLift(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t installedOpenLimitLift) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = WindowCovering::Attributes::InstalledOpenLimitLift::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, installedOpenLimitLift)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WindowCoveringClusterTest::WriteAttributeInstalledClosedLimitLift(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t installedClosedLimitLift) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = WindowCovering::Attributes::InstalledClosedLimitLift::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, installedClosedLimitLift)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WindowCoveringClusterTest::WriteAttributeInstalledOpenLimitTilt(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t installedOpenLimitTilt) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = WindowCovering::Attributes::InstalledOpenLimitTilt::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, installedOpenLimitTilt)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WindowCoveringClusterTest::WriteAttributeInstalledClosedLimitTilt(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t installedClosedLimitTilt) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = WindowCovering::Attributes::InstalledClosedLimitTilt::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, installedClosedLimitTilt)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WindowCoveringClusterTest::WriteAttributeSafetyStatus(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, uint16_t safetyStatus) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = WindowCovering::Attributes::SafetyStatus::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, safetyStatus)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| CHIP_ERROR WindowCoveringClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, |
| Callback::Cancelable * onFailureCallback, |
| uint16_t clusterRevision) |
| { |
| app::WriteClientHandle handle; |
| chip::app::AttributePathParams attributePath; |
| attributePath.mNodeId = mDevice->GetDeviceId(); |
| attributePath.mEndpointId = mEndpoint; |
| attributePath.mClusterId = mClusterId; |
| attributePath.mFieldId = Globals::Attributes::ClusterRevision::Id; |
| attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); |
| |
| ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); |
| ReturnErrorOnFailure(handle.EncodeAttributeWritePayload(attributePath, clusterRevision)); |
| |
| return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); |
| } |
| |
| } // namespace Controller |
| } // namespace chip |