1e41f4b71Sopenharmony_ci# @ohos.multimodalInput.infraredEmitter (IR Management) (System API)
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ciThe **infraredEmitter** module generates IR signals of the specified frequency and size, and queries the frequency range supported by the device.
4e41f4b71Sopenharmony_ci
5e41f4b71Sopenharmony_ci> **NOTE**
6e41f4b71Sopenharmony_ci>
7e41f4b71Sopenharmony_ci> - The initial APIs of this module are supported since API version 12. Newly added APIs will be marked with a superscript to indicate their earliest API version.
8e41f4b71Sopenharmony_ci>
9e41f4b71Sopenharmony_ci> - The APIs provided by this module are system APIs.
10e41f4b71Sopenharmony_ci
11e41f4b71Sopenharmony_ci## Modules to Import
12e41f4b71Sopenharmony_ci
13e41f4b71Sopenharmony_ci```js
14e41f4b71Sopenharmony_ciimport { infraredEmitter } from '@kit.InputKit';
15e41f4b71Sopenharmony_ci```
16e41f4b71Sopenharmony_ci
17e41f4b71Sopenharmony_ci## infraredEmitter.transmitInfrared 
18e41f4b71Sopenharmony_ci
19e41f4b71Sopenharmony_citransmitInfrared(infraredFrequency: number, pattern: Array<number>): void
20e41f4b71Sopenharmony_ci
21e41f4b71Sopenharmony_ciGenerates IR signals at the specified frequency and level.
22e41f4b71Sopenharmony_ci
23e41f4b71Sopenharmony_ci**Required permissions**: ohos.permission.MANAGE_INPUT_INFRARED_EMITTER
24e41f4b71Sopenharmony_ci
25e41f4b71Sopenharmony_ci**System capability**: SystemCapability.MultimodalInput.Input.InfraredEmitter
26e41f4b71Sopenharmony_ci
27e41f4b71Sopenharmony_ci**Parameters**
28e41f4b71Sopenharmony_ci
29e41f4b71Sopenharmony_ci| Name      | Type                       | Mandatory  | Description                                      |
30e41f4b71Sopenharmony_ci| -------- | ------------------------- | ---- | ---------------------------------------- |
31e41f4b71Sopenharmony_ci| infraredFrequency | number             | Yes   | IR frequency, in Hz.|
32e41f4b71Sopenharmony_ci| pattern | Array<number> | Yes   | IR level signal, in μs. The number of arrays must be an even number. For example, in [100, 200, 300, 400], 100 μs is a high level signal, 200 μs is a low level signal, 300 μs is a high level signal, and 400 μs is a low level signal. The number of arrays must be in the range of [0, 500).|
33e41f4b71Sopenharmony_ci
34e41f4b71Sopenharmony_ci**Error codes**
35e41f4b71Sopenharmony_ci
36e41f4b71Sopenharmony_ciFor details about the error codes, see [Universal Error Codes](../errorcode-universal.md).
37e41f4b71Sopenharmony_ci
38e41f4b71Sopenharmony_ci| ID| Error Message         |
39e41f4b71Sopenharmony_ci| -------- | ----------------- |
40e41f4b71Sopenharmony_ci| 201 | Permission denied. |
41e41f4b71Sopenharmony_ci| 202 | Not system application. |
42e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.2.Incorrect parameter types.3.Parameter verification failed. |
43e41f4b71Sopenharmony_ci
44e41f4b71Sopenharmony_ci**Example**
45e41f4b71Sopenharmony_ci
46e41f4b71Sopenharmony_ci```js
47e41f4b71Sopenharmony_citry {
48e41f4b71Sopenharmony_ci  infraredEmitter.transmitInfrared(38000, [100, 200, 300, 400]);
49e41f4b71Sopenharmony_ci} catch (error) {
50e41f4b71Sopenharmony_ci  console.log(`transmitInfrared failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
51e41f4b71Sopenharmony_ci}
52e41f4b71Sopenharmony_ci```
53e41f4b71Sopenharmony_ci
54e41f4b71Sopenharmony_ci## infraredEmitter.getInfraredFrequencies
55e41f4b71Sopenharmony_ci
56e41f4b71Sopenharmony_cigetInfraredFrequencies(): Array<InfraredFrequency>
57e41f4b71Sopenharmony_ci
58e41f4b71Sopenharmony_ciQueries the frequency range of IR signals supported by the mobile phone.
59e41f4b71Sopenharmony_ci
60e41f4b71Sopenharmony_ci**Required permissions**: ohos.permission.MANAGE_INPUT_INFRARED_EMITTER
61e41f4b71Sopenharmony_ci
62e41f4b71Sopenharmony_ci**System capability**: SystemCapability.MultimodalInput.Input.InfraredEmitter
63e41f4b71Sopenharmony_ci
64e41f4b71Sopenharmony_ci**Return value**
65e41f4b71Sopenharmony_ci
66e41f4b71Sopenharmony_ci| Parameter                 | Description                 |
67e41f4b71Sopenharmony_ci| ------------------- | ------------------- |
68e41f4b71Sopenharmony_ci| Array<[InfraredFrequency](#infraredfrequency)> | Frequency range, including multiple groups of maximum and minimum frequencies.|
69e41f4b71Sopenharmony_ci
70e41f4b71Sopenharmony_ci**Error codes**
71e41f4b71Sopenharmony_ci
72e41f4b71Sopenharmony_ciFor details about the error codes, see [Universal Error Codes](../errorcode-universal.md).
73e41f4b71Sopenharmony_ci
74e41f4b71Sopenharmony_ci| ID| Error Message         |
75e41f4b71Sopenharmony_ci| -------- | ----------------- |
76e41f4b71Sopenharmony_ci| 201 | Permission denied. |
77e41f4b71Sopenharmony_ci| 202 | Not system application. |
78e41f4b71Sopenharmony_ci
79e41f4b71Sopenharmony_ci**Example**
80e41f4b71Sopenharmony_ci
81e41f4b71Sopenharmony_ci```js
82e41f4b71Sopenharmony_citry {
83e41f4b71Sopenharmony_ci  let frequencies = infraredEmitter.getInfraredFrequencies();
84e41f4b71Sopenharmony_ci  console.log(`frequencies: ${JSON.stringify(frequencies)}`);
85e41f4b71Sopenharmony_ci} catch (error) {
86e41f4b71Sopenharmony_ci  console.log(`Get infrared frequencies failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
87e41f4b71Sopenharmony_ci}
88e41f4b71Sopenharmony_ci```
89e41f4b71Sopenharmony_ci
90e41f4b71Sopenharmony_ci##  InfraredFrequency
91e41f4b71Sopenharmony_ci
92e41f4b71Sopenharmony_ciDefines the frequency range of IR signals.
93e41f4b71Sopenharmony_ci
94e41f4b71Sopenharmony_ci**System capability**: SystemCapability.MultimodalInput.Input.InfraredEmitter
95e41f4b71Sopenharmony_ci
96e41f4b71Sopenharmony_ci| Name                              | Type| Mandatory  | Description |
97e41f4b71Sopenharmony_ci| -------------------------------- | ---- | ------ | ------ |
98e41f4b71Sopenharmony_ci| max                       | number | Yes| Maximum frequency, in Hz.|
99e41f4b71Sopenharmony_ci| min                          | number | Yes | Minimum frequency, in Hz.|
100