cangaroo icon indicating copy to clipboard operation
cangaroo copied to clipboard

WinUsb_WritePipe is timeout

Open sufengfeng opened this issue 2 years ago • 0 comments

Firstly,Open device successfully,then send package to can device. if insertting is not correctly, the function of WinUsb_WritePipe has chance of timeout. 企业微信截图_16885395106778

the answ of question is insert the code.

long  timeout = 500;            //设置输出超时时间为500ms
if (!WinUsb_SetPipePolicy(dev->winUSBHandle, dev->bulkOutPipe, PIPE_TRANSFER_TIMEOUT, sizeof(timeout),
                          &timeout)) {
    dev->last_error = CANDLE_ERR_SET_PIPE_TRANSFER_TIMEOUT;
    goto winusb_free;
}

sufengfeng avatar Jul 05 '23 06:07 sufengfeng