A2: S2F49/F50 Enhanced Remote Command

Adds the OBJSPEC-scoped sibling of S2F41 with extended per-parameter
ack shape (CPACK + CEPACK).  Wire:

  S2F49  body <DATAID OBJSPEC RCMD <L,n <CPNAME CPVAL>>>
  S2F50  body <HCACK <L,n <CPNAME CPACK CEPACK>>>

Server delegates to the existing HostCommandRegistry, logs OBJSPEC for
audit, and currently returns empty cpacks (all-OK).  Per-parameter
failures will be wired when the command registry grows CEPACK-level
validation; this commit is the catalog + dispatch scaffolding.

secsgem-py defines these in its catalog but never dispatches them; this
puts the C++ port marginally ahead on remote-command coverage.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-06-07 21:10:40 +02:00
parent b59c62bbc9
commit fafbd2abd2
4 changed files with 106 additions and 0 deletions
+31
View File
@@ -157,6 +157,37 @@ TEST_CASE("S2F42 round-trip with HCACK and CPACKs") {
CHECK(parsed->cpacks[1].code == 3);
}
TEST_CASE("S2F49 / S2F50 enhanced remote command round-trip") {
std::vector<CommandParameter> params = {
{"LOTID", s2::Item::ascii("LOT-99")},
{"PPID", s2::Item::ascii("RECIPE-B")},
};
auto m = s2f49_enhanced_host_command(/*dataid=*/7, "CJ-1", "START", params);
CHECK(m.stream == 2);
CHECK(m.function == 49);
CHECK(m.reply_expected);
auto parsed = parse_s2f49(m);
REQUIRE(parsed.has_value());
CHECK(parsed->dataid == 7);
CHECK(parsed->objspec == "CJ-1");
CHECK(parsed->rcmd == "START");
REQUIRE(parsed->params.size() == 2);
CHECK(parsed->params[0].name == "LOTID");
CHECK(parsed->params[0].value == s2::Item::ascii("LOT-99"));
auto ack = s2f50_enhanced_host_command_ack(
HostCmdAck::ParameterInvalid,
{{"LOTID", 0, 0}, {"PPID", 3, 1}});
auto preply = parse_s2f50(ack);
REQUIRE(preply.has_value());
CHECK(preply->hcack == HostCmdAck::ParameterInvalid);
REQUIRE(preply->cpacks.size() == 2);
CHECK(preply->cpacks[1].name == "PPID");
CHECK(preply->cpacks[1].cpack == 3);
CHECK(preply->cpacks[1].cepack == 1);
}
TEST_CASE("S2F42 no-params variant") {
auto m = s2f42_host_command_ack(HostCmdAck::Accept, {});
auto parsed = parse_s2f42(m);