Extract USB handling from AOA

The AOA code handled both USB initialization and AOA commands/events.
Extract USB-related code to a separate file and structure.

PR #2974 <https://github.com/Genymobile/scrcpy/pull/2974>
This commit is contained in:
Romain Vimont
2022-01-24 22:56:12 +01:00
parent d48d191262
commit 1d6f9952ee
5 changed files with 143 additions and 95 deletions

21
app/src/usb/usb.h Normal file
View File

@@ -0,0 +1,21 @@
#ifndef SC_USB_H
#define SC_USB_H
#include "common.h"
#include <stdbool.h>
#include <libusb-1.0/libusb.h>
struct sc_usb {
libusb_context *context;
libusb_device *device;
libusb_device_handle *handle;
};
bool
sc_usb_init(struct sc_usb *usb, const char *serial);
void
sc_usb_destroy(struct sc_usb *usb);
#endif