MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / readLoop

Method readLoop

app/src/IO/Drivers/HID.cpp:562–577  ·  view source on GitHub ↗

* @brief Interrupt read loop executed on m_readThread. */

Source from the content-addressed store, hash-verified

560 * @brief Interrupt read loop executed on m_readThread.
561 */
562void 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}

Callers

nothing calls this directly

Calls 2

hid_read_timeoutFunction · 0.50
loadMethod · 0.45

Tested by

no test coverage detected