Properties

$discovered

$discovered : boolean

Type

boolean — A flag to indicate whether we've discovered the devices yet or not.

$networkInterface

$networkInterface : string|integer

Type

string|integer — The network interface to use for SSDP discovery.

$multicastAddress

$multicastAddress : string

Type

string — The multicast address to use for SSDP discovery.

Methods

setLogger()

setLogger(\Psr\Log\LoggerInterface  $logger) : $this

Set the logger object to use.

Parameters

\Psr\Log\LoggerInterface $logger

Returns

$this

getLogger()

getLogger() : \Psr\Log\LoggerInterface

Get the logger object to use.

Returns

\Psr\Log\LoggerInterface —

$logger The logging object

setNetworkInterface()

setNetworkInterface(string|integer  $networkInterface) : $this

Set the network interface to use for SSDP discovery.

See the documentation on IP_MULTICAST_IF at http://php.net/manual/en/function.socket-get-option.php

Parameters

string|integer $networkInterface

The interface to use

Returns

$this

getNetworkInterface()

getNetworkInterface() : string|integer|null

Get the network interface currently in use

Returns

string|integer|null —

The network interface name

setMulticastAddress()

setMulticastAddress(string  $multicastAddress) : $this

Set the multicast address to use for SSDP discovery.

Parameters

string $multicastAddress

The address to use

Returns

$this

getMulticastAddress()

getMulticastAddress() : string

Get the multicast address to use for SSDP discovery.

Returns

string —

The address to use

addIp()

addIp(string  $address) : $this

Add a device to this collection using its IP address

Parameters

string $address

The IP address of the device to add

Returns

$this

clear()

clear() : $this

Remove all devices from this collection.

Returns

$this

discoverDevices()

discoverDevices(\duncan3dc\Sonos\Interfaces\Utils\SocketInterface  $socket) : void

Get all the devices on the current network.

Parameters

\duncan3dc\Sonos\Interfaces\Utils\SocketInterface $socket

An instance to send the discovery request via