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

Method subscriberSetConfig

app/src/API/Handlers/MqttHandler.cpp:593–610  ·  view source on GitHub ↗

* @brief Applies a partial config patch to the subscriber driver. */

Source from the content-addressed store, hash-verified

591 * @brief Applies a partial config patch to the subscriber driver.
592 */
593API::CommandResponse API::Handlers::MqttHandler::subscriberSetConfig(const QString& id,
594 const QJsonObject& params)
595{
596 auto* d = subscriber();
597 if (!d)
598 return CommandResponse::makeError(
599 id, ErrorCode::ExecutionError, QStringLiteral("MQTT subscriber driver unavailable"));
600
601 if (auto err = applySubscriberEndpoint(d, params); err)
602 return CommandResponse::makeError(id, ErrorCode::InvalidParam, *err);
603
604 if (auto err = applySubscriberSessionAndTls(d, params); err)
605 return CommandResponse::makeError(id, ErrorCode::InvalidParam, *err);
606
607 QJsonObject result;
608 result[QStringLiteral("updated")] = true;
609 return CommandResponse::makeSuccess(id, result);
610}
611
612/**
613 * @brief Snapshots subscriber driver live state.

Callers

nothing calls this directly

Calls 3

subscriberFunction · 0.85
applySubscriberEndpointFunction · 0.85

Tested by

no test coverage detected