Linux::_i2c PHP Method

_i2c() protected method

I2C devices
protected _i2c ( ) : void
return void
    protected function _i2c()
    {
        $i2cdevices = glob('/sys/bus/i2c/devices/*/name', GLOB_NOSORT);
        if (($total = count($i2cdevices)) > 0) {
            $buf = "";
            for ($i = 0; $i < $total; $i++) {
                if (CommonFunctions::rfts($i2cdevices[$i], $buf, 1, 4096, false) && trim($buf) != "") {
                    $dev = new HWDevice();
                    $dev->setName(trim($buf));
                    $this->sys->setI2cDevices($dev);
                }
            }
        }
    }