Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OTG support for Windows #3011

Merged
merged 10 commits into from
Feb 20, 2022
Merged

Add OTG support for Windows #3011

merged 10 commits into from
Feb 20, 2022

Commits on Feb 20, 2022

  1. 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 <#3011>
    rom1v committed Feb 20, 2022
    Configuration menu
    Copy the full SHA
    be1936b View commit details
    Browse the repository at this point in the history
  2. Remove USB hotplug callback error log

    If it fails, the error is already logged by sc_usb_register_callback().
    
    PR #3011 <#3011>
    rom1v committed Feb 20, 2022
    Configuration menu
    Copy the full SHA
    b9b2879 View commit details
    Browse the repository at this point in the history
  3. Avoid PRIx16 printf format on Windows

    Convert uint16_t to unsigned to avoid using PRIx16, which may not exist
    on Windows.
    
    PR #3011 <#3011>
    rom1v committed Feb 20, 2022
    Configuration menu
    Copy the full SHA
    06243e7 View commit details
    Browse the repository at this point in the history
  4. Fix libusb callback for Windows

    Add LIBUSB_CALL so that the callback has the correct signature on
    Windows (including __attribute__((stdcall))).
    
    PR #3011 <#3011>
    rom1v committed Feb 20, 2022
    Configuration menu
    Copy the full SHA
    ff3cb31 View commit details
    Browse the repository at this point in the history
  5. Build for Windows with libusb support

    Fixes #2773 <#2773>
    PR #3011 <#3011>
    rom1v committed Feb 20, 2022
    Configuration menu
    Copy the full SHA
    6b65cd4 View commit details
    Browse the repository at this point in the history
  6. Remove obsolete text in error message

    The HID/OTG features are now available on all platforms.
    
    PR #3011 <#3011>
    rom1v committed Feb 20, 2022
    Configuration menu
    Copy the full SHA
    6ee75c0 View commit details
    Browse the repository at this point in the history
  7. Make intr optional for adb commands

    All adb commands are executed with an "interruptor", so that they can be
    interrupted on Ctrl+C.
    
    Make this interruptor optional, so that we could call "adb kill-server"
    in OTG mode. This command always returns almost immediately anyway.
    
    Ideally, we should make all blocking calls interruptible (including
    libusb calls, by using the asynchronous API), but it's a lot of work,
    and in practice it works well enough.
    
    PR #3011 <#3011>
    rom1v committed Feb 20, 2022
    Configuration menu
    Copy the full SHA
    3bb24b3 View commit details
    Browse the repository at this point in the history
  8. Kill adb daemon in OTG mode on Windows

    On Windows, it is not possible to open a USB device from several
    process, so HID events may only work if no adb daemon is running.
    
    PR #3011 <#3011>
    rom1v committed Feb 20, 2022
    Configuration menu
    Copy the full SHA
    25296ae View commit details
    Browse the repository at this point in the history
  9. Forbid HID input without OTG on Windows

    On Windows, if the adb daemon is running, opening the USB device will
    necessarily fail, so HID input is not possible.
    
    Refs #2773 <#2773>
    PR #3011 <#3011>
    rom1v committed Feb 20, 2022
    Configuration menu
    Copy the full SHA
    73a5311 View commit details
    Browse the repository at this point in the history
  10. Disable USB features for win32

    Currently, there is an issue with the libusb prebuilt dll.
    
    Refs libusb/#1049 <libusb/libusb#1049>
    PR #3011 <#3011>
    rom1v committed Feb 20, 2022
    Configuration menu
    Copy the full SHA
    d9bc508 View commit details
    Browse the repository at this point in the history