diff options
author | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2009-04-02 20:56:42 +0000 |
---|---|---|
committer | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2009-04-02 20:56:42 +0000 |
commit | cb01267f42eba7bc5a572235e5d2571cc9b60303 (patch) | |
tree | 421d7509698c604a76499fdc95432642f323d9ad /xpp/dahdi_registration | |
parent | 8c29f87f0fe6465a171644f1d916481d0d2def4f (diff) |
Support for Astribanks 116x: tools part
* New USB firmware loading mechanism.
- Incompatible with previous one: upgrade using fxload or hard reset
- astribank_hexload is the new low-level loading tool
- fpga_load remains for backward compatibility.
- xpp/astribank_upgrade: automate upgrading using fxload
* Much enhanced control protocol ("MPP")
- astribank_tool is the low-level tool for that.
* Support for the TwinStar (dual USB port)
- Managed through astribank_tool
- Wrapper perl modules and scripts provided
* Allow explicit ordering of Astribanks
- /etc/dahdi/xpp_order - explicit order of Astribanks on the system
- The default sorter is now to use those and fall back to connectors
(previous default).
- An option to dahdi_registration to change sorting.
git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@6313 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'xpp/dahdi_registration')
-rwxr-xr-x | xpp/dahdi_registration | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/xpp/dahdi_registration b/xpp/dahdi_registration index 826721d..87b89f1 100755 --- a/xpp/dahdi_registration +++ b/xpp/dahdi_registration @@ -18,21 +18,24 @@ use Dahdi::Xpp::Xbus; use Getopt::Std; sub usage { - die "Usage: $0 [on|off|1|0]\n"; + die "Usage: $0 [-s sort_order] [on|off|1|0]\n"; } my %opts; -getopts('s:', \%opts); - -my $sort_order = $opts{s} || $ENV{XBUS_SORT} || 'SORT_CONNECTOR'; -my $sorter = Dahdi::Xpp::sorters($sort_order); - -if(!defined $sorter) { - my @sorter_names = Dahdi::Xpp::sorters; - print STDERR "Unknown sort order $sort_order. Select from:\n\t"; - print STDERR join("\n\t", @sorter_names); - print STDERR "\n"; - exit 1; +getopts('s:', \%opts) || usage; + +my $sorter; +my $sort_order = $opts{'s'}; +if(defined $sort_order) { + my $sorter = Dahdi::Xpp::sorters($sort_order); + + if(!defined $sorter) { + my @sorter_names = Dahdi::Xpp::sorters; + print STDERR "Unknown sort order $sort_order. Select from:\n\t"; + print STDERR join("\n\t", @sorter_names); + print STDERR "\n"; + exit 1; + } } @ARGV == 0 or @ARGV == 1 or usage; @@ -58,7 +61,8 @@ sub myprintf { my @spans = Dahdi::spans; foreach my $xbus (Dahdi::Xpp::xbuses($sorter)) { - myprintf "%-10s\t%s\t%s\n", $xbus->name, $xbus->label, $xbus->connector; + myprintf "%-10s\t%3s-%s\t%s\n", + $xbus->name, $xbus->xpporder, $xbus->label, $xbus->connector; next unless $xbus->status eq 'CONNECTED'; foreach my $xpd ($xbus->xpds()) { my $prev = $xpd->dahdi_registration($on); @@ -76,7 +80,7 @@ foreach my $xbus (Dahdi::Xpp::xbuses($sorter)) { myprintf "%3s ==> %3s\n", state2str($prev), state2str($on); } } -myprintf "# Sorted: $sort_order\n"; +myprintf "# Sorted: $sort_order\n" if defined $sort_order; __END__ @@ -118,7 +122,7 @@ The sort order to use. If the option is not used, the sort order is taken from the environment variable XBUS_SORT and failing that: the hard-coded default of -SORT_CONNECTOR. +SORT_XPPORDER. The available sorting orders are documented in Dahdi::Xpp manual. |