C# Class OpenHome.Net.Core.Library

Initialisation and finalisation of this library, plus utility functions
Inheritance: IDisposable
Mostra file Open project: openhome/ohNet Class Usage Examples

Public Methods

Method Description
AbortProcess ( ) : void

Terminate the process after a fatal error.

Create ( InitParams aParams ) : Library

Create the library instance.

Only one instance per process is allowed. This must be called before any other library function.

Dispose ( ) : void
Free ( IntPtr aPtr ) : void

Free memory returned by native code

NotifyResumed ( ) : void

Inform the library that the application has been resumed

This is necessary if the application may have been paused while other processes on a device continued to be executed (e.g. when an app moves to background on iOS). It is typically not necessary to call this when the host device resumes from hibernation.

NotifySuspended ( ) : void

Inform the library that the application has been suspended.

This is necessary if the application may be paused while other processes on a device continued to be executed (e.g. when an app moves to background on iOS). It is typically not necessary to call this when the host device hibernates.

RefreshNetworkAdapterList ( ) : void

Force a refresh of the library's list of available network adapters

This should only be required on platforms that are not capable of automatically detecting adapter changes.

SetCurrentSubnet ( NetworkAdapter aSubnet ) : void

Set which subnet the library should use

Device lists and subscriptions will be automatically updated. No other subnet will be selected if aSubnet is not available

SetDebugLevel ( DebugLevel aLevel ) : void

Set the level (if any) of debug logging.

Log messages will be passed to the callback registered in InitParams.LogOutput.

StartCombined ( uint aSubnet ) : CombinedStack

Start the library as both UPnP control point and device stacks

StartCp ( uint aSubnet ) : ControlPointStack

Start the library as a UPnP control point stack

StartDv ( ) : DeviceStack

Start the library as a UPnP device stack

Private Methods

Method Description
CheckStartupError ( uint aError ) : void
FreeMemory ( IntPtr aPtr ) : void
Initialise ( InitParams aParams ) : void
Library ( InitParams aParams ) : System
OhNetAbortProcess ( ) : void
OhNetDebugSetLevel ( uint aLevel ) : void
OhNetFree ( IntPtr aPtr ) : void
OhNetInitParamsSetFreeExternalCallback ( IntPtr aParams, CallbackFreeMemory aCallback ) : void
OhNetLibraryClose ( ) : void
OhNetLibraryInitialise ( IntPtr aInitParams ) : int
OhNetLibraryInitialiseMinimal ( IntPtr aInitParams ) : int
OhNetLibraryNotifyResumed ( ) : void
OhNetLibraryNotifySuspended ( ) : void
OhNetLibraryStartCombined ( uint aSubnet ) : uint
OhNetLibraryStartCp ( uint aSubnet ) : uint
OhNetLibraryStartDv ( ) : uint
OhNetRefreshNetworkAdapterList ( ) : void
OhNetSetCurrentSubnet ( uint aSubnet ) : void

Method Details

AbortProcess() public static method

Terminate the process after a fatal error.
public static AbortProcess ( ) : void
return void

Create() public static method

Create the library instance.
Only one instance per process is allowed. This must be called before any other library function.
public static Create ( InitParams aParams ) : Library
aParams InitParams
return Library

Dispose() public method

public Dispose ( ) : void
return void

Free() public static method

Free memory returned by native code
public static Free ( IntPtr aPtr ) : void
aPtr System.IntPtr IntPtr returned by native code which is documented as requiring explicit destruction
return void

NotifyResumed() public method

Inform the library that the application has been resumed
This is necessary if the application may have been paused while other processes on a device continued to be executed (e.g. when an app moves to background on iOS). It is typically not necessary to call this when the host device resumes from hibernation.
public NotifyResumed ( ) : void
return void

NotifySuspended() public method

Inform the library that the application has been suspended.
This is necessary if the application may be paused while other processes on a device continued to be executed (e.g. when an app moves to background on iOS). It is typically not necessary to call this when the host device hibernates.
public NotifySuspended ( ) : void
return void

RefreshNetworkAdapterList() public method

Force a refresh of the library's list of available network adapters
This should only be required on platforms that are not capable of automatically detecting adapter changes.
public RefreshNetworkAdapterList ( ) : void
return void

SetCurrentSubnet() public method

Set which subnet the library should use
Device lists and subscriptions will be automatically updated. No other subnet will be selected if aSubnet is not available
public SetCurrentSubnet ( NetworkAdapter aSubnet ) : void
aSubnet NetworkAdapter Handle returned by SubnetAt()
return void

SetDebugLevel() public static method

Set the level (if any) of debug logging.
Log messages will be passed to the callback registered in InitParams.LogOutput.
public static SetDebugLevel ( DebugLevel aLevel ) : void
aLevel DebugLevel Bit(s) specifying which debug levels to enable
return void

StartCombined() public method

Start the library as both UPnP control point and device stacks
public StartCombined ( uint aSubnet ) : CombinedStack
aSubnet uint
return CombinedStack

StartCp() public method

Start the library as a UPnP control point stack
public StartCp ( uint aSubnet ) : ControlPointStack
aSubnet uint
return ControlPointStack

StartDv() public method

Start the library as a UPnP device stack
public StartDv ( ) : DeviceStack
return DeviceStack