HubertD / cangaroo

open source can bus analyzer software
GNU General Public License v2.0
282 stars 173 forks source link

WinUsb_WritePipe is timeout #24

Open sufengfeng opened 1 year ago

sufengfeng commented 1 year ago

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;
}