您的位置:首页 > Web前端

CONTROL OUT transfer failed with Error Code:997

2017-09-13 11:18 274 查看
curEndpt.TimeOut = 25000;
success = curEndpt.XferData(ref buf, ref len);

if (success)
{
OutputBox.Text += stat + " Write Success";
BuildDataCaption();
DisplayXferData(buf, len, true);

OutputBox.SelectionStart = OutputBox.Text.Length;
OutputBox.ScrollToCaret();
}
else
{
OutputBox.Text += stat + " Transfer failed with Error Code:" + curEndpt.LastError + "\r\n";
OutputBox.SelectionStart = OutputBox.Text.Length;
OutputBox.ScrollToCaret();
}


windows error lookup:997 重叠 I/O 操作在进行中。



CyU3PUsbSendEP0Data (8, (uint8_t *)buf);

CyU3PUsbAckSetup ();

/** \brief Complete the status handshake of a USB control request.

**Description**\n
This function is used to complete the status handshake of a USB control
request that does not involve any data transfer. If there is a need for
OUT or IN data transfers to process the control request, the CyU3PUsbGetEP0Data
and CyU3PUsbSendEP0Data calls should be used instead.

This function should only be used if a positive ACK is to be sent to the
USB host. To indicate an error condition, the CyU3PUsbStall call should be
used to stall the endpoint EP0-OUT or EP0-IN.

**Return value**\n
* None

**\see
*\see CyU3PUSBSetupCb_t
*\see CyU3PUsbRegisterSetupCallback
*\see CyU3PUsbSendEP0Data
*\see CyU3PUsbGetEP0Data
*/
extern void
CyU3PUsbAckSetup (
void);


正确回应(发送的数据长度为0,8字节的最后两字节为0x00 0x00):

CONTROL OUT transfer

Zero-length data transfer completed

wLength:Number of bytes to transfer if there is a Data

stage.如果非0长度,但是没接收到所谓的非0数据(data stage),也会返回997错误。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