Allow MTP for specific devices on Windows and MAC - windows

Is there any way to allow only specific devices to connect a computer through MTP protocol in Macos as well as Windows and block the rest. Thanks in advance.

Since Windows and OS X are very different OS, there will be no uniform way to manage MTP devices on each of them.
For the Windows system I recommend you to investigate filter drivers.
For the OS X there is no default way to use devices through MTP, so you should decide what exactly users interactions you want to filter out, and then decide to block some library using or maybe write a kernel extension that will be filter out access to some /dev/xxx node.

Related

Add a fake bluetooth device without having a module itself

I need to create an application which will work with some medical bluetooth devices. In fact, currently I do not need any real devices, but I need them to be in the Windows 7 Devices list. Also, there is no a bluetooth module installed on my working machine.
So, the question is:
Is it possible to add a fake/virtual device(s) into the system?
If yes, then is it possible to make them of a specific type, e.g. any kind of blood pressure measurement device etc.?

WiFi: what does OS X call a "device"?

Where I work, we are building a GUI to run on iOS or Android; the GUI is intended to control an embedded board. The embedded board does not have WiFi, an Ethernet port, or a USB port, but it does have an RS-232 serial port; so we are using a product called a WiSnap.
http://serialio.com/products/mobile/wifi/WiSnapKit2.php
We have been able to connect to the WiSnap using OS X, or using iOS (an iPad 2). But none of our Android tablets recognize the device at all. The WiSnap acts as a WiFi access point, and broadcasts an SSID; the Android tablets do not list this SSID in the list of available WiFi access points. Under Linux Mint 12, my Laptop can see the WiSnap, but attempts to connect to it fail. Interestingly, my cell phone (a Droid 2) is able to see the WiSnap, but I don't have telnet on my phone so I haven't tested to see if it actually works.
Under OS X, I noticed something. In the drop-down list of WiFi access points, there are two distinct groups: the top group, which contains most of the listed WiFi access points, then a lower group, that has a sub-heading that says "Devices" and contains just the WiSnap and something called "hpsetup". (I don't know what "hpsetup" is or where it might be; there are lots of WiFi users in this neighborhood.)
The WiSnap is operating in "ad-hoc" mode with no security at all.
So, my question is: what is the significance of OS X calling the WiSnap a "device"? It is frustrating to try to search Google for "WiFi devices"; you get a giant haystack of results that are not related to this.
Also, is there anything we can do to make an Android tablet see the WiSnap and connect to it?
Can anyone recommend a good resource where I can read up on WiFi? Again Google hasn't helped much; there are so many introductions to WiFi out there, most of them at a very simple level.
Thanks for any help you can give me.
EDIT: The vendor does claim Android compatibility for some models of WiSnap, but not for others.
This lists Android as supported: http://serialio.com/products/mobile/wifi/WiSnapKit2.php
This does not: http://serialio.com/products/mobile/wifi/WiSnapAAA.php
I guess I should contact the vendor, but I do want to understand what is going on, so I was hoping to get advice from the StackOverflow community about this.
EDIT: We did contact the vendor. What we found out is that the WiSnap can be a stand-alone device only in ad-hoc mode. If you set up a WiFi router or access point, the WiSnap will join the network in infrastructure mode. But the WiSnap will not act as an infrastructure mode access point.
Android OS at the moment only supports infrastructure mode. So, if we want to use an Android tablet with a WiSnap we would have to set up some sort of WiFi router or access point. We are looking into other solutions now.
I'm relatively sure that hpsetup is the ad hoc wifi for an HP wireless printer. So perhaps the ad-hoc/peer-to-peer qualifier is what causes OS X to classify it as a device.

How do I communicate with a GPIO USB device in OS X?

I have a USB web camera from ViMicro that contains a GPIO chip. We have a microswitch wired to one of the IO pins and can read the status of the switch on Windows using an ActiveX control that was provided by ViMicro, named exvmuvc.ax. I need to duplicate this functionality using IOKit on OS X.
USBTrace from SysNucleus displays the conversation happening between the Windows system and the USB device, but I cannot duplicate this on the Mac.
Does anyone know of a software USB sniffer, like USBTrace, that works on OS X so that I can compare the packets? Also, is anyone familiar with this particular camera chip and its GPIO subsystem, even on Linux?
You could use usbtracer from Xcode, or you can try using using USB Prober with a debug release of IOUSBFamily, this will most likely output more information than you actually want. You may want to look at qa1370 for more information.
In general though, I'd recommend you get a hardware USB analyzer, they make this sort of thing much easier.

Custom USB Driver for Windows? Mac?

I'd like to modify a USB driver to send and receive USB data over a network.
Take for example, an iMac and a PC. I have an iPod plugged in to my PC (in NY). I want my iMac (in LA) to recognize the iPod as plugged in to a local USB port and be able to communicate with the iPod.
Forget my qualifications, or lack thereof (I have background in web, iOS apps, I've toyed with Java and C).
Where can I get source code for a USB driver for Windows that I can modify? Mac OS?
Any tips or pointers towards accomplishing my goal would be appreciated as well.
It looks like folks are coming up with something close to what you want. If you do decide to roll your own, the USB driver source you asked for is libusb.
On the Mac OS X end, drivers are built up in a stack. What you want to do should be relatively simple (nothing is really simple in kernel land). You need to create a driver that can communicate over ethernet with the PC and looks like a USB device to the driver matching software. Then everything else will happen automatically.
The source code is available for Apple's USB stack. You should also read about the IOKit API and IOKit device driver guidelines and IOKit fundamentals.
Oh yes and you say you have toyed with Java and C. To write device drivers on OS X, you'll need to learn some C++.
I suggest you to go see USBIP project. This is available on Linux and Windows, but not clear for MAC. If you can get a VHCI-Controller driver installed for MAC, we can kick start USBIP for MAC.
Sounds quite like this product, a bit unsure if theirs works over wide-area networks though.
I have a general idea of how I'd go about it, but not any specifics. Basically, I'd use the platform's driver development kit to write a USB device emulator on the client machine. I'd then add a virtual device to that system called "Networked USB Host", or something similar that maintains an open port to listen for communication from the server and passes it on to your virtual USB device. IIRC, the Windows DDK comes with a USB simulation framework that might be able to help you with this.
On the server, you'd have to hook into the USB subsystem to send raw USB packets to the client machine. libpcap and wireshark have USB capturing facilities for that, but I'm not sure if this works with winpcap and the Windows version of wireshark as well.
EDIT: Look at this for cross-platform USB capture alternatives.
You can buy OSR USB learning kit: https://www.osronline.com/custom.cfm?name=index_fullframeset.cfm&pageURL=https://www.osronline.com/store/index.cfm
This is actually small USB device with known interface. Windows Driver Kit (WDK) contains sample KMDF driver for this device: http://www.microsoft.com/whdc/driver/wdk/
This is good starting point to learn Windows Drivers development, and USB drivers development specifically. However, it is still far away from your problem solution.
Can't you use some sort of Remote Desktop?

Is there an alternative to RawInput in Mac OS X/Linux

I'm developing an application that runs on a machine that has several usb keyboards attached. Occasionally keyboards will added or removed. Each time a key is pressed, the application needs to find out which key was pressed, and which keyboard was used.
I have got a working version of the application which uses RawInput under windows. However windows can take a while to work out whats happened if you add or remove a hub or two full of keyboards, and I'm looking too see if the same can be achieved on a different OS more robustly.
Mac OS X/Cocoa would be the second choice if it is possible, but I am open to suggestions for any other platforms like linux if you can suggest a way to do it.
On Mac OS X, you can use the HID Manager to get direct visibility into which HID elements are being actuated on which devices.
That should work not just for keyboard but for all HID devices — mice, game pads, etc. — though of course you can restrict what your code pays attention to to only specific devices or devices of a specific class.
You'll need to be familiar with the concepts of USB device matching and USB Human Interface Device communication in general, but if you are then it should be fairly straightforward to get something up and running with the HID Manager on Mac OS X Leopard (10.5).

Resources