C# Class OpenHome.Net.ControlPoint.CpDeviceList

List of devices available on the current subnet
Runs callbacks when a device is detected on or removed from a network. Clients can't iterate the list's contents so must take note of the device in their 'added' callback and remove the device in their 'removed' callback. Since CpDevice instances are reference counted, a reference must be claimed inside the 'added' callback and removed inside the 'removed' callback. This class can't be directly instantiated. Clients should instead use subclasses which will define policy on how to detect devices etc. Dispose() must be called before Core.Library.Close().
Inheritance: ICpDeviceList, IDisposable
Show file Open project: openhome/ohNet Class Usage Examples

Protected Properties

Property Type Description
iAdded ChangeHandler
iFnAdded CallbackDevice
iFnRemoved CallbackDevice
iGch System.Runtime.InteropServices.GCHandle
iHandle System.IntPtr
iRemoved ChangeHandler

Public Methods

Method Description
Dispose ( ) : void

Must be called for each class instance. Must be called before Core.Library.Close().

Refresh ( ) : void

Refresh the contents of the list.

This may be a useful way to quickly update a list after a device has been removed abruptly from the network (without announcing its removal). The 'added' callback may run any time after this is called to notify new devices. Any removed devices will be notified by a burst of calls to the 'removed' callback Core.InitParams::MsearchTimeSecs() seconds after this call is made. There is no notification that a refresh has completed. Existing CpDevice instances can be used as normal throughout the refresh.

Protected Methods

Method Description
CpDeviceList ( ) : System

Private Methods

Method Description
Added ( IntPtr aPtr, IntPtr aHandle ) : void
CallListChangedDelegate ( ChangeHandler aDelegate, CpDeviceList aList, CpDevice aDevice ) : void
CpDeviceListDestroy ( IntPtr aListHandle ) : void
CpDeviceListRefresh ( IntPtr aListHandle ) : void
Removed ( IntPtr aPtr, IntPtr aHandle ) : void

Method Details

CpDeviceList() protected method

protected CpDeviceList ( ) : System
return System

Dispose() public method

Must be called for each class instance. Must be called before Core.Library.Close().
public Dispose ( ) : void
return void

Refresh() public method

Refresh the contents of the list.
This may be a useful way to quickly update a list after a device has been removed abruptly from the network (without announcing its removal). The 'added' callback may run any time after this is called to notify new devices. Any removed devices will be notified by a burst of calls to the 'removed' callback Core.InitParams::MsearchTimeSecs() seconds after this call is made. There is no notification that a refresh has completed. Existing CpDevice instances can be used as normal throughout the refresh.
public Refresh ( ) : void
return void

Property Details

iAdded protected property

protected ChangeHandler iAdded
return ChangeHandler

iFnAdded protected property

protected CallbackDevice iFnAdded
return CallbackDevice

iFnRemoved protected property

protected CallbackDevice iFnRemoved
return CallbackDevice

iGch protected property

protected GCHandle,System.Runtime.InteropServices iGch
return System.Runtime.InteropServices.GCHandle

iHandle protected property

protected IntPtr,System iHandle
return System.IntPtr

iRemoved protected property

protected ChangeHandler iRemoved
return ChangeHandler