Commit 8c511e6975515989f0b257750ae283be5579e196

Authored by oliverhaag
1 parent 840e89be

Ignore USB errors for bulkReadMulti after first packet

openhantek/ChangeLog
@@ -161,3 +161,6 @@ @@ -161,3 +161,6 @@
161 161
162 2012-10-03 Oliver Haag <oliver.haag@gmail.com> 162 2012-10-03 Oliver Haag <oliver.haag@gmail.com>
163 * Bugfix: Add CAPTURE_READY2250 for the DSO-2250 163 * Bugfix: Add CAPTURE_READY2250 for the DSO-2250
  164 +
  165 +2012-10-07 Oliver Haag <oliver.haag@gmail.com>
  166 +* Ignore errors after first packet was received by Hantek::Device::bulkReadMulti
openhantek/src/hantek/control.cpp
@@ -193,8 +193,10 @@ namespace Hantek { @@ -193,8 +193,10 @@ namespace Hantek {
193 int lastCaptureState = captureState; 193 int lastCaptureState = captureState;
194 #endif 194 #endif
195 captureState = this->getCaptureState(); 195 captureState = this->getCaptureState();
  196 + if(captureState < 0)
  197 + qWarning("Getting capture state failed: %s", Helper::libUsbErrorString(captureState).toLocal8Bit().data());
196 #ifdef DEBUG 198 #ifdef DEBUG
197 - if(captureState != lastCaptureState) 199 + else if(captureState != lastCaptureState)
198 qDebug("Capture state changed to %d", captureState); 200 qDebug("Capture state changed to %d", captureState);
199 #endif 201 #endif
200 switch(captureState) { 202 switch(captureState) {
@@ -271,8 +273,6 @@ namespace Hantek { @@ -271,8 +273,6 @@ namespace Hantek {
271 case CAPTURE_SAMPLING: 273 case CAPTURE_SAMPLING:
272 break; 274 break;
273 default: 275 default:
274 - if(captureState < 0)  
275 - qWarning("Getting capture state failed: %s", Helper::libUsbErrorString(captureState).toLocal8Bit().data());  
276 break; 276 break;
277 } 277 }
278 } 278 }
openhantek/src/hantek/device.cpp
@@ -397,10 +397,10 @@ namespace Hantek { @@ -397,10 +397,10 @@ namespace Hantek {
397 received += errorCode; 397 received += errorCode;
398 } 398 }
399 399
400 - if(errorCode < 0)  
401 - return errorCode;  
402 - else 400 + if(received > 0)
403 return received; 401 return received;
  402 + else
  403 + return errorCode;
404 } 404 }
405 405
406 /// \brief Control transfer to the oscilloscope. 406 /// \brief Control transfer to the oscilloscope.