* @brief List all available HID devices. */
| 109 | * @brief List all available HID devices. |
| 110 | */ |
| 111 | API::CommandResponse API::Handlers::HIDHandler::getDeviceList(const QString& id, |
| 112 | const QJsonObject& params) |
| 113 | { |
| 114 | Q_UNUSED(params) |
| 115 | |
| 116 | const auto& devices = IO::ConnectionManager::instance().hid()->deviceList(); |
| 117 | |
| 118 | QJsonArray devices_array; |
| 119 | for (const auto& device : devices) |
| 120 | devices_array.append(device); |
| 121 | |
| 122 | QJsonObject result; |
| 123 | result[QStringLiteral("devices")] = devices_array; |
| 124 | result[QStringLiteral("selectedIndex")] = IO::ConnectionManager::instance().hid()->deviceIndex(); |
| 125 | return CommandResponse::makeSuccess(id, result); |
| 126 | } |
| 127 | |
| 128 | /** |
| 129 | * @brief Get complete HID driver configuration and connected-device info. |
nothing calls this directly
no test coverage detected