[svn-commits] tzafrir: branch tools/2.2 r7492 - in /tools/branches/2.2: ./ xpp/ xpp/perl_mo...
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Thu Nov 5 03:41:26 CST 2009
Author: tzafrir
Date: Thu Nov 5 03:41:22 2009
New Revision: 7492
URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=7492
Log:
Use the timing_priority attribute, if available, to provide more corrent
LED indiction and such.
Merged revisions 7252-7253 via svnmerge from
http://svn.digium.com/svn/dahdi/tools/trunk
........
r7252 | tzafrir | 2009-09-29 21:06:47 +0200 (Tue, 29 Sep 2009) | 2 lines
xpp: xpp_sync: add -v and fix perldoc
........
r7253 | tzafrir | 2009-09-29 21:12:22 +0200 (Tue, 29 Sep 2009) | 2 lines
xpp: use xpd sysfs attr. timing_priority to set NT/TE
........
Modified:
tools/branches/2.2/ (props changed)
tools/branches/2.2/xpp/perl_modules/Dahdi/Xpp/Xpd.pm
tools/branches/2.2/xpp/xpp_sync
Propchange: tools/branches/2.2/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Nov 5 03:41:22 2009
@@ -1,1 +1,1 @@
-/tools/trunk:1-6678,6823,6829-6830,6832-6833,6835,6837-6886,6889-6982,6985-6998,7000-7011,7013-7042,7044,7046-7131,7133,7135-7136,7139-7217,7220-7251,7254-7255,7257-7262,7264-7332,7334-7460,7462,7464-7476
+/tools/trunk:1-6678,6823,6829-6830,6832-6833,6835,6837-6886,6889-6982,6985-6998,7000-7011,7013-7042,7044,7046-7131,7133,7135-7136,7139-7217,7220-7255,7257-7262,7264-7332,7334-7460,7462,7464-7476
Modified: tools/branches/2.2/xpp/perl_modules/Dahdi/Xpp/Xpd.pm
URL: http://svnview.digium.com/svn/dahdi/tools/branches/2.2/xpp/perl_modules/Dahdi/Xpp/Xpd.pm?view=diff&rev=7492&r1=7491&r2=7492
==============================================================================
--- tools/branches/2.2/xpp/perl_modules/Dahdi/Xpp/Xpd.pm (original)
+++ tools/branches/2.2/xpp/perl_modules/Dahdi/Xpp/Xpd.pm Thu Nov 5 03:41:22 2009
@@ -300,14 +300,24 @@
$self->{CHANNELS} = @offhook;
my $type = $self->xpd_getattr('type');
my $span = $self->xpd_getattr('span');
+ my $timing_priority = $self->xpd_getattr('timing_priority');
$self->{SPANNO} = $span;
$self->{TYPE} = $type;
+ $self->{TIMING_PRIORITY} = $timing_priority;
if($type =~ /BRI_(NT|TE)/) {
$self->{IS_BRI} = 1;
$self->{TERMTYPE} = $1;
$self->{DCHAN_HARDHDLC} = $self->xpd_driver_getattr('dchan_hardhdlc');
- }
- $self->{IS_PRI} = ($type =~ /[ETJ]1/);
+ } elsif($type =~ /[ETJ]1/) {
+ $self->{IS_PRI} = 1;
+ # older drivers may not have 'timing_priority'
+ # attribute. Preserve original behaviour:
+ if(defined($timing_priority) && ($timing_priority == 0)) {
+ $self->{TERMTYPE} = 'NT';
+ } else {
+ $self->{TERMTYPE} = 'TE';
+ }
+ }
$self->{IS_DIGITAL} = ( $self->{IS_BRI} || $self->{IS_PRI} );
Dahdi::Xpp::Line->create_all($self, $procdir);
return $self;
Modified: tools/branches/2.2/xpp/xpp_sync
URL: http://svnview.digium.com/svn/dahdi/tools/branches/2.2/xpp/xpp_sync?view=diff&rev=7492&r1=7491&r2=7492
==============================================================================
--- tools/branches/2.2/xpp/xpp_sync (original)
+++ tools/branches/2.2/xpp/xpp_sync Thu Nov 5 03:41:22 2009
@@ -9,6 +9,7 @@
#
use strict;
use File::Basename;
+use Getopt::Std;
BEGIN { my $dir = dirname($0); unshift(@INC, "$dir", "$dir/perl_modules"); }
use Dahdi::Xpp;
@@ -21,16 +22,17 @@
print
"$0: show / set Astribank sync source\n".
"\n".
- "Usage: $0 Show sync source.\n".
- " $0 <auto|NN|dahdi> Set sync source.\n".
+ "Usage: $0 [-v] Show sync source.\n".
+ " $0 [-v] <auto|NN|dahdi> Set sync source.\n".
"";
-}
-
+ exit 1;
+}
+
+my %opts;
+getopts('hv', \%opts) || usage;
+
+$opts{h} && usage;
if(@ARGV == 1) {
- if ($ARGV[0] =~ /^(-h|--help|help)$/) {
- usage;
- exit(0);
- }
$sync = shift;
$autoselect = 1 if $sync =~ /^auto$/i;
}
@@ -52,7 +54,7 @@
}
}
my @xpd_prio = Dahdi::Xpp::Xpd::xpds_by_rank(@good_xpds);
- #Dahdi::Xpp::Xpd::show_xpd_rank(@xpd_prio);
+ Dahdi::Xpp::Xpd::show_xpd_rank(@xpd_prio) if $opts{v};
return @xpd_prio;
}
@@ -143,7 +145,9 @@
=head1 SYNOPSIS
-xpp_sync [auto|dahdi|nn]
+xpp_sync <auto|dahdi|nn>
+
+xpp_sync [-v]
=head1 DESCRIPTION
@@ -172,6 +176,10 @@
=item nn
Sets XBUS-I<nn> as sync source.
+
+=item -v
+
+Also print the numeric xpp sync rank.
=back
@@ -211,8 +219,8 @@
shows the current xpp sync master (and in what format you need to write
to it to set the master).
+=back
+
=head1 SEE ALSO
dahdi_registration(1), dahdi_cfg(1), README.Astribank
-
-=back
More information about the svn-commits
mailing list