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

Method startDemo

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

* @brief Starts the bundled zero-hardware rocket-launch demo project. */

Source from the content-addressed store, hash-verified

124 * @brief Starts the bundled zero-hardware rocket-launch demo project.
125 */
126API::CommandResponse API::Handlers::SystemHandler::startDemo(const QString& id,
127 const QJsonObject& params)
128{
129 Q_UNUSED(params)
130
131 if (AppState::instance().ephemeralSession()) {
132 return CommandResponse::makeError(
133 id, ErrorCode::ExecutionError, QStringLiteral("Demo is unavailable in operator mode"));
134 }
135
136 if (!Misc::DemoLauncher::instance().startDemo()) {
137 return CommandResponse::makeError(
138 id, ErrorCode::OperationFailed, QStringLiteral("Failed to start the demo project"));
139 }
140
141 return CommandResponse::makeSuccess(id, QJsonObject());
142}
143
144/**
145 * @brief Registers all system.* commands with the global registry.

Callers

nothing calls this directly

Calls 2

QJsonObjectClass · 0.85
ephemeralSessionMethod · 0.80

Tested by

no test coverage detected