diff options
| author | Stefan Hilzinger <hilzinger@google.com> | 2010-04-26 10:17:43 +0100 |
|---|---|---|
| committer | Mike Lockwood <lockwood@android.com> | 2010-05-24 11:27:16 -0400 |
| commit | d9d1ca47802395e9e42e7deb05b2683d9d306598 (patch) | |
| tree | 0348632d9b50780523673122638617cf38b24250 /adb/adb.h | |
| parent | 5762ec29056936decf23b498724cd38d4a702edc (diff) | |
| download | system_core-d9d1ca47802395e9e42e7deb05b2683d9d306598.tar.gz system_core-d9d1ca47802395e9e42e7deb05b2683d9d306598.tar.bz2 system_core-d9d1ca47802395e9e42e7deb05b2683d9d306598.zip | |
Let "adb connect" connect to emulators too
- adb can now connect to an emulator configured with an arbitrary
pair of <console port, adb port>. These two ports do not have to be
adjacent.
This can be done from the commandline at any time using
adb connect emu:<console_port>,<adb_port>
- Emulators running on ports outside the normal range
(5554/5555-5584/5585) register themselves on startup if they follow
the convention "console port+1==abd port".
- Emulators outside the normal port range will not be auto-detected on
adb startup as these ports are not probed.
- The index into local_transports[] array in transport_local.c does no
longer indicate the port number of the local transport. Use the altered
atransport struct to get the port number.
- I have chosen not to document the adb connect emu:console_port,adb_port
syntax on adb's help screen as this might be confusing to most readers
and useful to very few.
- I don't expect this to introduce any (backwards) compatibility issues.
Change-Id: Iad3eccb2dcdde174b24ef0644d705ecfbff6e59d
Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'adb/adb.h')
| -rw-r--r-- | adb/adb.h | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -183,6 +183,7 @@ struct atransport /* used to identify transports for clients */ char *serial; char *product; + int adb_port; // Use for emulators (local transport) /* a list of adisconnect callbacks called when the transport is kicked */ int kicked; @@ -262,6 +263,9 @@ void run_transport_disconnects( atransport* t ); void kick_transport( atransport* t ); /* initialize a transport object's func pointers and state */ +#if ADB_HOST +int get_available_local_transport_index(); +#endif int init_socket_transport(atransport *t, int s, int port, int local); void init_usb_transport(atransport *t, usb_handle *usb, int state); @@ -280,6 +284,9 @@ void register_usb_transport(usb_handle *h, const char *serial, unsigned writeabl void unregister_usb_transport(usb_handle *usb); atransport *find_transport(const char *serial); +#if ADB_HOST +atransport* find_emulator_transport_by_adb_port(int adb_port); +#endif int service_to_fd(const char *name); #if ADB_HOST @@ -368,6 +375,7 @@ typedef enum { void local_init(int port); int local_connect(int port); +int local_connect_arbitrary_ports(int console_port, int adb_port); /* usb host/client interface */ void usb_init(); |
