2021-01-03 13:55:15 +00:00
|
|
|
#ifndef SC_ADB_H
|
|
|
|
#define SC_ADB_H
|
|
|
|
|
2021-01-08 18:24:51 +00:00
|
|
|
#include "common.h"
|
|
|
|
|
2021-01-03 13:55:15 +00:00
|
|
|
#include <stdbool.h>
|
|
|
|
#include <inttypes.h>
|
|
|
|
|
2021-11-18 21:08:15 +00:00
|
|
|
#include "util/intr.h"
|
2021-01-03 13:55:15 +00:00
|
|
|
|
2021-11-24 21:27:28 +00:00
|
|
|
#define SC_ADB_NO_STDOUT (1 << 0)
|
|
|
|
#define SC_ADB_NO_STDERR (1 << 1)
|
2021-11-25 21:05:38 +00:00
|
|
|
#define SC_ADB_NO_LOGERR (1 << 2)
|
2021-11-24 21:27:28 +00:00
|
|
|
|
2021-11-11 16:48:41 +00:00
|
|
|
sc_pid
|
2021-11-24 21:27:28 +00:00
|
|
|
adb_execute(const char *serial, const char *const adb_cmd[], size_t len,
|
|
|
|
unsigned flags);
|
2021-01-03 13:55:15 +00:00
|
|
|
|
2021-11-18 21:08:15 +00:00
|
|
|
bool
|
|
|
|
adb_forward(struct sc_intr *intr, const char *serial, uint16_t local_port,
|
2021-11-24 21:27:28 +00:00
|
|
|
const char *device_socket_name, unsigned flags);
|
2021-11-18 21:08:15 +00:00
|
|
|
|
|
|
|
bool
|
|
|
|
adb_forward_remove(struct sc_intr *intr, const char *serial,
|
2021-11-24 21:27:28 +00:00
|
|
|
uint16_t local_port, unsigned flags);
|
2021-11-18 21:08:15 +00:00
|
|
|
|
|
|
|
bool
|
|
|
|
adb_reverse(struct sc_intr *intr, const char *serial,
|
2021-11-24 21:27:28 +00:00
|
|
|
const char *device_socket_name, uint16_t local_port,
|
|
|
|
unsigned flags);
|
2021-11-18 21:08:15 +00:00
|
|
|
|
|
|
|
bool
|
|
|
|
adb_reverse_remove(struct sc_intr *intr, const char *serial,
|
2021-11-24 21:27:28 +00:00
|
|
|
const char *device_socket_name, unsigned flags);
|
2021-11-18 21:08:15 +00:00
|
|
|
|
|
|
|
bool
|
|
|
|
adb_push(struct sc_intr *intr, const char *serial, const char *local,
|
2021-11-24 21:27:28 +00:00
|
|
|
const char *remote, unsigned flags);
|
2021-11-18 21:08:15 +00:00
|
|
|
|
|
|
|
bool
|
2021-11-24 21:27:28 +00:00
|
|
|
adb_install(struct sc_intr *intr, const char *serial, const char *local,
|
|
|
|
unsigned flags);
|
2021-11-18 21:08:15 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Execute `adb get-serialno`
|
|
|
|
*
|
|
|
|
* Return the result, to be freed by the caller, or NULL on error.
|
|
|
|
*/
|
|
|
|
char *
|
2021-11-24 21:27:28 +00:00
|
|
|
adb_get_serialno(struct sc_intr *intr, unsigned flags);
|
2021-11-18 21:08:15 +00:00
|
|
|
|
2021-01-03 13:55:15 +00:00
|
|
|
#endif
|