Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Framework/Core/scripts/dpl-mcp-server/dpl_mcp_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,16 @@ async def get_logs(max_lines: int = 100) -> str:
return "\n".join(lines)


@mcp.tool()
async def start_devices() -> str:
"""Resume all stopped DPL devices (send SIGCONT).

Use this when the workflow was started with -s (all devices paused).
"""
await _send({"cmd": "start_devices"})
return "Sent SIGCONT to all active devices."


@mcp.tool()
async def enable_signpost(device: str, streams: list[str]) -> str:
"""Enable one or more signpost log streams for a DPL device.
Expand Down
13 changes: 13 additions & 0 deletions Framework/Core/src/StatusWebSocketHandler.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#include "DPLWebSocket.h"
#include "DriverServerContext.h"
#include "Framework/DeviceControl.h"
#include <csignal>
#include <unistd.h>
#include "Framework/DeviceController.h"
#include "Framework/DeviceInfo.h"
#include "Framework/DeviceMetricsInfo.h"
Expand Down Expand Up @@ -254,6 +256,8 @@ void StatusWebSocketHandler::frame(char const* data, size_t s)
handleSubscribeLogs(deviceName);
} else if (cmd == "unsubscribe_logs") {
handleUnsubscribeLogs(deviceName);
} else if (cmd == "start_devices") {
handleStartDevices();
} else if (cmd == "enable_signpost") {
handleEnableSignpost(deviceName, extractArrayField(msg, "streams"));
} else if (cmd == "disable_signpost") {
Expand Down Expand Up @@ -441,6 +445,15 @@ size_t StatusWebSocketHandler::findDeviceIndex(std::string_view name) const
return SIZE_MAX;
}

void StatusWebSocketHandler::handleStartDevices()
{
for (auto const& info : *mContext.infos) {
if (info.active) {
kill(info.pid, SIGCONT);
}
}
}

void StatusWebSocketHandler::handleEnableSignpost(std::string_view deviceName, std::string_view streamsArr)
{
if (streamsArr.empty()) {
Expand Down
1 change: 1 addition & 0 deletions Framework/Core/src/StatusWebSocketHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ struct StatusWebSocketHandler : public WebSocketHandler {
void handleUnsubscribe(std::string_view deviceName, std::string_view metricsJson);
void handleSubscribeLogs(std::string_view deviceName);
void handleUnsubscribeLogs(std::string_view deviceName);
void handleStartDevices();
void handleEnableSignpost(std::string_view deviceName, std::string_view streamsArr);
void handleDisableSignpost(std::string_view deviceName, std::string_view streamsArr);
size_t findDeviceIndex(std::string_view name) const;
Expand Down