New and updated version of old code.

This commit is contained in:
2024-05-15 21:24:05 +02:00
commit cc1038047e
11 changed files with 448 additions and 0 deletions

25
api/discoverScanners.php Normal file
View File

@@ -0,0 +1,25 @@
<?php
function discoverScanners()
{
$scannersList = shell_exec('sudo scanimage -f "%d|%v %m"');
if($scannersList != "")
{
session_start();
$_SESSION["ScannersList"][0] = explode('|', $scannersList);
return true;
}
else return false;
}
// TODO / DEBUG - Fix this function
if(discoverScanners() === true) echo "OK";
else echo "Failed";
// TEST code
// session_start();
// $_SESSION["ScannersList"][0] = [ "xerox_mfp:libusb:003:010", "Samsung M2070" ];
// echo "OK";
?>