Skip to content

Commit

Permalink
Tweak timings & matching tolerance.
Browse files Browse the repository at this point in the history
  • Loading branch information
crankyoldgit committed Jun 24, 2021
1 parent 8ec185a commit 1bf8211
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 23 deletions.
15 changes: 8 additions & 7 deletions src/ir_Teknopoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
#include "IRutils.h"

// Protocol timings
const uint16_t kTeknopointHdrMark = 3614;
const uint16_t kTeknopointBitMark = 439;
const uint16_t kTeknopointHdrSpace = 1610;
const uint16_t kTeknopointOneSpace = 1238;
const uint16_t kTeknopointZeroSpace = 567;
const uint16_t kTeknopointHdrMark = 3600;
const uint16_t kTeknopointBitMark = 477;
const uint16_t kTeknopointHdrSpace = 1600;
const uint16_t kTeknopointOneSpace = 1200;
const uint16_t kTeknopointZeroSpace = 530;
const uint16_t kTeknopointFreq = 38000; // Hz. (Guess Only)
const uint16_t kTeknopointOverhead = 3;
const uint8_t kTeknopointExtraTol = 10; // Extra tolerance percentage.

#if SEND_TEKNOPOINT
/// Send a Teknopoint formatted message.
Expand Down Expand Up @@ -65,7 +65,8 @@ bool IRrecv::decodeTeknopoint(decode_results *results, uint16_t offset,
kTeknopointHdrMark, kTeknopointHdrSpace,
kTeknopointBitMark, kTeknopointOneSpace,
kTeknopointBitMark, kTeknopointZeroSpace,
kTeknopointBitMark, kDefaultMessageGap, true)) return false;
kTeknopointBitMark, kDefaultMessageGap,
true, _tolerance + kTeknopointExtraTol)) return false;
// Success
results->decode_type = decode_type_t::TEKNOPOINT;
results->bits = nbits;
Expand Down
32 changes: 16 additions & 16 deletions test/ir_Teknopoint_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,22 +72,22 @@ TEST(TestDecodeTeknopoint, SyntheticExample) {

EXPECT_EQ(
"f38000d50"
"m3614s1610"
"m439s1238m439s1238m439s567m439s567m439s567m439s1238m439s567m439s567"
"m439s1238m439s1238m439s567m439s1238m439s567m439s567m439s1238m439s1238"
"m439s567m439s1238m439s1238m439s567m439s567m439s1238m439s567m439s567"
"m439s1238m439s567m439s567m439s567m439s567m439s567m439s567m439s567"
"m439s567m439s567m439s567m439s567m439s567m439s567m439s567m439s567"
"m439s567m439s567m439s1238m439s567m439s567m439s1238m439s567m439s567"
"m439s1238m439s1238m439s567m439s567m439s567m439s567m439s567m439s567"
"m439s1238m439s1238m439s1238m439s1238m439s567m439s567m439s567m439s567"
"m439s567m439s567m439s567m439s1238m439s567m439s567m439s567m439s567"
"m439s567m439s567m439s567m439s567m439s567m439s567m439s567m439s567"
"m439s567m439s567m439s567m439s567m439s567m439s567m439s567m439s567"
"m439s567m439s567m439s567m439s567m439s567m439s567m439s567m439s567"
"m439s567m439s567m439s567m439s567m439s567m439s567m439s567m439s567"
"m439s1238m439s1238m439s567m439s567m439s1238m439s567m439s1238m439s567"
"m439s100000",
"m3600s1600"
"m477s1200m477s1200m477s530m477s530m477s530m477s1200m477s530m477s530"
"m477s1200m477s1200m477s530m477s1200m477s530m477s530m477s1200m477s1200"
"m477s530m477s1200m477s1200m477s530m477s530m477s1200m477s530m477s530"
"m477s1200m477s530m477s530m477s530m477s530m477s530m477s530m477s530"
"m477s530m477s530m477s530m477s530m477s530m477s530m477s530m477s530"
"m477s530m477s530m477s1200m477s530m477s530m477s1200m477s530m477s530"
"m477s1200m477s1200m477s530m477s530m477s530m477s530m477s530m477s530"
"m477s1200m477s1200m477s1200m477s1200m477s530m477s530m477s530m477s530"
"m477s530m477s530m477s530m477s1200m477s530m477s530m477s530m477s530"
"m477s530m477s530m477s530m477s530m477s530m477s530m477s530m477s530"
"m477s530m477s530m477s530m477s530m477s530m477s530m477s530m477s530"
"m477s530m477s530m477s530m477s530m477s530m477s530m477s530m477s530"
"m477s530m477s530m477s530m477s530m477s530m477s530m477s530m477s530"
"m477s1200m477s1200m477s530m477s530m477s1200m477s530m477s1200m477s530"
"m477s100000",
irsend.outputStr());
}

Expand Down

0 comments on commit 1bf8211

Please sign in to comment.