I found a DataToggle Mismatch bug in USBClient.c
I need to know how to replace USBClient.lib in PB
Thanks a lot
Hilbert.
*****************************************
The bug is in the function "ResetBulkEndpoint()"
Since ResetPipe does nothing if Pipe is not halted.
So, DataToggle bit of the Pipe may be Toggle "1"
However, ClearOrSetFeature will reseet DataToggle bit
to "0" at USB device side.
It will cause Data Toggle Mismatch Error.
ResetBulkEndpoint(
.
.
.
)
{
.
.
.
//
// reset this pipe
//
ResetPipe(pUsbFuncs, hPipe, dwFlags);
.
.
.
#if GET_ENDPOINT_STATUS
// GetStatus can take quite some time, and will
sometimes hang EP0 on a bad device.
// Since we can't recover via port reset then do
it blindy.
dwErr = GetStatus( pUsbFuncs,
hUsbDevice,
NotifyRoutine,
NotifyContext,
USB_SEND_TO_ENDPOINT,
bIndex,
&wHalt,
dwTimeout );
#else
// just do it
wHalt = 0x01;
#endif
if ( ERROR_SUCCESS == dwErr && 0x01 == wHalt ) {
DEBUGMSG( ZONE_USBCLIENT, (TEXT("Enpoint:0x%x
wStatus:0x%x\n"), bIndex, wHalt ));
dwErr = ClearOrSetFeature(...); // clear
}
.
.
.
}