From 9a2ab65dd7911d0a4a34561a56963944e8d54703 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Fri, 12 Jul 2019 22:59:08 +0200 Subject: [PATCH] ir-probe: Onkyo --- ir-probe/decode-onkyo | 41 +++++++++++++++++++++++++++++++++++++++++ ir-probe/onkyo.decoded | 10 ++++++++++ ir-probe/onkyo.raw | 2 ++ 3 files changed, 53 insertions(+) create mode 100755 ir-probe/decode-onkyo create mode 100644 ir-probe/onkyo.decoded create mode 100644 ir-probe/onkyo.raw diff --git a/ir-probe/decode-onkyo b/ir-probe/decode-onkyo new file mode 100755 index 0000000..6d41f47 --- /dev/null +++ b/ir-probe/decode-onkyo @@ -0,0 +1,41 @@ +#!/usr/bin/perl +use common::sense; + +my %types; + +while (<>) { + chomp; + my ($button, $timings) = split /\t/; + my @timings = split /\s+/, $timings; + pop @timings; + my $bit = 1; + my @out = (); + for my $t (@timings) { + my $out = "<$bit:$t>"; + if ($bit) { + if ($t >= 8900 && $t <= 9100) { + $out = "^"; + } elsif ($t >= 100 && $t <= 700) { + $out = "*"; + } + } else { + if ($t >= 4000 && $t <= 5000) { + $out = "#"; + } elsif ($t >= 400 && $t <= 1000) { + $out = "A"; + } elsif ($t >= 1600 && $t <= 2200) { + $out = "B"; + } + } + $bit = 1 - $bit; + push @out, $out; + push @{$types{$out}}, $t; + } + print $button, "\t", join("", @out), "\n"; +} + +print "\n# Median timings [μs]\n\n"; +for my $k (sort keys %types) { + my @v = sort @{$types{$k}}; + print "$k\t", $v[@v/2], "\n"; +} diff --git a/ir-probe/onkyo.decoded b/ir-probe/onkyo.decoded new file mode 100644 index 0000000..6682337 --- /dev/null +++ b/ir-probe/onkyo.decoded @@ -0,0 +1,10 @@ +input-up ^#*A*B*A*A*B*A*B*B*A*A*B*A*A*A*A*A*A*B*B*B*B*A*A*A*B*A*A*A*A*B*B*B* +input-dn ^#*A*B*A*A*B*A*B*B*A*A*B*A*A*A*A*A*B*B*B*B*B*A*A*A*A*A*A*A*A*B*B*B* + +# Median timings [μs] + +# 4480 +* 616 +A 519 +B 1627 +^ 9090 diff --git a/ir-probe/onkyo.raw b/ir-probe/onkyo.raw new file mode 100644 index 0000000..64ae73d --- /dev/null +++ b/ir-probe/onkyo.raw @@ -0,0 +1,2 @@ +input-up 9061 4480 590 545 615 1627 616 518 590 549 616 1626 590 545 589 1657 590 1652 616 519 589 550 616 1626 616 519 615 519 594 545 616 519 615 519 589 550 590 1652 616 1627 589 1658 589 1653 589 545 616 519 589 550 615 1627 616 519 589 545 594 545 616 519 615 1627 589 1658 589 1653 615 69446 +input-dn 9090 4425 641 493 642 1600 616 523 616 519 641 1602 645 489 645 1602 641 1602 642 493 645 493 641 1602 642 493 641 493 621 515 645 493 668 468 641 1602 619 1627 641 1602 642 1600 646 1600 641 493 642 493 645 489 646 493 641 493 642 493 641 493 621 519 641 1602 641 1602 619 1627 642 69446 -- 2.39.2