From: Othmar Gsenger Date: Thu, 16 Feb 2012 18:07:59 +0000 (+0000) Subject: ./realraum_codes.pl schwarz 3 1 | ./data2sample.pl 7 | ./compress| ./rawhid_test - X-Git-Url: https://git.realraum.at/?a=commitdiff_plain;h=b95eb9f048feef2b6f066ce676096645d7e898f3;p=svn42.git ./realraum_codes.pl schwarz 3 1 | ./data2sample.pl 7 | ./compress| ./rawhid_test - working for schwarze fernbedieung --- diff --git a/rf433rcv/pc/realraum_codes.pl b/rf433rcv/pc/realraum_codes.pl new file mode 100755 index 0000000..774d6df --- /dev/null +++ b/rf433rcv/pc/realraum_codes.pl @@ -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 +{ + +}