./realraum_codes.pl schwarz 3 1 | ./data2sample.pl 7 | ./compress| ./rawhid_test -
authorOthmar Gsenger <otti@realraum.at>
Thu, 16 Feb 2012 18:07:59 +0000 (18:07 +0000)
committerOthmar Gsenger <otti@realraum.at>
Thu, 16 Feb 2012 18:07:59 +0000 (18:07 +0000)
working for schwarze fernbedieung

rf433rcv/pc/realraum_codes.pl [new file with mode: 0755]

diff --git a/rf433rcv/pc/realraum_codes.pl b/rf433rcv/pc/realraum_codes.pl
new file mode 100755 (executable)
index 0000000..774d6df
--- /dev/null
@@ -0,0 +1,47 @@
+#!/usr/bin/perl
+use strict;
+
+my %remotes =
+(
+  schwarz => [\&schwarz, "01110101a1b1c1000000dddd"] ,
+  weiss => \&weiss,
+  pollin => \&pollin,
+);
+
+&main();
+exit 0;
+
+sub main
+{
+  my $remote = shift @ARGV;
+  if ($remotes{$remote})
+  {
+    my $data = $remotes{$remote}[0]->(@ARGV);
+    my $base = $remotes{$remote}[1];
+    for my $key (keys %$data)
+    {
+      $base =~ s/$key/$data->{$key}/g;
+    }
+    print $base;
+  } else {
+    die "Usage $0 {". join(',',keys %remotes) ."} remote parameters";
+  }
+}
+
+sub schwarz
+{
+  my ($swicht_cnt, $on) = @_ or die "parameters swicht_cnt {0|1}";
+  my $data = {a=>0, b=> 0, c=> 0, dddd=> ($on? "1100":"0011")};
+  $data->{chr(ord('a')+$swicht_cnt-1)}=1;
+  return $data;
+}
+
+sub weiss
+{
+
+}
+
+sub pollin
+{
+
+}