Skip to content

Commit

Permalink
Change bit order of Whirlpool A/C Messages
Browse files Browse the repository at this point in the history
Analysis of the temperature data in the Whirlpool messages
indicate the bytes of data are in LSB First order, not MSB First.
  • Loading branch information
crankyoldgit committed Sep 2, 2018
1 parent ca80a39 commit 9f697ac
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/googletest
Submodule googletest updated 35 files
+1 −0 .gitignore
+58 −60 googlemock/include/gmock/gmock-matchers.h
+28 −25 googlemock/include/gmock/gmock-spec-builders.h
+4 −5 googlemock/include/gmock/internal/gmock-internal-utils.h
+1 −1 googlemock/src/gmock-cardinalities.cc
+2 −3 googlemock/src/gmock-internal-utils.cc
+4 −5 googlemock/src/gmock-matchers.cc
+4 −5 googlemock/src/gmock-spec-builders.cc
+57 −57 googlemock/test/gmock-generated-actions_test.cc
+20 −18 googlemock/test/gmock-generated-function-mockers_test.cc
+36 −36 googlemock/test/gmock-generated-matchers_test.cc
+12 −13 googlemock/test/gmock-internal-utils_test.cc
+84 −78 googlemock/test/gmock-matchers_test.cc
+77 −74 googlemock/test/gmock-more-actions_test.cc
+13 −14 googlemock/test/gmock-nice-strict_test.cc
+5 −6 googlemock/test/gmock-spec-builders_test.cc
+1 −1 googlemock/test/gmock_stress_test.cc
+1 −1 googletest/docs/AdvancedGuide.md
+56 −43 googletest/include/gtest/gtest-printers.h
+2 −3 googletest/include/gtest/gtest-spi.h
+2 −2 googletest/include/gtest/gtest.h
+3 −0 googletest/include/gtest/internal/custom/gtest-port.h
+4 −0 googletest/include/gtest/internal/custom/gtest.h
+4 −3 googletest/include/gtest/internal/gtest-internal.h
+9 −10 googletest/include/gtest/internal/gtest-param-util.h
+2 −0 googletest/include/gtest/internal/gtest-port-arch.h
+11 −3 googletest/include/gtest/internal/gtest-port.h
+3 −4 googletest/src/gtest-death-test.cc
+15 −15 googletest/src/gtest-internal-inl.h
+2 −2 googletest/src/gtest-port.cc
+18 −18 googletest/src/gtest.cc
+1 −1 googletest/test/gtest-death-test_test.cc
+25 −27 googletest/test/gtest-printers_test.cc
+3 −4 googletest/test/gtest_unittest.cc
+47 −0 googletest/xcode/gtest.xcodeproj/project.pbxproj
9 changes: 5 additions & 4 deletions src/ir_Whirlpool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void IRsend::sendWhirlpoolAC(unsigned char data[], uint16_t nbytes,
kWhirlpoolAcGap,
data, 6, // 6 bytes == 48 bits
38000, // Complete guess of the modulation frequency.
true, 0, 50);
false, 0, 50);
// Section 2
sendGeneric(0, 0,
kWhirlpoolAcBitMark, kWhirlpoolAcOneSpace,
Expand All @@ -65,15 +65,15 @@ void IRsend::sendWhirlpoolAC(unsigned char data[], uint16_t nbytes,
kWhirlpoolAcGap,
data + 6, 8, // 8 bytes == 64 bits
38000, // Complete guess of the modulation frequency.
true, 0, 50);
false, 0, 50);
// Section 3
sendGeneric(0, 0,
kWhirlpoolAcBitMark, kWhirlpoolAcOneSpace,
kWhirlpoolAcBitMark, kWhirlpoolAcZeroSpace,
kWhirlpoolAcBitMark, kWhirlpoolAcMinGap,
data + 14, 7, // 7 bytes == 56 bits
38000, // Complete guess of the modulation frequency.
true, 0, 50);
false, 0, 50);
}
}
#endif // SEND_WHIRLPOOL_AC
Expand Down Expand Up @@ -128,7 +128,8 @@ bool IRrecv::decodeWhirlpoolAC(decode_results *results, uint16_t nbits,
kWhirlpoolAcBitMark,
kWhirlpoolAcZeroSpace);
if (data_result.success == false) break; // Fail
results->state[i] = (uint8_t) data_result.data;
// Data is in LSB order. We need to reverse it.
results->state[i] = (uint8_t) reverseBits(data_result.data & 0xFF, 8);
}
// Section Footer
if (!matchMark(results->rawbuf[offset++], kWhirlpoolAcBitMark))
Expand Down
12 changes: 6 additions & 6 deletions test/ir_Whirlpool_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ TEST(TestSendWhirlpoolAC, SendDataOnly) {
IRsendTest irsend(0);
irsend.begin();
uint8_t data[kWhirlpoolAcStateLength] = {
0xC1, 0x60, 0x08, 0x8E, 0x00, 0x00, 0x89, 0xF8, 0x00, 0x00, 0x00, 0x00,
0x00, 0xF7, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40};
0x83, 0x06, 0x10, 0x71, 0x00, 0x00, 0x91, 0x1F, 0x00, 0x00, 0x00, 0x00,
0x00, 0xEF, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x02};

irsend.sendWhirlpoolAC(data);
EXPECT_EQ(
Expand Down Expand Up @@ -55,8 +55,8 @@ TEST(TestDecodeWhirlpoolAC, SyntheticDecode) {
// Synthesised Normal WhirlpoolAC message.
irsend.reset();
uint8_t expectedState[kWhirlpoolAcStateLength] = {
0xC1, 0x60, 0x08, 0x8E, 0x00, 0x00, 0x89, 0xF8, 0x00, 0x00, 0x00, 0x00,
0x00, 0xF7, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40};
0x83, 0x06, 0x10, 0x71, 0x00, 0x00, 0x91, 0x1F, 0x00, 0x00, 0x00, 0x00,
0x00, 0xEF, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x02};
irsend.sendWhirlpoolAC(expectedState);
irsend.makeDecodeResult();
EXPECT_TRUE(irrecv.decode(&irsend.capture));
Expand Down Expand Up @@ -103,8 +103,8 @@ TEST(TestDecodeWhirlpoolAC, RealExampleDecode) {
596, 542, 598, 544, 596, 534, 596, 524, 594, 1644, 596, 532,
596, 534, 596, 538, 602, 536, 594, 546, 594, 520, 600};
uint8_t expectedState[kWhirlpoolAcStateLength] = {
0xC1, 0x60, 0x08, 0x8E, 0x00, 0x00, 0x89, 0xF8, 0x00, 0x00, 0x00, 0x00,
0x00, 0xF7, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40};
0x83, 0x06, 0x10, 0x71, 0x00, 0x00, 0x91, 0x1F, 0x00, 0x00, 0x00, 0x00,
0x00, 0xEF, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x02};

irsend.reset();
irsend.sendRaw(rawData, 343, 38000);
Expand Down

0 comments on commit 9f697ac

Please sign in to comment.