]> jspc29.x-matter.uni-frankfurt.de Git - trbnettools.git/commitdiff
added
authorhadaq <hadaq>
Wed, 1 Feb 2012 10:59:17 +0000 (10:59 +0000)
committerhadaq <hadaq>
Wed, 1 Feb 2012 10:59:17 +0000 (10:59 +0000)
libtrbnet_perl/lib/HADES/TrbNet.pm [new file with mode: 0644]

diff --git a/libtrbnet_perl/lib/HADES/TrbNet.pm b/libtrbnet_perl/lib/HADES/TrbNet.pm
new file mode 100644 (file)
index 0000000..e3a9b06
--- /dev/null
@@ -0,0 +1,103 @@
+package HADES::TrbNet;
+
+use 5.010000;
+use strict;
+use warnings;
+
+require Exporter;
+
+our @ISA = qw(Exporter);
+
+# Items to export into callers namespace by default. Note: do not export
+# names by default without a very good reason. Use EXPORT_OK instead.
+# Do not simply export all your public functions/methods/constants.
+
+# This allows declaration      use HADES::TrbNet ':all';
+# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
+# will save memory.
+our %EXPORT_TAGS = ( 'all' => [ qw(
+       init_ports
+       trb_uid
+) ] );
+
+our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
+
+our @EXPORT = qw(
+       
+);
+
+our $VERSION = '0.01';
+
+require XSLoader;
+XSLoader::load('HADES::TrbNet', $VERSION);
+
+# Preloaded methods go here.
+
+1;
+__END__
+# Below is stub documentation for your module. You'd better edit it!
+
+=head1 NAME
+
+HADES::TrbNet - Perl extension for the libtrbnet library, also via RPC calls
+
+=head1 SYNOPSIS
+
+ #!/usr/bin/perl
+ use warnings; 
+ use strict;
+ use HADES::TrbNet qw(trb_rr trb_wr init_ports);
+
+ my $connect_status = &init_ports();
+ my @res; my $res;
+ # read from TrbNet
+ $res = trb_rr(0x3,0xa0e3);
+ if(!defined $res) {
+    $res = trb_strerror();
+    print "error output: $res\n";
+    exit();
+ }
+ else {
+    printf("0x%08x\n", $res);
+ }
+
+ # write to TrbNet
+ $res = trb_wr(0x03, 0xa0e3, 0x12);
+ if(!defined $res) {
+    $res = trb_strerror();
+    print "error output: $res\n";
+ }
+
+=head1 DESCRIPTION
+
+This package imports the libtrbnet into perl as a shared library.
+
+
+=head2 EXPORT
+
+None by default.
+
+=head2 Exportable functions
+
+    trb_rr
+    trb_wr
+
+
+=head1 SEE ALSO
+
+
+
+=head1 AUTHOR
+
+Hades DAQ, E<lt>hadaq@E<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2012 by Hades DAQ
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself, either Perl version 5.10.0 or,
+at your option, any later version of Perl 5 you may have available.
+
+
+=cut