Expose new user-friendly adb functions

Expose interruptible adb functions which return the expected result
directly, without exposing the process (sc_pid) to the caller.
This commit is contained in:
Romain Vimont
2021-11-18 22:08:15 +01:00
parent afb5a5e80f
commit b7559744a7
2 changed files with 100 additions and 0 deletions

View File

@@ -7,6 +7,7 @@
#include <inttypes.h>
#include "util/process.h"
#include "util/intr.h"
sc_pid
adb_execute(const char *serial, const char *const adb_cmd[], size_t len);
@@ -43,4 +44,35 @@ adb_exec_install(const char *serial, const char *local);
sc_pid
adb_exec_get_serialno(sc_pipe *pout);
bool
adb_forward(struct sc_intr *intr, const char *serial, uint16_t local_port,
const char *device_socket_name);
bool
adb_forward_remove(struct sc_intr *intr, const char *serial,
uint16_t local_port);
bool
adb_reverse(struct sc_intr *intr, const char *serial,
const char *device_socket_name, uint16_t local_port);
bool
adb_reverse_remove(struct sc_intr *intr, const char *serial,
const char *device_socket_name);
bool
adb_push(struct sc_intr *intr, const char *serial, const char *local,
const char *remote);
bool
adb_install(struct sc_intr *intr, const char *serial, const char *local);
/**
* Execute `adb get-serialno`
*
* Return the result, to be freed by the caller, or NULL on error.
*/
char *
adb_get_serialno(struct sc_intr *intr);
#endif