Commit Graph

12 Commits (2d32557fdea3e83dd8ec2a73e122338cbe5d417b)

Author SHA1 Message Date
Romain Vimont 2d32557fde Embed HID event data
In the implementation, an HID event is at most 8 bytes. Embed the data
in the HID event structure to avoid allocations and simplify the code.

PR #4473 <https://github.com/Genymobile/scrcpy/pull/4473>
3 months ago
Romain Vimont ae303b8d07 Rename hid event "buffer" to "data"
This fields contains the HID event data (there is no "bufferization").

PR #4473 <https://github.com/Genymobile/scrcpy/pull/4473>
3 months ago
Romain Vimont 29ce03e337 Rename "buffer" to "data"
The variable name is intended to match the parameter name of
libusb_control_transfer().

PR #4473 <https://github.com/Genymobile/scrcpy/pull/4473>
3 months ago
Romain Vimont 9e22f3bf1c Replace unsigned char by uint8_t for buffers
For consistency.
3 months ago
Romain Vimont f978e4d6de Use VecDeque in aoa_hid
Replace cbuf by VecDeque in aoa_hid
1 year ago
Romain Vimont be1936bb85 Report USB device disconnection when detected
USB device disconnection is detected via a hotplug callback when it is
supported.

In addition, report disconnection on libusb calls returning
LIBUSB_ERROR_NO_DEVICE or LIBUSB_ERROR_NOT_FOUND. This allows to detect
disconnection after a libusb call when hotplug is not available.

PR #3011 <https://github.com/Genymobile/scrcpy/pull/3011>
2 years ago
Romain Vimont 61b6324ee9 Remove LOGC()
It is not clear when to use LOGC() rather than LOGE(). Always use
LOGE().

Moreover, enum sc_log_level has no "critical" log level.
2 years ago
Romain Vimont b0e04aa327 Remove log_libusb_error()
This helper did not help a lot, and prevented the client to choose the
log level and the prefix error message.
2 years ago
Romain Vimont 37987b822e Make acksync optional for AOA initialization
Acksync is used to delay HID events until some request (in practice,
device clipboard synchronization) is acknowledged by the device.

This mechanism will not be necessary for OTG mode.

PR #2974 <https://github.com/Genymobile/scrcpy/pull/2974>
2 years ago
Romain Vimont adda47b0f7 Move sc_usb out of sc_aoa
This will allow to initialize a USB device separately and pass it to
sc_aoa.

PR #2974 <https://github.com/Genymobile/scrcpy/pull/2974>
2 years ago
Romain Vimont 1d6f9952ee 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>
2 years ago
Romain Vimont 2762f5d183 Move AOA/HID code to usb/
PR #2974 <https://github.com/Genymobile/scrcpy/pull/2974>
2 years ago