diff options
Diffstat (limited to 'adb/adb.h')
-rw-r--r-- | adb/adb.h | 54 |
1 files changed, 8 insertions, 46 deletions
@@ -18,10 +18,10 @@ #define __ADB_H #include <limits.h> +#include <sys/types.h> #include "adb_trace.h" #include "fdevent.h" -#include "transport.h" /* readx(), writex() */ #ifdef __cplusplus extern "C" { @@ -37,12 +37,15 @@ extern "C" { #define A_WRTE 0x45545257 #define A_AUTH 0x48545541 -#define A_VERSION 0x01000000 // ADB protocol version +// ADB protocol version. +#define A_VERSION 0x01000000 -#define ADB_VERSION_MAJOR 1 // Used for help/version information -#define ADB_VERSION_MINOR 0 // Used for help/version information +// Used for help/version information. +#define ADB_VERSION_MAJOR 1 +#define ADB_VERSION_MINOR 0 -#define ADB_SERVER_VERSION 32 // Increment this when we want to force users to start a new adb server +// Increment this when we want to force users to start a new adb server. +#define ADB_SERVER_VERSION 32 typedef struct amessage amessage; typedef struct apacket apacket; @@ -263,33 +266,11 @@ void fatal(const char *fmt, ...); void fatal_errno(const char *fmt, ...); void handle_packet(apacket *p, atransport *t); -void send_packet(apacket *p, atransport *t); void get_my_path(char *s, size_t maxLen); int launch_server(int server_port); int adb_main(int is_daemon, int server_port); - -/* transports are ref-counted -** 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 long_listing); -void update_transports(void); - -asocket* create_device_tracker(void); - -/* Obtain a transport from the available transports. -** If state is != CS_ANY, only transports in that state are considered. -** If serial is non-NULL then only the device with that serial will be chosen. -** If no suitable transport is found, error is set. -*/ -atransport *acquire_one_transport(int state, transport_type ttype, const char* serial, char **error_out); -void add_transport_disconnect( atransport* t, adisconnect* dis ); -void remove_transport_disconnect( atransport* t, adisconnect* dis ); -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(); @@ -297,22 +278,6 @@ int get_available_local_transport_index(); int init_socket_transport(atransport *t, int s, int port, int local); void init_usb_transport(atransport *t, usb_handle *usb, int state); -/* for MacOS X cleanup */ -void close_usb_devices(); - -/* cause new transports to be init'd and added to the list */ -int register_socket_transport(int s, const char *serial, int port, int local); - -/* these should only be used for the "adb disconnect" command */ -void unregister_transport(atransport *t); -void unregister_all_tcp_transports(); - -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); - -atransport *find_transport(const char *serial); #if ADB_HOST atransport* find_emulator_transport_by_adb_port(int adb_port); #endif @@ -343,9 +308,6 @@ void set_verity_enabled_state_service(int fd, void* cookie); apacket *get_apacket(void); void put_apacket(apacket *p); -int check_header(apacket *p); -int check_data(apacket *p); - // Define it if you want to dump packets. #define DEBUG_PACKETS 0 |