Getting Manufacturer Vendor ID for ADB - android

Is there any "universal" vendor ID that I can use so that ADB can detect my China-made Tablet? I can't find the vendor ID of the manufacturer. When I look into Device Manager in Windows the Vendor is a string and not a number. The device is a Cherry Mobile Fusion Bolt tablet.

Try this tool if you are on a windows machine- lsusb Link
If you are on a linux machine, you can run the lsusb command.
The tool is for windows platform. Run it while your tablet is connected through a USB. It may show your Vendor ID. If it does, you can try manually adding it to [USER_DIRECTORY] / .android / adb_usb.ini.

The vendor ID of the device can not be modified without replacing the software on the device (read a new AOSP installation). To use the Google driver, the Vendor ID of the product needs to be known.
Finding Vendor ID in Windows
Start Device Manager
In the Hardware tree, right-click the hardware entry for the device for which the Vendor ID is to be determined.
On the Details tab, set the property drop-down to be "Hardware Ids". The Vendor ID is the 4 character hexadecimal number following the letters VID_. In the case below, the Vendor ID is 18D1:
The PID_, which follows, is the Product ID. It also has a 4-digit hexadecimal number.

Related

How to access single USB devices of a Composite USB device?

I would like to send data from my Windows computer to my Android Mobile.
For this, I need to activate the Accessory mode of the Android device and the USB Host mode on the Windows device.
On my Windows computer, I have a USB Composite device for the Android Mobile. This Composite USB device bundles several interfaces: Enumeration of USB Composite Devices.
Unfortunately, I can't find information how I can access the single devices of a Composite device.
I want to get a device id / path, which I can open with CreateFile to use the created HANDLE for opening a WinUsb handle with WinUsb_Initialize.
But if I try to open a Composite USB device with CreateFile, I get a ERROR_NOT_ENOUGH_MEMORY result.
I'm using this code:
_deviceHandle = CreateFile(
deviceId, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_NONE, NULL,
OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL);
... with the filename "\?\USB#VID_04E8&PID_6864#RF8NB0NMT0X#{a5dcbf10-6530-11d2-901f-00c04fb951ed}"
It's a GUID_DEVINTERFACE_USB_DEVICE device id for a Samsung Galaxy mobile with enabled USB debugging.
As the driver Windows uses ssudbus2.sys, Version 2.17.16.0 (2021-09-14) from Samsung Electronics Co. Ltd.
The app MyPhoneExplorer can access to my mobile. So it a solution without a special driver must be possible.
How can I get this device id / path of the single USB devices inside a Composite USB device?
The filename you are using represents the overall USB device; it doesn't represent any particular instance. A filename that represents interface will have something like &mi_01 right after the product name, where 1 is the 0-based interface number.
You might be able to just insert the appropriate &mi_xx string into your filename at the appropriate place and get it work. I think you'd also need to modify the GUID at the end of the string, which is the device interface GUID.
The more standard way to find the filename in code is to use the SetupAPI and the configuration manager (CM) API to iterate through all the child devices of your USB device. Look for a child whose device instance ID (retrieved with CM_Get_Device_ID) contains MI_xx where xx is the two-digit interface number you are looking for.
It takes a lot of effort to write up this code in standalone form, and test it, and debug it, so I will not be presenting you with a working code example. Instead, I encourage you to look at the working code in the get_interface_composite function of libusbp which does what you need to do:
https://github.com/pololu/libusbp/blob/759f48d/src/windows/interface_windows.c#L86
There are some more steps to get the path of that device node. And then the code that actually calls CreateFile and WinUsb_Initialize is here:
https://github.com/pololu/libusbp/blob/759f48d/src/windows/generic_handle_windows.c#L56-L77

How to change usb number?

I'm going to let my GPS and 4G module worked.
My 4G module will using ttyACM0~5.
My GPS is using ttyACMX.
Here is the problem, 4G module need to be using on ttyACM0~5.
But if GPS power on first then it will take ttyACM0 and will cause my 4G module can't worked.
So I'm trying to let GPS tied on ttyACM6 when booting but I don't know how to do it.
Which driver should I modify or any other methods can get this worked?
if you have i.e. vendor id and product id of your GPS and 4G device you can assign static device nodes in linux using udev rules
this is described in https://unix.stackexchange.com/questions/66901/how-to-bind-usb-device-under-a-static-name and http://www.thelinuxdaily.com/2010/01/statically-assign-dev-nodes-to-hardware-devices-in-linux/
the name of the static device node can be chosen in the SYMLINK+="..." field
you can get vendor id and product id of your devices with lsusb or lsusb -v when your devices are plugged in ...

Android: get flash drive's mountpoint from USB enumeration point

