X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=sc-emulator.pl;h=d958359b2cb6c536fca8aaa445b0d1bb41287563;hb=1c778b24965f06e5ff39ddaf58b66468d1a0f28b;hp=34886124e17442f888be2b66713cd24b4fecbb78;hpb=7108951ead6fcb1d3719c4ea7c79cfffc520ed02;p=Biblio-SIP2.git diff --git a/sc-emulator.pl b/sc-emulator.pl index 3488612..d958359 100755 --- a/sc-emulator.pl +++ b/sc-emulator.pl @@ -3,9 +3,6 @@ use warnings; use strict; -use IO::Socket::INET; -use autodie; - our $user = 'sip2-user'; our $password = 'sip2-paasswd'; our $patron = 200000000042; @@ -14,29 +11,29 @@ our $loc = 'FFZG'; require 'config.pl' if -e 'config.pl'; -use SIP2; +use lib 'lib'; +use SIP2::SC; -SIP2::connect '10.60.0.251:6001'; +my $sc = SIP2::SC->new( $ENV{ACS} || '10.60.0.251:6001' ); # login -SIP2::send "9300CN$user|CO$password|"; +$sc->message("9300CN$user|CO$password|"); # SC Status -SIP2::send "9900302.00"; +$sc->message("9900302.00"); -# Patron Information -SIP2::send "6300020091214 085452 AO$loc|AA$patron|AC$password|"; +$sc->message("6300020091214 085452 AO$loc|AA$patron|AC$password|"); # Checkout -SIP2::send "11YN20091214 124436 AO$loc|AA$patron|AB$barcode|AC$password|BON|BIN|"; +$sc->message("11YN20091214 124436 AO$loc|AA$patron|AB$barcode|AC$password|BON|BIN|"); # Checkin -SIP2::send "09N20091214 08142820091214 081428AP|AO$loc|AB$barcode|AC|BIN|"; +$sc->message("09N20091214 08142820091214 081428AP|AO$loc|AB$barcode|AC|BIN|"); -# checkout another -SIP2::send "09N20091216 15320820091216 153208AP|AOFFZG|AB200903160190|ACviva2koha|BIN|"; +# checkout - invalid barcode +$sc->message("09N20091216 15320820091216 153208AP|AOFFZG|AB200903160190|ACviva2koha|BIN|"); # status -SIP2::send "9900302.00"; +$sc->message("9900302.00");