PHP based UPnP device discovery
composer require cyberline/phupnp
namespace CyberLine\phUPnP
{
require 'src/Scanner.php';
try {
$scanner = new Scanner;
$scanner
->setTimeout(1);
print_r($scanner->discover());
} catch (\Exception $e) {
print 'Exception: ' . $e->getMessage() . PHP_EOL;
}
}
namespace CyberLine\phUPnP
{
require 'src/Scanner.php';
try {
$scanner = new Scanner;
$scanner
->setTimeout(1)
->setSearchType('upnp:rootdevice');
print_r($scanner->discover());
} catch (\Exception $e) {
print 'Exception: ' . $e->getMessage() . PHP_EOL;
}
}
namespace CyberLine\phUPnP
{
require 'src/Scanner.php';
try {
print json_encode(new Scanner);
} catch (\Exception $e) {
print 'Exception: ' . $e->getMessage() . PHP_EOL;
}
}