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

Method broadcastLifecycleEvent

app/src/API/Server.cpp:737–751  ·  view source on GitHub ↗

* @brief Broadcasts a lifecycle event to all connected API clients. */

Source from the content-addressed store, hash-verified

735 * @brief Broadcasts a lifecycle event to all connected API clients.
736 */
737void API::Server::broadcastLifecycleEvent(const QString& eventName)
738{
739 Q_ASSERT(!eventName.isEmpty());
740 Q_ASSERT(m_worker);
741
742 if (!enabled())
743 return;
744
745 QJsonObject event;
746 event.insert(QStringLiteral("event"), eventName);
747
748 auto* worker = static_cast<ServerWorker*>(m_worker);
749 QMetaObject::invokeMethod(
750 worker, "broadcastEvent", Qt::QueuedConnection, Q_ARG(QJsonObject, event));
751}
752
753//--------------------------------------------------------------------------------------------------
754// Server: data reception helpers

Callers 1

Calls 1

isEmptyMethod · 0.80

Tested by

no test coverage detected