/* * * 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. */ #pragma once #include #include #include #include #include #include #include class RefrigeratorAlarmServer { public: static RefrigeratorAlarmServer & Instance(); chip::Protocols::InteractionModel::Status GetMaskValue(chip::EndpointId endpoint, chip::BitMask * mask); chip::Protocols::InteractionModel::Status GetStateValue(chip::EndpointId endpoint, chip::BitMask * state); chip::Protocols::InteractionModel::Status GetSupportedValue(chip::EndpointId endpoint, chip::BitMask * suppported); // A change in mask value will result in a corresponding change in state. chip::Protocols::InteractionModel::Status SetMaskValue(chip::EndpointId endpoint, const chip::BitMask mask); // When State changes we are generating Notify event. chip::Protocols::InteractionModel::Status SetStateValue(chip::EndpointId endpoint, chip::BitMask newState); // A change in supported value will result in a corresponding change in mask and state. chip::Protocols::InteractionModel::Status SetSupportedValue(chip::EndpointId endpoint, const chip::BitMask supported); private: static RefrigeratorAlarmServer instance; void SendNotifyEvent(chip::EndpointId endpointId, chip::BitMask becameActive, chip::BitMask becameInactive, chip::BitMask newState, chip::BitMask mask); };