From 73c0d299a30cea294b2d8ad11fc8112d84bb3d34 Mon Sep 17 00:00:00 2001 From: Pradip De Date: Mon, 7 Oct 2024 20:34:25 -0700 Subject: [PATCH] Camera AV Stream Management Server Impl * Delegate definition - Support for list entries per index - Support for Command handlers * Attributes support - Setters for Application to update values * Add attributes to json files * Autogen code changes to zzz_generated/ --- src/app/chip_data_model.gni | 5 + .../camera-av-stream-management-server.cpp | 1048 +++++++++++ .../camera-av-stream-management-server.h | 338 ++++ src/app/common/templates/config-data.yaml | 1 + .../zcl/zcl-with-test-extensions.json | 45 +- src/app/zap-templates/zcl/zcl.json | 45 +- src/app/zap_cluster_list.json | 4 +- .../zap-generated/attributes/Accessors.cpp | 1609 ----------------- .../zap-generated/attributes/Accessors.h | 217 --- .../app-common/zap-generated/callback.h | 78 - 10 files changed, 1483 insertions(+), 1907 deletions(-) create mode 100644 src/app/clusters/camera-av-stream-management-server/camera-av-stream-management-server.cpp create mode 100644 src/app/clusters/camera-av-stream-management-server/camera-av-stream-management-server.h diff --git a/src/app/chip_data_model.gni b/src/app/chip_data_model.gni index cc998948d835e7..2fb8d08a5def00 100644 --- a/src/app/chip_data_model.gni +++ b/src/app/chip_data_model.gni @@ -446,6 +446,11 @@ template("chip_data_model") { "${_app_root}/clusters/${cluster}/ArlEncoder.cpp", "${_app_root}/clusters/${cluster}/ArlEncoder.h", ] + } else if (cluster == "camera-av-stream-management-server") { + sources += [ + "${_app_root}/clusters/${cluster}/${cluster}.cpp", + "${_app_root}/clusters/${cluster}/${cluster}.h", + ] } else { sources += [ "${_app_root}/clusters/${cluster}/${cluster}.cpp" ] } diff --git a/src/app/clusters/camera-av-stream-management-server/camera-av-stream-management-server.cpp b/src/app/clusters/camera-av-stream-management-server/camera-av-stream-management-server.cpp new file mode 100644 index 00000000000000..8d8ece051c2326 --- /dev/null +++ b/src/app/clusters/camera-av-stream-management-server/camera-av-stream-management-server.cpp @@ -0,0 +1,1048 @@ +/** + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::CameraAVStreamMgmt; +using namespace chip::app::Clusters::CameraAVStreamMgmt::Structs; +using namespace chip::app::Clusters::CameraAVStreamMgmt::Attributes; +using namespace Protocols::InteractionModel; +using chip::Protocols::InteractionModel::Status; + +namespace chip { +namespace app { +namespace Clusters { +namespace CameraAVStreamMgmt { + +CameraAVStreamMgmtServer::CameraAVStreamMgmtServer(CameraAVStreamMgmtDelegate & aDelegate, EndpointId aEndpointId, ClusterId aClusterId, + BitMask aFeature, uint8_t aMaxConcurrentVideoEncoders, uint32_t aMaxEncodedPixelRate, + const VideoSensorParamsStruct & aVideoSensorParams, bool aNightVisionCapable, + const VideoResolutionStruct & aMinViewPort, uint32_t aMaxContentBufferSize, const AudioCapabilitiesStruct & aMicrophoneCapabilities, + const AudioCapabilitiesStruct & aSpkrCapabilities, TwoWayTalkSupportTypeEnum aTwoWayTalkSupport, + uint32_t aMaxNetworkBandwidth) : + CommandHandlerInterface(MakeOptional(aEndpointId), aClusterId), + AttributeAccessInterface(MakeOptional(aEndpointId), aClusterId), mDelegate(aDelegate), mEndpointId(aEndpointId), + mClusterId(aClusterId), mFeature(aFeature), mMaxConcurrentVideoEncoders(aMaxConcurrentVideoEncoders), mMaxEncodedPixelRate(aMaxEncodedPixelRate), + mVideoSensorParams(aVideoSensorParams), mNightVisionCapable(aNightVisionCapable), mMinViewPort(aMinViewPort), + mMaxContentBufferSize(aMaxContentBufferSize), mMicrophoneCapabilities(aMicrophoneCapabilities), mSpeakerCapabilities(aSpeakerCapabilities), + mTwoWayTalkSupport(aTwoWayTalkSupport), mMaxNetworkBandwidth(aMaxNetworkBandwidth) +{ + mDelegate.SetCameraAVStreamMgmtServer(this); +} + +CameraAVStreamMgmtServer::~CameraAVStreamMgmtServer() +{ + // Explicitly set the CameraAVStreamMgmtServer pointer in the Delegate to + // null. + mDelegate.SetCameraAVStreamMgmtServer(nullptr); + + CommandHandlerInterfaceRegistry::CameraAVStreamMgmtServer().UnregisterCommandHandler(this); + AttributeAccessInterfaceRegistry::CameraAVStreamMgmtServer().Unregister(this); +} + +CHIP_ERROR CameraAVStreamMgmtServer::Init() +{ + ReturnErrorOnFailure(InteractionModelEngine::GetCameraAVStreamMgmtServer()->RegisterCommandHandler(this)); + + VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); + + return CHIP_NO_ERROR; +} + +bool CameraAVStreamMgmtServer::HasFeature(Feature feature) const +{ + return mFeature.Has(feature); +} + +bool CameraAVStreamMgmtServer::IsLocalVideoRecordingEnabled() const +{ + return mLocalVideoRecordingEnabled; +} + +CHIP_ERROR CameraAVStreamMgmtServer::ReadAndEncodeRateDistortionTradeOffPoints(const AttributeValueEncoder::ListEncodeHelper & encoder) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + // Tell the delegate the read is starting.. + ReturnErrorOnFailure(mDelegate.StartRateDistortionTradeOffPointsRead()); + + for (uint8_t i = 0; true; i++) + { + Structs::RateDistortionTradeOffPointsStruct::Type rateDistortionTradeOffPoints; + + err = mDelegate.GetRateDistortionTradeOffPointByIndex(i, rateDistortionTradeOffPoints); + SuccessOrExit(err); + + err = encoder.Encode(rateDistortionTradeOffPoints); + SuccessOrExit(err); + } + +exit: + if (err == CHIP_ERROR_PROVIDER_LIST_EXHAUSTED) + { + // Convert end of list to CHIP_NO_ERROR + err = CHIP_NO_ERROR; + } + + // Tell the delegate the read is complete + err = mDelegate.EndRateDistortionTradeOffPointsRead(); + return err; +} + +CHIP_ERROR CameraAVStreamMgmtServer::ReadAndEncodeSupportedSnapshotParams(const AttributeValueEncoder::ListEncodeHelper & encoder) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + // Tell the delegate the read is starting.. + ReturnErrorOnFailure(mDelegate.StartSupportedSnapshotParamsRead()); + + for (uint8_t i = 0; true; i++) + { + Structs::SupportedSnapshotParamsStruct::Type supportedSnapshotParams; + + err = mDelegate.GetSupportedSnapshotParamByIndex(i, supportedSnapshotParams); + SuccessOrExit(err); + + err = encoder.Encode(supportedSnapshotParams); + SuccessOrExit(err); + } + +exit: + if (err == CHIP_ERROR_PROVIDER_LIST_EXHAUSTED) + { + // Convert end of list to CHIP_NO_ERROR + err = CHIP_NO_ERROR; + } + + // Tell the delegate the read is complete + err = mDelegate.EndSupportedSnapshotParamsRead(); + return err; +} + +CHIP_ERROR CameraAVStreamMgmtServer::ReadAndEncodeCurrentVideoCodecs(const AttributeValueEncoder::ListEncodeHelper & encoder) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + // Tell the delegate the read is starting.. + ReturnErrorOnFailure(mDelegate.StartCurrentVideoCodecsRead()); + + for (uint8_t i = 0; true; i++) + { + VideoCodecEnum videoCodec; + + err = mDelegate.GetCurrentVideoCodecByIndex(i, videoCodec); + SuccessOrExit(err); + + err = encoder.Encode(videoCodec); + SuccessOrExit(err); + } + +exit: + if (err == CHIP_ERROR_PROVIDER_LIST_EXHAUSTED) + { + // Convert end of list to CHIP_NO_ERROR + err = CHIP_NO_ERROR; + } + + // Tell the delegate the read is complete + err = mDelegate.EndCurrentVideoCodecsRead(); + return err; +} + +CHIP_ERROR CameraAVStreamMgmtServer::ReadAndEncodeFabricsUsingCamera(const AttributeValueEncoder::ListEncodeHelper & encoder) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + // Tell the delegate the read is starting.. + ReturnErrorOnFailure(mDelegate.StartFabricsUsingCameraRead()); + + for (uint8_t i = 0; true; i++) + { + chip::FabricIndex fabricIndex; + + err = mDelegate.GetFabricUsingCameraByIndex(i, fabricIndex); + SuccessOrExit(err); + + err = encoder.Encode(fabricIndex); + SuccessOrExit(err); + } + +exit: + if (err == CHIP_ERROR_PROVIDER_LIST_EXHAUSTED) + { + // Convert end of list to CHIP_NO_ERROR + err = CHIP_NO_ERROR; + } + + // Tell the delegate the read is complete + err = mDelegate.EndFabricsUsingCameraRead(); + return err; +} + +CHIP_ERROR CameraAVStreamMgmtServer::ReadAndEncodeAllocatedVideoStreams(const AttributeValueEncoder::ListEncodeHelper & encoder) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + // Tell the delegate the read is starting.. + ReturnErrorOnFailure(mDelegate.StartAllocatedVideoStreamsRead()); + + for (uint8_t i = 0; true; i++) + { + Structs::VideoStreamStruct::Type videoStream; + + err = mDelegate.GetAllocatedVideoStreamByIndex(i, videoStream); + SuccessOrExit(err); + + err = encoder.Encode(videoStream); + SuccessOrExit(err); + } + +exit: + if (err == CHIP_ERROR_PROVIDER_LIST_EXHAUSTED) + { + // Convert end of list to CHIP_NO_ERROR + err = CHIP_NO_ERROR; + } + + // Tell the delegate the read is complete + err = mDelegate.EndAllocatedVideoStreamsRead(); + return err; +} + +CHIP_ERROR CameraAVStreamMgmtServer::ReadAndEncodeAllocatedAudioStreams(const AttributeValueEncoder::ListEncodeHelper & encoder) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + // Tell the delegate the read is starting.. + ReturnErrorOnFailure(mDelegate.StartAllocatedAudioStreamsRead()); + + for (uint8_t i = 0; true; i++) + { + Structs::AudioStreamStruct::Type audioStream; + + err = mDelegate.GetAllocatedAudioStreamByIndex(i, audioStream); + SuccessOrExit(err); + + err = encoder.Encode(audioStream); + SuccessOrExit(err); + } + +exit: + if (err == CHIP_ERROR_PROVIDER_LIST_EXHAUSTED) + { + // Convert end of list to CHIP_NO_ERROR + err = CHIP_NO_ERROR; + } + + // Tell the delegate the read is complete + err = mDelegate.EndAllocatedAudioStreamsRead(); + return err; + +} + +CHIP_ERROR CameraAVStreamMgmtServer::ReadAndEncodeAllocatedSnapshotStreams(const AttributeValueEncoder::ListEncodeHelper & encoder) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + // Tell the delegate the read is starting.. + ReturnErrorOnFailure(mDelegate.StartAllocatedSnapshotStreamsRead()); + + for (uint8_t i = 0; true; i++) + { + Structs::SnapshotStreamStruct::Type snapshotStream; + + err = mDelegate.GetAllocatedSnapshotStreamByIndex(i, snapshotStream); + SuccessOrExit(err); + + err = encoder.Encode(snapshotStream); + SuccessOrExit(err); + } + +exit: + if (err == CHIP_ERROR_PROVIDER_LIST_EXHAUSTED) + { + // Convert end of list to CHIP_NO_ERROR + err = CHIP_NO_ERROR; + } + + // Tell the delegate the read is complete + err = mDelegate.EndAllocatedSnapshotStreamsRead(); + return err; + +} + +CHIP_ERROR CameraAVStreamMgmtServer::ReadAndEncodeRankedVideoStreamPrioritiesList(const AttributeValueEncoder::ListEncodeHelper & encoder) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + // Tell the delegate the read is starting.. + ReturnErrorOnFailure(mDelegate.StartRankedVideoStreamPrioritiesListRead()); + + for (uint8_t i = 0; true; i++) + { + StreamTypeEnum streamType; + + err = mDelegate.GetRankedVideoStreamPrioritiesListByIndex(i, streamType); + SuccessOrExit(err); + + err = encoder.Encode(streamType); + SuccessOrExit(err); + } + +exit: + if (err == CHIP_ERROR_PROVIDER_LIST_EXHAUSTED) + { + // Convert end of list to CHIP_NO_ERROR + err = CHIP_NO_ERROR; + } + + // Tell the delegate the read is complete + err = mDelegate.EndStartRankedVideoStreamPrioritiesListRead(); + return err; + +} + +// AttributeAccessInterface +CHIP_ERROR CameraAVStreamMgmtServer::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +{ + VerifyOrDie(aPath.mClusterId == CameraAVStreamMgmt::Id); + ChipLogError(Zcl, "Camera AVStream Management: Reading"); + + switch (aPath.mAttributeId) + { + case FeatureMap::Id: + ReturnErrorOnFailure(aEncoder.Encode(mFeature)); + break; + case MaxConcurrentVideoEncoders::Id: + ReturnErrorOnFailure(aEncoder.Encode(mMaxConcurrentVideoEncoders)); + break; + case MaxEncodedPixelRate::Id: + ReturnErrorOnFailure(aEncoder.Encode(mMaxEncodedPixelRate)); + break; + case VideoSensorParams::Id: + VerifyOrReturnError(HasFeature(Feature::kVideo), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, + ChipLogError(Zcl, "CameraAVStreamMgmt: can not get VideoSensorParams, feature is not supported")); + + ReturnErrorOnFailure(aEncoder.Encode(mVideoSensorParams)); + break; + case NightVisionCapable::Id: + VerifyOrReturnError(HasFeature(Feature::kVideo), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, + ChipLogError(Zcl, "CameraAVStreamMgmt: can not get VideoSensorParams, feature is not supported")); + ReturnErrorOnFailure(aEncoder.Encode(mNightVisionCapable)); + break; + case MinViewPort::Id: + VerifyOrReturnError(HasFeature(Feature::kVideo), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, + ChipLogError(Zcl, "CameraAVStreamMgmt: can not get MinViewPort, feature is not supported")); + ReturnErrorOnFailure(aEncoder.Encode(mMinViewPort)); + case RateDistortionTradeOffPoints::Id: + VerifyOrReturnError(HasFeature(Feature::kVideo), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, + ChipLogError(Zcl, "CameraAVStreamMgmt: can not get RateDistortionTradeOffPoints, feature is not supported")); + ReturnErrorOnFailure( + aEncoder.EncodeList([this](const auto & encoder) -> CHIP_ERROR { return this->ReadAndEncodeRateDistortionTradeOffPoints(encoder); })); + break; + case MaxContentBufferSize::Id: + VerifyOrReturnError(HasFeature(Feature::kVideo), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, + ChipLogError(Zcl, "CameraAVStreamMgmt: can not get MaxContentBufferSize, feature is not supported")); + ReturnErrorOnFailure(aEncoder.Encode(mMaxContentBufferSize)); + break; + case MicrophoneCapabilities::Id: + VerifyOrReturnError(HasFeature(Feature::kAudio), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, + ChipLogError(Zcl, "CameraAVStreamMgmt: can not get MicrophoneCapabilities, feature is not supported")); + ReturnErrorOnFailure(aEncoder.Encode(mMicrophoneCapabilities)); + break; + case SpeakerCapabilities::Id: + VerifyOrReturnError(HasFeature(Feature::kAudio) && HasFeature(Feature::kSpeaker), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, + ChipLogError(Zcl, "CameraAVStreamMgmt: can not get SpeakerCapabilities, feature is not supported")); + ReturnErrorOnFailure(aEncoder.Encode(mSpeakerCapabilities)); + break; + case TwoWayTalkSupport::Id: + VerifyOrReturnError(HasFeature(Feature::kAudio) && HasFeature(Feature::kSpeaker), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, + ChipLogError(Zcl, "CameraAVStreamMgmt: can not get TwoWayTalkSupport, feature is not supported")); + ReturnErrorOnFailure(aEncoder.Encode(mTwoWayTalkSupport)); + break; + case SupportedSnapshotParams::Id: + VerifyOrReturnError(HasFeature(Feature::kSnapshot), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, + ChipLogError(Zcl, "CameraAVStreamMgmt: can not get RateDistortionTradeOffPoints, feature is not supported")); + ReturnErrorOnFailure( + aEncoder.EncodeList([this](const auto & encoder) -> CHIP_ERROR { return this->ReadAndEncodeSupportedSnapshotParams(encoder); })); + break; + case MaxNetworkBandwidth::Id: + ReturnErrorOnFailure(aEncoder.Encode(mMaxNetworkBandwidth)); + break; + case CurrentFrameRate::Id: + VerifyOrReturnError(HasFeature(Feature::kVideo), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, + ChipLogError(Zcl, "CameraAVStreamMgmt: can not get CurrentFrameRate, feature is not supported")); + ReturnErrorOnFailure(aEncoder.Encode(mCurrentFrameRate)); + break; + case HDRModeEnabled::Id: + VerifyOrReturnError(HasFeature(Feature::kVideo), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, + ChipLogError(Zcl, "CameraAVStreamMgmt: can not get HDRModeEnabled, feature is not supported")); + ReturnErrorOnFailure(aEncoder.Encode(mHDRModeEnabled)); + break; + case CurrentVideoCodecs::Id: + VerifyOrReturnError(HasFeature(Feature::kVideo), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, + ChipLogError(Zcl, "CameraAVStreamMgmt: can not get CurrentVideoCodecs, feature is not supported")); + ReturnErrorOnFailure( + aEncoder.EncodeList([this](const auto & encoder) -> CHIP_ERROR { return this->ReadAndEncodeCurrentVideoCodecs(encoder); })); + break; + case CurrentSnapshotConfig::Id: + VerifyOrReturnError(HasFeature(Feature::kSnapshot), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, + ChipLogError(Zcl, "CameraAVStreamMgmt: can not get CurrentSnapshotConfig, feature is not supported")); + ReturnErrorOnFailure(aEncoder.Encode(mCurrentSnapshotConfig)); + break; + case FabricsUsingCamera::Id: + VerifyOrReturnError(HasFeature(Feature::kVideo), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, + ChipLogError(Zcl, "CameraAVStreamMgmt: can not get FabricsUsingCamera, feature is not supported")); + ReturnErrorOnFailure( + aEncoder.EncodeList([this](const auto & encoder) -> CHIP_ERROR { return this->ReadAndEncodeFabricsUsingCamera(encoder); })); + break; + case AllocatedVideoStreams::Id: + VerifyOrReturnError(HasFeature(Feature::kVideo), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, + ChipLogError(Zcl, "CameraAVStreamMgmt: can not get AllocatedVideoStreams, feature is not supported")); + + ReturnErrorOnFailure( + aEncoder.EncodeList([this](const auto & encoder) -> CHIP_ERROR { return this->ReadAndEncodeAllocatedVideoStreams(encoder); })); + break; + case AllocatedAudioStreams::Id: + VerifyOrReturnError(HasFeature(Feature::kAudio), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, + ChipLogError(Zcl, "CameraAVStreamMgmt: can not get AllocatedAudioStreams, feature is not supported")); + + ReturnErrorOnFailure( + aEncoder.EncodeList([this](const auto & encoder) -> CHIP_ERROR { return this->ReadAndEncodeAllocatedAudioStreams(encoder); })); + break; + case AllocatedSnapshotStreams::Id: + VerifyOrReturnError(HasFeature(Feature::kAudio), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, + ChipLogError(Zcl, "CameraAVStreamMgmt: can not get AllocatedSnapshotStreams, feature is not supported")); + + ReturnErrorOnFailure( + aEncoder.EncodeList([this](const auto & encoder) -> CHIP_ERROR { return this->ReadAndEncodeAllocatedSnapshotStreams(encoder); })); + break; + case RankedVideoStreamPrioritiesList::Id: + VerifyOrReturnError(HasFeature(Feature::kVideo), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, + ChipLogError(Zcl, "CameraAVStreamMgmt: can not get RankedVideoStreamPrioritiesList, feature is not supported")); + + ReturnErrorOnFailure( + aEncoder.EncodeList([this](const auto & encoder) -> CHIP_ERROR { return this->ReadAndEncodeRankedVideoStreamPrioritiesList(encoder); })); + break; + case SoftRecordingPrivacyModeEnabled::Id: + VerifyOrReturnError(HasFeature(Feature::kPrivacy), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, + ChipLogError(Zcl, "CameraAVStreamMgmt: can not get SoftRecordingPrivacyModeEnabled, feature is not supported")); + ReturnErrorOnFailure(aEncoder.Encode(mSoftRecordingPrivacyModeEnabled)); + break; + case SoftLivestreamPrivacyModeEnabled::Id: + VerifyOrReturnError(HasFeature(Feature::kPrivacy), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, + ChipLogError(Zcl, "CameraAVStreamMgmt: can not get SoftLivestreamPrivacyModeEnabled, feature is not supported")); + ReturnErrorOnFailure(aEncoder.Encode(mSoftLivestreamPrivacyModeEnabled)); + break; + case HardPrivacyModeOn::Id: + ReturnErrorOnFailure(aEncoder.Encode(mHardPrivacyModeOn)); + break; + case NightVision::Id: + VerifyOrReturnError(HasFeature(Feature::kVideo) && HasFeature(Feature::kSnapshot), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, + ChipLogError(Zcl, "CameraAVStreamMgmt: can not get NightVision, feature is not supported")); + ReturnErrorOnFailure(aEncoder.Encode(mNightVision)); + break; + case NightVisionIllum::Id: + VerifyOrReturnError(HasFeature(Feature::kVideo) && HasFeature(Feature::kSnapshot), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, + ChipLogError(Zcl, "CameraAVStreamMgmt: can not get NightVisionIllumination, feature is not supported")); + ReturnErrorOnFailure(aEncoder.Encode(mNightVisionIllum)); + break; + case AWBEnabled::Id: + VerifyOrReturnError(HasFeature(Feature::kImageControl), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, + ChipLogError(Zcl, "CameraAVStreamMgmt: can not get AWBEnabled, feature is not supported")); + ReturnErrorOnFailure(aEncoder.Encode(mAWBEnabled)); + break; + case AutoShutterSpeedEnabled::Id: + VerifyOrReturnError(HasFeature(Feature::kImageControl), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, + ChipLogError(Zcl, "CameraAVStreamMgmt: can not get AutoShutterSpeedEnabled, feature is not supported")); + ReturnErrorOnFailure(aEncoder.Encode(mAutoShutterSpeedEnabled)); + break; + case AutoISOEnabled::Id: + VerifyOrReturnError(HasFeature(Feature::kImageControl), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, + ChipLogError(Zcl, "CameraAVStreamMgmt: can not get AutoISOEnabled, feature is not supported")); + ReturnErrorOnFailure(aEncoder.Encode(mAutoISOEnabled)); + break; + case Viewport::Id: + VerifyOrReturnError(HasFeature(Feature::kVideo), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, + ChipLogError(Zcl, "CameraAVStreamMgmt: can not get Viewport, feature is not supported")); + ReturnErrorOnFailure(aEncoder.Encode(mViewport)); + break; + + case LocalVideoRecordingEnabled::Id: + VerifyOrReturnError(HasFeature(Feature::kVideo), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, + ChipLogError(Zcl, "CameraAVStreamMgmt: can not get LocalVideoRecordingEnabled, feature is not supported")); + + ReturnErrorOnFailure(aEncoder.Encode(mLocalVideoRecordingEnabled)); + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR CameraAVStreamMgmtServer::Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) +{ + VerifyOrDie(aPath.mClusterId == CameraAVStreamMgmt::Id); + + switch (aPath.mAttributeId) + { + case RankedVideoStreamPrioritiesList::Id: { + uint8_t newValue; + ReturnErrorOnFailure(aDecoder.Decode(newValue)); + ReturnErrorOnFailure(mDelegate.SetRankedVideoStreamPrioritiesList(newValue)); + return CHIP_NO_ERROR; + + } + case LocalVideoRecordingEnabled::Id: { + bool newValue; + ReturnErrorOnFailure(aDecoder.Decode(newValue)); + mLocalVideoRecordingEnabled = newValue; + + return CHIP_NO_ERROR; + } + case SoftRecordingPrivacyModeEnabled::Id: { + bool newPrivacyModeEnabled; + ReturnErrorOnFailure(aDecoder.Decode(newPrivacyModeEnabled)); + Status status = SetSoftRecordingPrivacyModeEnabled(newPrivacyModeEnabled); + return StatusIB(status).ToChipError(); + + } + + default: + // Unknown attribute + return CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute); + } + +} + +Status CameraAVStreamMgmtServer::SetCurrentFrameRate(uint16_t aCurrentFrameRate) +{ + bool frameRateChanged = !(mCurrentFrameRate == aCurrentFrameRate); + + if (frameRateChanged) + { + mCurrentFrameRate = aCurrentFrameRate; + ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::CurrentFrameRate::Id); + MatterReportingAttributeChangeCallback(path); + } + return Protocols::InteractionModel::Status::Success; +} + +Status CameraAVStreamMgmtServer::SetHDRModeEnabled(bool aHDRModeEnabled) +{ + bool hdrEnableChanged = !(mHDRModeEnabled == aHDRModeEnabled); + + if (hdrEnableChanged) + { + mHDRModeEnabled = aHDRModeEnabled; + + ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::HDRModeEnabled::Id); + GetSafeAttributePersistenceProvider()->WriteScalarValue(path, mHDRModeEnabled); + MatterReportingAttributeChangeCallback(path); + } + return Protocols::InteractionModel::Status::Success; +} + +Status CameraAVStreamMgmtServer::SetCurrentSnapshotConfig(const VideoResolutionStruct & aVideoResolution, + uint16_t aMaxFrameRate, + ImageCodecEnum aImageCodecEnum) +{ + bool snapshotConfigChanged = false; + if (mCurrentSnapshotConfig.Resolution != aVideoResolution) + { + mCurrentSnapshotConfig.Resolution = aVideoResolution; + snapshotConfigChanged = true; + } + if (mCurrentSnapshotConfig.MaxFrameRate != aMaxFrameRate) + { + mCurrentSnapshotConfig.MaxFrameRate = aMaxFrameRate; + snapshotConfigChanged = true; + } + if (mCurrentSnapshotConfig.ImageCodec != aImageCodecEnum) + { + mCurrentSnapshotConfig.ImageCodec = aImageCodecEnum; + snapshotConfigChanged = true; + } + if (snapshotConfigChanged) + { + ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::CurrentSnapshotConfig::Id); + MatterReportingAttributeChangeCallback(path); + } + + return Protocols::InteractionModel::Status::Success; +} + +Status CameraAVStreamMgmtServer::SetSoftRecordingPrivacyModeEnabled(bool aSoftRecordingPrivacyModeEnabled) +{ + bool privacyModeChanged = !(mSoftRecordingPrivacyModeEnabled == aSoftRecordingPrivacyModeEnabled); + + if (privacyModeChanged) + { + mSoftRecordingPrivacyModeEnabled = aSoftRecordingPrivacyModeEnabled; + + ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::SoftRecordingPrivacyModeEnabled::Id); + GetSafeAttributePersistenceProvider()->WriteScalarValue(path, mSoftRecordingPrivacyModeEnabled); + } + return Protocols::InteractionModel::Status::Success; +} + +Status CameraAVStreamMgmtServer::SetSoftLivestreamPrivacyModeEnabled(bool aSoftLivestreamPrivacyModeEnabled) +{ + bool privacyModeChanged = !(mSoftLivestreamPrivacyModeEnabled == aSoftLivestreamPrivacyModeEnabled); + + if (privacyModeChanged) + { + mSoftLivestreamPrivacyModeEnabled = aSoftLivestreamPrivacyModeEnabled; + + ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::SoftLivestreamPrivacyModeEnabled::Id); + GetSafeAttributePersistenceProvider()->WriteScalarValue(path, mSoftLivestreamPrivacyModeEnabled); + } + return Protocols::InteractionModel::Status::Success; +} + +Status CameraAVStreamMgmtServer::SetHardPrivacyModeOn(bool aHardPrivacyModeOn) +{ + bool privacyModeChanged = !(mHardPrivacyModeOn == aHardPrivacyModeOn); + + if (privacyModeChanged) + { + mHardPrivacyModeOn = aHardPrivacyModeOn; + + ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::HardPrivacyModeOn::Id); + MatterReportingAttributeChangeCallback(path); + } + return Protocols::InteractionModel::Status::Success; +} + +Status CameraAVStreamMgmtServer::SetNightVision(TriStateAutoEnum aNightVision) +{ + bool nightVisionChanged = !(mNightVision == aNightVision); + + if (nightVisionChanged) + { + mNightVision = aNightVision; + + ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::NightVision::Id); + GetSafeAttributePersistenceProvider()->WriteScalarValue(path, mNightVision); + } + return Protocols::InteractionModel::Status::Success; +} + +Status CameraAVStreamMgmtServer::SetNightVisionIllum(TriStateAutoEnum aNightVisionIllum) +{ + bool nightVisionIllumChanged = !(mNightVisionIllum == aNightVisionIllum); + + if (nightVisionIllumChanged) + { + mNightVisionIllum = aNightVisionIllum; + + ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::NightVisionIllum::Id); + GetSafeAttributePersistenceProvider()->WriteScalarValue(path, mNightVisionIllum); + } + return Protocols::InteractionModel::Status::Success; +} + +Status CameraAVStreamMgmtServer::SetAWBEnabled(bool aAWBEnabled) +{ + bool awbEnabledChanged = !(mAWBEnabled == aAWBEnabled); + + if (awbEnabledChanged) + { + mAWBEnabled = aAWBEnabled; + + ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::AWBEnabled::Id); + GetSafeAttributePersistenceProvider()->WriteScalarValue(path, mAWBEnabled); + } + return Protocols::InteractionModel::Status::Success; +} + +Status CameraAVStreamMgmtServer::SetAutoShutterSpeedEnabled(bool aAutoShutterSpeedEnabled) +{ + bool autoShutterSpeedEnabledChanged = !(mAutoShutterSpeedEnabled == aAutoShutterSpeedEnabled); + + if (autoShutterSpeedEnabledChanged) + { + mAutoShutterSpeedEnabled = aAutoShutterSpeedEnabled; + + ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::AutoShutterSpeedEnabled::Id); + GetSafeAttributePersistenceProvider()->WriteScalarValue(path, mAutoShutterSpeedEnabled); + } + return Protocols::InteractionModel::Status::Success; +} + +Status CameraAVStreamMgmtServer::SetAutoISOEnabled(bool aAutoISOEnabled) +{ + bool autoISOEnabledChanged = !(mAutoISOEnabled == aAutoISOEnabled); + + if (autoISOEnabledChanged) + { + mAutoISOEnabled = aAutoISOEnabled; + + ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::AutoISOEnabled::Id); + GetSafeAttributePersistenceProvider()->WriteScalarValue(path, mAutoISOEnabled); + } + return Protocols::InteractionModel::Status::Success; +} + +Status CameraAVStreamMgmtServer::SetViewport(const ViewportStruct & aAutoISOEnabled) +{ + bool viewportChanged = !(mViewport == aViewport); + + if (viewportChanged) + { + mViewport = aViewport; + + ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::Viewport::Id); + GetSafeAttributePersistenceProvider()->WriteScalarValue(path, mViewport); + } + return Protocols::InteractionModel::Status::Success; +} + +void CameraAVStreamMgmtServer::LoadPersistentAttributes() +{ + // Load HDR Mode Enabled + bool storedHDRModeEnabled; + CHIP_ERROR err = GetSafeAttributePersistenceProvider()->ReadScalarValue( + ConcreteAttributePath(mEndpointId, mClusterId, Attributes::HDRModeEnabled::Id), storedHDRModeEnabled); + if (err == CHIP_NO_ERROR) + { + mHDRModeEnabled = storedHDRModeEnabled; + ChipLogDetail(Zcl, "CameraAVStreamMgmt: Loaded HDRModeEnabled as %u", mHDRModeenabled); + } + else + { + ChipLogDetail(Zcl, "CameraAVStreamMgmt: Unable to load the HDRModeEnabled from the KVS. Defaulting to %u", mHDRModeEnabled); + } +} + +// CommandHandlerInterface +void CameraAVStreamMgmtServer::InvokeCommand(HandlerContext & handlerContext) +{ + ChipLogDetail(Zcl, "CameraAV: InvokeCommand"); + switch (handlerContext.mRequestPath.mCommandId) + { + case Commands::VideoStreamAllocate::Id: + ChipLogDetail(Zcl, "CameraAVStreamMgmt: Allocating Video Stream"); + + if (!HasFeature(CameraAVStreamMgmt::Feature::kVideo)) + { + handlerContext.mCommandHandler.AddStatus(handlerContext.mRequestPath, Status::UnsupportedCommand); + } + else + { + HandleCommand(handlerContext, [this](HandlerContext & ctx, const auto & commandData) { + HandleVideoStreamAllocate(ctx, commandData); + }); + } + return; + + case Commands::VideoStreamModify::Id: + ChipLogDetail(Zcl, "CameraAVStreamMgmt: Modifying Video Stream"); + + if (!HasFeature(CameraAVStreamMgmt::Feature::kVideo)) + { + handlerContext.mCommandHandler.AddStatus(handlerContext.mRequestPath, Status::UnsupportedCommand); + } + else + { + HandleCommand(handlerContext, [this](HandlerContext & ctx, const auto & commandData) { + HandleVideoStreamModify(ctx, commandData); + }); + } + return; + + case Commands::VideoStreamDeallocate::Id: + ChipLogDetail(Zcl, "CameraAVStreamMgmt: Deallocating Video Stream"); + + if (!HasFeature(CameraAVStreamMgmt::Feature::kVideo)) + { + handlerContext.mCommandHandler.AddStatus(handlerContext.mRequestPath, Status::UnsupportedCommand); + } + else + { + HandleCommand(handlerContext, [this](HandlerContext & ctx, const auto & commandData) { + HandleVideoStreamDeallocate(ctx, commandData); + }); + } + return; + + case Commands::AudioStreamAllocate::Id: + ChipLogDetail(Zcl, "CameraAVStreamMgmt: Allocating Audio Stream"); + + if (!HasFeature(CameraAVStreamMgmt::Feature::kAudio)) + { + handlerContext.mCommandHandler.AddStatus(handlerContext.mRequestPath, Status::UnsupportedCommand); + } + else + { + HandleCommand(handlerContext, [this](HandlerContext & ctx, const auto & commandData) { + HandleAudioStreamAllocate(ctx, commandData); + }); + } + return; + + case Commands::AudioStreamDeallocate::Id: + ChipLogDetail(Zcl, "CameraAVStreamMgmt: Deallocating Audio Stream"); + + if (!HasFeature(CameraAVStreamMgmt::Feature::kAudio)) + { + handlerContext.mCommandHandler.AddStatus(handlerContext.mRequestPath, Status::UnsupportedCommand); + } + else + { + HandleCommand(handlerContext, [this](HandlerContext & ctx, const auto & commandData) { + HandleAudioStreamDeallocate(ctx, commandData); + }); + } + return; + + case Commands::SnapshotStreamAllocate::Id: + ChipLogDetail(Zcl, "CameraAVStreamMgmt: Allocating Snapshot Stream"); + + if (!HasFeature(CameraAVStreamMgmt::Feature::kSnapshot)) + { + handlerContext.mCommandHandler.AddStatus(handlerContext.mRequestPath, Status::UnsupportedCommand); + } + else + { + HandleCommand(handlerContext, [this](HandlerContext & ctx, const auto & commandData) { + HandleSnapshotStreamAllocate(ctx, commandData); + }); + } + return; + + case Commands::SnapshotStreamDeallocate::Id: + ChipLogDetail(Zcl, "CameraAVStreamMgmt: Deallocating Snapshot Stream"); + + if (!HasFeature(CameraAVStreamMgmt::Feature::kSnapshot)) + { + handlerContext.mCommandHandler.AddStatus(handlerContext.mRequestPath, Status::UnsupportedCommand); + } + else + { + HandleCommand(handlerContext, [this](HandlerContext & ctx, const auto & commandData) { + HandleSnapshotStreamDeallocate(ctx, commandData); + }); + } + return; + + case Commands::CaptureSnapshot::Id: + ChipLogDetail(Zcl, "CameraAVStreamMgmt: Capture Snapshot image"); + + if (!HasFeature(CameraAVStreamMgmt::Feature::Snapshot)) + { + handlerContext.mCommandHandler.AddStatus(handlerContext.mRequestPath, Status::UnsupportedCommand); + } + else + { + HandleCommand(handlerContext, [this](HandlerContext & ctx, const auto & commandData) { + HandleCaptureSnapshot(ctx, commandData); + }); + } + return; + + #TODO : Add more commands + } +} + +void CameraAVStreamMgmtServer::HandleVideoStreamAllocate(HandlerContext & ctx, const Commands::VideoStreamAllocate::DecodableType & commandData) +{ + + Commands::VideoStreamAllocateResponse::Type response; + auto & streamType = commandData.streamType; + auto & videoCodec = commandData.videoCodec; + auto & minFrameRate = commandData.minFrameRate; + auto & maxFrameRate = commandData.maxFrameRate; + auto & minResolution = commandData.minResolution; + auto & maxResolution = commandData.maxResolution; + auto & minBitRate = commandData.minBitRate; + auto & maxBitRate = commandData.maxBitRate; + auto & minFragmentLen = commandData.minFragmentLen; + auto & maxFragmentLen = commandData.maxFragmentLen; + + // Call the delegate + Status status = mDelegate.VideoStreamAllocate(streamType, videoCodec, minFrameRate, maxFrameRate, minResolution, maxResolution, + minBitRate, maxBitRate, minFragmentLen, maxFragmentLen); + + if (status != Status::Success) + { + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); + return; + } + + ctx.mCommandHandler.AddResponse(ctx.mRequestPath, response); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Protocols::InteractionModel::Status::Success); +} + +void CameraAVStreamMgmtServer::HandleVideoStreamModify(HandlerContext & ctx, const Commands::VideoStreamAllocate::DecodableType & commandData) +{ + + auto & videoStreamID = commandData.videoStreamID; + auto & videoRes = commandData.resolution; + + // Call the delegate + Status status = mDelegate.VideoStreamModify(videoStreamID, videoRes); + + if (status != Status::Success) + { + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); + return; + } + + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Protocols::InteractionModel::Status::Success); +} + +void CameraAVStreamMgmtServer::HandleVideoStreamDeallocate(HandlerContext & ctx, const Commands::VideoStreamAllocate::DecodableType & commandData) +{ + + auto & videoStreamID = commandData.videoStreamID; + + // Call the delegate + Status status = mDelegate.VideoStreamDeallocate(videoStreamID); + + if (status != Status::Success) + { + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); + return; + } + + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Protocols::InteractionModel::Status::Success); +} + +void CameraAVStreamMgmtServer::HandleAudioStreamAllocate(HandlerContext & ctx, const Commands::AudioStreamAllocate::DecodableType & commandData) +{ + + Commands::AudioStreamAllocateResponse::Type response; + auto & streamType = commandData.streamType; + auto & audioCodec = commandData.audioCodec; + auto & channelCount = commandData.channelCount; + auto & sampleRate = commandData.sampleRate; + auto & bitRate = commandData.bitRate; + auto & bitDepth = commandData.bitDepth; + + // Call the delegate + Status status = mDelegate.AudioStreamAllocate(streamType, audioCodec, channelCount, sampleRate, bitRate, bitDepth); + + if (status != Status::Success) + { + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); + return; + } + + ctx.mCommandHandler.AddResponse(ctx.mRequestPath, response); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Protocols::InteractionModel::Status::Success); +} + +void CameraAVStreamMgmtServer::HandleAudioStreamDeallocate(HandlerContext & ctx, const Commands::VideoStreamAllocate::DecodableType & commandData) +{ + + auto & audioStreamID = commandData.audioStreamID; + + // Call the delegate + Status status = mDelegate.AudioStreamDeallocate(audioStreamID); + + if (status != Status::Success) + { + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); + return; + } + + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Protocols::InteractionModel::Status::Success); +} + +void CameraAVStreamMgmtServer::HandleSnapshotStreamAllocate(HandlerContext & ctx, const Commands::SnapshotStreamAllocate::DecodableType & commandData) +{ + + Commands::SnapshotStreamAllocateResponse::Type response; + auto & imageCodec = commandData.imageCodec; + auto & frameRate = commandData.frameRate; + auto & bitRate = commandData.bitRate; + auto & minResolution = commandData.minResolution; + auto & maxResolution = commandData.maxResolution; + auto & quality = commandData.quality; + + // Call the delegate + Status status = mDelegate.SnapshotStreamAllocate(imageCodec, frameRate, bitRate, minResolution, maxResolution, quality); + + if (status != Status::Success) + { + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); + return; + } + + ctx.mCommandHandler.AddResponse(ctx.mRequestPath, response); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Protocols::InteractionModel::Status::Success); +} + +void CameraAVStreamMgmtServer::HandleSnapshotStreamDeallocate(HandlerContext & ctx, const Commands::SnapshotStreamAllocate::DecodableType & commandData) +{ + + auto & snapshotStreamID = commandData.snapshotStreamID; + + // Call the delegate + Status status = mDelegate.SnapshotStreamDeallocate(snapshotStreamID); + + if (status != Status::Success) + { + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); + return; + } + + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Protocols::InteractionModel::Status::Success); +} + +void CameraAVStreamMgmtServer::HandleCaptureSnapshot(HandlerContext & ctx, const Commands::VideoStreamAllocate::DecodableType & commandData) +{ + + Commands::CaptureSnapshotResponse::Type response; + auto & snapshotStreamID = commandData.snapshotStreamID; + auto & requestedResolution = commandData.requestedResolution; + + // Call the delegate + Status status = mDelegate.CaptureSnapshot(snapshotStreamID, requestedResolution); + + if (status != Status::Success) + { + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); + return; + } + + ctx.mCommandHandler.AddResponse(ctx.mRequestPath, response); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Protocols::InteractionModel::Status::Success); +} + +} // namespace CameraAVStreamMgmt +} // namespace Clusters +} // namespace app +} // namespace chip + +/** @brief Camera AV Stream Management Cluster Server Init + * + * Server Init + * + */ +void MatterCameraAVStreamMgmtPluginServerInitCallback() {} diff --git a/src/app/clusters/camera-av-stream-management-server/camera-av-stream-management-server.h b/src/app/clusters/camera-av-stream-management-server/camera-av-stream-management-server.h new file mode 100644 index 00000000000000..5322e17f84b1b0 --- /dev/null +++ b/src/app/clusters/camera-av-stream-management-server/camera-av-stream-management-server.h @@ -0,0 +1,338 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include + +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace CameraAVStreamMgmt { + +using VideoStreamStruct = Structs::VideoStreamStruct::Type; +using AudioStreamStruct = Structs::AudioStreamStruct::Type; +using SnapshotStreamStruct = Structs::SnapshotStreamStruct::Type; +using AudioCapabilitiesStruct = Structs::AudioCapabilitiesStruct::Type; +using VideoSensorParamsStruct = Structs::VideoSensorParamsStruct::Type; +using SnapshotParamsStruct = Structs::SnapshotParamsStruct::Type; +using VideoResolutionStruct = Structs::VideoResolutionStruct::Type; +using ViewportStruct = Structs::ViewportStruct::Type; + +// constexpr uint8_t kDefaultPowerStepNum = 10u; + +/** @brief + * Defines methods for implementing application-specific logic for the CameraAVStreamMgmt Cluster. + */ +class CameraAVStreamMgmtDelegate +{ +public: + CameraAVStreamMgmtDelegate() = default; + + virtual ~CameraAVStreamMgmtDelegate() = default; + + /** + * @brief Handle Command Delegate for Video stream allocation. + */ + virtual Protocols::InteractionModel::Status VideoStreamAllocate(StreamTypeEnum streamType, VideoCodecEnum videoCodec, + const uint16_t minFrameRate, const uint16_t maxFrameRate, + VideoResolutionStruct minResolution, VideoResolutionStruct maxResolution, + const uint32_t minBitRate, const uint32_t maxBitRate, + const uint16_t minFragmentLen, const uint16_t maxFragmentLen) = 0; + + /** + * @brief Handle Command Delegate for Video stream modification. + */ + virtual Protocols::InteractionModel::Status VideoStreamModify(const uint16_t streamID, VideoResolutionStruct videoResolution) = 0; + + /** + * @brief Handle Command Delegate for Video stream deallocation. + */ + virtual Protocols::InteractionModel::Status VideoStreamDeallocate(const uint16_t streamID) = 0; + + /** + * @brief Handle Command Delegate for Audio stream allocation. + */ + virtual Protocols::InteractionModel::Status AudioStreamAllocate(StreamTypeEnum streamType, AudioCodecEnum audioCodec, + const uint8_t channelCount, const uint32_t sampleRate, + const uint32_t bitRate, const uint32_t bitDepth) = 0; + + /** + * @brief Handle Command Delegate for Audio stream deallocation. + */ + virtual Protocols::InteractionModel::Status AudioStreamDeallocate(const uint16_t streamID) = 0; + + /** + * @brief Handle Command Delegate for Snapshot stream allocation. + */ + virtual Protocols::InteractionModel::Status SnapshotStreamAllocate(ImageCodecEnum imageCodec, const uint16_t frameRate, const uint32_t bitRate, + VideoResolutionStruct minResolution, VideoResolutionStruct maxResolution, + const uint8_t quality) = 0; + + /** + * @brief Handle Command Delegate for Snapshot stream deallocation. + */ + virtual Protocols::InteractionModel::Status SnapshotStreamDeallocate(const uint16_t streamID) = 0; + + /** + * @brief Handle Command Delegate for CaptureSnapshot. + */ + virtual Protocols::InteractionModel::Status CaptureSnapshot(const uint16_t streamID, VideoResolutionStruct videoResolution) = 0; + + // Get attribute methods for list index items + + virtual uint8_t GetMaxConcurrentVideoEncoders() = 0; + virtual uint32_t GetMaxEncodedPixelRate() = 0; + + virtual CHIP_ERROR StartAllocatedVideoStreamsRead() = 0; + virtual CHIP_ERROR GetAllocatedVideoStreamByIndex(uint8_t, Structs::VideoStreamSturct::Type &) = 0; + virtual CHIP_ERROR EndAllocatedVideoStreamsRead() = 0; + + virtual CHIP_ERROR StartAllocatedAudioStreamsRead() = 0; + virtual CHIP_ERROR GetAllocatedAudioStreamByIndex(uint8_t, Structs::AudioStreamSturct::Type &) = 0; + virtual CHIP_ERROR EndAllocatedAudioStreamsRead() = 0; + + virtual CHIP_ERROR StartAllocatedSnapshotStreamsRead() = 0; + virtual CHIP_ERROR GetAllocatedSnapshotStreamByIndex(uint8_t, Structs::SnapshotStreamSturct::Type &) = 0; + virtual CHIP_ERROR EndAllocatedSnapshotStreamsRead() = 0; + + virtual CHIP_ERROR StartRateDistortionTradeOffPointsRead() = 0; + virtual CHIP_ERROR GetRateDistortionTradeOffPointByIndex(uint8_t, Structs::RateDistortionTradeOffPointsStruct::Type &) = 0; + virtual CHIP_ERROR EndRateDistortionTradeOffPointsRead() = 0; + + virtual CHIP_ERROR StartSupportedSnapshotParamsRead() = 0; + virtual CHIP_ERROR GetSupportedSnapshotParamByIndex(uint8_t, Structs::RateDistortionTradeOffPointsStruct::Type &) = 0; + virtual CHIP_ERROR EndSupportedSnapshotParamsRead() = 0; + + virtual CHIP_ERROR StartCurrentVideoCodecsRead() = 0; + virtual CHIP_ERROR GetCurrentVideoCodecByIndex(uint8_t, VideoCodecEnumType) = 0; + virtual CHIP_ERROR EndCurrentVideoCodecsRead() = 0; + + virtual CHIP_ERROR StartFabricsUsingCameraRead() = 0; + virtual CHIP_ERROR GetFabricUsingCameraByIndex(uint8_t, chip::FabricIndex) = 0; + virtual CHIP_ERROR EndFabricsUsingCameraRead() = 0; + + virtual CHIP_ERROR StartRankedVideoStreamPrioritiesListRead = 0; + virtual CHIP_ERROR GetRankedVideoStreamPrioritiesListByIndex(uint8_t, StreamTypeEnumType) = 0; + virtual CHIP_ERROR EndRankedVideoStreamPrioritiesListRead = 0; + +protected: + friend class CameraAVStreamMgmtServer; + + CameraAVStreamMgmtServer * mCameraAVStreamMgmtServer = nullptr; + + /** + * This method is used by the SDK to set the instance pointer. This is done during the instantiation of a CameraAVStreamMgmtServer object. + * @param aCameraAVStreamMgmtServer A pointer to the CameraAVStreamMgmtServer object related to this delegate object. + */ + void SetCameraAVStreamMgmtServer(CameraAVStreamMgmtServer * aCameraAVStreamMgmtServer) { mCameraAVStreamMgmtServer = aCameraAVStreamMgmtServer; } + + CameraAVStreamMgmtServer * GetCameraAVStreamMgmtServer() const { return mCameraAVStreamMgmtServer; } +}; + +class CameraAVStreamMgmtServer : public CommandHandlerInterface, public AttributeAccessInterface +{ +public: + + /** + * @brief Creates a Camera AV Stream Management cluster instance. The Init() function needs to be called for this instance + * to be registered and called by the interaction model at the appropriate times. + * @param aDelegate A pointer to the delegate to be used by this server. + * Note: the caller must ensure that the delegate lives throughout the instance's lifetime. + * @param aEndpointId The endpoint on which this cluster exists. This must match the zap configuration. + * @param aClusterId The ID of the Microwave Oven Control cluster to be instantiated. + * @param aFeature The bitmask value that identifies which features are supported by this instance. + */ + CameraAVStreamMgmtServer(CameraAVStreamMgmtDelegate * aDelegate, EndpointId aEndpointId, ClusterId aClusterId, BitMask aFeature, + uint8_t aMaxConVideoEncoders, uint32_t aMaxEncodedPixelRate, VideoSensorParamsStruct aVideoSensorParams, bool aNightVisionCapable, + VideoResolutionStruct minViewPort, uint32_t aMaxContentBufferSize, AudioCapabilitiesStruct aMicCapabilities, + AudioCapabilitiesStruct aSpkrCapabilities, TwoWayTalkSupportTypeEnum aTwoWayTalkSupport, + uint32_t aMaxNetworkBandwidth); + + ~CameraAVStreamMgmtServer() override; + + /** + * @brief Initialise the Camera AV Stream Management server instance. + * This function must be called after defining an CameraAVStreamMgmtServer class object. + * @return Returns an error if the given endpoint and cluster ID have not been enabled in zap or if the + * CommandHandler or AttributeHandler registration fails, else returns CHIP_NO_ERROR. + * This method also checks if the feature setting is valid, if invalid it will returns CHIP_ERROR_INVALID_ARGUMENT. + */ + CHIP_ERROR Init(); + + bool HasFeature(Feature feature) const; + + bool IsLocalVideoRecordingEnabled() const; + + Protocols::InteractionModel::Status SetCurrentFrameRate(uint16_t aCurrentFrameRate); + + Protocols::InteractionModel::Status SetHDRModeEnabled(bool aHDRModeEnabled); + + Protocols::InteractionModel::Status CameraAVStreamMgmtServer::SetCurrentSnapshotConfig(const VideoResolutionStruct & aVideoResolution, + uint16_t aMaxFrameRate, + ImageCodecEnumType aImageCodecEnum); + + Protocols::InteractionModel::Status SetSoftRecordingPrivacyModeEnabled(bool aSoftRecordingPrivacyModeEnabled); + + Protocols::InteractionModel::Status SetSoftLivestreamPrivacyModeEnabled(bool aSoftLivestreamPrivacyModeEnabled); + + Protocols::InteractionModel::Status SetHardPrivacyModeOn(bool aHardPrivacyModeOn); + + Protocols::InteractionModel::Status SetNightVision(TriStateAutoEnum aNightVision); + + Protocols::InteractionModel::Status SetNightVisionIllum(TriStateAutoEnum aNightVisionIllum); + + Protocols::InteractionModel::Status SetAWBEnabled(bool aAWBEnabled); + + Protocols::InteractionModel::Status SetAutoShutterSpeedEnabled(bool aAutoShutterSpeedEnabled); + + Protocols::InteractionModel::Status SetAutoISOEnabled(bool aAutoISOEnabled); + + Protocols::InteractionModel::Status SetViewport(const ViewportStruct & aAutoISOEnabled); + + EndpointId GetEndpointId() + { + return AttributeAccessInterface::GetEndpointId().Value(); + } +private: + CameraAVStreamMgmtDelegate & mDelegate; + EndpointId mEndpointId; + ClusterId mClusterId; + BitMask mFeature; + + // Attributes with F quality + const uint8_t mMaxConcurrentVideoEncoders; + const uint32_t mMaxEncodedPixelRate; + const VideoSensorParamsStruct mVideoSensorParams; + const bool mNightVisionCapable; + const VideoResolutionStruct mMinViewPort; + const uint32_t mMaxContentBufferSize; + const AudioCapabilities mMicrophoneCapabilities; + const AudioCapabilities mSpeakerCapabilities; + const TwoWayTalkSupportEnumType mTwoWayTalkSupport; + const uint32_t mMaxNetworkBandwidth; + + uint16_t mCurrentFrameRate; + bool mHDRModeEnabled = false; + SnapshotParamsStruct mCurrentSnapshotConfig; + bool mSoftRecordingPrivacyModeEnabled = false; + bool mSoftLivestreamPrivacyModeEnabled = false; + bool mHardPrivacyModeOn = false; + TriStateAutoEnumType mNightVision; + TriStateAutoEnumType mNightVisionIllum; + bool mAWBEnabled = false; + bool mAutoShutterSpeedEnabled = false; + bool mAutoISOEnabled = false; + ViewPortStruct mViewport; + bool mSpeakerMuted = false; + uint8_t mSpeakerVolumeLevel; + uint8_t mSpeakerMaxLevel; + uint8_t mSpeakerMinLevel; + bool mMicrophoneMuted = false; + uint8_t mMicrophoneVolumeLevel; + uint8_t mMicrophoneMaxLevel; + uint8_t mMicrophoneMinLevel; + bool mMicrophoneAGCEnabled = false; + uint16_t mImageRotation; + bool mImageFlipHorizontal = false; + bool mImageFlipVertical = false; + bool mLocalVideoRecordingEnabled = false; + bool mLocalSnapshotRecordingEnabled = false; + bool mStatusLightEnabled = false; + // StatusLightBrightness + // DepthSensorStatus + + Structs::VideoSensorParamsStruct::Type mVideoSensorParams; + CHIP_ERROR SetVideoSensorParams(const Structs::VideoSensorParamsStruct::Type & videoSensorParams) + { + mVideoSensorParams = videoSensorParams; + } + + + // Maybe CameraAVStreamMgmtDelegate? + // RateDistortionTradeOffPoints + // SupportedSnapshotParams; + // + + /** + * IM-level implementation of read + * @return appropriately mapped CHIP_ERROR if applicable + */ + CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + + /** + * IM-level implementation of write + * @return appropriately mapped CHIP_ERROR if applicable + */ + CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; + + /** + * Helper function that loads all the persistent attributes from the KVS. + */ + void LoadPersistentAttributes(); + + // Helpers to read list items via delegate APIs + CHIP_ERROR ReadAndEncodeRateDistortionTradeOffPoints(const AttributeValueEncoder::ListEncodeHelper & encoder); + CHIP_ERROR ReadAndEncodeSupportedSnapshotParams(const AttributeValueEncoder::ListEncodeHelper & encoder); + CHIP_ERROR ReadAndEncodeCurrentVideoCodecs(const AttributeValueEncoder::ListEncodeHelper & encoder); + CHIP_ERROR ReadAndEncodeFabricsUsingCamera(const AttributeValueEncoder::ListEncodeHelper & encoder); + + CHIP_ERROR ReadAndEncodeAllocatedVideoStreams(const AttributeValueEncoder::ListEncodeHelper & encoder); + CHIP_ERROR ReadAndEncodeAllocatedAudioStreams(const AttributeValueEncoder::ListEncodeHelper & encoder); + CHIP_ERROR ReadAndEncodeAllocatedSnapshotStreams(const AttributeValueEncoder::ListEncodeHelper & encoder); + + CHIP_ERROR ReadAndEncodeRankedVideoStreamPrioritiesList(const AttributeValueEncoder::ListEncodeHelper & encoder); + + /** + * @brief Inherited from CommandHandlerInterface + */ + void InvokeCommand(HandlerContext & ctx) override; + + void HandleVideoStreamAllocate(HandlerContext & ctx, const Commands::VideoStreamAllocate::DecodableType & req); + + void HandleVideoStreamModify(HandlerContext & ctx, const Commands::VideoStreamModify::DecodableType & req); + + void HandleVideoStreamDeallocate(HandlerContext & ctx, const Commands::VideoStreamModify::DecodableType & req); + + void HandleAudioStreamAllocate(HandlerContext & ctx, const Commands::VideoStreamAllocate::DecodableType & req); + + void HandleAudioStreamDeallocate(HandlerContext & ctx, const Commands::VideoStreamModify::DecodableType & req); + + void HandleSnapshotStreamAllocate(HandlerContext & ctx, const Commands::VideoStreamAllocate::DecodableType & req); + + void HandleSnapshotStreamDeallocate(HandlerContext & ctx, const Commands::VideoStreamModify::DecodableType & req); + + void HandleCaptureSnapshot(HandlerContext & ctx, const Commands::VideoStreamModify::DecodableType & req); + + /** + * @brief Handle Command: AddMoreTime. + * @param ctx Returns the Interaction Model status code which was user determined in the business logic. + * If the cook time value is out of range, returns the Interaction Model status code of CONSTRAINT_ERROR. + * If the operational state is in 'Error', returns the Interaction Model status code of INVALID_IN_STATE. + */ + void HandleAddMoreTime(HandlerContext & ctx, const Commands::AddMoreTime::DecodableType & req); +}; + +} // namespace CameraAVStreamMgmt +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/common/templates/config-data.yaml b/src/app/common/templates/config-data.yaml index 61e7c45582268a..de9716e1ca3719 100644 --- a/src/app/common/templates/config-data.yaml +++ b/src/app/common/templates/config-data.yaml @@ -36,6 +36,7 @@ CommandHandlerInterfaceOnlyClusters: - RVC Operational State - Sample MEI - Microwave Oven Control + - Camera AV Stream Management - Energy EVSE - Energy EVSE Mode - Device Energy Management diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index 3ad401afb3e47a..1c6c285db18994 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -676,7 +676,50 @@ "MicrophoneCapabilities", "SpeakerCapabilities", "CurrentSnapshotConfig", - "Viewport" + "Viewport", + "MaxConcurrentVideoEncoders", + "MaxEncodedPixelRate", + "NightVisionCapable", + "RateDistortionTradeOffPoints", + "MaxPreRollBufferSize", + "TwoWayTalkSupport", + "SupportedSnapshotParams", + "MaxNetworkBandwidth", + "CurrentFrameRate", + "HDRModeEnabled", + "CurrentVideoCodecs", + "CurrentSnapshotConfig", + "FabricsUsingCamera", + "AllocatedVideoStreams", + "AllocatedAudioStreams", + "AllocatedSnapshotStreams", + "RankedVideoStreamPrioritiesList", + "SoftRecordingPrivacyModeEnabled", + "SoftLivestreamPrivacyModeEnabled", + "HardPrivacyModeOn", + "NightVision", + "NightVisionIllum", + "AWBEnabled", + "AutoShutterSpeedEnabled", + "AutoISOEnabled", + "SpeakerMuted", + "SpeakerVolumeLevel", + "SpeakerMaxLevel", + "SpeakerMinLevel", + "MicrophoneMuted", + "MicrophoneVolumeLevel", + "MicrophoneMaxLevel", + "MicrophoneMinLevel", + "MicrophoneAGCEnabled", + "ImageRotation", + "ImageFlipHorizontal", + "ImageFlipVertical", + "LocalVideoRecordingEnabled", + "LocalSnapshotRecordingEnabled", + "StatusLightEnabled", + "StatusLightBrightness", + "DepthSensorStatus", + "FeatureMap" ] }, "mandatoryDeviceTypes": "0x0016", diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index c291fc651f6aa0..1b676bb2394911 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -670,7 +670,50 @@ "MicrophoneCapabilities", "SpeakerCapabilities", "CurrentSnapshotConfig", - "Viewport" + "Viewport", + "MaxConcurrentVideoEncoders", + "MaxEncodedPixelRate", + "NightVisionCapable", + "RateDistortionTradeOffPoints", + "MaxPreRollBufferSize", + "TwoWayTalkSupport", + "SupportedSnapshotParams", + "MaxNetworkBandwidth", + "CurrentFrameRate", + "HDRModeEnabled", + "CurrentVideoCodecs", + "CurrentSnapshotConfig", + "FabricsUsingCamera", + "AllocatedVideoStreams", + "AllocatedAudioStreams", + "AllocatedSnapshotStreams", + "RankedVideoStreamPrioritiesList", + "SoftRecordingPrivacyModeEnabled", + "SoftLivestreamPrivacyModeEnabled", + "HardPrivacyModeOn", + "NightVision", + "NightVisionIllum", + "AWBEnabled", + "AutoShutterSpeedEnabled", + "AutoISOEnabled", + "SpeakerMuted", + "SpeakerVolumeLevel", + "SpeakerMaxLevel", + "SpeakerMinLevel", + "MicrophoneMuted", + "MicrophoneVolumeLevel", + "MicrophoneMaxLevel", + "MicrophoneMinLevel", + "MicrophoneAGCEnabled", + "ImageRotation", + "ImageFlipHorizontal", + "ImageFlipVertical", + "LocalVideoRecordingEnabled", + "LocalSnapshotRecordingEnabled", + "StatusLightEnabled", + "StatusLightBrightness", + "DepthSensorStatus", + "FeatureMap" ] }, "mandatoryDeviceTypes": "0x0016", diff --git a/src/app/zap_cluster_list.json b/src/app/zap_cluster_list.json index e38e8809616f45..eeceef564879d2 100644 --- a/src/app/zap_cluster_list.json +++ b/src/app/zap_cluster_list.json @@ -163,7 +163,9 @@ "BRIDGED_DEVICE_BASIC_INFORMATION_CLUSTER": [ "bridged-device-basic-information-server" ], - "CAMERA_AV_STREAM_MANAGEMENT_CLUSTER": [], + "CAMERA_AV_STREAM_MANAGEMENT_CLUSTER": [ + "camera-av-stream-management-server" + ], "CARBON_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER": [ "concentration-measurement-server" ], diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 382c808a78cc62..f13b7bd4701593 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -36915,1615 +36915,6 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) namespace CameraAvStreamManagement { namespace Attributes { -namespace MaxConcurrentVideoEncoders { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -} // namespace MaxConcurrentVideoEncoders - -namespace MaxEncodedPixelRate { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); -} - -} // namespace MaxEncodedPixelRate - -namespace NightVisionCapable { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); -} - -} // namespace NightVisionCapable - -namespace MaxPreRollBufferSize { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); -} - -} // namespace MaxPreRollBufferSize - -namespace TwoWayTalkSupport { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, - chip::app::Clusters::CameraAvStreamManagement::TwoWayTalkSupportTypeEnum * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, - chip::app::Clusters::CameraAvStreamManagement::TwoWayTalkSupportTypeEnum value, - MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, - chip::app::Clusters::CameraAvStreamManagement::TwoWayTalkSupportTypeEnum value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); -} - -} // namespace TwoWayTalkSupport - -namespace MaxNetworkBandwidth { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); -} - -} // namespace MaxNetworkBandwidth - -namespace CurrentFrameRate { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace CurrentFrameRate - -namespace HDRModeEnabled { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); -} - -} // namespace HDRModeEnabled - -namespace SoftRecordingPrivacyModeEnabled { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); -} - -} // namespace SoftRecordingPrivacyModeEnabled - -namespace SoftLivestreamPrivacyModeEnabled { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); -} - -} // namespace SoftLivestreamPrivacyModeEnabled - -namespace HardPrivacyModeOn { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); -} - -} // namespace HardPrivacyModeOn - -namespace NightVision { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, - chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value, - MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); -} - -} // namespace NightVision - -namespace NightVisionIllum { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, - chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value, - MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); -} - -} // namespace NightVisionIllum - -namespace AWBEnabled { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); -} - -} // namespace AWBEnabled - -namespace AutoShutterSpeedEnabled { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); -} - -} // namespace AutoShutterSpeedEnabled - -namespace AutoISOEnabled { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); -} - -} // namespace AutoISOEnabled - -namespace SpeakerMuted { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); -} - -} // namespace SpeakerMuted - -namespace SpeakerVolumeLevel { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -} // namespace SpeakerVolumeLevel - -namespace SpeakerMaxLevel { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -} // namespace SpeakerMaxLevel - -namespace SpeakerMinLevel { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -} // namespace SpeakerMinLevel - -namespace MicrophoneMuted { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); -} - -} // namespace MicrophoneMuted - -namespace MicrophoneVolumeLevel { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -} // namespace MicrophoneVolumeLevel - -namespace MicrophoneMaxLevel { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -} // namespace MicrophoneMaxLevel - -namespace MicrophoneMinLevel { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -} // namespace MicrophoneMinLevel - -namespace MicrophoneAGCEnabled { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); -} - -} // namespace MicrophoneAGCEnabled - -namespace ImageRotation { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace ImageRotation - -namespace ImageFlipHorizontal { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); -} - -} // namespace ImageFlipHorizontal - -namespace ImageFlipVertical { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); -} - -} // namespace ImageFlipVertical - -namespace LocalVideoRecordingEnabled { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); -} - -} // namespace LocalVideoRecordingEnabled - -namespace LocalSnapshotRecordingEnabled { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); -} - -} // namespace LocalSnapshotRecordingEnabled - -namespace StatusLightEnabled { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); -} - -} // namespace StatusLightEnabled - -namespace StatusLightBrightness { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::Globals::ThreeLevelAutoEnum * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Globals::ThreeLevelAutoEnum value, - MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Globals::ThreeLevelAutoEnum value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); -} - -} // namespace StatusLightBrightness - -namespace DepthSensorStatus { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, - chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value, - MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); -} - -} // namespace DepthSensorStatus - -namespace FeatureMap { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); -} - -} // namespace FeatureMap - namespace ClusterRevision { Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index e0a965b732a743..0a908e310898b6 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -5602,223 +5602,6 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, Mar namespace CameraAvStreamManagement { namespace Attributes { -namespace MaxConcurrentVideoEncoders { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value); // int8u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); -} // namespace MaxConcurrentVideoEncoders - -namespace MaxEncodedPixelRate { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // int32u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); -} // namespace MaxEncodedPixelRate - -namespace NightVisionCapable { -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); -} // namespace NightVisionCapable - -namespace MaxPreRollBufferSize { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // int32u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); -} // namespace MaxPreRollBufferSize - -namespace TwoWayTalkSupport { -Protocols::InteractionModel::Status -Get(EndpointId endpoint, - chip::app::Clusters::CameraAvStreamManagement::TwoWayTalkSupportTypeEnum * value); // TwoWayTalkSupportTypeEnum -Protocols::InteractionModel::Status Set(EndpointId endpoint, - chip::app::Clusters::CameraAvStreamManagement::TwoWayTalkSupportTypeEnum value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, - chip::app::Clusters::CameraAvStreamManagement::TwoWayTalkSupportTypeEnum value, - MarkAttributeDirty markDirty); -} // namespace TwoWayTalkSupport - -namespace MaxNetworkBandwidth { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // int32u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); -} // namespace MaxNetworkBandwidth - -namespace CurrentFrameRate { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace CurrentFrameRate - -namespace HDRModeEnabled { -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); -} // namespace HDRModeEnabled - -namespace SoftRecordingPrivacyModeEnabled { -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); -} // namespace SoftRecordingPrivacyModeEnabled - -namespace SoftLivestreamPrivacyModeEnabled { -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); -} // namespace SoftLivestreamPrivacyModeEnabled - -namespace HardPrivacyModeOn { -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); -} // namespace HardPrivacyModeOn - -namespace NightVision { -Protocols::InteractionModel::Status -Get(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum * value); // TriStateAutoEnum -Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value, - MarkAttributeDirty markDirty); -} // namespace NightVision - -namespace NightVisionIllum { -Protocols::InteractionModel::Status -Get(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum * value); // TriStateAutoEnum -Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value, - MarkAttributeDirty markDirty); -} // namespace NightVisionIllum - -namespace AWBEnabled { -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); -} // namespace AWBEnabled - -namespace AutoShutterSpeedEnabled { -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); -} // namespace AutoShutterSpeedEnabled - -namespace AutoISOEnabled { -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); -} // namespace AutoISOEnabled - -namespace SpeakerMuted { -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); -} // namespace SpeakerMuted - -namespace SpeakerVolumeLevel { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value); // int8u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); -} // namespace SpeakerVolumeLevel - -namespace SpeakerMaxLevel { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value); // int8u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); -} // namespace SpeakerMaxLevel - -namespace SpeakerMinLevel { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value); // int8u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); -} // namespace SpeakerMinLevel - -namespace MicrophoneMuted { -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); -} // namespace MicrophoneMuted - -namespace MicrophoneVolumeLevel { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value); // int8u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); -} // namespace MicrophoneVolumeLevel - -namespace MicrophoneMaxLevel { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value); // int8u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); -} // namespace MicrophoneMaxLevel - -namespace MicrophoneMinLevel { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value); // int8u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); -} // namespace MicrophoneMinLevel - -namespace MicrophoneAGCEnabled { -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); -} // namespace MicrophoneAGCEnabled - -namespace ImageRotation { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace ImageRotation - -namespace ImageFlipHorizontal { -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); -} // namespace ImageFlipHorizontal - -namespace ImageFlipVertical { -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); -} // namespace ImageFlipVertical - -namespace LocalVideoRecordingEnabled { -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); -} // namespace LocalVideoRecordingEnabled - -namespace LocalSnapshotRecordingEnabled { -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); -} // namespace LocalSnapshotRecordingEnabled - -namespace StatusLightEnabled { -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); -} // namespace StatusLightEnabled - -namespace StatusLightBrightness { -Protocols::InteractionModel::Status Get(EndpointId endpoint, - chip::app::Clusters::Globals::ThreeLevelAutoEnum * value); // ThreeLevelAutoEnum -Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Globals::ThreeLevelAutoEnum value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Globals::ThreeLevelAutoEnum value, - MarkAttributeDirty markDirty); -} // namespace StatusLightBrightness - -namespace DepthSensorStatus { -Protocols::InteractionModel::Status -Get(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum * value); // TriStateAutoEnum -Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value, - MarkAttributeDirty markDirty); -} // namespace DepthSensorStatus - -namespace FeatureMap { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // bitmap32 -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); -} // namespace FeatureMap - namespace ClusterRevision { Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 90be2632818072..0d154a47d82f8e 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -6798,84 +6798,6 @@ bool emberAfZoneManagementClusterGetTwoDCartesianZoneCallback( bool emberAfZoneManagementClusterRemoveZoneCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::ZoneManagement::Commands::RemoveZone::DecodableType & commandData); -/** - * @brief Camera AV Stream Management Cluster AudioStreamAllocate Command callback (from client) - */ -bool emberAfCameraAvStreamManagementClusterAudioStreamAllocateCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamAllocate::DecodableType & commandData); -/** - * @brief Camera AV Stream Management Cluster AudioStreamDeallocate Command callback (from client) - */ -bool emberAfCameraAvStreamManagementClusterAudioStreamDeallocateCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamDeallocate::DecodableType & commandData); -/** - * @brief Camera AV Stream Management Cluster VideoStreamAllocate Command callback (from client) - */ -bool emberAfCameraAvStreamManagementClusterVideoStreamAllocateCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamAllocate::DecodableType & commandData); -/** - * @brief Camera AV Stream Management Cluster VideoStreamModify Command callback (from client) - */ -bool emberAfCameraAvStreamManagementClusterVideoStreamModifyCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamModify::DecodableType & commandData); -/** - * @brief Camera AV Stream Management Cluster VideoStreamDeallocate Command callback (from client) - */ -bool emberAfCameraAvStreamManagementClusterVideoStreamDeallocateCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamDeallocate::DecodableType & commandData); -/** - * @brief Camera AV Stream Management Cluster SnapshotStreamAllocate Command callback (from client) - */ -bool emberAfCameraAvStreamManagementClusterSnapshotStreamAllocateCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamAllocate::DecodableType & commandData); -/** - * @brief Camera AV Stream Management Cluster SnapshotStreamDeallocate Command callback (from client) - */ -bool emberAfCameraAvStreamManagementClusterSnapshotStreamDeallocateCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamDeallocate::DecodableType & commandData); -/** - * @brief Camera AV Stream Management Cluster SetStreamPriorities Command callback (from client) - */ -bool emberAfCameraAvStreamManagementClusterSetStreamPrioritiesCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::CameraAvStreamManagement::Commands::SetStreamPriorities::DecodableType & commandData); -/** - * @brief Camera AV Stream Management Cluster CaptureSnapshot Command callback (from client) - */ -bool emberAfCameraAvStreamManagementClusterCaptureSnapshotCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::CameraAvStreamManagement::Commands::CaptureSnapshot::DecodableType & commandData); -/** - * @brief Camera AV Stream Management Cluster SetViewport Command callback (from client) - */ -bool emberAfCameraAvStreamManagementClusterSetViewportCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::CameraAvStreamManagement::Commands::SetViewport::DecodableType & commandData); -/** - * @brief Camera AV Stream Management Cluster SetImageRotation Command callback (from client) - */ -bool emberAfCameraAvStreamManagementClusterSetImageRotationCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageRotation::DecodableType & commandData); -/** - * @brief Camera AV Stream Management Cluster SetImageFlipHorizontal Command callback (from client) - */ -bool emberAfCameraAvStreamManagementClusterSetImageFlipHorizontalCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageFlipHorizontal::DecodableType & commandData); -/** - * @brief Camera AV Stream Management Cluster SetImageFlipVertical Command callback (from client) - */ -bool emberAfCameraAvStreamManagementClusterSetImageFlipVerticalCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageFlipVertical::DecodableType & commandData); /** * @brief WebRTC Transport Provider Cluster SolicitOffer Command callback (from client) */