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 | |
---|---|---|
DiscoveryVersion | Gets the discovery version. | |
EndpointAddress | Contains a DPWS-compliant endpoint address. | |
HostedServices | Gets a collection used to add hosted services to this device. | |
IgnoreLocalClientRequest | Specifies whether to ignore discovery requests from the same IP address as the device. | |
IPV4Address | Gets the IPV4 address of this device. | |
MaxDiscoveryThreads | Gets or sets the maximum number of threads used to process Udp (Discovery) requests. The default value is 5. | |
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. | |
MetadataVersion | Gets the device's DPWS-compliant metadata version. | |
Port | Gets the HTTP listener port number. | |
ProbeMatchDelay | Gets the maximum wait time for a probe match message response. | |
Started | Gets the value that indicates whether device services are running. | |
SupressAdhoc | Turns ad hoc discovery on or off. |
Top
Methods
Name | Description | |
---|---|---|
Initialize | Initializes the device. | |
Start | Starts the stack's transport services. | |
Stop | Stops stack transport services. |
Top
Fields
Name | Description | |
---|---|---|
Host | Holds a hosted service that implements device-specific host functionality. | |
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.