Open and enable / disable devices on Win8?

I am writing a metro application for Windows 8 (C # 5) to act as a power management application that allows the user to turn on and off various devices that computers will likely have. So far, I'm just thinking about Bluetooth and a wireless network adapter. In the end, I will add other devices, but one step at a time.

The main aspects I'm worried about are the reliable detection of devices, turning them on and off, and asking for their status (is this device already on?). I need to be able to do any of these on different machines with different devices, including several NIC or Bluetooth hardware settings.

I looked at devcon on Win7, but I'm worried about reliable device discovery. If I capture the wrong devices, who knows that I will disconnect, not to mention that it will not disconnect what I intend to disconnect. In addition, I have not tried this on Win8 yet, and it may not be a portable application, I do not want people to install it, and then my application.

WMI is powerful, but always a little intimidating to roam without the slightest guidance. If it were better, I would appreciate some resources.

The command line or .Net library is what I hope for, but I have not tried such things before, so I am open to any other alternatives. In addition, any forethought in working with other devices, such as cellular network cards or devices that I have not thought about, would be great.

+4
source share
1 answer

Most of what you want (such as the Bluetooth API) is truly isolated from Metro apps. There are some substitutes in the Windows namespace, although they will meet your needs, which I do not know. See http://msdn.microsoft.com/en-us/library/windows/apps/hh464945 for links to suggested alternatives for working with devices.

In particular, the Windows.Devices.Enumeration namespace talks about device discovery. However, when I read the page, it seems to me that this is more connected with detection and less control. I will not be surprised that you cannot control them. But this is where I will start digging.

+1
source

All Articles