logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Device::USB::PCSensor::HidTEMPer - Device overview

Acknowledgements

       Thanks to Elan Ruusamäe for fixing some compatibility issues with perl 5.8.

       Thanks to Daniel Fahlgren for adding the TEMPer2 device.

Author

       Magnus Sulland < msulland@cpan.org >

Bugs

       Please report any bugs or missing features using the CPAN RT tool.

Dependencies

       This module internally includes and takes use of the following packages:

        use Device::USB;
        use Device::USB::PCSensor::HidTEMPer::Device;
        use Device::USB::PCSensor::HidTEMPer::NTC;
        use Device::USB::PCSensor::HidTEMPer::TEMPer;
        use Device::USB::PCSensor::HidTEMPer::TEMPer2;

       This module uses the strict and warning pragmas.

Description

       This module is a simplified interface to the HidTEMPer thermometers created by PCSensor. It hides any
       problems recognizing the correct objects to initialize and the dependency on Device::USB. Use of the
       connected thermometers can be done by either creating a array of objects if multiple devices are
       connected, or the function device() if only one device is present.

       One example of its usage can be found in the Linux Journal August 2010, "Cool Projects edition" page
       32-34.

   CONSTANTS
       The following constants are declared

       •  PRODUCT_ID

          Contains the hex value of the product id on the usb chip, in this case 0x660c

       •  VENDOR_ID

          Contains the hex value representing the manufacturer of the chip, in this case "Tenx Technology, Inc."

       •  SUPPORTED_DEVICES

          Contains the mapping between name and identifiers for all supported thermometers.

           Hex value   Product         Internal sensor    External sensor
           0x5b        HidTEMPerNTC    Yes                Yes
           0x58        HidTEMPer       Yes                No
           0x59        HidTEMPer2      Yes                Yes

   METHODSnew()

          Initialize the system, and the USB-connection to be used.

       •  device()

          Return  a  single  thermometer instance. ONLY to be used in systems using a single thermometer device.
          Returns undef if no devices was found.

       •  list_devices()

          Returns an array of recognized thermometer instances if an  array  value  is  expected,  otherwise  it
          returns a scalar with the number of devices found.

For More Information

       None

Name

       Device::USB::PCSensor::HidTEMPer - Device overview

Pod Errors

       Hey! Theabovedocumenthadsomecodingerrors,whichareexplainedbelow:

       Around line 205:
           Non-ASCII character seen before =encoding in 'Ruusamäe'. Assuming UTF-8

perl v5.40.0                                       2024-11-30              Device::USB::PCSensor::HidTEMPer(3pm)

Synopsis

       Shared code:

         use Device::USB::PCSensor::HidTEMPer;
         my $pcsensor = Device::USB::PCSensor::HidTEMPer->new();

       Single-device systems:

         my $device = $pcsensor->device();
         print $device->external()->fahrenheit() if defined $device->external();

       Multi-device systems:

         my @devices = $pcsensor->list_devices();

         foreach my $device ( @devices ){
           print $device->internal()->celsius() if defined $device->internal();
         }

Version

       Version 0.04

See Also