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

Method setUdpMulticast

app/src/API/Handlers/NetworkHandler.cpp:242–256  ·  view source on GitHub ↗

* @brief Enable or disable UDP multicast */

Source from the content-addressed store, hash-verified

240 * @brief Enable or disable UDP multicast
241 */
242API::CommandResponse API::Handlers::NetworkHandler::setUdpMulticast(const QString& id,
243 const QJsonObject& params)
244{
245 if (!params.contains(QStringLiteral("enabled"))) {
246 return CommandResponse::makeError(
247 id, ErrorCode::MissingParam, QStringLiteral("Missing required parameter: enabled"));
248 }
249
250 const bool enabled = params.value(QStringLiteral("enabled")).toBool();
251 IO::ConnectionManager::instance().network()->setUdpMulticast(enabled);
252
253 QJsonObject result;
254 result[QStringLiteral("udpMulticast")] = enabled;
255 return CommandResponse::makeSuccess(id, result);
256}
257
258/**
259 * @brief Perform DNS lookup for a hostname

Callers

nothing calls this directly

Calls 3

networkMethod · 0.80
containsMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected