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

Method write

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

* @brief Sends @p data to the device as an interrupt OUT / feature report. */

Source from the content-addressed store, hash-verified

145 * @brief Sends @p data to the device as an interrupt OUT / feature report.
146 */
147qint64 IO::Drivers::HID::write(const QByteArray& data)
148{
149 if (!isOpen())
150 return -1;
151
152 const auto* buf = reinterpret_cast<const unsigned char*>(data.constData());
153 const int n = hid_write(m_handle, buf, static_cast<size_t>(data.size()));
154 return static_cast<qint64>(n);
155}
156
157/**
158 * @brief Opens the selected HID device and starts the read thread.

Callers

nothing calls this directly

Calls 2

hid_writeFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected