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.
+# names by default withX1out 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';
for (my $k = 0; $k < scalar @res; $k += 4) {
my $uid = ($res[$k] << 32) | $res[$k + 1];
my $endP = $res[$k + 2];
- my $sender = $res[$k + 3];
+ my $trb_address = $res[$k + 3];
- $hash{$uid}->{'trb_address'} = $sender;
- $hash{$uid}->{'trb_endpoint'} = $endP;
+ $hash{$uid}->{$endP} = $trb_address;
}
return \%hash;
my $ref;
my @array;
# Read all UIDs as hash
-$ref = trb_read_uid(0xfffb) or die "trb_read_uid: ", trb_strerror();
-foreach my $cur_key (sort {$a <=> $b } keys %$ref) {
- printf "uid: 0x%016x ==> addr: 0x%04x: endpoint: 0x%02x\n", $cur_key,
- $ref->{$cur_key}->{'trb_address'}, $ref->{$cur_key}->{'trb_endpoint'} ;
-}
+$ref = trb_read_uid(0xffff) or die "trb_read_uid: ", trb_strerror();
#print Dumper $ref;
+foreach my $uid (sort {$a <=> $b } keys %$ref) {
+ foreach my $endp (sort {$a <=> $b } keys $ref->{$uid}) {
+ printf "uid: 0x%016x ==> addr: 0x%04x: endpoint: 0x%02x\n",
+ $uid, $ref->{$uid}->{$endp}, $endp ;
+ }
+}
# Read all UIDs as array
@array = trb_read_uid_c(0xfffb) or die "trb_read_uid: ", trb_strerror();
use warnings;
use strict;
use Data::Dumper;
-
use HADES::TrbNet;
trb_init_ports() or die "Failed trb_init_ports: ", trb_strerror();
my $ref;
-$ref = trb_registertime_read(0x8001, 0x0) or die "trb_registertime_read: ",
+$ref = trb_registertime_read(0xffff, 0x0) or die "trb_registertime_read: ",
trb_strerror();
print Dumper $ref;
+print "Hallo: ". $ref->{8790}->{'value'}[0]."\n";
+exit 1;
$ref = trb_registertime_read_mem(0x8001, 0x4031, 0, 3) or die "trb_registertime_read_mem: ",
trb_strerror();