If we look at RPi::PIGPIO::Device::DHT22 we can see a pure Perl method of reading the output from the device (DHT11 and DHT22 are read the same way).
Ahhh, but wait! Understand that the library you mention is a TCP connector to a daemon that is running on the Pi hardware. That daemon is what does all of the GPIO register manipulation directly. That daemon is written in guess what? C! So the library you mention does not interact with the hardware directly. It communicates with software that does. My software directly interfaces the hardware, which is why I needed C/XS to do so. This library communicates with someone elses software via a TCP socket that does the down and dirty work.
From the pigpio web page:
The pigpio library is written in the C programming language. The pigpio daemon offers a socket and pipe interface to the underlying C library.
So that's why the library you mention can be written in Pure Perl. Note that the author of the Perl library you mention and the author of pigpio are not the same person.
In reply to Re^3: XS Modules - why and when?
by stevieb
in thread XS Modules - why and when?
by Bod
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |