C# Class OpenHome.Net.ControlPoint.CpDevice

Protocol-independent device
Instance of this class are reference counted and are automatically deleted when the reference count falls to zero. All references to class instances must have been removed before Core.Library.Close() is called.
Inheritance: ICpDevice
显示文件 Open project: openhome/ohNet Class Usage Examples

Public Methods

Method Description
AddRef ( ) : void

Claim a reference to a device.

Can only be called from code that can guarantee another reference is already held. Each call to AddRef() must later have exactly one matching call to RemoveRef().

CpDevice ( IntPtr aHandle ) : System

Constructor. Not intended for external use.

Devices should be constructed via CpDevice or CpDeviceList subclasses.

GetAttribute ( string aKey, string &aValue ) : bool

Query the value of one of the device's attributes

Handle ( ) : IntPtr

Get the handle to the underlying native device

RemoveRef ( ) : void

Remove a reference to a device.

Removing the final reference causes a device to be deleted.

Udn ( ) : String

Query the unique identifier associated with a device

Private Methods

Method Description
CpDeviceCAddRef ( IntPtr aDevice ) : void
CpDeviceCGetAttribute ( IntPtr aDevice, IntPtr aKey, IntPtr &aValue ) : int
CpDeviceCGetUdn ( IntPtr aDevice, IntPtr &aUdn, uint &aLen ) : void
CpDeviceCRemoveRef ( IntPtr aDevice ) : void
OhNetFree ( IntPtr aPtr ) : void

Method Details

AddRef() public method

Claim a reference to a device.
Can only be called from code that can guarantee another reference is already held. Each call to AddRef() must later have exactly one matching call to RemoveRef().
public AddRef ( ) : void
return void

CpDevice() public method

Constructor. Not intended for external use.
Devices should be constructed via CpDevice or CpDeviceList subclasses.
public CpDevice ( IntPtr aHandle ) : System
aHandle System.IntPtr Handle to the underlying native device
return System

GetAttribute() public method

Query the value of one of the device's attributes
public GetAttribute ( string aKey, string &aValue ) : bool
aKey string The name of the attribute being queried. Available attributes /// will be listed in a protocol-specific header
aValue string The value of the attribute
return bool

Handle() public method

Get the handle to the underlying native device
public Handle ( ) : IntPtr
return System.IntPtr

RemoveRef() public method

Remove a reference to a device.
Removing the final reference causes a device to be deleted.
public RemoveRef ( ) : void
return void

Udn() public method

Query the unique identifier associated with a device
public Udn ( ) : String
return String