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

Method getDeviceList

app/src/API/Handlers/HIDHandler.cpp:111–126  ·  view source on GitHub ↗

* @brief List all available HID devices. */

Source from the content-addressed store, hash-verified

109 * @brief List all available HID devices.
110 */
111API::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.

Callers

nothing calls this directly

Calls 4

hidMethod · 0.80
deviceListMethod · 0.45
appendMethod · 0.45
deviceIndexMethod · 0.45

Tested by

no test coverage detected