1 /* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef INFRARED_EMMITTER_CONTROLLER_H 17 #define INFRARED_EMMITTER_CONTROLLER_H 18 19 #include "nocopyable.h" 20 #include "i_infrared_emitter_adapter.h" 21 22 namespace OHOS { 23 namespace MMI { 24 struct InfraredFrequencyInfo { 25 int64_t max_ { 0 }; 26 int64_t min_ { 0 }; 27 }; 28 class InfraredEmitterController { 29 public: 30 /** 31 * @brief Obtains an <b>InfraredEmitterController</b> instance. 32 * @return Returns the pointer to the <b>InfraredEmitterController</b> instance. 33 * @since 12 34 */ 35 static InfraredEmitterController *GetInstance(); 36 virtual ~InfraredEmitterController(); 37 void InitInfraredEmitter(); 38 bool Transmit(int64_t carrierFreq, const std::vector<int64_t> pattern); 39 bool GetFrequencies(std::vector<InfraredFrequencyInfo> &frequencyInfo); 40 41 private: 42 InfraredEmitterController(); 43 DISALLOW_COPY_AND_MOVE(InfraredEmitterController); 44 static InfraredEmitterController *instance_; 45 IInfraredEmitterAdapter *irInterface_ {nullptr}; 46 void *soIrHandle_ {nullptr}; 47 }; 48 } 49 } 50 #endif // INFRARED_EMMITTER_CONTROLLER_H