* @brief Applies a partial config patch to the subscriber driver. */
| 591 | * @brief Applies a partial config patch to the subscriber driver. |
| 592 | */ |
| 593 | API::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. |
nothing calls this directly
no test coverage detected