add ext4,vfat and tar.bz2
[u-tools.git] / u-tools / apps / adb / adb_client.h
blob80615790c46f16aa1b451e47878e38bbed19aaf6
1 #ifndef _ADB_CLIENT_H_
2 #define _ADB_CLIENT_H_
4 #include "adb.h"
6 /* connect to adb, connect to the named service, and return
7 ** a valid fd for interacting with that service upon success
8 ** or a negative number on failure
9 */
10 int adb_connect(const char *service);
11 int _adb_connect(const char *service);
13 /* connect to adb, connect to the named service, return 0 if
14 ** the connection succeeded AND the service returned OKAY
16 int adb_command(const char *service);
18 /* connect to adb, connect to the named service, return
19 ** a malloc'd string of its response upon success or NULL
20 ** on failure.
22 char *adb_query(const char *service);
24 /* Set the preferred transport to connect to.
26 void adb_set_transport(transport_type type, const char* serial);
28 /* Return the console port of the currently connected emulator (if any)
29 * of -1 if there is no emulator, and -2 if there is more than one.
30 * assumes adb_set_transport() was alled previously...
32 int adb_get_emulator_console_port(void);
34 /* send commands to the current emulator instance. will fail if there
35 * is zero, or more than one emulator connected (or if you use -s <serial>
36 * with a <serial> that does not designate an emulator)
38 int adb_send_emulator_command(int argc, char** argv);
40 /* return verbose error string from last operation */
41 const char *adb_error(void);
43 /* read a standard adb status response (OKAY|FAIL) and
44 ** return 0 in the event of OKAY, -1 in the event of FAIL
45 ** or protocol error
47 int adb_status(int fd);
49 #endif