Differentiate multiple USB devices having same Vendor and Product ID - usb

I am writing an application which allows a Linux machine to connect to internet over usb modem. I have multiple usb modems having same vendor and product ID; I cannot differentiate them using lsusb which gives vendor and product ID. Also giving IDs according to their usb ports does not solve my problem either, because I want to be able to use usb modems in whichever port I want.
Is there a unique identifier which I can use to differentiate my usb devices?

Using serial numbers I differetiated my usb modems. Here in this site basic commands are shown.
http://wiki.openmoko.org/wiki/Hardware:AT_Commands#Section_5.2C_General_Commands
I used "ATE+CGSN" command which gives serial number of the device.

Related

NIC card and network adapters?

Hopefully I get answer to this question, not sure if this is the correct forum here.
I want to know do laptops (for example, dell, hp etc.) have ONLY ONE NIC card? If so, then how using this card are we able to connect to LAN cable, we are able to connect to WI-FI.
When I see the network adapters, there are many? So what is the relationship between NIC and these adapters?
Can anyone please help me understand this?
There is a NIC for each type (Cable, WiFi and Blutooth ...).
For example: In a PC, which normally comes with one NIC for cable only, you can buy a Wifi NIC to make it connect to WiFi networks.

Why can a SD card be read/write by both the phone and a computer

Some phones carry a SD card and can read/write files on it. If the phone is connected to a computer and placed in mass storage mode, the computer can also read/write files on the SD card as if it's a USB drive. So my question is, how can the computer access a peripheral that belongs to another device (the phone)?
To my understanding, there should be a physical switch in the phone that routes the data buses of the SD card to either the bus of the phone or the micro-USB port? Then there's also a driver that controls this switch? If so, where's such driver (in Android OS or iOS for examples)? If not, what's the mechanism to share this SD card?
Note that I'm not talking about MTP, but the mass storage class. I know that the phone and computer may not be able to access the SD card simultaneously - probably one at a time, depending on the status of USB connection. I'm interested in the mechanism to control/switch the access/connection to the SD card from two hosts.
Comments: The similar mechanism may be found in a mp3 player: when it's plugged into the computer, we can add/remove musics. The mp3 player cannot play musics until it's unplugged from the computer - at least mine is like this. Android OS should do the same but I can't find the related source codes.
To my understanding, there should be a physical switch
No, the switch is in the software.
what's the mechanism to share this SD card?
A piece of the software does the umount of the sdcard and connects
it as a USB Mass storage device to the PC - like a card reader would do.
The Linux kernel itself contains a driver that works as a USB mass storage device, but I don't know whether Android actually uses this.

Smartcard reader ACR122U has no unique serial number

I am using the PCSC driver and the javax.smartcardio library as the wrapper to the driver. I have 3 ACR122U devices plugged into a Linux (debian) system. I have ran udevadm info on the devices and they all have a serial number of 0. I need to identify which reader is which in my class. I can check which topological usb port is used by parsing the /sys/devices folder but I still cant "select" a device in the Java api.
Does anyone know a way to modify the PCSC device stack order or something. So that I can specify which order the devices are in the terminal list from the terminal factory. I have emailed ACS asking them why the serial numbers are 0 and if they can help me to modify it but I have had no reply.
Please let me know if anyone thinks they have a solution.
Thanks,
Mitch
The reader does have a unique serial number but it is only an external sticker and not on the readers internal EEPROM. Perhaps you can write the serial number to the reader somehow.

CoreBluetooth - get all devices connected to Bluetooth peripheral

Is there a way how to get list of all devices connected to the Bluetooth peripheral?
I want to connect to iBeacon and check if another iPhone is connected to it.
No, two reasons why not:
iBeacons are not connected to the iOS device, iBeacons are broadcast only and no back communication exist from the phone to the beacon.
Knowing details of other BT 4.0 Centrals connected to a Peripheral are not in line with the the privacy features of Bluetooth 4.0. iOS and other Centrals are are using resolvable private addresses, in order to avoid situation like you are describing.
#barbazoo is correct that you cannot do exactly what you are asking because iBeacons only transmit data -- they have no idea what devices see them.
You can accomplish something similar, however, if you have an app running on each of the iOS devices you mention, and you have a server where you can build a web service. The web service would expose two methods:
reportIBeaconVisible(iBeaconProximityUUID, iBeaconMajor, iBeaconMinor, myPhoneAdvertisingId)
queryVisiblePhones(iBeaconProximityUUID, iBeaconMajor, iBeaconMinor)
The app would report each iBeacon it sees using the first method, passing the iBeacon's identifiers, along with the phone's advertising identifier to the server.
The app could then use the second method to ask the server what other phones have seen the exact same iBeacon, which would return a list of phone advertising identifiers.
You'd have to have logic on the phone to only report data to the server at a reasonable frequency. You'd also need code on the server to automatically delete phone records in the list if the phones haven't reported seeing a beacon in a certain time interval.

How can I send/receive data to/from my samsung s3 to a (medical) device via an arduino board (wifi + usb)?

I am new to using arduino board. I will like to connect my samsung s3 to a medical device via a an ardunio board.
The first idea is to send/recieve data to/from the phone to the medica device via usb on an arduino board and the medical device recieve/send data from/to my phone via usb on the arduino board.
The second idea is send/recieve data to/from the phone to the medica device via WIFI on an arduino board via usb and the medical device recieve/send data from/to my phone via usb on the ardunio board.
Thanks for your proposed solutions.
All problems, including this one are best approached in increments. In this particular case, I assume you already have an arduino with a WiFi shield and a Samsung s3.
You don't mention the medical device or how it is programmed. But first, concentrate on how to get the Samsung to talk to your PC via wireless. In doing this you will learn a lot about how to write code for the Samsung and how to write code for a PC/Wireless connection. There are probably already sample applications that do this.
Next, identify how the arduino board will connected to the medical device and make the same connection from the arduino to your PC. Get this connection to work. I know there are many examples of how to do this.
Next, get the Samsung to talk just to the arduino board which maybe turns on an LED. Since you already learned how to code the Samsung to do wireless in the first step, then this step might be easy.
Next, connect the arduino to the PC and have the Arduino pass data back and forth between the PC and the Samsung.
After you have this "stack" of: Samsung <==> Arduino <==> PC working then consider what it would take to replace the PC with a medical device so that you have:
Samsung <==> Arduino <==> Medical Device
You can design your own series of incremental steps based on your more specific knowledge of the devices that you have. But the idea is the same, each step is something easy to do and easy to debug. But taking all the steps results in a complex system!
No one is able to do what you want on the first try (unless they have already developed the same or similar system). But everyone is capable of learning new material, if they are persistent.
Please keep me informed as you work on this, it is an interesting project!!