| 403 | |
| 404 | |
| 405 | void SDRThread::readLoop() { |
| 406 | |
| 407 | SDRThreadIQDataQueuePtr iqDataOutQueue = std::static_pointer_cast<SDRThreadIQDataQueue>( getOutputQueue("IQDataOutput")); |
| 408 | |
| 409 | if (iqDataOutQueue == nullptr) { |
| 410 | return; |
| 411 | } |
| 412 | |
| 413 | updateGains(); |
| 414 | |
| 415 | try { |
| 416 | while (!stopping.load()) { |
| 417 | |
| 418 | updateSettings(); |
| 419 | |
| 420 | if (SDR_DEVICE_LOST == readStream(iqDataOutQueue)) { |
| 421 | //stop reading loop: |
| 422 | stopping = true; |
| 423 | } |
| 424 | } //End while |
| 425 | } |
| 426 | catch (...) { |
| 427 | //notify App of device loss: |
| 428 | std::cout << "SDRThread::readLoop() exception, stopping device..." << std::endl << std::flush; |
| 429 | stopping = true; |
| 430 | } |
| 431 | |
| 432 | iqDataOutQueue->flush(); |
| 433 | } |
| 434 | |
| 435 | void SDRThread::updateGains() { |
| 436 | SDRDeviceInfo *devInfo = deviceInfo.load(); |