| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 1 | /* | 
|  | 2 | * Copyright (C) 2007 The Android Open Source Project | 
|  | 3 | * | 
|  | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | 
|  | 5 | * you may not use this file except in compliance with the License. | 
|  | 6 | * You may obtain a copy of the License at | 
|  | 7 | * | 
|  | 8 | *      http://www.apache.org/licenses/LICENSE-2.0 | 
|  | 9 | * | 
|  | 10 | * Unless required by applicable law or agreed to in writing, software | 
|  | 11 | * distributed under the License is distributed on an "AS IS" BASIS, | 
|  | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
|  | 13 | * See the License for the specific language governing permissions and | 
|  | 14 | * limitations under the License. | 
|  | 15 | */ | 
|  | 16 |  | 
|  | 17 | #ifndef __ADB_H | 
|  | 18 | #define __ADB_H | 
|  | 19 |  | 
|  | 20 | #include <limits.h> | 
| Josh Gao | 06d61d4 | 2016-10-06 13:31:44 -0700 | [diff] [blame] | 21 | #include <stdint.h> | 
| Dan Albert | 7664901 | 2015-02-24 15:51:19 -0800 | [diff] [blame] | 22 | #include <sys/types.h> | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 23 |  | 
| Elliott Hughes | 381cfa9 | 2015-07-23 17:12:58 -0700 | [diff] [blame] | 24 | #include <string> | 
|  | 25 |  | 
| Elliott Hughes | 4f71319 | 2015-12-04 22:00:26 -0800 | [diff] [blame] | 26 | #include <android-base/macros.h> | 
| Dan Albert | 1792c23 | 2015-05-18 13:06:53 -0700 | [diff] [blame] | 27 |  | 
| leozwang | d3fc15f | 2014-07-29 12:50:02 -0700 | [diff] [blame] | 28 | #include "adb_trace.h" | 
| Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 29 | #include "fdevent.h" | 
| Yabin Cui | c1b1f6f | 2015-09-15 16:27:09 -0700 | [diff] [blame] | 30 | #include "socket.h" | 
| Josh Gao | 1c70e1b | 2016-09-28 12:32:45 -0700 | [diff] [blame] | 31 | #include "usb.h" | 
| JP Abgrall | 408fa57 | 2011-03-16 15:57:42 -0700 | [diff] [blame] | 32 |  | 
| Tamas Berghammer | 3d2904c | 2015-07-13 19:12:28 +0100 | [diff] [blame] | 33 | constexpr size_t MAX_PAYLOAD_V1 = 4 * 1024; | 
| Jerry Zhang | ecee434 | 2017-07-18 14:07:57 -0700 | [diff] [blame] | 34 | constexpr size_t MAX_PAYLOAD = 1024 * 1024; | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 35 |  | 
| Jerry Zhang | 2f8c60b | 2017-02-10 17:45:27 -0800 | [diff] [blame] | 36 | constexpr size_t LINUX_MAX_SOCKET_SIZE = 4194304; | 
|  | 37 |  | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 38 | #define A_SYNC 0x434e5953 | 
|  | 39 | #define A_CNXN 0x4e584e43 | 
|  | 40 | #define A_OPEN 0x4e45504f | 
|  | 41 | #define A_OKAY 0x59414b4f | 
|  | 42 | #define A_CLSE 0x45534c43 | 
|  | 43 | #define A_WRTE 0x45545257 | 
| Benoit Goby | d5fcafa | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 44 | #define A_AUTH 0x48545541 | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 45 |  | 
| Dan Albert | 7664901 | 2015-02-24 15:51:19 -0800 | [diff] [blame] | 46 | // ADB protocol version. | 
| Tim Murray | de47194 | 2017-12-07 11:40:00 -0800 | [diff] [blame] | 47 | // Version revision: | 
|  | 48 | // 0x01000000: original | 
|  | 49 | // 0x01000001: skip checksum (Dec 2017) | 
|  | 50 | #define A_VERSION_MIN 0x01000000 | 
|  | 51 | #define A_VERSION_SKIP_CHECKSUM 0x01000001 | 
|  | 52 | #define A_VERSION 0x01000001 | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 53 |  | 
| Dan Albert | 7664901 | 2015-02-24 15:51:19 -0800 | [diff] [blame] | 54 | // Used for help/version information. | 
|  | 55 | #define ADB_VERSION_MAJOR 1 | 
|  | 56 | #define ADB_VERSION_MINOR 0 | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 57 |  | 
| Elliott Hughes | 42ae260 | 2015-08-12 08:32:10 -0700 | [diff] [blame] | 58 | std::string adb_version(); | 
|  | 59 |  | 
| Dan Albert | 7664901 | 2015-02-24 15:51:19 -0800 | [diff] [blame] | 60 | // Increment this when we want to force users to start a new adb server. | 
| Tim Murray | de47194 | 2017-12-07 11:40:00 -0800 | [diff] [blame] | 61 | #define ADB_SERVER_VERSION 40 | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 62 |  | 
| Josh Gao | b122b17 | 2017-08-16 16:57:01 -0700 | [diff] [blame] | 63 | using TransportId = uint64_t; | 
| Dan Albert | c7915a3 | 2015-05-18 16:46:31 -0700 | [diff] [blame] | 64 | class atransport; | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 65 |  | 
|  | 66 | struct amessage { | 
| Josh Gao | 06d61d4 | 2016-10-06 13:31:44 -0700 | [diff] [blame] | 67 | uint32_t command;     /* command identifier constant      */ | 
|  | 68 | uint32_t arg0;        /* first argument                   */ | 
|  | 69 | uint32_t arg1;        /* second argument                  */ | 
|  | 70 | uint32_t data_length; /* length of payload (0 is allowed) */ | 
|  | 71 | uint32_t data_check;  /* checksum of data payload         */ | 
|  | 72 | uint32_t magic;       /* command ^ 0xffffffff             */ | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 73 | }; | 
|  | 74 |  | 
| Mark Salyzyn | 0a78cc1 | 2017-10-04 15:05:40 -0700 | [diff] [blame] | 75 | struct apacket { | 
|  | 76 | apacket* next; | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 77 |  | 
| Josh Gao | 06d61d4 | 2016-10-06 13:31:44 -0700 | [diff] [blame] | 78 | size_t len; | 
|  | 79 | char* ptr; | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 80 |  | 
|  | 81 | amessage msg; | 
| Josh Gao | 06d61d4 | 2016-10-06 13:31:44 -0700 | [diff] [blame] | 82 | char data[MAX_PAYLOAD]; | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 83 | }; | 
|  | 84 |  | 
| Josh Gao | 06d61d4 | 2016-10-06 13:31:44 -0700 | [diff] [blame] | 85 | uint32_t calculate_apacket_checksum(const apacket* packet); | 
|  | 86 |  | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 87 | /* the adisconnect structure is used to record a callback that | 
|  | 88 | ** will be called whenever a transport is disconnected (e.g. by the user) | 
|  | 89 | ** this should be used to cleanup objects that depend on the | 
|  | 90 | ** transport (e.g. remote sockets, listeners, etc...) | 
|  | 91 | */ | 
| Mark Salyzyn | 0a78cc1 | 2017-10-04 15:05:40 -0700 | [diff] [blame] | 92 | struct adisconnect { | 
|  | 93 | void (*func)(void* opaque, atransport* t); | 
|  | 94 | void* opaque; | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 95 | }; | 
|  | 96 |  | 
| Dan Albert | c7915a3 | 2015-05-18 16:46:31 -0700 | [diff] [blame] | 97 | // A transport object models the connection to a remote device or emulator there | 
|  | 98 | // is one transport per connected device/emulator. A "local transport" connects | 
|  | 99 | // through TCP (for the emulator), while a "usb transport" through USB (for real | 
|  | 100 | // devices). | 
|  | 101 | // | 
|  | 102 | // Note that kTransportHost doesn't really correspond to a real transport | 
|  | 103 | // object, it's a special value used to indicate that a client wants to connect | 
|  | 104 | // to a service implemented within the ADB server itself. | 
| Elliott Hughes | 3bd73c1 | 2015-05-05 13:10:43 -0700 | [diff] [blame] | 105 | enum TransportType { | 
| Dan Albert | c7915a3 | 2015-05-18 16:46:31 -0700 | [diff] [blame] | 106 | kTransportUsb, | 
|  | 107 | kTransportLocal, | 
|  | 108 | kTransportAny, | 
|  | 109 | kTransportHost, | 
| Elliott Hughes | 2d4121c | 2015-04-17 09:47:42 -0700 | [diff] [blame] | 110 | }; | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 111 |  | 
| Benoit Goby | d5fcafa | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 112 | #define TOKEN_SIZE 20 | 
|  | 113 |  | 
| Dan Albert | dcd78a1 | 2015-05-18 16:43:57 -0700 | [diff] [blame] | 114 | enum ConnectionState { | 
|  | 115 | kCsAny = -1, | 
|  | 116 | kCsOffline = 0, | 
|  | 117 | kCsBootloader, | 
|  | 118 | kCsDevice, | 
|  | 119 | kCsHost, | 
|  | 120 | kCsRecovery, | 
|  | 121 | kCsNoPerm,  // Insufficient permissions to communicate with the device. | 
|  | 122 | kCsSideload, | 
|  | 123 | kCsUnauthorized, | 
|  | 124 | }; | 
|  | 125 |  | 
| Mark Salyzyn | 0a78cc1 | 2017-10-04 15:05:40 -0700 | [diff] [blame] | 126 | void print_packet(const char* label, apacket* p); | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 127 |  | 
| Josh Gao | 56e9bb9 | 2016-01-15 15:17:37 -0800 | [diff] [blame] | 128 | // These use the system (v)fprintf, not the adb prefixed ones defined in sysdeps.h, so they | 
|  | 129 | // shouldn't be tagged with ADB_FORMAT_ARCHETYPE. | 
|  | 130 | void fatal(const char* fmt, ...) __attribute__((noreturn, format(__printf__, 1, 2))); | 
|  | 131 | void fatal_errno(const char* fmt, ...) __attribute__((noreturn, format(__printf__, 1, 2))); | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 132 |  | 
| Mark Salyzyn | 0a78cc1 | 2017-10-04 15:05:40 -0700 | [diff] [blame] | 133 | void handle_packet(apacket* p, atransport* t); | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 134 |  | 
| Josh Gao | 9c869b5 | 2016-08-25 16:00:22 -0700 | [diff] [blame] | 135 | int launch_server(const std::string& socket_spec); | 
|  | 136 | int adb_server_main(int is_daemon, const std::string& socket_spec, int ack_reply_fd); | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 137 |  | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 138 | /* initialize a transport object's func pointers and state */ | 
| Stefan Hilzinger | d9d1ca4 | 2010-04-26 10:17:43 +0100 | [diff] [blame] | 139 | #if ADB_HOST | 
|  | 140 | int get_available_local_transport_index(); | 
|  | 141 | #endif | 
| Mark Salyzyn | 0a78cc1 | 2017-10-04 15:05:40 -0700 | [diff] [blame] | 142 | int init_socket_transport(atransport* t, int s, int port, int local); | 
| Yabin Cui | b5e1141 | 2017-03-10 16:01:01 -0800 | [diff] [blame] | 143 | void init_usb_transport(atransport* t, usb_handle* usb); | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 144 |  | 
| Lingfeng Yang | 1197952 | 2016-10-06 12:22:55 -0700 | [diff] [blame] | 145 | std::string getEmulatorSerialString(int console_port); | 
| Stefan Hilzinger | d9d1ca4 | 2010-04-26 10:17:43 +0100 | [diff] [blame] | 146 | #if ADB_HOST | 
|  | 147 | atransport* find_emulator_transport_by_adb_port(int adb_port); | 
| Lingfeng Yang | 1197952 | 2016-10-06 12:22:55 -0700 | [diff] [blame] | 148 | atransport* find_emulator_transport_by_console_port(int console_port); | 
| Stefan Hilzinger | d9d1ca4 | 2010-04-26 10:17:43 +0100 | [diff] [blame] | 149 | #endif | 
| Mike Lockwood | 74d7ff8 | 2009-10-11 23:04:18 -0400 | [diff] [blame] | 150 |  | 
| David Pursell | 0955c66 | 2015-08-31 10:42:13 -0700 | [diff] [blame] | 151 | int service_to_fd(const char* name, const atransport* transport); | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 152 | #if ADB_HOST | 
| Josh Gao | b122b17 | 2017-08-16 16:57:01 -0700 | [diff] [blame] | 153 | asocket* host_service_to_socket(const char* name, const char* serial, TransportId transport_id); | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 154 | #endif | 
|  | 155 |  | 
|  | 156 | #if !ADB_HOST | 
| Mark Salyzyn | 0a78cc1 | 2017-10-04 15:05:40 -0700 | [diff] [blame] | 157 | int init_jdwp(void); | 
|  | 158 | asocket* create_jdwp_service_socket(); | 
|  | 159 | asocket* create_jdwp_tracker_service_socket(); | 
|  | 160 | int create_jdwp_connection_fd(int jdwp_pid); | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 161 | #endif | 
|  | 162 |  | 
| Josh Gao | b122b17 | 2017-08-16 16:57:01 -0700 | [diff] [blame] | 163 | int handle_forward_request(const char* service, TransportType type, const char* serial, | 
|  | 164 | TransportId transport_id, int reply_fd); | 
| David 'Digit' Turner | 2525869 | 2013-03-21 21:07:42 +0100 | [diff] [blame] | 165 |  | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 166 | #if !ADB_HOST | 
| Mark Salyzyn | 0a78cc1 | 2017-10-04 15:05:40 -0700 | [diff] [blame] | 167 | void framebuffer_service(int fd, void* cookie); | 
| Paul Lawrence | 982089d | 2014-12-03 15:31:57 -0800 | [diff] [blame] | 168 | void set_verity_enabled_state_service(int fd, void* cookie); | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 169 | #endif | 
|  | 170 |  | 
|  | 171 | /* packet allocator */ | 
| Mark Salyzyn | 0a78cc1 | 2017-10-04 15:05:40 -0700 | [diff] [blame] | 172 | apacket* get_apacket(void); | 
|  | 173 | void put_apacket(apacket* p); | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 174 |  | 
| leozwang | cbf0267 | 2014-08-15 09:51:27 -0700 | [diff] [blame] | 175 | // Define it if you want to dump packets. | 
|  | 176 | #define DEBUG_PACKETS 0 | 
|  | 177 |  | 
| Benoit Goby | d5fcafa | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 178 | #if !DEBUG_PACKETS | 
| Mark Salyzyn | 0a78cc1 | 2017-10-04 15:05:40 -0700 | [diff] [blame] | 179 | #define print_packet(tag, p) \ | 
|  | 180 | do {                     \ | 
|  | 181 | } while (0) | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 182 | #endif | 
|  | 183 |  | 
| John Michelau | c318833 | 2010-09-23 17:08:34 -0500 | [diff] [blame] | 184 | #if ADB_HOST_ON_TARGET | 
|  | 185 | /* adb and adbd are coexisting on the target, so use 5038 for adb | 
|  | 186 | * to avoid conflicting with adbd's usage of 5037 | 
|  | 187 | */ | 
| Mark Salyzyn | 0a78cc1 | 2017-10-04 15:05:40 -0700 | [diff] [blame] | 188 | #define DEFAULT_ADB_PORT 5038 | 
| John Michelau | c318833 | 2010-09-23 17:08:34 -0500 | [diff] [blame] | 189 | #else | 
| Mark Salyzyn | 0a78cc1 | 2017-10-04 15:05:40 -0700 | [diff] [blame] | 190 | #define DEFAULT_ADB_PORT 5037 | 
| John Michelau | c318833 | 2010-09-23 17:08:34 -0500 | [diff] [blame] | 191 | #endif | 
|  | 192 |  | 
| Stefan Hilzinger | a84a42e | 2010-04-19 12:21:12 +0100 | [diff] [blame] | 193 | #define DEFAULT_ADB_LOCAL_TRANSPORT_PORT 5555 | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 194 |  | 
| Mark Salyzyn | 0a78cc1 | 2017-10-04 15:05:40 -0700 | [diff] [blame] | 195 | #define ADB_CLASS 0xff | 
|  | 196 | #define ADB_SUBCLASS 0x42 | 
|  | 197 | #define ADB_PROTOCOL 0x1 | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 198 |  | 
| Mike Lockwood | cef31a0 | 2009-08-26 12:50:22 -0700 | [diff] [blame] | 199 | void local_init(int port); | 
| Yabin Cui | b74c649 | 2016-04-29 16:53:52 -0700 | [diff] [blame] | 200 | bool local_connect(int port); | 
| Mark Salyzyn | 0a78cc1 | 2017-10-04 15:05:40 -0700 | [diff] [blame] | 201 | int local_connect_arbitrary_ports(int console_port, int adb_port, std::string* error); | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 202 |  | 
| Mark Salyzyn | 0a78cc1 | 2017-10-04 15:05:40 -0700 | [diff] [blame] | 203 | ConnectionState connection_state(atransport* t); | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 204 |  | 
| Dan Albert | 1792c23 | 2015-05-18 13:06:53 -0700 | [diff] [blame] | 205 | extern const char* adb_device_banner; | 
|  | 206 |  | 
| Alex Vallée | 947cb3e | 2015-07-17 15:30:59 -0400 | [diff] [blame] | 207 | #if !ADB_HOST | 
| JP Abgrall | 408fa57 | 2011-03-16 15:57:42 -0700 | [diff] [blame] | 208 | extern int SHELL_EXIT_NOTIFY_FD; | 
| Mark Salyzyn | 0a78cc1 | 2017-10-04 15:05:40 -0700 | [diff] [blame] | 209 | #endif  // !ADB_HOST | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 210 |  | 
| Mark Salyzyn | 0a78cc1 | 2017-10-04 15:05:40 -0700 | [diff] [blame] | 211 | #define CHUNK_SIZE (64 * 1024) | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 212 |  | 
| Andrzej Pietrasiewicz | fd96db1 | 2012-01-13 15:13:46 +0100 | [diff] [blame] | 213 | #if !ADB_HOST | 
| Mark Salyzyn | 0a78cc1 | 2017-10-04 15:05:40 -0700 | [diff] [blame] | 214 | #define USB_FFS_ADB_PATH "/dev/usb-ffs/adb/" | 
|  | 215 | #define USB_FFS_ADB_EP(x) USB_FFS_ADB_PATH #x | 
| Andrzej Pietrasiewicz | fd96db1 | 2012-01-13 15:13:46 +0100 | [diff] [blame] | 216 |  | 
| Mark Salyzyn | 0a78cc1 | 2017-10-04 15:05:40 -0700 | [diff] [blame] | 217 | #define USB_FFS_ADB_EP0 USB_FFS_ADB_EP(ep0) | 
|  | 218 | #define USB_FFS_ADB_OUT USB_FFS_ADB_EP(ep1) | 
|  | 219 | #define USB_FFS_ADB_IN USB_FFS_ADB_EP(ep2) | 
| Andrzej Pietrasiewicz | fd96db1 | 2012-01-13 15:13:46 +0100 | [diff] [blame] | 220 | #endif | 
|  | 221 |  | 
| Josh Gao | b122b17 | 2017-08-16 16:57:01 -0700 | [diff] [blame] | 222 | int handle_host_request(const char* service, TransportType type, const char* serial, | 
|  | 223 | TransportId transport_id, int reply_fd, asocket* s); | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 224 |  | 
| Mark Salyzyn | 0a78cc1 | 2017-10-04 15:05:40 -0700 | [diff] [blame] | 225 | void handle_online(atransport* t); | 
|  | 226 | void handle_offline(atransport* t); | 
| Dan Albert | ba3a251 | 2015-02-18 17:47:33 -0800 | [diff] [blame] | 227 |  | 
| Mark Salyzyn | 0a78cc1 | 2017-10-04 15:05:40 -0700 | [diff] [blame] | 228 | void send_connect(atransport* t); | 
| Dan Albert | ba3a251 | 2015-02-18 17:47:33 -0800 | [diff] [blame] | 229 |  | 
| Dan Albert | 1792c23 | 2015-05-18 13:06:53 -0700 | [diff] [blame] | 230 | void parse_banner(const std::string&, atransport* t); | 
|  | 231 |  | 
| Josh Gao | fd713e5 | 2017-05-03 22:37:10 -0700 | [diff] [blame] | 232 | // On startup, the adb server needs to wait until all of the connected devices are ready. | 
|  | 233 | // To do this, we need to know when the scan has identified all of the potential new transports, and | 
|  | 234 | // when each transport becomes ready. | 
|  | 235 | // TODO: Do this for mDNS as well, instead of just USB? | 
|  | 236 |  | 
|  | 237 | // We've found all of the transports we potentially care about. | 
|  | 238 | void adb_notify_device_scan_complete(); | 
|  | 239 |  | 
|  | 240 | // One or more transports have changed status, check to see if we're ready. | 
|  | 241 | void update_transport_status(); | 
|  | 242 |  | 
|  | 243 | // Wait until device scan has completed and every transport is ready, or a timeout elapses. | 
|  | 244 | void adb_wait_for_device_initialization(); | 
|  | 245 |  | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 246 | #endif |