Get type of device inserted to windows 8 pc via USB port - windows-8

I've been asked to work on a project for Windows 8 where I have to detect:
Type of device inserted to USB port (mass storage drive or android phone or windows phone etc.)
Port in which device was inserted. (if I have 4 USB ports in PC then identify which port received new device)
Detect when the device was ejected from the PC
Are there some managed C# API's that can be used to query or if there are some callbacks that can be subscribes to.
Any help or direction will be very useful.
Thanks

You don't specify whether you are writing a desktop app, or a Modern UI app. If it is the latter, I'm afraid you are going to be out of luck as this level of information is simply not passed down to the app's sandbox.
You may have better luck with a desktop app. I don't have any direct experience of doing what you ask for, but I do remember having read that it may be possible through .NET.

Related

What is the exact function of an USB driver?

On reading many websites, I got confused.
Is the USB driver essential for making the device work? Or is it essential for making it communicate with the OS to do functions such as printing and doing other OS stuff?
To explain my question more clearly -
I am working on developing a USB device, that will communicate with the software i will write.
Do I need to develop a driver for such a system?
or
Do I just need the software program to send the proper messages to the device?
I am assuming your micro controller will be a USB device and your PC will be USB host.
The below diagram is the SW architecture for USB host. Now since your host is a PC, you do not need to worry about any part except the application at the top.
So lets talk about the device. What you need is a device stack which resembles with the host stack below. You can get the device stack easily and port it in your micro controller. But I suppose you need an application in your device too same as the top box of the below diagram which will understand the requests from the host and service the request.
So basically what I am saying that you need two applications and the rest of the components you can get it with some effort.
Regards.

WiFi Direct on Windows Phone 8.1

Is it possible to use WiFi Direct to connect to another device (Raspberry Pi) without tapping (NFC)?
The app needs to be able to find all WiFi Direct devices (Raspberry Pi's) in its vicinity, and by tapping one a connection is made to send strings.
The app needs to be able to detect new devices, that have never been paired with the phone before.
Windows Phone doesn't support WiFi direct communication from the SDK. Although it is available in Windows 8, its not yet present in phones.
According to Channel 9, MSDN
Windows 8 natively supports Wi-Fi Direct and has integrated the technology into the Windows 8 Play To and proximity sharing experiences.
However this doesn't apply for windows phone.
There are apps on the store which supports it, but I have no idea how to implement that in programming. Take a look at the process of using those apps
http://www.lumiamine.com/2014/07/wifi-direct-on-windows-phone.html

connecting 2 Kinect sensors to my notebook

I am trying to connect 2 kinect sensors to my notebook. I know that I have to have at least 2 separate USB 2.0 controllers. According to tis website: LINK I have the same settings as in the picture. So I think that connecting 2 kinect sensors should be possible for me. I have 3 regular USB2 ports and one combined with e-SATA. So I have 4 ports to connect USB devices. However, when I try to connect 2 Kinect sensors (each time into different ports), I am always getting error message on one device (in windows device manager):
This device cannot start. (Code 10)
Can anyone help me please? I do not have any other computer and dont want to buy new just because USB controllers. I thing there has to be a way to do this. Thank you
can you please get a schematic of your notebook's motherboard and double check how your 3 ports are connected to the 2 controllers you mention. Hopefully 1 out of the 3 ports will be connected to a different controller from other 2 ports.
Does your notebook allow you to connect an express card to it ? Perhaps you could get an additional port this way.
With a custom built PC and a PCI Express USB expansion card we've got 3 kinects connected at the same time for an art-installation/robotics project.
I remember though at the time getting 2 Kinects running at the same time on my old 2008 macbook with no problems. Note that this was with either the libfreenect and OpenNI drivers, since the Kinect SDK driver doesn't work on osx.
Also, since you're using the Kinect SDK, I'm guessing you are using either Kinect for Windows (v1 if you will) or Kinect for Xbox360 and not the Kinect 2 for Windows since the current Alpha release of the SDK currently only allows a single sensor.
Update
Had a quick look here:
although couldn't easily find the schematics. My guess is two USB ports are connected to the same controller and the 3rd USB port might(don't take my word for it, check the manufacturers specs) be connected to a separate usb controller, in which case connecting one kinect to one side of your laptop and the other kinect to the port on the opposite should work. Make sure you see both sensors in Device Manager(run devmgmt.msc).
Also, just to double check your sensors as well, try connecting one, running a demo/test, then disconnecting and using a second sensor on the same port.
If both sensors work individually work on the same port, test them also on the usb port on the opposite side. You just want to make sure neither the sensors nor your ports are faulty. Lastly, if your hardware looks fine (power is good, sensors and ports are good), double check your code and me sure you don't accidentally open the same sensor twice or any other mistake that might be easy to miss.
If you have a friend you can either borrow another laptop for a short time just to test that would also be good. You can also try getting an USB Express Card™ card for your laptop. Although a long shot, you could try to disable other usb devices on your laptop, leaving as much bandwidth available to the ports as possible. You should be able to do this either from Device Manager or your potentially from BIOS settings.

Can my iphone app communicate with a connected computer?

Preferably, this would be a computer connected via cable, but if there's a way to do it over wifi then this would also be useful. I'm wondering if it's possible to send messages between them?
Or if i had a mac app and an iPhone app, could I communicate between them over wifi or a usb connection, rather than using a server or something?
Connecting over WiFi is possible, cable connection however isn't possible (certainly not in the documented API) unless the phone is jailbroken.
For wifi you're just going to connect to a TCP/IP host/socket. Have a look at CocoaAsyncSocket. The computer would need to be hosting some sort of server software. This is how iTunes Remote and AirMouse work.
There are some "permitted" (non-cracked phone) ways to send data to the iPhone from a device that's physically plugged in. There are several barcode readers - like the Linēa-pro used in US Apple stores - and magstripe readers for credit cards (e.g., the Macally Quikswipe) that can send limited amounts of data to/from the iPhone.
If your computer is a small embedded device and your data requirements are meager, it may be possible.

How to detect that Symbian phone is being used as a modem?

I have a Nokia Symbian Series 60 3rd edition phone. I can use it as a GPRS / 3G modem either using Bluetooth, USB or IR.
Is there a way to programmatically detect when the phone is being used as a modem?
Please note I don't want to detect when a GPRS / 3G connection comes up (such as when you use the phone browser), but when a GPRS / 3G connection comes up that is the result of the phone being used as tethered modem via BT / IR / USB.
So the user has set up a dial up networking connection on their laptop, for instance, which uses the modem in the phone. They then launch that connection because they want to make a 3G wireless internet connection from their laptop via the phone. That's what I'd like to be able to detect from the phone.
I don't believe there's any public interface that you could use for this. You could probably use internal APIs to check what is creating the data connection, or more crudely check which processes are running when a data connection is created - probably quite easy to fool this method, depends why you want to know?
I can see network operators wanting to do this to block and/or charge extra for tethering usage. Easiest way to do that would be network side though, checking the browser UA header (also possible to fool, but not without harming your browsing experience a bit on the laptop).