aboutsummaryrefslogtreecommitdiffstats
path: root/adb/adb.h
diff options
context:
space:
mode:
authorScott Anderson <saa@android.com>2012-04-20 11:21:14 -0700
committerScott Anderson <saa@android.com>2012-04-20 11:21:14 -0700
commite109d266c12c5f537d429ca4b892f2719e02c2da (patch)
tree61222590bc0f380f6c46bf922db48772e04ab3a1 /adb/adb.h
parent5383476727659544875b90d49a5371886a31c1fe (diff)
downloadsystem_core-e109d266c12c5f537d429ca4b892f2719e02c2da.tar.gz
system_core-e109d266c12c5f537d429ca4b892f2719e02c2da.tar.bz2
system_core-e109d266c12c5f537d429ca4b892f2719e02c2da.zip
adb: Add ability to specify device path
For manufacturing and testing, there is a need to talk to whatever device is connected to a given port on the host. This change modifies adb's "-s" option to take either a serial number or a device path. The device paths of the connected devices can be listed using "adb devices -l" whose output will resemble: List of devices attached 016B75D60A00600D usb:2-5 device 3031D0B2E71D00EC usb:1-4.3 device The second column lists the device paths. If the -l option is not given, the output from "adb devices" will be the same as it used to be (i.e. the paths will not be printed). The device path can also be obtained with the get-devpath command: $adb -s 3031D0B2E71D00EC get-devpath usb:1-4.3 Note that the format of the device paths are platform dependent. The example above is from Linux. On OS-X, the paths will be "usb:" followed by hex digits. For other platforms, the device paths will be printed as "????????????" and the -s option will not be able to select a device until someone implements the underlying functionality. Change-Id: I057d5d9f8c5bb72eddf5b8088aae110763f809d7 Signed-off-by: Scott Anderson <saa@android.com>
Diffstat (limited to 'adb/adb.h')
-rw-r--r--adb/adb.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/adb/adb.h b/adb/adb.h
index ac31f11c..b99d7ac8 100644
--- a/adb/adb.h
+++ b/adb/adb.h
@@ -185,6 +185,7 @@ struct atransport
/* used to identify transports for clients */
char *serial;
char *product;
+ char *devpath;
int adb_port; // Use for emulators (local transport)
/* a list of adisconnect callbacks called when the transport is kicked */
@@ -248,7 +249,7 @@ int adb_main(int is_daemon, int server_port);
** get_device_transport does an acquire on your behalf before returning
*/
void init_transport_registration(void);
-int list_transports(char *buf, size_t bufsize);
+int list_transports(char *buf, size_t bufsize, int show_devpath);
void update_transports(void);
asocket* create_device_tracker(void);
@@ -281,7 +282,7 @@ void register_socket_transport(int s, const char *serial, int port, int local);
void unregister_transport(atransport *t);
void unregister_all_tcp_transports();
-void register_usb_transport(usb_handle *h, const char *serial, unsigned writeable);
+void register_usb_transport(usb_handle *h, const char *serial, const char *devpath, unsigned writeable);
/* this should only be used for transports with connection_state == CS_NOPERM */
void unregister_usb_transport(usb_handle *usb);