- added some missing files from old-door-daemon
authorMarkus Grüneis <gimpf@realraum.at>
Thu, 23 Apr 2009 19:44:59 +0000 (19:44 +0000)
committerMarkus Grüneis <gimpf@realraum.at>
Thu, 23 Apr 2009 19:44:59 +0000 (19:44 +0000)
 - added "design-document"...

new-devil/design [new file with mode: 0644]
old-door-deamon/add-card-to-database~ [new file with mode: 0644]
old-door-deamon/checkcard.pl [new file with mode: 0755]
old-door-deamon/getcard.pl [new file with mode: 0755]
old-door-deamon/ledstats_0.3.1-5.dsc [new file with mode: 0644]
old-door-deamon/ledstats_0.3.1.orig.tar.gz [new file with mode: 0644]
old-door-deamon/libparportled_0.5.1-6.dsc [new file with mode: 0644]

diff --git a/new-devil/design b/new-devil/design
new file mode 100644 (file)
index 0000000..b71b7de
--- /dev/null
@@ -0,0 +1,34 @@
+Goal:
+ - Card is read
+ - UID is piped to door-key-bubble-jet-printer-daemon
+ - door-key-bubble-jet-printer-daemon (dkbjpd) toggles open/close
+ - it works
+
+Features:
+ - opening/closing of key is logged
+ - state of key is periodically checked and logged
+ - open/close toggling can be triggered by different sources, like
+   - RFID card
+   - phone calls
+   - agressively watching onto a Windows login screen
+ - learn-mode
+   - simple way to add new rfid cards to allowed card-list
+
+Architecture:
+ - door-key-bubble-jet-printer-daemon
+   - can open/close door
+   - logs state of door
+ - rfid-reader
+   - recognizes presence of accepted rfid-card and toggles door
+ - voip-reader
+   - recognizes phone call of accepted caller-id and toggles doort
+ - door-key-ubble-jet-printer
+   - accepts single-character commands and writes
+     success and status messages
+ - *-reader write to a fifo, which is listened by the
+   door-key-bubble-jet-printer-daemon
+ - rfid-learner
+
+Design:
+ - Perl is great for everything.
+ - Shell is for the rest.
diff --git a/old-door-deamon/add-card-to-database~ b/old-door-deamon/add-card-to-database~
new file mode 100644 (file)
index 0000000..d13bccf
--- /dev/null
@@ -0,0 +1,14 @@
+
+i=1
+while [ $i -gt 0 ]; do
+       opensc-tool --serial > /dev/null 2>&1
+       i=$?
+       if [ $i -gt 0 ]; then
+               echo "Please insert card...."
+               sleep 5
+       else
+               opensc-tool --serial | cut -b 0,48 >> card-database
+       fi
+done 
+       
+perl -ne s/[^0-9A-F]//g; $_ = substr($_,0,32); print "$_\n" card-database
diff --git a/old-door-deamon/checkcard.pl b/old-door-deamon/checkcard.pl
new file mode 100755 (executable)
index 0000000..f110cd0
--- /dev/null
@@ -0,0 +1,33 @@
+#!/usr/bin/perl -w
+
+my $fifofile = "/root/door_cmd.fifo";
+my %validcards;
+
+while (<>)
+{ 
+  my ($cardid,$name)= split /\s+/,$_;
+  $validcards{$cardid}=$name;
+};
+
+my $currentcard=0;
+while (sleep 1)
+{
+  my $card=`/usr/bin/opensc-tool --serial 2>/dev/null`;
+  $card =~ s/[^0-9A-F]//g; 
+  $card = substr($card,0,32);
+  if ($card eq $currentcard)
+       { next; }
+  else 
+       {$currentcard=$card;}
+  if ($validcards{$card})
+  {
+    if( -p $fifofile)
+    {
+      open(my $fifo,"> $fifofile");
+      print $fifo "toggle "."Card ".$validcards{$card}."\n";
+      close($fifo);  
+    }
+  } else {
+    print "Card did not match $card\n";
+  }
+}
diff --git a/old-door-deamon/getcard.pl b/old-door-deamon/getcard.pl
new file mode 100755 (executable)
index 0000000..ebbde3a
--- /dev/null
@@ -0,0 +1,7 @@
+#!/usr/bin/perl
+
+my $card=`/usr/bin/opensc-tool --serial`;
+my @validcards;
+
+$card =~ s/\D//g;
+print "$card\n";
diff --git a/old-door-deamon/ledstats_0.3.1-5.dsc b/old-door-deamon/ledstats_0.3.1-5.dsc
new file mode 100644 (file)
index 0000000..e019a21
--- /dev/null
@@ -0,0 +1,22 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+Format: 1.0
+Source: ledstats
+Version: 0.3.1-5
+Binary: ledstats
+Maintainer: Julien Danjou <acid@debian.org>
+Architecture: i386 amd64 kfreebsd-i386 kfreebsd-amd64
+Standards-Version: 3.6.2.2
+Build-Depends: debhelper (>> 4.0.0), libparportled-dev (>= 0.3)
+Files: 
+ 4219980ce5e5c2caaa775f84898dc827 22789 ledstats_0.3.1.orig.tar.gz
+ 25ce0b0df64c43ef83337399f7802c5e 25312 ledstats_0.3.1-5.diff.gz
+
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.3 (GNU/Linux)
+
+iD8DBQFEOPcUpGK1HsL+5c0RApQ8AKCAf2cUWfzsjVSQy+Vn4Q8i79Af4gCg1K7b
+EKeMPdHr9iKROoaSpL5seS4=
+=fvbV
+-----END PGP SIGNATURE-----
diff --git a/old-door-deamon/ledstats_0.3.1.orig.tar.gz b/old-door-deamon/ledstats_0.3.1.orig.tar.gz
new file mode 100644 (file)
index 0000000..19adb90
Binary files /dev/null and b/old-door-deamon/ledstats_0.3.1.orig.tar.gz differ
diff --git a/old-door-deamon/libparportled_0.5.1-6.dsc b/old-door-deamon/libparportled_0.5.1-6.dsc
new file mode 100644 (file)
index 0000000..097151a
--- /dev/null
@@ -0,0 +1,22 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+Format: 1.0
+Source: libparportled
+Version: 0.5.1-6
+Binary: libparportled-dev, libparportled
+Maintainer: Julien Danjou <acid@debian.org>
+Architecture: i386 amd64 kfreebsd-i386 kfreebsd-amd64
+Standards-Version: 3.6.2.2
+Build-Depends: debhelper (>> 4.0.0)
+Files: 
+ 78874d9d652d44e7aae1780a4dc78eb8 27486 libparportled_0.5.1.orig.tar.gz
+ 5473343aea605842fb69c4ade3097a8e 24630 libparportled_0.5.1-6.diff.gz
+
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.3 (GNU/Linux)
+
+iD8DBQFEOPYSpGK1HsL+5c0RApO2AJ4jN+vEaOYwS93x94cSkOHoJL4a6wCgtGU8
++UCZk34aiYOMMlJVoGEMiYs=
+=D+o1
+-----END PGP SIGNATURE-----