Store actual serial in sc_server
Before starting the server, the actual device serial (possibly its ip:port if it's over TCP/IP) must be known. A serial might be requested via -s/--serial (stored in the sc_server_params), but the actual serial may change afterwards: - if none is provided, then it is retrieved with "adb get-serialno"; - if --tcpip is requested, then the final serial will be the target ip:port. The requested serial was overwritten by the actual serial in the sc_server_params struct, which was a bit hacky. Instead, store a separate serial field in sc_server (and rename the one from sc_server_params to "req_serial" to avoid confusion).
This commit is contained in:
@@ -22,7 +22,7 @@ struct sc_server_info {
|
||||
};
|
||||
|
||||
struct sc_server_params {
|
||||
const char *serial;
|
||||
const char *req_serial;
|
||||
enum sc_log_level log_level;
|
||||
const char *crop;
|
||||
const char *codec_options;
|
||||
@@ -49,6 +49,7 @@ struct sc_server_params {
|
||||
struct sc_server {
|
||||
// The internal allocated strings are copies owned by the server
|
||||
struct sc_server_params params;
|
||||
char *serial;
|
||||
|
||||
sc_thread thread;
|
||||
struct sc_server_info info; // initialized once connected
|
||||
|
||||
Reference in New Issue
Block a user