B2: HostHandler status + subscription senders
Adds the five GEM event-subscription primitives the host needs to drive
the equipment's data-collection lifecycle (E30 §6.11):
S1F3/F4 selected status data
S1F11/F12 status variable namelist
S2F33/F34 define reports
S2F35/F36 link event reports
S2F37/F38 enable/disable events
Each is a one-line wrapper over the codegen builders + Connection's
send_request, surfacing the codegen-generated DefineReportEntry /
LinkEventEntry structs to callers behind a {id, [vids]} pair API.
This is the minimum surface a host needs to walk a fresh equipment
through "define report -> link CEID -> enable" and start receiving
S6F11 event reports — the same pattern the existing demo client does
inline. B3 lands the RCMD / recipe / job / terminal senders that
build on top.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -81,6 +81,42 @@ void HostHandler::go_offline(ReplyHandler cb) {
|
||||
send_request(s1f15_request_offline(), std::move(cb));
|
||||
}
|
||||
|
||||
void HostHandler::send_selected_status(const std::vector<uint32_t>& svids,
|
||||
ReplyHandler cb) {
|
||||
send_request(s1f3_selected_status_request(svids), std::move(cb));
|
||||
}
|
||||
|
||||
void HostHandler::send_status_namelist(const std::vector<uint32_t>& svids,
|
||||
ReplyHandler cb) {
|
||||
send_request(s1f11_status_namelist_request(svids), std::move(cb));
|
||||
}
|
||||
|
||||
void HostHandler::send_define_reports(
|
||||
uint32_t dataid,
|
||||
const std::vector<std::pair<uint32_t, std::vector<uint32_t>>>& reports,
|
||||
ReplyHandler cb) {
|
||||
std::vector<DefineReportEntry> entries;
|
||||
entries.reserve(reports.size());
|
||||
for (const auto& [rptid, vids] : reports) entries.push_back({rptid, vids});
|
||||
send_request(s2f33_define_report(dataid, entries), std::move(cb));
|
||||
}
|
||||
|
||||
void HostHandler::send_link_event_reports(
|
||||
uint32_t dataid,
|
||||
const std::vector<std::pair<uint32_t, std::vector<uint32_t>>>& links,
|
||||
ReplyHandler cb) {
|
||||
std::vector<LinkEventEntry> entries;
|
||||
entries.reserve(links.size());
|
||||
for (const auto& [ceid, rptids] : links) entries.push_back({ceid, rptids});
|
||||
send_request(s2f35_link_event_report(dataid, entries), std::move(cb));
|
||||
}
|
||||
|
||||
void HostHandler::send_enable_events(bool enable,
|
||||
const std::vector<uint32_t>& ceids,
|
||||
ReplyHandler cb) {
|
||||
send_request(s2f37_enable_event(enable, ceids), 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