in reply to Re^2: XS Modules - why and when?
in thread XS Modules - why and when?
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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: XS Modules - why and when?
by cavac (Prior) on Dec 15, 2023 at 08:55 UTC | |
by Bod (Parson) on Dec 18, 2023 at 21:56 UTC | |
by cavac (Prior) on Dec 19, 2023 at 09:38 UTC | |
by stevieb (Canon) on Dec 20, 2023 at 08:47 UTC | |
by cavac (Prior) on Dec 21, 2023 at 09:09 UTC | |
by bliako (Abbot) on Dec 19, 2023 at 07:53 UTC |