fix:fix cordump problem when run stereo_new_sample on virtual machine
JIRA:OSDK-2943 TEST:test ok
Esse commit está contido em:
@@ -77,6 +77,13 @@ ProtocolBase::readPoll()
|
||||
{
|
||||
this->buf_read_pos = 0;
|
||||
this->read_len = deviceDriver->readall(this->buf, BUFFER_SIZE);
|
||||
|
||||
if (this->read_len < 0)
|
||||
{
|
||||
memset(p_filter->recvBuf, 0, p_filter->recvIndex);
|
||||
p_filter->recvIndex = 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef API_BUFFER_DATA
|
||||
|
||||
@@ -176,7 +176,7 @@ LinuxUSBDevice::readall(uint8_t* buf, size_t maxlen)
|
||||
int read_len = 0, ret;
|
||||
ret = libusb_bulk_transfer(DJI_dev_handle, IN_END_PT,
|
||||
buf, maxlen, &read_len, TIMEOUT);
|
||||
if (0 == ret)
|
||||
if (0 == ret || read_len != 0)
|
||||
return (size_t)read_len;
|
||||
|
||||
return (size_t)-1;
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário