How do I reactivate USB devices using WIN API? - winapi

Do you know how to reactivate USB devices?
WIN API CM_Request_Device_Eject function can eject USB device,
but how to reactivate it?
I tried to use CM_Setup_DevNode, it returns failed(19).
Thank you!

Related

Accessing USB device using firefox

Is there any way to access an USB device through Firefox on a local computer?
More details: I have created a USB device using microchip 18F2250 that sends data of thermal and humidity sensors & able to receive data to control a robotic arm..
The device has been tested on a C#2010 program to access the USB device successfully..
Now I run a HTML/javascript web page as a local server (http://localhost:8000/..bla bla bla..) & I need to access the USB device from this firefox bowser..
Notes : cannot use Chrome and its plug in WebUSB, I'm restricted to Firefox only for some reasons.
Any help??

unpair dual-mode bluetooth device in uwp application

use Windows.Devices.Bluetooth.Advertisement.BluetoothLEAdvertisementWatcher to discover the device
Windows.Devices.Bluetooth.BluetoothLEDevice.FromBluetoothAddressAsync([address]) to get Windows.Devices.Bluetooth.BluetoothLEDevice
call Windows.Devices.Bluetooth.BluetoothLEDevice.DeviceInformation.Pairing.Custom.PairAsync(....)
because the device is a dual-mode bluetooth device, after pairing, there are same two device names I can see in the Windows Bluetooth list. And after calling the UnpairAsync api, I can only unpair the BLE device.
Is there a way to unpair both devices?

Using USB device on PC in Android Studio Emulator

I am developing an app that A dongle (USB) device must connect to Android OS supported device(mobile phones, tablets...) via OTG (On-The-Go) cable. The problem starts here. I need to do debug while the dongle is connected to the Mobile phone. Unfortunately, such situation makes connecting mobile phone to PC and debugging method impossible. ( Mobile phone has 1 socket but I need 2, one for connecting the dongle to mobile phone and other for connecting mobile phone to pc for debugging)
Is there a way such that the Android Studio Emulator can access to USB device on the PC?
EDIT I have found an alternative way like connecting the mobile phone to PC via Bluetooth which is explained here.
EDIT 2: A better and clear way : Installing Genymotion and Virtual Box.
Another option (I use daily) is
adb connect phone_ip
The phone should be connected to wifi (the host also).
Lots of sources for that on the net (here is one)
mordy.

iMac developing Bluetooth 4.0 application with external dongle

I have a Late 2009 iMac which doesn't support Bluetooth 4.0 and an USB Bluetooth 4.0 dongle (CSR).
I need to write an OSX application which transfers data with a Bluetooth 4.0 device.
If I plug the dongle, the CBCentralManager returns the state CBCentralManagerStateUnsupported since OSX has loaded the driver for the internal Bluetooth device.
If I issue the following command:
sudo nvram bluetoothHostControllerSwitchBehavior="always"
the OSX loads the driver for the dongle, the CBCentralManager recognize the device but unfortunately both wireless keyboard and magic mouse stop working. Presumably because they use a previous version of Bluetooth.
Is there any way to have both internal Bluetooth and external dongle working together ?
Aside from the development, which I can manage with USB keyboard and mouse, this issue prevents older iMacs to use my app.
Thank you in advance.
...unfortunately both wireless keyboard and magic mouse stop working. Presumably because they use a previous version of Bluetooth.
This is not true. The iMac takes some time to recognize that it has not keyboard and mouse configured. After waiting some time, the iMac asks for pairing keyboard and everything work correctly with the external dongle.

Can Windows be set up to automatically launch an application when an HID-compliant USB device is plugged in?

I have a custom HID-compliant USB device. I would like to set up Windows to launch an application when this device is plugged in. Is this possible through a configuration setting? Or do I need to write an application (for example, one that resides in the system tray on Windows startup) that detects when the device is inserted?
I know that my Canon camera and my Nokia phone can start applications or AutoPlay when they are plugged in, but they are not HID devices.
You should be able to achieve this by monitoring for a WMI Win32_DeviceChangeEvent, or RegisterDeviceNotification.
Win32_DeviceChangeEvent: http://msdn.microsoft.com/en-us/library/aa394124(VS.85).aspx
RegisterDeviceNotification: http://msdn.microsoft.com/en-us/library/aa363431(VS.85).aspx

Resources