Platforms to show: All Mac Windows Linux Cross-Platform

Back to WindowsDeviceWatcherMBS class.

WindowsDeviceWatcherMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Bluetooth MBS WinFrameworks Plugin 24.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Creates a DeviceWatcher for all devices.

The DeviceWatcher first performs an initial enumeration of devices, raising an Added event for each device that it finds, and raising an EnumerationCompleted event when the initial enumeration is complete. After the initial enumeration is complete, it raises events when a device is added, deleted, or updated.

See also:

WindowsDeviceWatcherMBS.Constructor(aqsFilter as String)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Bluetooth MBS WinFrameworks Plugin 24.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Creates a DeviceWatcher for devices matching the specified Advanced Query Syntax (AQS) string.

aqsFilter: An AQS string that filters the DeviceInformation objects to enumerate. Typically this string is retrieved from the GetDeviceSelector method of a class that interacts with devices. For example, GetDeviceSelector retrieves the string for the StorageDevice class.

The DeviceWatcher first performs an initial enumeration of devices, raising an Added event for each device that it finds, and raising an EnumerationCompleted event when the initial enumeration is complete. After the initial enumeration is complete, it raises events when a device is added, deleted, or updated.

See also:

WindowsDeviceWatcherMBS.Constructor(DeviceClass as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Bluetooth MBS WinFrameworks Plugin 24.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Creates a DeviceWatcher for devices matching the specified Advanced Query Syntax (AQS) string.

aqsFilter: An AQS string that filters the DeviceInformation objects to enumerate. Typically this string is retrieved from the GetDeviceSelector method of a class that interacts with devices. For example, GetDeviceSelector retrieves the string for the StorageDevice class.

The DeviceWatcher first performs an initial enumeration of devices, raising an Added event for each device that it finds, and raising an EnumerationCompleted event when the initial enumeration is complete. After the initial enumeration is complete, it raises events when a device is added, deleted, or updated.

See also:

WindowsDeviceWatcherMBS.Destructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Bluetooth MBS WinFrameworks Plugin 24.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The destructor.

WindowsDeviceWatcherMBS.Start

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Bluetooth MBS WinFrameworks Plugin 24.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Starts a search for devices, and subscribes to device enumeration events.

An app calls Start to begin the search for devices. During this initial enumeration, the DeviceWatcher raises an Added event for each device that's found, until all devices are found. The DeviceWatcher raises an EnumerationCompleted event when the initial enumeration is complete, and continues to raise events if a device is added, updated, or removed.
The Start method can only be called when the DeviceWatcher is in the Created, Stopped or Aborted state. The Status property indicates the DeviceWatcher state. When re-starting the watcher, wait for the Stopped event before calling Start. The following diagram shows how the DeviceWatcher transitions between the states represented by DeviceWatcherStatus enumeration.

WindowsDeviceWatcherMBS.Stop

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Bluetooth MBS WinFrameworks Plugin 24.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Stop raising the events that add, update and remove enumeration results.

To stop a search for devices, an app calls Stop and enters the Stopping state. The Stopped event is raised when the Stop operation completes and the DeviceWatcher enters the Stopped state.
The following diagram shows how the DeviceWatcher transitions between the states represented by DeviceWatcherStatus enumeration.

This call transitions the DeviceWatcher to the Stopping state and completes immediately. The watcher will transition to the Stopped state once all events that are already in the process of being raised have completed.
Callers may wait for the Stopped event if they need to know when the DeviceWatcher has stopped. Callers must wait for the Stopped event before they can call Start to restart the watcher. Callers may unsubscribe from events if they do not want to receive any additional events after Stop but do not want to wait for the Stopped event.

The items on this page are in the following plugins: MBS WinFrameworks Plugin.


The biggest plugin in space...