Thank you for continuing to step me through this. I'm very much at a brick wall for days. I'll try and give you all the information I can.
Here is the C# code when it is supposed to send data out:
if (myDeviceDetected)
{
success = myWinUsbDevice.SendViaInterruptTransfer
(ref dataBuffer,
bytesToSend);
if (success)
{
formText = "Data sent via interrupt transfer.";
}
else
{
formText = "Interrupt OUT transfer failed.";
}
Success ends up being false.
My microcontroller reads no data packet. Since no packet comes in, obviously it isn't going to reply...
EXTRA DATA:
Here is the myWinUsbDevice.SendViaInterruptTransfer inspected deeper:
internal Boolean SendViaInterruptTransfer(ref Byte[] buffer, UInt32 bytesToWrite)
{
UInt32 bytesWritten = 0;
Boolean success;
try
{
success = WinUsb_WritePipe
(myDevInfo.winUsbHandle,
myDevInfo.interruptOutPipe,
buffer,
bytesToWrite,
ref bytesWritten,
IntPtr.Zero);
if (!(success))
{
CloseDeviceHandle();
}
return success;
}
catch (Exception ex)
{
throw;
}
}
HERE IS THE Writepipe deeper:
[DllImport("winusb.dll", SetLastError = true)]
internal static extern Boolean WinUsb_WritePipe(IntPtr InterfaceHandle, Byte PipeID, Byte[] Buffer, UInt32 BufferLength, ref UInt32 LengthTransferred, IntPtr Overlapped);