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:
@@ -389,6 +389,30 @@ int main(int argc, char** argv) {
|
||||
return gem::s2f42_host_command_ack(result.ack, {});
|
||||
});
|
||||
|
||||
// S2F49 — Enhanced Remote Command. OBJSPEC scopes the command at a
|
||||
// specific object instance (e.g. a CJ or PJ id); for now we delegate
|
||||
// to the same command registry as S2F41 and surface OBJSPEC in the
|
||||
// log so downstream tooling can audit it. The richer CPACK/CEPACK
|
||||
// shape lets us return per-parameter outcomes; until a command in
|
||||
// the registry produces per-CP failures we just reply with an empty
|
||||
// cpacks list, matching the spec's "all OK" interpretation.
|
||||
router.on(2, 49, [model, logfn, emit_event, emit_alarm_set](const s2::Message& msg) {
|
||||
auto cmd = gem::parse_s2f49(msg);
|
||||
if (!cmd) return gem::s2f50_enhanced_host_command_ack(gem::HostCmdAck::ParameterInvalid, {});
|
||||
auto result = model->commands.dispatch(cmd->rcmd, cmd->params);
|
||||
logfn("S2F49 DATAID=" + std::to_string(cmd->dataid) +
|
||||
" OBJSPEC=" + cmd->objspec + " RCMD=" + cmd->rcmd +
|
||||
" -> S2F50 HCACK=" + std::to_string(static_cast<int>(result.ack)));
|
||||
if (result.ack == gem::HostCmdAck::Accept) {
|
||||
if (result.emit_ceid) emit_event(*result.emit_ceid);
|
||||
if (result.set_alarm) emit_alarm_set(*result.set_alarm);
|
||||
if (result.force_spool) {
|
||||
model->spool.set_force_spool(*result.force_spool);
|
||||
}
|
||||
}
|
||||
return gem::s2f50_enhanced_host_command_ack(result.ack, {});
|
||||
});
|
||||
|
||||
router.on(2, 23, [model, logfn](const s2::Message& msg) {
|
||||
auto req = gem::parse_s2f23(msg);
|
||||
auto ack = gem::TraceAck::Accept;
|
||||
|
||||
Reference in New Issue
Block a user