* @brief Interrupt read loop executed on m_readThread. */
| 560 | * @brief Interrupt read loop executed on m_readThread. |
| 561 | */ |
| 562 | void IO::Drivers::HID::readLoop() |
| 563 | { |
| 564 | uint8_t buf[kReadBufSize]; |
| 565 | |
| 566 | while (m_running.load()) { |
| 567 | const int n = hid_read_timeout(m_handle, buf, kReadBufSize, kReadTimeoutMs); |
| 568 | |
| 569 | if (n > 0) |
| 570 | publishReceivedData(QByteArray(reinterpret_cast<char*>(buf), n)); |
| 571 | |
| 572 | else if (n < 0) { |
| 573 | QMetaObject::invokeMethod(this, "onReadError", Qt::QueuedConnection); |
| 574 | break; |
| 575 | } |
| 576 | } |
| 577 | } |
nothing calls this directly
no test coverage detected