diff options
author | Dan Albert <danalbert@google.com> | 2015-05-18 16:43:57 -0700 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2015-05-18 17:10:33 -0700 |
commit | dcd78a15d0be143d48fc93af6a9fa5748dbf9790 (patch) | |
tree | da8b2b52321d95c84f3285ab07f2a03a88709cd2 /adb/adb.h | |
parent | 917b455ee78949701d2ee0ec72d9cdb44329d028 (diff) | |
download | system_core-dcd78a15d0be143d48fc93af6a9fa5748dbf9790.tar.gz system_core-dcd78a15d0be143d48fc93af6a9fa5748dbf9790.tar.bz2 system_core-dcd78a15d0be143d48fc93af6a9fa5748dbf9790.zip |
Make connection states a proper type.
Change-Id: I809f9b327c832b88dd63151bf7dcb012d88e81c4
Diffstat (limited to 'adb/adb.h')
-rw-r--r-- | adb/adb.h | 26 |
1 files changed, 14 insertions, 12 deletions
@@ -170,6 +170,18 @@ enum TransportType { #define TOKEN_SIZE 20 +enum ConnectionState { + kCsAny = -1, + kCsOffline = 0, + kCsBootloader, + kCsDevice, + kCsHost, + kCsRecovery, + kCsNoPerm, // Insufficient permissions to communicate with the device. + kCsSideload, + kCsUnauthorized, +}; + struct atransport { atransport *next; @@ -266,7 +278,7 @@ int adb_main(int is_daemon, int server_port); 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); +void init_usb_transport(atransport *t, usb_handle *usb, ConnectionState state); #if ADB_HOST atransport* find_emulator_transport_by_adb_port(int adb_port); @@ -336,17 +348,7 @@ int is_adb_interface(int vid, int pid, int usb_class, int usb_subclass, int usb_ int adb_commandline(int argc, const char **argv); -int connection_state(atransport *t); - -#define CS_ANY -1 -#define CS_OFFLINE 0 -#define CS_BOOTLOADER 1 -#define CS_DEVICE 2 -#define CS_HOST 3 -#define CS_RECOVERY 4 -#define CS_NOPERM 5 /* Insufficient permissions to communicate with the device */ -#define CS_SIDELOAD 6 -#define CS_UNAUTHORIZED 7 +ConnectionState connection_state(atransport *t); extern const char *adb_device_banner; extern int HOST; |