]> jspc29.x-matter.uni-frankfurt.de Git - trbnettools.git/commitdiff
trb_set_address works like this on 64-bit perl, mt
authorhadaq <hadaq>
Sun, 26 Aug 2012 21:02:33 +0000 (21:02 +0000)
committerhadaq <hadaq>
Sun, 26 Aug 2012 21:02:33 +0000 (21:02 +0000)
libtrbnet_perl/TrbNet.xs
libtrbnet_perl/lib/HADES/TrbNet.pm
libtrbnet_perl/test/test.pl

index 5873cbc26c6bdf7320e30b3f44c9f12878d239ac..ac6643ed970077535b8be100eb6e6f1eb69d4a5d 100644 (file)
@@ -216,7 +216,7 @@ trb_register_modify(trb_address, reg_address, mode, bitMask, bitValue)
 
 void
 trb_set_address(uid, endpoint, trb_address)
-     U32  uid
+     unsigned long  uid
      U8 endpoint
      U16 trb_address
    INIT:
@@ -229,3 +229,5 @@ trb_set_address(uid, endpoint, trb_address)
      } else {
        XPUSHs(sv_2mortal(newSVuv(1)));
      }
+
+
index 387f984b2a922414fb80bffa0c88d5b03385427d..427233047bf218e4289a308da674c4ca318fcd09 100644 (file)
@@ -36,6 +36,7 @@ our %EXPORT_TAGS = ( 'all' => [ qw(
                                    trb_nettrace
                                    trb_nettrace_c
                                    trb_setbit
+                                   trb_set_address
                                    trb_clearbit
                                 ) ] );
 
index 55671dbd1356bc4412634e2e804d9c0f1de0a8e0..073b62dca98d9e383f3dcc9fa0707d5709728969 100755 (executable)
@@ -20,7 +20,7 @@ foreach my $uid (sort {$a <=> $b } keys %$ref) {
 }
 
 # Read all UIDs as array
-@array = trb_read_uid_c(0xfffb) or die "trb_read_uid: ", trb_strerror();
+@array = trb_read_uid_c(0xffff) or die "trb_read_uid: ", trb_strerror();
 #print Dumper $ref;
 foreach my $cur_key (@array) {
     printf "0x%08x\n", $cur_key;
@@ -28,7 +28,7 @@ foreach my $cur_key (@array) {
 
 
 # Read ADCM's by mem
-$ref = trb_register_read(0xfffb, 0xa000)
+$ref = trb_register_read(0xfffe, 0x1)
     or die "Failed trb_register_read: ", trb_strerror();
 
 foreach my $cur_key (sort {$a <=> $b } keys %$ref) {
@@ -40,7 +40,7 @@ foreach my $cur_key (sort {$a <=> $b } keys %$ref) {
 
 
 # Read all UIDs as array
-@array = trb_register_read_mem_c(0xfffb, 0xa000, 1, 10) or die "trb_register_read_mem_c: ", trb_strerror();
+@array = trb_register_read_mem_c(0xfffe, 0x4000, 1, 4) or die "trb_register_read_mem_c: ", trb_strerror();
 
 foreach my $cur_key (@array) {
     printf "0x%08x\n", $cur_key;
@@ -48,7 +48,7 @@ foreach my $cur_key (@array) {
 
 
 # Read read mem test
-$ref = trb_register_read_mem(0xfffb, 0xa000, 0, 10) or die "trb_register_read_mem: ", trb_strerror();
+$ref = trb_register_read_mem(0xfffe, 0x4000, 0, 4) or die "trb_register_read_mem: ", trb_strerror();
 #print Dumper $ref;
 printf "\n\n\n";
 print "Hash content\n";
@@ -61,5 +61,15 @@ foreach my $k (keys %$ref) {
    print "\n";
 }
 
+
+#0x2b00000270d5b328
+
+print "test trb_set_address\n";
+
+#no warnings 'portable';
+$ref = trb_set_address(0x2b00000270d5b328, 0x2, 0x5);
+print Dumper $ref;
+
+
 exit;