Device::USB::PCSensor::HidTEMPer - Device overview
Version 0.01
use Device::USB::PCSensor::HidTEMPer; my $pcsensor = Device::USB::PCSensor::HidTEMPer->new(); my @devices = $pcsensor->list_devices(); foreach my $device ( @devices ){ say $device->internal()->celsius(); }
Simplified interface to the usb devices hiding Device::USB from the user. Using this class to list devices ensures that only the correct temperature devices are returned, all initialized and ready for use.
The following constants are declared in this class
PRODUCT_ID
Contains the hex value of the product id on the usb chip.
VENDOR_ID
Contains the hex value representing the manufacturer of the chip, in this case this is "Tenx Technology, Inc."
new()
list_devices()
Returns an array of all the recognized devices that are attaced to the system. Each device is a object of the same type as the device found.
device( $generic_device )
Convert a generic usb-device into the corresponding HidTEMPer device.
Input parameters 1) The Device::USB::Device object that should be converted to the appropriate object type.
Output This method returns a object of the corresponding type if the device is supported, else it returns undef. Returns undef on errors, and carp to display the error message.
List of supported devices:
Hex value Product Internal sensor External sensor 0x5b HidTEMPerNTC Yes Yes 0x58 HidTEMPer Yes No
use 5.010; use strict; use warnings; use Carp; use Device::USB; use Device::USB::PCSensor::HidTEMPer::Device; use Device::USB::PCSensor::HidTEMPer::NTC; use Device::USB::PCSensor::HidTEMPer::TEMPer;
This module uses the strict and warning pragmas.
If you find any bugs or missing features please notify me using the following email address: msulland@cpan.org
None
Magnus Sulland < msulland@cpan.org >
Copyright (c) 2010 Magnus Sulland
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.
To install Device::USB::PCSensor::HidTEMPer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Device::USB::PCSensor::HidTEMPer
CPAN shell
perl -MCPAN -e shell install Device::USB::PCSensor::HidTEMPer
For more information on module installation, please visit the detailed CPAN module installation guide.