Yield when send/recv fails with hardware I/O error.

git-svn-id: http://yate.null.ro/svn/yate/trunk@6034 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
marian 2015-09-15 12:50:37 +00:00
parent d4f4a0d2ee
commit 4cf402e052
1 changed files with 12 additions and 2 deletions

View File

@ -2731,7 +2731,12 @@ unsigned int BrfLibUsbDevice::syncTx(uint64_t ts, float* data, unsigned int samp
{
BRF_TX_SERIALIZE;
BRF_CHECK_DEV("syncTx()");
return send(ts,data,samples,powerScale);
unsigned int code = send(ts,data,samples,powerScale);
if (code == RadioInterface::HardwareIOError) {
txSerialize.drop();
Thread::yield();
}
return code;
}
// Receive data from the Rx interface of the bladeRF device
@ -2739,7 +2744,12 @@ unsigned int BrfLibUsbDevice::syncRx(uint64_t& ts, float* data, unsigned int& sa
{
BRF_RX_SERIALIZE;
BRF_CHECK_DEV("syncRx()");
return recv(ts,data,samples);
unsigned int code = recv(ts,data,samples);
if (code == RadioInterface::HardwareIOError) {
rxSerialize.drop();
Thread::yield();
}
return code;
}
unsigned int BrfLibUsbDevice::setFrequency(uint32_t hz, bool tx)