Remove sc_adb_get_serialno()
The device serial is now retrieved from `adb devices -l`, `adb get-serialno` is not called anymore. PR #3005 <https://github.com/Genymobile/scrcpy/pull/3005>
This commit is contained in:
parent
0a619dc9ef
commit
9c545e8c29
2 changed files with 0 additions and 40 deletions
|
@ -587,38 +587,6 @@ sc_adb_getprop(struct sc_intr *intr, const char *serial, const char *prop,
|
|||
return strdup(buf);
|
||||
}
|
||||
|
||||
char *
|
||||
sc_adb_get_serialno(struct sc_intr *intr, unsigned flags) {
|
||||
const char *const argv[] = SC_ADB_COMMAND("get-serialno");
|
||||
|
||||
sc_pipe pout;
|
||||
sc_pid pid = sc_adb_execute_p(argv, flags, &pout);
|
||||
if (pid == SC_PROCESS_NONE) {
|
||||
LOGE("Could not execute \"adb get-serialno\"");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char buf[128];
|
||||
ssize_t r = sc_pipe_read_all_intr(intr, pid, pout, buf, sizeof(buf) - 1);
|
||||
sc_pipe_close(pout);
|
||||
|
||||
bool ok = process_check_success_intr(intr, pid, "adb get-serialno", flags);
|
||||
if (!ok) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (r == -1) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
assert((size_t) r < sizeof(buf));
|
||||
buf[r] = '\0';
|
||||
size_t len = strcspn(buf, " \r\n");
|
||||
buf[len] = '\0';
|
||||
|
||||
return strdup(buf);
|
||||
}
|
||||
|
||||
char *
|
||||
sc_adb_get_device_ip(struct sc_intr *intr, const char *serial, unsigned flags) {
|
||||
assert(serial);
|
||||
|
|
|
@ -86,14 +86,6 @@ char *
|
|||
sc_adb_getprop(struct sc_intr *intr, const char *serial, const char *prop,
|
||||
unsigned flags);
|
||||
|
||||
/**
|
||||
* Execute `adb get-serialno`
|
||||
*
|
||||
* Return the result, to be freed by the caller, or NULL on error.
|
||||
*/
|
||||
char *
|
||||
sc_adb_get_serialno(struct sc_intr *intr, unsigned flags);
|
||||
|
||||
/**
|
||||
* Attempt to retrieve the device IP
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue