Skip to content

Commit e6e1940

Browse files
authored
Fix Bosch144 timings (#2242)
A few of the commands from my Durastar remote were being detected as Coolix protocol, due to the bit mark and zero space timings being slightly out of the expected range for Bosch144 Fixes #2241
1 parent 8833210 commit e6e1940

File tree

2 files changed

+54
-2
lines changed

2 files changed

+54
-2
lines changed

src/ir_Bosch.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030

3131
// Constants
3232
const uint16_t kBoschHdrMark = 4366;
33-
const uint16_t kBoschBitMark = 502;
33+
const uint16_t kBoschBitMark = 456;
3434
const uint16_t kBoschHdrSpace = 4415;
3535
const uint16_t kBoschOneSpace = 1645;
36-
const uint16_t kBoschZeroSpace = 571;
36+
const uint16_t kBoschZeroSpace = 610;
3737
const uint16_t kBoschFooterSpace = 5235;
3838
const uint16_t kBoschFreq = 38000; // Hz. (Guessing the most common frequency.)
3939
const uint16_t kBosch144NrOfSections = 3;

test/ir_Bosch_test.cpp

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,58 @@ TEST(TestDecodeBosch144, DurastarExample) {
126126
ASSERT_TRUE(IRAcUtils::decodeToState(&irsend.capture, &result, &prev));
127127
}
128128

129+
// This example command has more extreme timings
130+
TEST(TestDecodeBosch144, DurastarExample61F) {
131+
IRsendTest irsend(kGpioUnused);
132+
IRrecv irrecv(kGpioUnused);
133+
134+
// Mode: Heat; Fan: High ; Temp: 61°F
135+
uint16_t rawData[299] = {
136+
4450, 4345, 590, 1560, 590, 510, 560, 1560, 590, 1560, 590, 510, 565,
137+
510, 560, 1565, 590, 510, 560, 515, 560, 1565, 590, 515, 560, 515, 560,
138+
1565, 590, 1565, 585, 520, 560, 1570, 560, 515, 560, 515, 555, 1595, 560,
139+
1595, 555, 1595, 530, 1620, 530, 1620, 530, 1625, 525, 1625, 525, 1630,
140+
520, 555, 525, 550, 525, 550, 525, 550, 525, 550, 550, 525, 550, 530,
141+
550, 525, 550, 530, 550, 525, 550, 1605, 520, 1630, 520, 550, 550, 525,
142+
550, 1605, 520, 1630, 520, 1630, 525, 1630, 520, 550, 525, 550, 525,
143+
1625, 550, 1605, 550, 5200, 4405, 4390, 520, 1630, 520, 555, 520, 1630,
144+
520, 1630, 520, 555, 520, 555, 520, 1630, 520, 555, 520, 555, 520, 1635,
145+
520, 555, 520, 560, 520, 1635, 515, 1635, 515, 560, 515, 1655, 495, 580,
146+
495, 580, 495, 1660, 495, 1660, 495, 1660, 490, 1660, 490, 1660, 490,
147+
1660, 490, 1660, 490, 1660, 490, 585, 490, 590, 485, 590, 485, 590, 485,
148+
595, 480, 590, 480, 600, 480, 590, 485, 590, 485, 590, 485, 1670, 485,
149+
1670, 485, 590, 485, 590, 485, 1670, 480, 1670, 485, 1670, 480, 1670,
150+
480, 595, 480, 590, 485, 1670, 480, 1690, 460, 5290, 4320, 4475, 460,
151+
1690, 460, 1690, 460, 615, 460, 1690, 460, 615, 460, 1690, 460, 615,
152+
460, 1690, 460, 615, 460, 1690, 460, 1690, 460, 615, 460, 615, 460,
153+
1690, 460, 615, 460, 615, 460, 615, 460, 620, 460, 1695, 435, 640, 435,
154+
640, 435, 640, 435, 640, 435, 640, 435, 640, 440, 640, 435, 665, 410,
155+
1740, 410, 665, 410, 665, 410, 665, 410, 1740, 410, 665, 410, 665, 410,
156+
670, 410, 665, 410, 665, 410, 665, 410, 670, 405, 670, 405, 670, 410,
157+
1745, 405, 1745, 410, 670, 410, 1745, 380, 670, 405, 1770, 385, 690, 385
158+
}; // DURASTAR DRAW09F2A
159+
160+
uint8_t expectedState[18] = {
161+
0xB2, 0x4D, 0x3F, 0xC0, 0x0C, 0xF3,
162+
0xB2, 0x4D, 0x3F, 0xC0, 0x0C, 0xF3,
163+
0xD5, 0x64, 0x20, 0x11, 0x00, 0x6A};
164+
165+
irsend.begin();
166+
irsend.reset();
167+
168+
irsend.sendRaw(rawData, 299, 38000);
169+
irsend.makeDecodeResult();
170+
ASSERT_TRUE(irrecv.decode(&irsend.capture));
171+
EXPECT_EQ(decode_type_t::BOSCH144, irsend.capture.decode_type);
172+
EXPECT_EQ(kBosch144Bits, irsend.capture.bits);
173+
EXPECT_STATE_EQ(expectedState, irsend.capture.state, irsend.capture.bits);
174+
EXPECT_EQ(
175+
"Power: On, Mode: 6 (Heat), Fan: 5 (High), Temp: 61F, Quiet: Off",
176+
IRAcUtils::resultAcToString(&irsend.capture));
177+
stdAc::state_t result, prev;
178+
ASSERT_TRUE(IRAcUtils::decodeToState(&irsend.capture, &result, &prev));
179+
}
180+
129181
TEST(TestDecodeBosch144, SyntheticSelfDecode) {
130182
IRsendTest irsend(kGpioUnused);
131183
IRrecv irrecv(kGpioUnused);

0 commit comments

Comments
 (0)