interop: secsgem-py cross-validation harness + lenient identifier parsing
Adds a Docker-based interop harness that drives the C++ server with
secsgem-py 0.3.0 as the active host and probes a secsgem-py-passive
equipment from a minimal C++ active client. Surfaces and fixes four
interoperability bugs uncovered by cross-testing:
* SEMI E5 identifier formatcodes are a U1|U2|U4|U8 wildcard;
secsgem-py picks the narrowest fitting width while our parsers
only accepted U4. `as_uN_scalar` / `as_iN_scalar` now accept
any unsigned/signed width and range-check the downcast.
* PPBODY (S7F3/F6) is "ASCII | Binary | List" per the spec;
secsgem-py defaults to ASCII. Added BINARY_OR_ASCII codegen
item type with `as_text_or_binary` accessor.
* S1F23/F24 Collection Event Namelist was unimplemented; added
schema + `vids_for(ceid)` accessor on EventReportSubscriptions
plus the dispatch handler.
* S10F1 was registered as a host->equipment handler, but per
SEMI E5 §12 S10F1 is equipment->host; S10F3 is the actual
host->equipment Terminal Display Single. Added an S10F3
handler alongside (we keep S10F1 too for backward compat).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -49,6 +49,12 @@ SCALAR_TABLE = {
|
||||
"as_binary_first({i})"),
|
||||
"BINARY": ("std::string", "secs2::Item::binary(std::vector<uint8_t>({v}.begin(), {v}.end()))",
|
||||
"as_binary_string({i})"),
|
||||
# SEMI's "ASCII | Binary" wildcard (e.g. PPBODY). Sent as Binary,
|
||||
# accepted as either Binary or ASCII (JIS-8 too) so we interoperate
|
||||
# with libraries like secsgem-py that default to ASCII.
|
||||
"BINARY_OR_ASCII": ("std::string",
|
||||
"secs2::Item::binary(std::vector<uint8_t>({v}.begin(), {v}.end()))",
|
||||
"as_text_or_binary({i})"),
|
||||
"BOOLEAN": ("bool", "secs2::Item::boolean({v})",
|
||||
"as_boolean({i})"),
|
||||
"ITEM": ("secs2::Item", "{v}",
|
||||
|
||||
Reference in New Issue
Block a user