Device...TEMPer(3pm)

πŸ“¦
version 0.04 Β· 4 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

okay bestie, so this is the manual page for Device::USB::PCSensor::HidTEMPer β€” it's a Perl module, it lives in section 3pm of the User Contributed Perl Documentation, and it's literally just the device overview. That's it. That's the whole name. Device overview. short and sweet, we love that for us. πŸ’…


✨ VERSION ✨

Version 0.04 πŸŽ€


🌸 SYNOPSIS 🌸

ok so first, the shared code β€” every setup needs this part:

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

Then, if you've got a single-device situation (one thermometer, main character energy):

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

And if you're running a multi-device household (a whole squad of thermometers, iconic):

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

foreach my $device ( @devices ){
  print $device->internal()->celsius() if defined $device->internal();
}
notice the if defined checks bestie β€” they're there for a reason, don't skip them πŸ™ˆ

πŸ¦‹ DESCRIPTION πŸ¦‹

This module is a simplified interface to the HidTEMPer thermometers made by PCSensor. What does "simplified" mean here? It means it hides all the messy stuff from you β€” all the problems with recognizing the correct objects to initialize, and the whole dependency on Device::USB. gone. handled. not your problem anymore. πŸ’…

To actually use the thermometers you've got connected, you've got two options:

  • if you have multiple devices connected, you create an array of objects
  • if you have just one device, you use the device() function

Also, there's an example of this module being used in real life in the Linux Journal August 2010, "Cool Projects edition", page 32-34. published, periodt. πŸ“–

πŸŽ€ CONSTANTS πŸŽ€

These constants are declared:

  • PRODUCT_ID β€” holds the hex value of the product id on the usb chip, which in this case is 0x660c
  • VENDOR_ID β€” holds the hex value representing the manufacturer of the chip, which in this case is "Tenx Technology, Inc."
  • SUPPORTED_DEVICES β€” holds the mapping between name and identifiers for all the supported thermometers. the lineup:
    • Hex value 0x5b β†’ product HidTEMPerNTC β†’ internal sensor: Yes, external sensor: Yes
    • Hex value 0x58 β†’ product HidTEMPer β†’ internal sensor: Yes, external sensor: No
    • Hex value 0x59 β†’ product HidTEMPer2 β†’ internal sensor: Yes, external sensor: Yes
bestie clock the pattern β€” HidTEMPer is the only one with no external sensor πŸ‘€

πŸ’œ METHODS πŸ’œ

  • new() β€” initializes the system, and the USB-connection that's gonna be used. your starting point, your origin story ✨
  • device() β€” returns a single thermometer instance. ONLY to be used in systems with a single thermometer device, okay?? don't be out here calling it on multi-device setups. Returns undef if no devices were 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. context-sensitive queen πŸ‘‘

🌈 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;

It also uses the strict and warning pragmas. yes, we're being responsible. we love a module that practices safe code. 🫢


πŸ’€ BUGS πŸ’€

Found a bug? Missing a feature? Please report any bugs or missing features using the CPAN RT tool. don't suffer in silence bestie, tell the maintainers.


πŸ”₯ FOR MORE INFORMATION πŸ”₯

None.

not me writing a whole section to say "None" 😭 iconic honestly

πŸ‘‘ AUTHOR πŸ‘‘

Magnus Sulland < msulland@cpan.org >


🧚 ACKNOWLEDGEMENTS 🧚

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

Thanks to Daniel Fahlgren for adding the TEMPer2 device.

shoutout to the contributors, y'all ate πŸ’–


Copyright (c) 2010-2011 Magnus Sulland

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


πŸ“ POD ERRORS πŸ“

Hey! The above document had some coding errors, which are explained below:

Around line 205:

Non-ASCII character seen before =encoding in 'RuusamΓ€e'. Assuming
UTF-8
ngl the doc was out here assuming UTF-8 like the rest of us πŸ™ˆ perl said "sure, we'll allow it"

and that's the whole page, bestie!! this was perl v5.40.0, dated 2024-11-30, straight from the Device...TEMPer(3pm) man page. go forth and read your thermometers 🌑️✨

πŸ“¦ where this page comes from