Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Reading data from USB device using winusb.dll

Discussion in 'Scripting' started by V0odo0, Nov 10, 2021.

  1. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    321
    I'm using Windows winusb.dll NET wrapper library to interact with USB devices. I can not get it working on Unity while the exact same code compiled with VS is working properly.

    Here is what I noticed with winusb.dll native calls.

    Visual Studio:
    WinUsb_GetDescriptor() - OK
    WinUsb_ReadPipe() - OK

    Unity:
    WinUsb_GetDescriptor() - OK
    WinUsb_ReadPipe() - returns false but fills the read buffer with random amount of bytes on each call

    I assume that this issue somehow related to Unity.