161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd. 361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 461847f8eSopenharmony_ci * you may not use this file except in compliance with the License. 561847f8eSopenharmony_ci * You may obtain a copy of the License at 661847f8eSopenharmony_ci * 761847f8eSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 861847f8eSopenharmony_ci * 961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and 1361847f8eSopenharmony_ci * limitations under the License. 1461847f8eSopenharmony_ci */ 1561847f8eSopenharmony_ci 1661847f8eSopenharmony_ci/** 1761847f8eSopenharmony_ci * @file 1861847f8eSopenharmony_ci * @kit InputKit 1961847f8eSopenharmony_ci */ 2061847f8eSopenharmony_ci 2161847f8eSopenharmony_ci/** 2261847f8eSopenharmony_ci * Declares the APIs for configuring attributes of the IR emitter. 2361847f8eSopenharmony_ci * 2461847f8eSopenharmony_ci * @namespace infraredEmitter 2561847f8eSopenharmony_ci * @syscap SystemCapability.MultimodalInput.Input.InfraredEmitter 2661847f8eSopenharmony_ci * @since 12 2761847f8eSopenharmony_ci */ 2861847f8eSopenharmony_cideclare namespace infraredEmitter { 2961847f8eSopenharmony_ci /** 3061847f8eSopenharmony_ci * Infrared frequency range supported by the IR emitter. 3161847f8eSopenharmony_ci * 3261847f8eSopenharmony_ci * @interface InfraredFrequency 3361847f8eSopenharmony_ci * @syscap SystemCapability.MultimodalInput.Input.InfraredEmitter 3461847f8eSopenharmony_ci * @systemapi hide for inner use 3561847f8eSopenharmony_ci * @since 12 3661847f8eSopenharmony_ci */ 3761847f8eSopenharmony_ci interface InfraredFrequency { 3861847f8eSopenharmony_ci /** 3961847f8eSopenharmony_ci * Maximum frequency. 4061847f8eSopenharmony_ci * 4161847f8eSopenharmony_ci * @type { number } 4261847f8eSopenharmony_ci * @syscap SystemCapability.MultimodalInput.Input.InfraredEmitter 4361847f8eSopenharmony_ci * @systemapi hide for inner use 4461847f8eSopenharmony_ci * @since 12 4561847f8eSopenharmony_ci */ 4661847f8eSopenharmony_ci max: number; 4761847f8eSopenharmony_ci 4861847f8eSopenharmony_ci /** 4961847f8eSopenharmony_ci * Minimum frequency. 5061847f8eSopenharmony_ci * 5161847f8eSopenharmony_ci * @type { number } 5261847f8eSopenharmony_ci * @syscap SystemCapability.MultimodalInput.Input.InfraredEmitter 5361847f8eSopenharmony_ci * @systemapi hide for inner use 5461847f8eSopenharmony_ci * @since 12 5561847f8eSopenharmony_ci */ 5661847f8eSopenharmony_ci min: number; 5761847f8eSopenharmony_ci } 5861847f8eSopenharmony_ci 5961847f8eSopenharmony_ci /** 6061847f8eSopenharmony_ci * Transmitted IR signal. 6161847f8eSopenharmony_ci * 6261847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INPUT_INFRARED_EMITTER 6361847f8eSopenharmony_ci * @param { number} infraredFrequency - IR infrared frequency, in Hz. 6461847f8eSopenharmony_ci * @param { Array<number>} pattern - Pattern of signal transmission in alternate on/off mode, in microseconds. 6561847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 6661847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 6761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 6861847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 6961847f8eSopenharmony_ci * @syscap SystemCapability.MultimodalInput.Input.InfraredEmitter 7061847f8eSopenharmony_ci * @systemapi hide for inner use 7161847f8eSopenharmony_ci * @since 12 7261847f8eSopenharmony_ci */ 7361847f8eSopenharmony_ci function transmitInfrared(infraredFrequency: number, pattern: Array<number>): void; 7461847f8eSopenharmony_ci 7561847f8eSopenharmony_ci /** 7661847f8eSopenharmony_ci * Obtains the infrared frequency supported by the IR emitter. 7761847f8eSopenharmony_ci * 7861847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INPUT_INFRARED_EMITTER 7961847f8eSopenharmony_ci * @returns { Array<InfraredFrequency> } The return value is an array of InfraredFrequency objects, indicating the infrared frequency ranges supported by the IR emitter. 8061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 8161847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 8261847f8eSopenharmony_ci * @syscap SystemCapability.MultimodalInput.Input.InfraredEmitter 8361847f8eSopenharmony_ci * @systemapi hide for inner use 8461847f8eSopenharmony_ci * @since 12 8561847f8eSopenharmony_ci */ 8661847f8eSopenharmony_ci function getInfraredFrequencies(): Array<InfraredFrequency>; 8761847f8eSopenharmony_ci} 8861847f8eSopenharmony_ci 8961847f8eSopenharmony_ciexport default infraredEmitter; 90