-
Notifications
You must be signed in to change notification settings - Fork 5
/
ir.c
369 lines (328 loc) · 24.2 KB
/
ir.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
#include <FreeRTOS.h>
#include <esp/uart.h>
#include <esp8266.h>
#include <stdio.h>
#include <stdlib.h>
#include <task.h>
#include "homekit_config.h"
#include "ir.h"
int16_t AC_POWER[] = {0};
int16_t AC_TEMP_DOWN[] = {0};
int16_t AC_TEMP_UP[] = {0};
int16_t AC_WIND_SPEED[] = {0};
int16_t AC_SWING_ENABLE[] = {0};
int16_t AC_SWING_DISABLE[] = {0};
int16_t FAN_POWER[] = {0};
int16_t FAN_ROTATION_SPEED[] = {0};
int16_t FAN_TIMER[] = {0};
int16_t cmd_ac_cooler_on[343] = {
9013, -4489, 600, -1625, 601, -1624, 601, -499, 600, -500, 599, -499, 600, -500, 600, -499,
600, -1625, 600, -500, 599, -1626, 600, -1626, 600, -500, 599, -500, 599, -501, 598, -500,
599, -500, 599, -501, 598, -501, 598, -1626, 599, -502, 597, -501, 599, -500, 598, -501,
598, -502, 597, -502, 597, -1627, 599, -501, 597, -503, 596, -503, 596, -503, 596, -503,
596, -1629, 596, -504, 595, -504, 595, -505, 594, -505, 594, -504, 594, -506, 593, -506,
593, -506, 593, -506, 593, -506, 592, -1632, 594, -507, 591, -508, 591, -509, 589, -510,
566, -533, 566, -7972, 564, -536, 562, -537, 561, -538, 561, -538, 560, -539, 559, -540,
558, -542, 556, -1668, 557, -543, 555, -544, 555, -544, 554, -545, 554, -545, 554, -545,
554, -545, 553, -546, 553, -546, 553, -547, 552, -547, 552, -547, 552, -547, 552, -547,
575, -524, 575, -524, 575, -524, 575, -525, 575, -524, 575, -524, 575, -524, 575, -524,
575, -524, 575, -524, 575, -524, 575, -525, 574, -525, 574, -525, 574, -525, 574, -1651,
575, -1650, 575, -1651, 574, -525, 574, -526, 573, -526, 573, -526, 573, -526, 573, -526,
573, -526, 573, -1652, 573, -526, 573, -526, 573, -527, 572, -1653, 572, -1653, 572, -528,
571, -1654, 571, -528, 571, -528, 571, -1655, 570, -529, 570, -1655, 570, -1655, 570, -1656,
569, -530, 569, -530, 569, -7969, 569, -531, 568, -531, 567, -532, 567, -532, 567, -532,
567, -532, 566, -534, 566, -533, 566, -1659, 566, -533, 565, -1661, 541, -558, 541, -558,
540, -1685, 541, -559, 540, -559, 540, -559, 540, -559, 539, -560, 539, -560, 539, -560,
538, -562, 537, -562, 537, -562, 536, -563, 536, -563, 536, -563, 493, -607, 492, -607,
492, -607, 492, -607, 493, -606, 493, -606, 493, -607, 492, -607, 492, -607, 492, -1733,
493, -1733, 493, -606, 493, -607, 492, -607, 492, -607, 493, -606, 493, -1732, 494, -1732,
493, -607, 492, -607, 493, -606, 493, -1732, 493, -607, 493, -1732, 493, -1733, 493, -606,
493, -607, 492, -607, 492, -607, 493};// UNKNOWN F8B45CAF(开机,温度:26,上下风:上,风速:自动,模式:制冷)
int16_t cmd_ac_off[343] = {
8939, -4561, 559, -1667, 558, -1668, 555, -546, 557, -540, 557, -543, 556, -543, 556, -543,
556, -1669, 556, -544, 555, -1670, 555, -1670, 555, -545, 554, -545, 554, -545, 554, -545,
554, -545, 554, -545, 554, -545, 554, -1671, 554, -546, 553, -546, 553, -546, 553, -546,
553, -546, 553, -546, 553, -1672, 553, -546, 553, -546, 553, -546, 552, -547, 553, -546,
552, -1674, 552, -547, 552, -547, 574, -525, 575, -524, 575, -524, 575, -524, 575, -524,
576, -523, 576, -523, 576, -523, 576, -1650, 575, -524, 575, -524, 575, -524, 575, -524,
575, -524, 575, -7963, 576, -524, 575, -524, 575, -524, 575, -524, 575, -524, 575, -524,
575, -524, 575, -1650, 575, -524, 575, -524, 575, -524, 576, -523, 576, -524, 575, -524,
575, -523, 576, -524, 575, -524, 575, -524, 575, -524, 575, -524, 575, -524, 575, -524,
576, -520, 573, -529, 576, -524, 575, -524, 575, -524, 575, -524, 575, -524, 575, -524,
575, -524, 575, -524, 575, -525, 574, -525, 575, -524, 574, -525, 574, -525, 575, -1650,
575, -1650, 575, -1651, 575, -524, 574, -525, 574, -525, 575, -524, 574, -525, 574, -525,
574, -525, 574, -1651, 575, -525, 574, -525, 573, -526, 573, -1652, 574, -1651, 574, -526,
573, -1652, 573, -526, 573, -526, 573, -1652, 573, -527, 572, -1653, 573, -1652, 573, -1652,
573, -527, 572, -527, 572, -7966, 572, -527, 572, -527, 572, -527, 571, -529, 570, -529,
570, -529, 570, -529, 569, -530, 569, -1656, 569, -530, 569, -1656, 569, -531, 568, -531,
568, -1656, 569, -531, 568, -531, 568, -531, 567, -532, 567, -532, 567, -532, 566, -533,
566, -533, 566, -533, 566, -533, 566, -533, 565, -535, 540, -558, 541, -558, 541, -558,
543, -557, 563, -535, 541, -559, 539, -560, 539, -560, 539, -560, 539, -560, 539, -560,
539, -1686, 538, -561, 538, -561, 538, -561, 538, -561, 538, -561, 537, -1688, 537, -1688,
536, -563, 536, -564, 492, -607, 492, -1733, 493, -606, 493, -1732, 493, -1732, 493, -1733,
492, -607, 492, -607, 492, -607, 493};// UNKNOWN 4681921(关机)
//温度(上下风:上,风速:自动,模式:制冷)
int16_t cooler_temperature_22[343] ={
9007, -4495, 600, -1625, 600, -1626, 600, -500, 599, -500, 600, -501, 598, -500, 599, -501,
598, -1627, 599, -501, 598, -1627, 599, -1627, 599, -500, 599, -501, 598, -501, 599, -501,
598, -500, 599, -501, 598, -501, 598, -501, 599, -501, 598, -501, 598, -501, 598, -502,
598, -501, 598, -501, 598, -1626, 600, -501, 598, -501, 598, -502, 597, -502, 597, -1628,
598, -501, 598, -502, 597, -502, 598, -501, 598, -502, 597, -502, 597, -502, 597, -502,
597, -503, 596, -503, 598, -501, 597, -1628, 597, -503, 597, -503, 596, -503, 596, -503,
596, -504, 595, -7943, 596, -504, 595, -504, 595, -504, 596, -503, 596, -504, 595, -504,
595, -504, 596, -1629, 596, -504, 595, -505, 594, -505, 595, -504, 595, -504, 595, -505,
594, -505, 594, -505, 594, -505, 594, -506, 593, -506, 594, -505, 594, -506, 593, -506,
593, -506, 593, -507, 592, -507, 592, -507, 592, -508, 592, -507, 592, -507, 592, -507,
592, -507, 592, -508, 591, -508, 591, -508, 591, -508, 568, -532, 567, -532, 569, -1655,
569, -1657, 569, -1657, 568, -532, 567, -533, 566, -533, 567, -532, 566, -534, 566, -533,
565, -534, 566, -1659, 566, -534, 565, -534, 565, -535, 564, -1660, 566, -1660, 565, -535,
565, -1660, 565, -535, 564, -535, 563, -1662, 564, -1662, 564, -1661, 564, -1662, 563, -1663,
563, -1670, 556, -1662, 563, -7977, 562, -538, 561, -538, 561, -538, 560, -540, 559, -540,
493, -606, 493, -607, 492, -607, 492, -607, 493, -1732, 493, -607, 493, -606, 493, -607,
492, -607, 492, -607, 493, -606, 493, -606, 493, -607, 492, -607, 493, -606, 493, -607,
492, -607, 492, -607, 493, -606, 493, -607, 492, -607, 492, -607, 493, -607, 492, -607,
492, -607, 492, -607, 493, -607, 551, -548, 550, -549, 552, -547, 552, -548, 551, -1673,
553, -1673, 552, -548, 552, -547, 552, -547, 552, -548, 551, -548, 551, -1673, 553, -1673,
552, -548, 552, -548, 551, -548, 551, -548, 551, -1674, 552, -548, 551, -1674, 551, -549,
551, -1674, 551, -549, 550, -549, 550};// UNKNOWN B147EF62(22)
int16_t cooler_temperature_23[343] = {
9001, -4502, 597, -1627, 598, -1628, 598, -502, 597, -503, 596, -503, 596, -503, 596, -503,
596, -1629, 597, -503, 596, -1629, 596, -1630, 596, -504, 595, -504, 595, -504, 595, -504,
595, -504, 595, -504, 595, -504, 595, -505, 594, -505, 595, -504, 595, -504, 595, -505,
594, -505, 594, -505, 594, -1631, 595, -505, 594, -505, 594, -1631, 595, -504, 595, -1631,
595, -505, 594, -505, 594, -506, 593, -505, 594, -506, 593, -506, 593, -506, 594, -505,
594, -505, 594, -506, 593, -506, 593, -1632, 594, -506, 593, -507, 592, -507, 593, -506,
592, -507, 593, -7945, 594, -506, 593, -507, 592, -507, 592, -507, 592, -507, 592, -507,
593, -506, 592, -1633, 592, -509, 593, -505, 592, -508, 591, -508, 591, -508, 591, -508,
591, -509, 590, -509, 590, -509, 590, -509, 590, -509, 567, -533, 589, -509, 567, -533,
566, -533, 566, -533, 566, -533, 566, -533, 566, -534, 565, -534, 565, -534, 565, -534,
565, -534, 565, -534, 565, -535, 564, -535, 564, -535, 564, -535, 563, -536, 563, -1662,
564, -1662, 563, -1662, 563, -537, 563, -536, 562, -538, 561, -538, 561, -538, 560, -539,
560, -539, 561, -1664, 561, -539, 560, -539, 560, -540, 559, -1665, 560, -1666, 560, -540,
559, -1665, 560, -541, 558, -541, 558, -1667, 558, -1667, 559, -1667, 559, -541, 558, -1667,
559, -1666, 559, -1667, 558, -7981, 559, -541, 557, -543, 555, -544, 492, -607, 492, -607,
493, -607, 553, -546, 492, -607, 492, -607, 555, -1670, 493, -607, 555, -544, 555, -544,
555, -545, 554, -546, 554, -545, 558, -540, 554, -546, 554, -545, 554, -546, 553, -546,
553, -546, 553, -547, 552, -547, 553, -546, 553, -546, 553, -546, 553, -547, 552, -547,
552, -547, 552, -547, 552, -547, 553, -547, 552, -547, 552, -547, 552, -548, 551, -1673,
553, -1673, 552, -548, 552, -548, 551, -548, 551, -548, 551, -548, 551, -1674, 552, -1674,
552, -548, 574, -525, 574, -526, 574, -525, 574, -1651, 574, -526, 574, -1650, 575, -526,
574, -1650, 575, -526, 573, -526, 574};// UNKNOWN 20E11AA2 (23)
int16_t cooler_temperature_24[343] = {
8991, -4512, 591, -1634, 592, -1634, 592, -508, 590, -509, 591, -508, 591, -509, 590, -509,
590, -1636, 590, -509, 590, -1636, 590, -1636, 590, -509, 590, -508, 589, -511, 590, -510,
589, -511, 588, -511, 589, -510, 588, -511, 566, -534, 565, -534, 565, -534, 565, -535,
564, -535, 564, -535, 565, -1661, 565, -535, 564, -535, 564, -536, 563, -1662, 564, -1662,
564, -536, 563, -536, 563, -537, 563, -536, 563, -536, 563, -536, 563, -537, 562, -537,
562, -538, 561, -538, 561, -538, 561, -1665, 561, -539, 560, -539, 561, -538, 561, -539,
560, -539, 560, -7979, 562, -538, 560, -540, 560, -539, 560, -539, 560, -540, 559, -540,
559, -540, 559, -1666, 560, -541, 558, -541, 558, -541, 558, -541, 558, -542, 558, -541,
558, -541, 558, -541, 558, -542, 557, -542, 557, -543, 557, -542, 557, -542, 557, -542,
557, -543, 556, -543, 556, -543, 557, -543, 556, -543, 556, -544, 555, -544, 555, -544,
555, -544, 556, -544, 555, -544, 554, -545, 555, -545, 554, -545, 554, -545, 554, -1671,
555, -1671, 555, -1671, 555, -545, 554, -542, 556, -546, 554, -546, 553, -546, 554, -546,
553, -546, 553, -1671, 555, -545, 554, -546, 553, -546, 554, -1671, 554, -1672, 554, -546,
553, -1672, 554, -546, 553, -547, 552, -1673, 553, -1673, 553, -1673, 553, -1672, 554, -547,
552, -1673, 553, -1673, 552, -7988, 552, -548, 575, -524, 575, -525, 575, -524, 575, -525,
575, -524, 575, -524, 575, -525, 575, -524, 575, -1650, 576, -524, 575, -524, 575, -525,
575, -524, 575, -525, 574, -525, 575, -524, 575, -525, 574, -525, 575, -524, 575, -525,
574, -525, 575, -525, 574, -525, 574, -525, 574, -526, 573, -526, 574, -525, 574, -526,
573, -526, 573, -527, 572, -527, 573, -526, 573, -527, 572, -527, 572, -527, 572, -1653,
573, -1653, 572, -528, 571, -528, 571, -529, 570, -529, 571, -528, 570, -1655, 571, -1655,
570, -530, 569, -530, 569, -526, 567, -536, 569, -1656, 570, -530, 568, -1657, 569, -532,
567, -1657, 569, -532, 566, -533, 566};// UNKNOWN DF39ABEC (24)
int16_t cooler_temperature_25[343] = {
8941, -4563, 557, -1669, 557, -1669, 556, -544, 556, -543, 556, -543, 556, -543, 556, -544,
555, -1671, 554, -545, 555, -1671, 554, -1672, 554, -545, 554, -546, 554, -545, 554, -546,
553, -546, 553, -546, 554, -546, 553, -546, 553, -546, 553, -547, 553, -546, 553, -546,
553, -547, 553, -546, 553, -1673, 552, -547, 553, -547, 552, -1674, 552, -1674, 574, -1651,
575, -525, 575, -524, 576, -523, 576, -524, 575, -524, 576, -524, 575, -524, 575, -524,
576, -524, 575, -524, 576, -524, 575, -1650, 576, -524, 575, -524, 576, -524, 575, -524,
577, -523, 575, -7964, 575, -524, 575, -525, 575, -524, 575, -524, 575, -524, 575, -525,
575, -524, 575, -1651, 575, -524, 575, -524, 575, -525, 574, -525, 575, -524, 575, -525,
574, -525, 575, -524, 575, -525, 574, -525, 575, -524, 575, -525, 574, -525, 574, -526,
574, -525, 574, -525, 574, -526, 573, -526, 574, -525, 574, -525, 574, -526, 573, -526,
574, -526, 573, -526, 573, -526, 573, -526, 573, -526, 573, -527, 573, -526, 573, -1653,
573, -1653, 572, -1653, 573, -527, 573, -527, 572, -527, 572, -527, 572, -528, 571, -528,
571, -528, 572, -1654, 571, -528, 571, -529, 571, -528, 571, -1654, 571, -1655, 571, -529,
570, -1655, 570, -530, 569, -530, 569, -1657, 569, -1656, 569, -1657, 569, -531, 568, -531,
568, -1658, 567, -1658, 568, -7973, 568, -531, 566, -533, 566, -534, 565, -534, 564, -535,
541, -559, 540, -559, 540, -559, 540, -560, 539, -1686, 540, -560, 539, -560, 539, -560,
539, -560, 539, -560, 538, -562, 537, -562, 537, -562, 537, -562, 537, -563, 536, -563,
535, -564, 535, -565, 532, -567, 492, -607, 492, -607, 493, -607, 492, -607, 492, -607,
493, -607, 492, -607, 492, -607, 501, -599, 492, -607, 492, -607, 493, -606, 493, -1733,
493, -1732, 493, -607, 493, -606, 493, -607, 492, -607, 493, -606, 493, -1733, 493, -1732,
493, -607, 493, -606, 493, -607, 492, -607, 492, -1733, 493, -607, 492, -1733, 493, -607,
492, -1733, 493, -607, 492, -607, 493};// UNKNOWN 8AEBE498 (25)
int16_t cooler_temperature_26[343] = {
8991, -4513, 564, -1662, 563, -1663, 563, -537, 563, -536, 563, -536, 563, -537, 562, -537,
562, -1664, 562, -538, 562, -1663, 562, -1664, 562, -538, 561, -538, 561, -539, 560, -539,
560, -539, 561, -538, 561, -539, 560, -539, 560, -540, 559, -540, 559, -540, 559, -541,
558, -541, 559, -540, 559, -1667, 559, -540, 559, -541, 557, -542, 557, -542, 558, -542,
557, -1668, 558, -542, 557, -542, 557, -543, 556, -543, 556, -543, 556, -544, 555, -544,
555, -544, 555, -544, 556, -544, 554, -1671, 555, -545, 554, -545, 554, -546, 554, -545,
554, -545, 554, -7986, 553, -546, 554, -546, 553, -546, 553, -546, 553, -550, 550, -546,
553, -546, 553, -1673, 553, -547, 552, -547, 552, -547, 553, -547, 552, -547, 552, -548,
551, -548, 575, -524, 575, -524, 576, -524, 575, -524, 575, -524, 576, -524, 575, -524,
575, -524, 576, -524, 575, -524, 575, -524, 576, -524, 575, -524, 575, -524, 576, -524,
575, -524, 575, -524, 575, -525, 575, -524, 571, -535, 569, -524, 575, -524, 575, -1651,
575, -1651, 574, -1651, 575, -525, 574, -525, 575, -525, 574, -525, 574, -525, 575, -525,
574, -525, 574, -1652, 574, -525, 574, -526, 573, -526, 574, -1652, 573, -1652, 574, -526,
573, -1653, 572, -527, 573, -527, 572, -1653, 572, -1654, 572, -1654, 572, -1654, 571, -1654,
572, -528, 571, -528, 571, -7969, 570, -529, 571, -529, 570, -529, 570, -529, 570, -530,
569, -530, 569, -530, 569, -531, 568, -531, 568, -1658, 568, -531, 568, -532, 567, -532,
567, -532, 567, -533, 566, -533, 566, -533, 566, -534, 566, -533, 564, -535, 565, -535,
565, -534, 541, -559, 540, -559, 541, -558, 541, -559, 540, -559, 540, -559, 540, -560,
539, -560, 540, -560, 538, -561, 538, -561, 539, -561, 538, -561, 538, -561, 538, -1688,
537, -1688, 537, -563, 536, -563, 536, -564, 534, -565, 493, -606, 493, -1733, 493, -1734,
492, -607, 492, -607, 493, -606, 493, -607, 492, -1733, 493, -607, 493, -1733, 493, -606,
493, -1733, 493, -607, 492, -607, 493};// UNKNOWN 20C716B1 (26)
int16_t cooler_temperature_27[343] = {
9003, -4503, 596, -1630, 596, -1631, 594, -505, 594, -506, 594, -505, 594, -506, 593, -506,
593, -1633, 593, -506, 593, -1633, 593, -1633, 593, -507, 592, -507, 593, -507, 592, -507,
592, -507, 592, -508, 591, -508, 592, -507, 592, -508, 591, -508, 591, -509, 591, -508,
591, -509, 590, -509, 591, -1634, 592, -508, 591, -509, 590, -1635, 592, -508, 590, -510,
590, -1635, 591, -509, 590, -510, 590, -509, 590, -510, 589, -510, 590, -509, 590, -510,
589, -510, 590, -510, 589, -510, 589, -1636, 591, -509, 592, -508, 589, -510, 566, -534,
566, -533, 566, -7974, 590, -510, 589, -510, 566, -534, 566, -534, 565, -534, 565, -534,
565, -535, 565, -1659, 567, -534, 565, -534, 565, -535, 564, -535, 564, -536, 564, -535,
564, -536, 563, -536, 564, -535, 564, -536, 563, -536, 563, -536, 563, -537, 562, -537,
562, -537, 562, -538, 562, -538, 561, -538, 561, -538, 561, -539, 560, -539, 560, -539,
560, -539, 560, -540, 559, -540, 559, -541, 559, -540, 559, -541, 558, -541, 558, -1667,
559, -1667, 558, -1668, 558, -543, 556, -543, 556, -543, 556, -544, 555, -544, 556, -544,
555, -544, 555, -1670, 556, -544, 555, -545, 554, -545, 555, -1670, 555, -1671, 555, -546,
553, -1672, 554, -546, 553, -546, 554, -1671, 555, -1671, 554, -1672, 554, -547, 552, -1673,
553, -547, 552, -547, 553, -7987, 553, -547, 552, -547, 552, -548, 551, -548, 552, -548,
551, -548, 551, -548, 574, -525, 575, -525, 575, -1649, 576, -525, 575, -524, 575, -525,
574, -525, 575, -522, 572, -529, 575, -525, 575, -525, 574, -525, 574, -525, 575, -525,
574, -525, 574, -525, 575, -524, 575, -525, 574, -525, 575, -525, 574, -525, 574, -525,
575, -525, 574, -525, 574, -525, 574, -526, 574, -525, 574, -525, 574, -526, 574, -1650,
575, -1651, 575, -526, 573, -526, 574, -525, 574, -526, 573, -526, 573, -1652, 574, -1652,
574, -526, 573, -526, 573, -527, 572, -527, 572, -1653, 573, -527, 572, -1653, 573, -528,
571, -1653, 573, -528, 571, -528, 571};// UNKNOWN F6D716C1 (27)
int16_t cooler_temperature_28[343] = {
9024, -4481, 595, -1630, 596, -1631, 595, -505, 594, -505, 595, -505, 594, -505, 594, -506,
594, -1632, 594, -506, 593, -1632, 594, -1632, 594, -506, 593, -507, 593, -506, 593, -507,
592, -507, 592, -508, 592, -508, 591, -508, 591, -509, 591, -508, 591, -508, 591, -509,
591, -508, 591, -509, 590, -1636, 590, -510, 589, -510, 589, -510, 590, -1636, 589, -511,
588, -1637, 567, -534, 565, -534, 590, -509, 566, -534, 565, -535, 564, -535, 564, -536,
564, -535, 564, -536, 563, -536, 564, -1662, 563, -537, 563, -536, 563, -537, 562, -537,
563, -537, 562, -7978, 564, -537, 562, -537, 562, -538, 561, -538, 562, -537, 562, -538,
561, -538, 562, -1664, 562, -538, 561, -539, 560, -539, 560, -540, 560, -539, 560, -540,
560, -539, 560, -540, 559, -540, 559, -541, 559, -541, 563, -536, 558, -541, 558, -542,
557, -542, 557, -543, 557, -542, 557, -543, 556, -543, 557, -543, 556, -543, 556, -544,
555, -544, 555, -544, 555, -545, 555, -545, 554, -544, 555, -545, 554, -546, 553, -1672,
555, -1671, 555, -1672, 554, -546, 553, -546, 554, -546, 553, -546, 553, -547, 553, -546,
553, -547, 552, -1673, 553, -547, 553, -547, 552, -547, 552, -1674, 552, -1674, 552, -548,
552, -1673, 553, -548, 551, -548, 575, -1647, 552, -1678, 575, -1651, 575, -1651, 575, -525,
575, -524, 575, -525, 575, -7965, 575, -525, 575, -524, 575, -525, 575, -524, 575, -525,
575, -524, 575, -525, 575, -524, 575, -525, 574, -1651, 576, -524, 575, -525, 574, -525,
575, -525, 574, -525, 575, -525, 574, -525, 574, -525, 575, -525, 574, -526, 573, -526,
574, -525, 574, -526, 573, -526, 574, -526, 573, -526, 573, -526, 574, -526, 573, -526,
573, -527, 573, -526, 573, -527, 572, -527, 573, -526, 573, -527, 574, -525, 572, -1653,
573, -1653, 573, -527, 572, -528, 571, -528, 571, -528, 571, -529, 571, -1654, 572, -1654,
571, -529, 570, -530, 569, -530, 569, -531, 568, -1657, 569, -531, 568, -1657, 568, -532,
567, -1658, 568, -532, 567, -533, 566};// UNKNOWN AF568279 (28)
int16_t cooler_temperature_29[343] = {
8941, -4565, 554, -1672, 554, -1672, 554, -545, 555, -545, 554, -546, 553, -546, 554, -545,
554, -1672, 554, -546, 553, -1673, 553, -1673, 553, -546, 554, -546, 553, -546, 553, -547,
553, -546, 553, -547, 552, -547, 553, -546, 553, -547, 552, -547, 553, -546, 553, -547,
552, -547, 552, -548, 552, -1674, 552, -548, 551, -548, 574, -1652, 575, -1651, 575, -525,
575, -1650, 576, -524, 575, -525, 575, -524, 575, -525, 575, -524, 575, -524, 576, -524,
575, -524, 576, -524, 575, -524, 576, -1650, 576, -524, 575, -524, 576, -524, 575, -524,
576, -524, 575, -7965, 575, -525, 575, -524, 575, -524, 576, -524, 575, -525, 575, -524,
575, -524, 575, -1651, 575, -525, 575, -524, 575, -524, 572, -528, 575, -525, 574, -525,
575, -525, 574, -525, 575, -524, 575, -525, 574, -525, 575, -525, 574, -525, 574, -526,
574, -525, 574, -525, 574, -526, 574, -525, 574, -526, 574, -525, 574, -526, 573, -526,
574, -526, 573, -526, 573, -527, 573, -526, 573, -527, 572, -527, 573, -527, 572, -1653,
573, -1653, 573, -1653, 572, -528, 572, -528, 571, -528, 571, -528, 571, -529, 571, -528,
571, -529, 570, -1656, 570, -529, 570, -530, 569, -530, 569, -1656, 570, -1657, 569, -531,
568, -1657, 569, -531, 568, -532, 567, -1658, 568, -1658, 568, -1659, 567, -533, 566, -533,
566, -534, 565, -534, 565, -7975, 565, -535, 541, -559, 540, -559, 540, -560, 539, -560,
540, -560, 539, -560, 539, -561, 538, -561, 538, -1687, 537, -564, 538, -561, 537, -562,
538, -562, 537, -562, 536, -564, 536, -564, 534, -565, 534, -566, 497, -602, 492, -608,
492, -607, 492, -607, 493, -607, 492, -607, 493, -607, 492, -607, 492, -608, 492, -607,
492, -608, 492, -607, 492, -607, 492, -608, 492, -607, 492, -607, 492, -608, 492, -1732,
494, -1733, 493, -607, 492, -607, 493, -607, 492, -607, 493, -607, 492, -1733, 493, -1733,
493, -607, 493, -607, 492, -607, 525, -575, 524, -1701, 525, -575, 525, -1700, 526, -575,
524, -1701, 525, -575, 525, -575, 524};// UNKNOWN E6AB521D (29)
int16_t cooler_temperature_30[343] = {
8940, -4564, 557, -1669, 557, -1670, 556, -544, 555, -544, 555, -544, 556, -544, 555, -544,
555, -1671, 555, -545, 555, -1671, 555, -1670, 556, -544, 555, -545, 554, -545, 555, -545,
554, -545, 554, -546, 553, -546, 554, -546, 553, -546, 554, -546, 553, -546, 553, -546,
554, -546, 553, -547, 552, -1674, 552, -547, 553, -546, 553, -547, 552, -547, 553, -1673,
553, -1673, 575, -525, 575, -525, 575, -524, 575, -524, 576, -524, 575, -524, 576, -524,
575, -524, 576, -524, 575, -524, 576, -1647, 575, -527, 576, -524, 576, -524, 575, -524,
575, -525, 575, -7965, 575, -525, 575, -524, 575, -524, 576, -524, 575, -524, 576, -524,
575, -524, 575, -1651, 575, -525, 575, -524, 575, -525, 575, -524, 575, -525, 575, -523,
576, -524, 575, -525, 575, -524, 575, -525, 575, -524, 575, -525, 574, -525, 575, -525,
574, -525, 575, -524, 575, -525, 574, -525, 575, -525, 574, -525, 575, -525, 574, -525,
574, -526, 574, -525, 574, -526, 574, -525, 574, -526, 573, -526, 573, -527, 573, -1652,
574, -1653, 573, -1652, 573, -527, 573, -527, 572, -527, 572, -528, 572, -527, 572, -528,
571, -528, 571, -1655, 571, -529, 570, -529, 571, -529, 570, -1655, 570, -1656, 570, -530,
569, -1657, 569, -530, 569, -531, 568, -1657, 569, -1658, 568, -1658, 568, -1658, 567, -1658,
568, -1659, 567, -533, 566, -7974, 566, -534, 565, -534, 565, -535, 564, -535, 565, -534,
541, -559, 540, -560, 540, -559, 540, -559, 540, -1686, 540, -560, 539, -560, 540, -560,
539, -560, 539, -561, 538, -561, 538, -562, 537, -562, 538, -561, 538, -562, 537, -562,
537, -563, 536, -563, 536, -564, 535, -564, 535, -565, 534, -565, 535, -564, 493, -607,
492, -607, 492, -608, 492, -607, 492, -607, 493, -607, 492, -607, 493, -607, 492, -1733,
493, -1733, 493, -607, 493, -607, 492, -607, 492, -607, 493, -607, 492, -1733, 493, -1733,
493, -608, 492, -607, 492, -607, 493, -607, 492, -1733, 493, -607, 493, -1733, 493, -607,
492, -1733, 493, -607, 493, -607, 492};// UNKNOWN B7BA7415 (30)
void ir_init() {
ir_tx_init();
ir_rx_init(IR_RX_GPIO, 1024);
}
void ir_ac_power() { IR_SEND(AC_POWER); }
void ir_ac_temp_up() { IR_SEND(AC_TEMP_UP); }
void ir_ac_temp_down() { IR_SEND(AC_TEMP_DOWN); }
void ir_ac_wind_speed() { IR_SEND(AC_WIND_SPEED); }
void ir_ac_swing_enable() { IR_SEND(AC_SWING_ENABLE); }
void ir_ac_swing_disable() { IR_SEND(AC_SWING_DISABLE); }
void ir_fan_power() { IR_SEND(FAN_POWER); }
void ir_fan_rotation_speed() { IR_SEND(FAN_ROTATION_SPEED); }
//电源
void ir_ac_power_on(){ IR_SEND(cmd_ac_cooler_on); }
void ir_ac_power_off(){ IR_SEND(cmd_ac_off); }
//温度
void ir_ac_temp_22(){ IR_SEND(cooler_temperature_22); }
void ir_ac_temp_23(){ IR_SEND(cooler_temperature_23); }
void ir_ac_temp_24(){ IR_SEND(cooler_temperature_24); }
void ir_ac_temp_25(){ IR_SEND(cooler_temperature_25); }
void ir_ac_temp_26(){ IR_SEND(cooler_temperature_26); }
void ir_ac_temp_27(){ IR_SEND(cooler_temperature_27); }
void ir_ac_temp_28(){ IR_SEND(cooler_temperature_28); }
void ir_ac_temp_29(){ IR_SEND(cooler_temperature_29); }
void ir_ac_temp_30(){ IR_SEND(cooler_temperature_30); }
//模式
//void ir_ac_mode_auto(){ IR_SEND(); }
void ir_ac_mode_cool(){ IR_SEND(cmd_ac_cooler_on); }
//void ir_ac_mode_heat(){ IR_SEND(); }
//风速
// void ir_ac_fan_speed_auto(){ IR_SEND(); }
// void ir_ac_fan_speed_0(){ IR_SEND(); }
// void ir_ac_fan_speed_1(){ IR_SEND(); }
// void ir_ac_fan_speed_2(){ IR_SEND(); }
// void ir_ac_fan_speed_3(){ IR_SEND(); }
// void ir_ac_fan_speed_4(){ IR_SEND(); }
// void ir_ac_fan_speed_5(){ IR_SEND(); }
void ir_dump_task(void *arg) {
ir_decoder_t *raw_decoder = ir_raw_make_decoder();
uint16_t buffer_size = sizeof(int16_t) * 1024;
int16_t *buffer = malloc(buffer_size);
while (1) {
int size = ir_recv(raw_decoder, 0, buffer, buffer_size);
if (size <= 0)
continue;
printf("Decoded packet (size = %d):\n", size);
for (int i = 0; i < size; i++) {
printf("%5d ", buffer[i]);
if (i % 16 == 15)
printf("\n");
}
if (size % 16)
printf("\n");
}
raw_decoder->free(raw_decoder);
vTaskDelete(NULL);
}