HubertD / cangaroo

open source can bus analyzer software

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WinUsb_WritePipe is timeout

sufengfeng opened this issue · 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;
}