From b95eb9f048feef2b6f066ce676096645d7e898f3 Mon Sep 17 00:00:00 2001 From: Othmar Gsenger Date: Thu, 16 Feb 2012 18:07:59 +0000 Subject: [PATCH] ./realraum_codes.pl schwarz 3 1 | ./data2sample.pl 7 | ./compress| ./rawhid_test - working for schwarze fernbedieung --- rf433rcv/pc/realraum_codes.pl | 47 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 rf433rcv/pc/realraum_codes.pl 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 +{ + +} -- 1.7.10.4