Add adb devices parser

Add a parser of `adb device -l` output, to extract a list of devices
with their serial, state and model.

PR #3005 <https://github.com/Genymobile/scrcpy/pull/3005>
This commit is contained in:
Romain Vimont
2022-02-05 22:32:40 +01:00
parent 85ff70fc95
commit 4389de1c23
6 changed files with 391 additions and 1 deletions

View File

@@ -5,6 +5,19 @@
#include <stddef.h>
#include "adb_device.h"
/**
* Parse the available devices from the output of `adb devices`
*
* The parameter must be a NUL-terminated string.
*
* Warning: this function modifies the buffer for optimization purposes.
*/
ssize_t
sc_adb_parse_devices(char *str, struct sc_adb_device *devices,
size_t devices_len);
/**
* Parse the ip from the output of `adb shell ip route`
*