I am developing an app in C# to send through Bulk Endpoint Transfer data to an android-powered device (a tablet in this case).
My tablet is configured to use USB for "No data transfer", with developer options an USB debugging on, since the other options doesn't even show the device on the list on Windows.
I am currently trying the Bulk Read/Write example within LibUsbDotNet documentation.
Constantly fails reading, throwing "Read failed:ErrorPipe".
Doesn't even show if any mode besides "No data transfer" is selected in the code shown below:
public static void Main(string[] args)
{
UsbRegDeviceList allDevices = UsbDevice.AllDevices;
foreach (UsbRegistry usbRegistry in allDevices)
{
if (usbRegistry.Open(out MyUsbDevice))
{
Console.WriteLine(MyUsbDevice.Info.ToString());
for (int iConfig = 0; iConfig < MyUsbDevice.Configs.Count; iConfig++)
{
UsbConfigInfo configInfo = MyUsbDevice.Configs[iConfig];
Console.WriteLine(configInfo.ToString());
ReadOnlyCollection<UsbInterfaceInfo> interfaceList = configInfo.InterfaceInfoList;
for (int iInterface = 0; iInterface < interfaceList.Count; iInterface++)
{
UsbInterfaceInfo interfaceInfo = interfaceList[iInterface];
Console.WriteLine(interfaceInfo.ToString());
ReadOnlyCollection<UsbEndpointInfo> endpointList = interfaceInfo.EndpointInfoList;
for (int iEndpoint = 0; iEndpoint < endpointList.Count; iEndpoint++)
{
Console.WriteLine(endpointList[iEndpoint].ToString());
}
}
}
}
}
To give more info, it uses a ADB interface, which I think might be the problem, but I'm not sure anymore what the problem is and how can I solve it/work around it.