* @brief List all available USB devices. */
| 246 | * @brief List all available USB devices. |
| 247 | */ |
| 248 | API::CommandResponse API::Handlers::USBHandler::getDeviceList(const QString& id, |
| 249 | const QJsonObject& params) |
| 250 | { |
| 251 | Q_UNUSED(params) |
| 252 | |
| 253 | const auto& devices = IO::ConnectionManager::instance().usb()->deviceList(); |
| 254 | |
| 255 | QJsonArray devices_array; |
| 256 | for (const auto& device : devices) |
| 257 | devices_array.append(device); |
| 258 | |
| 259 | QJsonObject result; |
| 260 | result[QStringLiteral("devices")] = devices_array; |
| 261 | result[QStringLiteral("selectedIndex")] = IO::ConnectionManager::instance().usb()->deviceIndex(); |
| 262 | return CommandResponse::makeSuccess(id, result); |
| 263 | } |
| 264 | |
| 265 | /** |
| 266 | * @brief Get the complete USB driver configuration. |
nothing calls this directly
no test coverage detected