Documentation

Discovery
in package
implements CollectionInterface

FinalYes

Table of Contents

Interfaces

CollectionInterface
Manage a group of devices.

Properties

$collection  : CollectionInterface
$discovered  : bool
$multicastAddress  : string
$networkInterface  : string|int|null

Methods

__construct()  : mixed
addDevice()  : $this
Add a device to this collection.
addIp()  : $this
Add a device to this collection using its IP address
clear()  : $this
Remove all devices from this collection.
getDevices()  : array<string|int, DeviceInterface>
Get all of the devices on the current network
getLogger()  : LoggerInterface
Get the logger currently in use.
getMulticastAddress()  : string
Get the multicast address to use for SSDP discovery.
getNetworkInterface()  : string|int|null
Get the network interface currently in use
setLogger()  : void
setMulticastAddress()  : $this
Set the multicast address to use for SSDP discovery.
setNetworkInterface()  : $this
Set the network interface to use for SSDP discovery.
discoverDevices()  : void
Get all the devices on the current network.

Properties

$discovered

private bool $discovered = false

$multicastAddress

private string $multicastAddress = "239.255.255.250"

$networkInterface

private string|int|null $networkInterface = null

Methods

addIp()

Add a device to this collection using its IP address

public addIp(string $address) : $this
Parameters
$address : string

The IP address of the device to add

Return values
$this

clear()

Remove all devices from this collection.

public clear() : $this
Return values
$this

getLogger()

Get the logger currently in use.

public getLogger() : LoggerInterface
Return values
LoggerInterface

getMulticastAddress()

Get the multicast address to use for SSDP discovery.

public getMulticastAddress() : string
Return values
string

getNetworkInterface()

Get the network interface currently in use

public getNetworkInterface() : string|int|null
Return values
string|int|null

setLogger()

public setLogger(LoggerInterface $logger) : void
Parameters
$logger : LoggerInterface

setMulticastAddress()

Set the multicast address to use for SSDP discovery.

public setMulticastAddress(string $multicastAddress) : $this
Parameters
$multicastAddress : string

The address to use

Return values
$this

setNetworkInterface()

Set the network interface to use for SSDP discovery.

public setNetworkInterface(string|int $networkInterface) : $this

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

Parameters
$networkInterface : string|int

The interface to use

Return values
$this

discoverDevices()

Get all the devices on the current network.

private discoverDevices(SocketInterface $socket) : void
Parameters
$socket : SocketInterface

An instance to send the discovery request via

On this page

Search results