Device Class

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Creates a device used to manage global device information, host, and hosted services.

Inheritance Hierarchy

System. . :: . .Object
  Dpws.Device..::..Device

Namespace:  Dpws.Device
Assembly:  MFDpwsDevice (in MFDpwsDevice.dll)

Syntax

'Declaration
Public NotInheritable Class Device
public static class Device
public ref class Device abstract sealed
[<AbstractClass>]
[<Sealed>]
type Device =  class end
public final class Device

The Device type exposes the following members.

Properties

  Name Description
Public propertyStatic member DiscoveryVersion Gets the discovery version.
Public propertyStatic member EndpointAddress Contains a DPWS-compliant endpoint address.
Public propertyStatic member HostedServices Gets a collection used to add hosted services to this device.
Public propertyStatic member IgnoreLocalClientRequest Specifies whether to ignore discovery requests from the same IP address as the device.
Public propertyStatic member IPV4Address Gets the IPV4 address of this device.
Public propertyStatic member MaxDiscoveryThreads Gets or sets the maximum number of threads used to process Udp (Discovery) requests. The default value is 5.
Public propertyStatic member MaxServiceThreads Gets or sets the maximum number of threads used to process Http requests. The default value is 5. /// Use this as a tuning parameter and be conservative.
Public propertyStatic member MetadataVersion Gets the device's DPWS-compliant metadata version.
Public propertyStatic member Port Gets the HTTP listener port number.
Public propertyStatic member ProbeMatchDelay Gets the maximum wait time for a probe match message response.
Public propertyStatic member Started Gets the value that indicates whether device services are running.
Public propertyStatic member SupressAdhoc Turns ad hoc discovery on or off.

Top

Methods

  Name Description
Public methodStatic member Initialize Initializes the device.
Public methodStatic member Start Starts the stack's transport services.
Public methodStatic member Stop Stops stack transport services.

Top

Fields

  Name Description
Public fieldStatic member Host Holds a hosted service that implements device-specific host functionality.
Public fieldStatic member SubscriptionManager Accesses an event subscription manager, which provides functionality required to fire events from a hosted service.

Top

Remarks

The Device class provides the base functionality of a device. It is the primary control class for a device and is the container and manager of hosted services provided by a device. This class exposes static methods and properties used to manage device information, start, and stop internal services and to manage hosted services.

A device developer uses this class to set device-specific information common to all hosted services such as ThisModel, ThisDevice, and endpoint information like the device address and device ID. When developing hosted services, this class provides access to information required by the service when building response messages. The Device class also manages a collection of hosted services that implement the functionality of a device.

Hosted services are created by device developers. These services are added to the collection of hosted services maintained by the Device class. When the device services start, an instance of each hosted service in the hosted services collection is instantiated. When a device request is received, the hosted services collection contains information used by the transport services to route requests to a specific service.

The Device class also manages a set of internally-hosted services that provide the boilerplate functionality of Devices Profile for Web Services (DPWS), such as Discovery, Mex (Metadata Exchange), and the Event Subscription manager. These are not exposed to a device developer.

The Device class also manages a collection of namespaces common to all DPWS-compliant devices.

If a device requires Host functionality outlined in the DPWS specification, a hosted service can be added to the device to provide this functionality. Special provisions are made because a device's Host service has the same endpoint as the device.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Dpws.Device Namespace