export yaml descriptor as JSON graph - #20
Merged
Merged
Conversation
Add a machine-readable descriptor graph report (descriptor/reports/graph.py): nodes for IO/PROG/PROTO/SYSTEM objects (type, dtype, flags, ObjectID, protocol allocation rows) and edges for program inputs/outputs/reset, protocol bindings, and schema-declared object references (targets, objid_ref, control/data/target fields via ConfigField.value_type). Objects that fail typed decoding stay visible as generic invalid nodes, and dangling references are flagged unresolved, so consumers can always render the full graph. Multi descriptor specs (descriptorN) are supported. Expose it as the desc-graph CLI command and add a --json flag to desc-valid for machine-readable validation output. This is the foundation for the Dawn Workbench backend.
When an IO variant forces a dtype (e.g. sysinfo 'uptime' is always uint64), the firmware's ObjectID uses that dtype regardless of what the descriptor's 'dtype:' field declares. ClientIo previously exposed the declared dtype, so a descriptor that declared a conflicting dtype (e.g. uptime as float) made client tools decode device bytes with the wrong format and produce garbage values. Resolve the variant-forced dtype when building ClientIo so client tools decode by the dtype the device actually uses. Scoped to the client view; generation/encoding are untouched.
The nimble handler declared no bindings, so a nimble ProtocolObject
carried an empty bindings list: the descriptor graph drew no
protocol_binding edges (the protocol node floated unconnected) and the
allocation summary showed no bound IOs. Unlike modbus/can, nimble keeps
its IO references nested in config.services (bas.battery_level,
aios.groups[].{digital,analog}_{inputs,outputs}, ess/imds
characteristics, ots.objects, and custom services'
characteristics[].io) rather than a flat bindings list.
Add a module-level resolve_bindings that walks every service shape and
returns the referenced IO ids, ordered and de-duplicated, so
ProtocolObject.from_spec populates bindings and the existing
graph/summary machinery binds them like any other protocol.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.