I have a flash drive where I know its vendor ID and product ID.
By scanning through /sys/bus/usb/devices, I can reliably find the enumeration point for the root device (e.g. /sys/bus/usb/devices/3-1) and the enumeration point for the mass storage device (e.g. /sys/bus/usb/devices/3-1:1.0).
Once I know the two enumeration points, how do I use these to lookup the mountpoint (e.g. /mnt/usb0/part0 or /mnt/UsbStorageA)?
--
Alternatively, is there a direct way to get the mountpoint from the vendor ID and product ID?
--
EDIT 1 (more details on my progress):
Ok so (working backward from the mountpoint):
mountpoint: /storage/usb0/part0 (according to /proc/mount)
device node: /dev/block/vold/8:1 (according to /proc/mount)
partition name sda1 (according to /proc/partitions)
But I can't seem to correlate into /sys/block, because there is no sda1 entry in /sys/block, and neither is there any 8:1 entry in /sys/dev/block. Instead, bizarrely, the USB device is in /sys/dev/char, as 189:261. Why the heck would it appear as a char device but not a block device? :-(

How to get Vendor ID of an Android-powered device via adb?

I have a problem with how to get vendor ID and product ID of an Android-powered device.
Are there any commands of adb that can do this?
I can get vendor id and product id while device inserted, but after installing windows drivers, I could not tell apart the real vendor id if I insert two devices at on time. So I need to find out the vendor ID via ADB or any other connections between the hardware device and the android device.
If you are running Ubuntu/Linux Just Key in
lsusb -v
and press enter.
It will bring out details of all USB devices.
Check for a field called "idVendor" in the results and find your device.
Eg: My Motorola Defy[vendor id = 22b8] gives,
" idVendor 0x22b8 Motorola PCS"
i don't know whether you got the solution but connecting my phone via USB cable to my computer and typing the below line of code on ubuntu terminal i was able to get Vendor ID
lsusb
For example, if you had a Nexus One connected you would get:
Bus 002 Device 004: ID 18d1:4e12
In this case the Vendor Id is “18d1″ and the Product ID is “4e12″. (we are interested in vendor id of course)
ADB itself will not help find the Vendor ID of a connected piece of hardware, indeed (for the Google ADB driver) it's necessary to have the Vendor ID set up in advance of it working with ADB.
Fortunately, there's an easy way to find the Vendor ID (and Product ID) of any device connected to a Windows PC. The device doesn't even need drivers for this approach to work:
Start Device Manager
In the Hardware tree, right-click the hardware entry for the device for which the Vendor ID is to be determined.
On the Details tab, set the property drop-down to be "Hardware Ids". The Vendor ID is the 4 character hexadecimal number following the letters VID_. In the case below, the Vendor ID is 18D1:
The PID_, which follows, is the Product ID. It also has a 4-digit hexadecimal number.
if you want to get in your android application you can use following code
UsbManager manager = (UsbManager) getSystemService(Context.USB_SERVICE);
HashMap<String, UsbDevice> deviceList = manager.getDeviceList();
Iterator<UsbDevice> deviceIterator = deviceList.values().iterator();
while (deviceIterator.hasNext()) {
UsbDevice device = deviceIterator.next();
Log.e("DB", gson.toJson(device));
}
Hope this link help you
-s serialNumber is the adb command that give you a specific emulator/device instance, referred to by its adb-assigned serial number (such as "emulator-5556").I think this is the adb command that you are looking for.

Smart Phone & Tablet - Plugged Into Computer

Is there a way to determine if a smart phone or tablet (iOS or Android), is plugged into a computer?
Either the phone/tablet perspective (i.e. isConnectedToComputer) or the computer perspective (i.e. connectedDevices) would be fine.
If it's from the computer perspective, it would specifically have to be via a Mac OS X app.
If it's from the phone/tablet perspective, it would need to be differentiated from simply charging.
The general idea is to determine when a user is at their computer.
Note: In order to make this determination, I need to identify the device. For iOS, the device UUID (similar to that used in APNS) is used. In Android, a combination hardware and software IDs are combined. So if the solution in from the computer perspective, I need to be able to obtain these strings. Otherwise, I need to be able to pass them to the computer.
Bonus: It would be fantastic if Wi-Fi syncing could also be taken into account as "connected".
Simple Solution
Consider using system_profiler SPUSBDataType through NSTask.
When my iPhone is connected the following is included in the result:
iPhone:
Product ID: 0x1292
Vendor ID: 0x05ac (Apple Inc.)
Version: 0.01
Serial Number:
Speed: Up to 480 Mb/sec
Manufacturer: Apple Inc.
Location ID: 0xfa140000 / 6
Current Available (mA): 500
Current Required (mA): 500
Extra Operating Current (mA): 500
Use system_profiler SPUSBDataType -xml to output the result in XML format:
<dict>
<key>_name</key>
<string>iPhone</string>
<key>a_product_id</key>
<string>0x1292</string>
<key>b_vendor_id</key>
<string>apple_vendor_id</string>
<key>c_bcd_device</key>
<string> 0.01</string>
<key>d_serial_num</key>
<string></string>
<key>e_device_speed</key>
<string>high_speed</string>
<key>f_manufacturer</key>
<string>Apple Inc.</string>
<key>g_location_id</key>
<string>0xfa140000 / 6</string>
<key>h_bus_power</key>
<string>500</string>
<key>j_bus_power_used</key>
<string>500</string>
<key>k_extra_current_used</key>
<string>500</string>
</dict>
Simply parse the XML to determine wether the device of interest is connected or not.

Categories

Resources