* @brief Get the complete USB driver configuration. */
| 266 | * @brief Get the complete USB driver configuration. |
| 267 | */ |
| 268 | API::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 | } |
nothing calls this directly
no test coverage detected