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

Method getConfiguration

app/src/API/Handlers/USBHandler.cpp:268–292  ·  view source on GitHub ↗

* @brief Get the complete USB driver configuration. */

Source from the content-addressed store, hash-verified

266 * @brief Get the complete USB driver configuration.
267 */
268API::CommandResponse API::Handlers::USBHandler::getConfiguration(const QString& id,
269 const QJsonObject& params)
270{
271 Q_UNUSED(params)
272
273 auto* usb = IO::ConnectionManager::instance().usb();
274
275 QJsonArray in_endpoints;
276 for (const auto& ep : usb->inEndpointList())
277 in_endpoints.append(ep);
278
279 QJsonArray out_endpoints;
280 for (const auto& ep : usb->outEndpointList())
281 out_endpoints.append(ep);
282
283 QJsonObject result;
284 result[QStringLiteral("deviceIndex")] = usb->deviceIndex();
285 result[QStringLiteral("transferMode")] = usb->transferMode();
286 result[QStringLiteral("inEndpointIndex")] = usb->inEndpointIndex();
287 result[QStringLiteral("outEndpointIndex")] = usb->outEndpointIndex();
288 result[QStringLiteral("isoPacketSize")] = usb->isoPacketSize();
289 result[QStringLiteral("inEndpoints")] = in_endpoints;
290 result[QStringLiteral("outEndpoints")] = out_endpoints;
291 return CommandResponse::makeSuccess(id, result);
292}

Callers

nothing calls this directly

Calls 9

usbMethod · 0.80
inEndpointListMethod · 0.80
outEndpointListMethod · 0.80
inEndpointIndexMethod · 0.80
outEndpointIndexMethod · 0.80
isoPacketSizeMethod · 0.80
appendMethod · 0.45
deviceIndexMethod · 0.45
transferModeMethod · 0.45

Tested by

no test coverage detected