fix: preserve UART backend for read plans

This commit is contained in:
root
2026-07-21 11:07:35 +02:00
parent c87bbec04e
commit 55c45412e0
2 changed files with 4 additions and 1 deletions
+2
View File
@@ -275,6 +275,8 @@ test("hwpod-cli dry-run invokes hwpod-compiler-cli and exposes hwpod-node-ops pl
"--spec",
specPath
], { now: () => NOW });
const pyserialRead = await runHwpodCli(["uart", "read", "--spec", specPath, "--port", "uart1", "--dry-run"], { now: () => NOW });
assert.equal(pyserialRead.payload.plan.ops[0].args.uartBackend, "pyserial");
const uartOpen = await runHwpodCli(["uart", "open", "--spec", specPath, "--port", "uart1", "--dry-run"], { now: () => NOW });
assert.equal(uartOpen.payload.plan.ops[0].op, "io.uart.open");
assert.equal(uartOpen.payload.plan.ops[0].args.port, "COM9");
+2 -1
View File
@@ -1018,7 +1018,7 @@ function keilJobStatusCommand(args: any, document: any) {
function serialMonitorReadCommand(args: any, document: any) {
const binding = serialMonitorBinding(args, document);
const { requestedPort, physicalPort, baudRate, serialMonitorDir, commandBase, timeoutMs } = binding;
const { requestedPort, backend, physicalPort, baudRate, serialMonitorDir, commandBase, timeoutMs } = binding;
const limit = Math.max(1, Math.min(numberValue(args.limit) ?? Math.ceil((numberValue(args.maxBytes) ?? 4096) / 80), 200));
const fetchArgs = ["fetch", "-l", String(limit), ...(args.sessionOnly === true ? ["--session-only"] : []), ...(text(args.since) ? ["-s", text(args.since)] : [])];
const sequenceRun = jsonCliSequenceCommandRun([
@@ -1026,6 +1026,7 @@ function serialMonitorReadCommand(args: any, document: any) {
[...commandBase, ...fetchArgs]
]);
return {
backend,
physicalPort,
baudRate,
serialMonitorDir,