Linux::Sysfs::ClassDevice - sysfs class devices
my $classdev = Linux::Sysfs::ClassDevice->open($name); my $parent = $classdev->get_parent; my $device = $classdev->get_device; $classdev->close;
Libsysfs provides functions to open sysfs class devices.
my $classdev = Linux::Sysfs::ClassDevice->open($name);
Given the $name of the class on which to look for, this method locates a given class device and returns a Linux::Sysfs::ClassDevice instance corresponding to the requested class device.
$name
my $classdev = Linux::Sysfs::ClassDevice->open_path($path);
Given the $path to the class device file, this method opens up one of the class devices represented in /sys/class/$class. It returns a Linux::Sysfs::ClassDevice instance on success or undef on failure.
$path
/sys/class/$class
$classdev->close;
Closes up the class device.
my $parent = $classdev->get_parent;
Returns a Linux::Sysfs::ClassDevice instance for the parent of the given class device.
my $attr = $classdev->get_attribute($name);
Searches supplied class device's attributes by $name and returns the Linux::Sysfs::Attribute instance for it.
my @attrs = $classdev->get_attributes;
Returns a list of Linux::Sysfs::Attribute instances for the given class device.
my $device = $classdev->get_device;
Returns the Linux::Sysfs::Device instance (if present) for the given class device.
my $name = $classdev->name;
Returns the class device's name.
my $path = $classdev->path;
Returns the full path to the class device in sysfs.
my $path = $classdev->classname;
Returns the name of the class $classdev belongs to.
$classdev
Florian Ragwitz <rafl@debian.org>
Copyright 2006 Florian Ragwitz, all rights reserved.
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA.
To install Linux::Sysfs, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Linux::Sysfs
CPAN shell
perl -MCPAN -e shell install Linux::Sysfs
For more information on module installation, please visit the detailed CPAN module installation guide.