[svn-commits] tzafrir: branch tools/tzafrir/sysfs r7651 - in /tools/team/tzafrir/sysfs/xpp:...
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Mon Nov 30 11:40:26 CST 2009
Author: tzafrir
Date: Mon Nov 30 11:40:24 2009
New Revision: 7651
URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=7651
Log:
More attributes in the interface. dahdi_scan is mostly complete
SysFS span interface, and the Dahdi::Span interface accordingly, has been
expanded to make the implementation of dahdi_scna more complete.
A number of details are still missing, as this commit will show.
Modified:
tools/team/tzafrir/sysfs/xpp/dahdi_scan
tools/team/tzafrir/sysfs/xpp/perl_modules/Dahdi/Span.pm
Modified: tools/team/tzafrir/sysfs/xpp/dahdi_scan
URL: http://svnview.digium.com/svn/dahdi/tools/team/tzafrir/sysfs/xpp/dahdi_scan?view=diff&rev=7651&r1=7650&r2=7651
==============================================================================
--- tools/team/tzafrir/sysfs/xpp/dahdi_scan (original)
+++ tools/team/tzafrir/sysfs/xpp/dahdi_scan Mon Nov 30 11:40:24 2009
@@ -18,26 +18,27 @@
my @spans = Dahdi::spans;
-my %seen;
-my $format = "%-20s %-12s %4s:%4s %s\n";
-
my @devices = Dahdi::Hardware->device_list;
foreach my $span (@spans) {
my $num = sprintf("%d", $span->num);
- my $active = "MISSING"; # FIXME: how do I get this information?
- my $alarms = "MISSING"; # FIXME: how do I get this information?
+ my $alarms = $span->alarms(); # FIXME: resolve to list of alarms
my $description = $span->description;
my $name = $span->name;
my $manufacturer = $span->manufacturer;
my $devicetype = $span->devicetype;
my $location = $span->location;
+ my $irq = $span->irq();
my $first_chan =($span->chans())[0]; # FIXME: what if there's none?
my $basechan = $first_chan->num();
my $totchans = $span->chans();
+ # FIXME: the 'type' is not proper:
+ my $type = $span->devicetype();
+ $type = '' if ($type eq '<NULL>');
+ $type = "digital-$type" if $span->is_digital();
print <<EOT;
[$num]
-active=$active
+active=yes
alarms=$alarms
description=$description
name=$name
@@ -46,5 +47,29 @@
location=$location
basechan=$basechan
totchans=$totchans
+irq=$irq
+type=$type
EOT
+ if ($span->is_digital()) {
+ my $syncsrc = $span->syncsrc(); # FIXME: buggy?
+ my $lbo = $span->lbo(); # FIXME: make it a string
+ my $coding_opts = "MISSING";
+ my $framing_opts = "MISSING";
+ my $coding = "MISSING";
+ my $framing = "MISSING";
+ print <<EOT;
+syncsrc=$syncsrc
+lbo=$lbo
+coding_opts=$coding_opts
+framing_opts=$framing_opts
+coding=$coding
+framing=$framing
+EOT
+ } else {
+ foreach my $chan ($span->chans()){
+ my $num = $chan->num();
+ my $type = $chan->type();
+ print "port=$num,$type\n";
+ }
+ }
}
Modified: tools/team/tzafrir/sysfs/xpp/perl_modules/Dahdi/Span.pm
URL: http://svnview.digium.com/svn/dahdi/tools/team/tzafrir/sysfs/xpp/perl_modules/Dahdi/Span.pm?view=diff&rev=7651&r1=7650&r2=7651
==============================================================================
--- tools/team/tzafrir/sysfs/xpp/perl_modules/Dahdi/Span.pm (original)
+++ tools/team/tzafrir/sysfs/xpp/perl_modules/Dahdi/Span.pm Mon Nov 30 11:40:24 2009
@@ -217,9 +217,14 @@
$self->{NAME} = $self->_get_dev_attr('name');
$self->{DESCRIPTION} = $self->_get_dev_attr('desc');
$self->{DEVICETYPE} = $self->_get_dev_attr('devicetype');
+ $self->{IRQ} = $self->_get_dev_attr('irq');
+ $self->{IRQMISSES} = $self->_get_dev_attr('irqmisses');
+ $self->{LBO} = $self->_get_dev_attr('lbo');
$self->{LOCATION} = $self->_get_dev_attr('location');
+ $self->{SYNCSRC} = $self->_get_dev_attr('syncsrc');
$self->{MANUFACTURER} = $self->_get_dev_attr('manufacturer');
- # TODO: span alarms?
+ # FIXME: the following is a number, rather than a readable value:
+ $self->{ALARMS} = $self->_get_dev_attr('alarms');
$self->{CHANS} = [];
my @channels;
More information about the svn-commits
mailing list