B3: HostHandler RCMD/alarm/recipe/terminal/job senders
Fleshes out the host-side message surface so the demo client app no
longer has to inline message construction. Senders added (each is a
one-line wrapper over the codegen builders + Connection::send_request):
Remote command: S2F41/F42, S2F49/F50
Alarm management: S5F3/F4 enable, S5F5/F6 list, S5F7/F8 list-enabled,
S5F13/F14 recover, S5F17/F18 recover-abort
Process programs: S7F3/F4 send, S7F5/F6 request, S7F19/F20 EPPD
Spool: S6F23/F24
Terminal: S10F1/F2 single, S10F5/F6 multi
E40 Process Jobs: S16F11/F12 create, S16F5/F6 command, S16F13/F14 dequeue
E94 Control Jobs: S14F9/F10 create, S14F11/F12 delete, S16F27/F28 command
CommandParameter is reused from store/host_commands.hpp rather than
inventing a parallel ParamPair — host and equipment talk in the same
struct now.
Closes the outbound side of the host-mode menu. The remaining piece
is an integration test that drives this against the equipment server
end-to-end (B4).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -117,6 +117,116 @@ void HostHandler::send_enable_events(bool enable,
|
||||
send_request(s2f37_enable_event(enable, ceids), std::move(cb));
|
||||
}
|
||||
|
||||
// ---- Remote command senders (B3) ----------------------------------------
|
||||
|
||||
void HostHandler::send_remote_command(const std::string& rcmd,
|
||||
const std::vector<CommandParameter>& params,
|
||||
ReplyHandler cb) {
|
||||
send_request(s2f41_host_command(rcmd, params), std::move(cb));
|
||||
}
|
||||
|
||||
void HostHandler::send_enhanced_remote_command(
|
||||
uint32_t dataid, const std::string& objspec, const std::string& rcmd,
|
||||
const std::vector<CommandParameter>& params, ReplyHandler cb) {
|
||||
send_request(s2f49_enhanced_host_command(dataid, objspec, rcmd, params),
|
||||
std::move(cb));
|
||||
}
|
||||
|
||||
// ---- Alarm management (B3) ----------------------------------------------
|
||||
|
||||
void HostHandler::send_enable_alarm(uint32_t alid, bool enable, ReplyHandler cb) {
|
||||
// ALED bit-7 encodes enable per E5 §10.
|
||||
const uint8_t aled = enable ? kAlarmEnableByte : kAlarmDisableByte;
|
||||
send_request(s5f3_enable_alarm(aled, alid), std::move(cb));
|
||||
}
|
||||
|
||||
void HostHandler::send_list_alarms(const std::vector<uint32_t>& alids,
|
||||
ReplyHandler cb) {
|
||||
send_request(s5f5_list_alarms_request(alids), std::move(cb));
|
||||
}
|
||||
|
||||
void HostHandler::send_list_enabled_alarms(ReplyHandler cb) {
|
||||
send_request(s5f7_list_enabled_alarms_request(), std::move(cb));
|
||||
}
|
||||
|
||||
void HostHandler::send_exception_recover(uint32_t exid, const std::string& exrecvra,
|
||||
ReplyHandler cb) {
|
||||
send_request(s5f13_exception_recover_request(exid, exrecvra), std::move(cb));
|
||||
}
|
||||
|
||||
void HostHandler::send_exception_recover_abort(uint32_t exid, ReplyHandler cb) {
|
||||
send_request(s5f17_exception_recover_abort_request(exid), std::move(cb));
|
||||
}
|
||||
|
||||
// ---- Process programs (B3) ----------------------------------------------
|
||||
|
||||
void HostHandler::send_request_eppd(ReplyHandler cb) {
|
||||
send_request(s7f19_current_eppd_request(), std::move(cb));
|
||||
}
|
||||
|
||||
void HostHandler::send_pp_data(const std::string& ppid, const std::string& body,
|
||||
ReplyHandler cb) {
|
||||
send_request(s7f3_process_program_send(ppid, body), std::move(cb));
|
||||
}
|
||||
|
||||
void HostHandler::send_request_pp(const std::string& ppid, ReplyHandler cb) {
|
||||
send_request(s7f5_process_program_request(ppid), std::move(cb));
|
||||
}
|
||||
|
||||
// ---- Spool (B3) ---------------------------------------------------------
|
||||
|
||||
void HostHandler::send_request_spool(SpoolRequestCode code, ReplyHandler cb) {
|
||||
send_request(s6f23_request_spool_data(code), std::move(cb));
|
||||
}
|
||||
|
||||
// ---- Terminal (B3) ------------------------------------------------------
|
||||
|
||||
void HostHandler::send_terminal_display(uint32_t tid, const std::string& text,
|
||||
ReplyHandler cb) {
|
||||
send_request(s10f1_terminal_display_single(tid, text), std::move(cb));
|
||||
}
|
||||
|
||||
void HostHandler::send_terminal_display_multi(uint32_t tid,
|
||||
const std::vector<std::string>& lines,
|
||||
ReplyHandler cb) {
|
||||
send_request(s10f5_terminal_display_multi(tid, lines), std::move(cb));
|
||||
}
|
||||
|
||||
// ---- E40 Process Jobs (B3) ----------------------------------------------
|
||||
|
||||
void HostHandler::send_create_process_job(
|
||||
const std::string& prjobid, const std::string& ppid,
|
||||
const std::vector<std::string>& mtrloutspec, ReplyHandler cb) {
|
||||
send_request(s16f11_pr_job_create(prjobid, ppid, mtrloutspec), std::move(cb));
|
||||
}
|
||||
|
||||
void HostHandler::send_pr_job_command(const std::string& prjobid,
|
||||
const std::string& prcmd, ReplyHandler cb) {
|
||||
send_request(s16f5_pr_job_command(prjobid, prcmd), std::move(cb));
|
||||
}
|
||||
|
||||
void HostHandler::send_pr_job_dequeue(const std::string& prjobid, ReplyHandler cb) {
|
||||
send_request(s16f13_pr_job_dequeue(prjobid), std::move(cb));
|
||||
}
|
||||
|
||||
// ---- E94 Control Jobs (B3) ----------------------------------------------
|
||||
|
||||
void HostHandler::send_create_control_job(
|
||||
const std::string& ctljobid, const std::vector<std::string>& prjobids,
|
||||
ReplyHandler cb) {
|
||||
send_request(s14f9_create_control_job(ctljobid, prjobids), std::move(cb));
|
||||
}
|
||||
|
||||
void HostHandler::send_delete_control_job(const std::string& ctljobid,
|
||||
ReplyHandler cb) {
|
||||
send_request(s14f11_delete_control_job(ctljobid), std::move(cb));
|
||||
}
|
||||
|
||||
void HostHandler::send_cj_command(const std::string& ctljobid,
|
||||
const std::string& ctljobcmd, ReplyHandler cb) {
|
||||
send_request(s16f27_cj_command(ctljobid, ctljobcmd), std::move(cb));
|
||||
}
|
||||
|
||||
void HostHandler::send_request(s2::Message msg, ReplyHandler cb) {
|
||||
conn_->send_request(std::move(msg), std::move(cb));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user