RPi-DHT11

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

Revision history for Perl extension RPi::DHT11

1.05    2026-06-12
        - Fixed undefined behavior in DHT11.xs setup(): RPI_PIN_MODE was
          re-stamped with putenv() of a stack buffer, leaving environ pointing
          at a dead frame after return; now uses setenv(), which copies its
          arguments
        - The test suite board gate is now RPI_BOARD (ecosystem-wide rename
          from PI_BOARD); the old name is no longer honored
        - Makefile.PL's wiringPi presence check is restored as a real gate
          (its exit had been commented out, sacrificing CPAN testers' NA
          behavior) and can be bypassed with RPI_DIST_RELEASE=1 so release
          tarballs can be cut on non-Pi machines

1.04    2018-06-09
        - no functional changes

DHT11.xs  view on Meta::CPAN

        int setupMode = -1;

        if (getenv("RPI_PIN_MODE"))
            setupMode = atoi(getenv("RPI_PIN_MODE"));

        if (setupMode == -1){
            if (wiringPiSetupGpio() == -1)
                exit(1);
        }
        else {
            /* setenv() copies its args; putenv() with a stack buffer left
               environ pointing at a dead frame once setup() returned */
            char modeValue[12];
            sprintf(modeValue, "%d", setupMode);
            setenv("RPI_PIN_MODE", modeValue, 1);
        }
    }
    return true;
}

MODULE = RPi::DHT11  PACKAGE = RPi::DHT11

PROTOTYPES: DISABLE

int



( run in 1.110 second using v1.01-cache-2.11-cpan-6aa56a78535 )